Game Development Community

why Damage and Destruction tutorial does not working for boulder and granade?

by Ahsan Muzaheed · in Torque 3D Beginner · 08/08/2011 (11:24 pm) · 1 replies

i was trying to work on Damage and Destruction tutorial.
but there is something wrong with boulder(half-stucked in terrain).
they do not destruct with granade.
only be destructable with close range bullet.
why?

is it problem with half-stucked boulder or granade or the code?


here is a video:

About the author

Torque 3D enthusiastic since 2010.Have been working in several T3D projects besides of Unreal Engine 4 and Unity 3D. NEED a hand with your project? SHoot me a mail. http://www.garagegames.com/community/forums /viewthread/138437/


#1
08/09/2011 (2:13 am)
Because of how the radius damage implementation works.

Bullets do direct damage, the grenade does radius damage. Inside the radiusDamage() method there is a check that calculates if the object is exposed or not:
// Calculate how much exposure the current object has to
// the explosive force.  The object types listed are objects
// that will block an explosion.  If the object is totally blocked,
// then no damage is applied.
%coverage = calcExplosionCoverage(%position, %targetObject,
                                  $TypeMasks::InteriorObjectType |
                                  $TypeMasks::TerrainObjectType |
                                  $TypeMasks::ForceFieldObjectType |
                                  $TypeMasks::StaticTSObjectType |
                                  $TypeMasks::VehicleObjectType);
if (%coverage == 0)
   continue;
Since the boulder is pushed through the Terrain, calcExplosionCoverage considers the boulder as blocked by the Terrain, thus it recieves no radiusDamage.