Game Development Community

DTS with Multiple damage states

by John Eckhardt · in Torque Game Engine · 02/05/2009 (12:35 pm) · 3 replies

So I'm looking to make a Wall which can be destroyed. It has to be a .dts. It needs to have several "states" in which it is not damaged, slightly damaged, moderately damaged, etc... Another thing is that it needs to support players walking across it. What is the best way to go about this?

Should I make several .dts files and swap them out? If that were the case, I'd think that the swapping might cause players on top to fall through or something stupid.

Is there a built in way to have different damage states? I know there's a Disabled and also a Destroyed. Would I have to extend the engine to have more states? And if so, how could I link them to the .dts?

Thanks for help!

#1
02/05/2009 (2:07 pm)
You can use multiple meshes, but a single mesh with animation states may be better if you wish to maintain constant collision -- or even meshhiding would work. I initially designed Kaboom! to use all three methods, but we ended up going with multiple meshes in order to aid others in "rapid prototyping".

All Shapebase objects have built in "damage states" of: ENABLED, DISABLED, and DESTROYED. You can add more with engine changes, or even in script (through calculation of current damageLevel compared to maxDamage), although the engine changes would probably be more optimized.
#2
02/05/2009 (2:38 pm)
Let's say that I do animation states and the Disabled state is the wall at half the Enabled height. Would it be possible to change (animate?) the collision box to fit the new wall size?

And, sorry, I'm not much of an artist, any links to meshhiding descriptions/tutorials?
#3
02/06/2009 (3:52 am)
I'm not much of an artist myself... I'll have to admit that I/we didn't completely test the collision aspects for animation states or mesh-hiding. Hmmm, might be why the artist convinced me that multiple objects would be easier. But, in my mind I would think you should be able to.

The various resources for mesh-hiding:
Hiding nodes in a model
Hiding Meshes
Hiding Meshes v2

Just a thought, but when you switch your shapes, you could place the new damaged one right before removing the old undamaged shape. That way anything standing on the wall will still collide with the "smaller" collision mesh once the undamaged shape is removed. Depending on weapon explosion and any debris effects you should be able to hide the fact that you're swapping models.