Game Development Community

Updated Terrain Deformer

by Ron Nelson · 12/26/2007 (10:30 am) · 51 comments

Download Code File

This is an update to the original Basic TerrainDeformer Object for Torque resource released by Robert Brower found here:

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7343

It fixes several bugs in the code to include:

All network issues have been resolved.

Updates all shapebase item's terrain so items don't remain floating in air if they are in the terrain deformation radius (part of the network issues).

Fixes to deformation edges.

Clearing of decals that are on the terrain in the deformation radius. In other words, no floating bullet holes, foot prints, or tire treads.

Added a new unDeform functionality that can be used to clear all terrain deformations on a map and restore original terrain appearance.

KNOWN ISSUES:
You cannot edit the terrain in the editor after using a deformation. The terrain that you see deformed is a cached terrain and not the true terrain. If you try to do so your game will crash.

In the included file are Instructions that show how to add the required code and script to make the terrain deformer work. It also includes some examples of how to use other new added functions.

Let me know if you have any problems.

Thank you Gary for letting me release this with your work included.
Page«First 1 2 3 Next»
#41
06/20/2008 (11:42 am)
I got the following errors when implementing this resource:

7>terraindeformer.cc
7>c:\rts\battlegroundgalactica\engine\game\fx\terraindeformer.cc(127) : error C2065: 'TerrainDeformerObjectType' : undeclared identifier
7>c:\rts\battlegroundgalactica\engine\game\fx\terraindeformer.cc(324) : error C2039: 'terrainDeformed' : is not a member of 'ShapeBase'
7>        c:\rts\battlegroundgalactica\engine\game\shapebase.h(539) : see declaration of 'ShapeBase'
7>c:\rts\battlegroundgalactica\engine\game\fx\terraindeformer.cc(333) : error C2039: 'checkForDecalTD' : is not a member of 'DecalManager'
7>        c:\rts\battlegroundgalactica\engine\sim\decalmanager.h(63) : see declaration of 'DecalManager'
7>c:\rts\battlegroundgalactica\engine\game\fx\terraindeformer.cc(656) : error C2039: 'terrainDeformed' : is not a member of 'ShapeBase'
7>        c:\rts\battlegroundgalactica\engine\game\shapebase.h(539) : see declaration of 'ShapeBase'

I have no clue what these errors are or how to fix them. Thanks for any help that can be provided.
#42
06/20/2008 (1:31 pm)
Thats why you have to add the additioanl code to the other files. The instructions tell you how. This is not just a drop in piece of code, you have to make some additional code changes.
#43
06/26/2008 (7:41 am)
I am having an issue with this now. It works, but the terrain slowly deforms instead of just instantly deforming to its specified depth. Also, I put the depth at 0.1 and its going pretty deep. It doesnt look like anything I set it to effects what is actually created.
#44
08/02/2008 (11:09 am)
Quote:It works, but the terrain slowly deforms instead of just instantly deforming to its specified depth.
That's not a bug, it's a feature!

Are you getting anything in the console? It seems like you might have an invalid datablock or something, so your deformer is using default values instead of the ones you set.
#45
08/14/2008 (2:29 pm)
How would I get rid of that "feature"? I want it to just instantly deform. Also, the networking doesnt seem to be fixed. You dont see any changes on the client side, only server.
#46
08/14/2008 (2:48 pm)
I gotta be honest I had to pull alot of Dan's changes because they did screw up the network code. Did you get all of the stuff added to the Shapebase, Player, Vehicle, and item sections? The network code absolutely requires it.
#47
11/20/2008 (1:03 pm)
This is brilliant! Many thanks for sharing.

Quick question though - is there any way to modify this so static shapes don't float? E.g., if I blast out the ground around a tree, the tree remains floating...

~G
#48
01/16/2009 (4:37 am)
Brilliant, going to try this out.
#49
07/08/2009 (11:54 am)
Noob Question: i am development a miniMMOG, this resource is good for these type of games?, ex. 100 players per instance of TGE, or better for Lan multiplayer with aprox. 32 players?, consume much network resources? thanks...
Page«First 1 2 3 Next»