Game Development Community

Fall Damage not working

by Glenn Bermingham · in Torque 3D Professional · 01/15/2010 (12:05 am) · 5 replies

Now I'm not sure if there's some sort of Pref that enables/disables this but I can't seem to get fall damage to work at all. I've got my settings at:
minImpactSpeed = 1;
speedDamageScale = 100;
which should kill me if I jump off the ground (Or close enough) but nothing happens when I hit the ground. Has anyone one else had this problem with T3D 1.0.1 Binary or have I just completely missed something?

#1
01/15/2010 (6:53 am)
I'm having the same problems. Can't get it to work, whatever the datablock values are!

Anyone got an idea?
#2
01/15/2010 (8:19 am)
Hmm this is not good news for me, I need falling damage... I hope there's a Hotfix or something close to it soon because I can't do anything about it on the Binary version.
#3
01/15/2010 (12:30 pm)
Yeah I think that the binary will need this updating, it obviously got lost somewhere when other things got fixed.

As to the devs, there is this community fix here by Davide Archetti ... but it would be nice to have something which gave a set amount of damage per second of falling.

[edit] Actually it might have been this fix by Ivan linky.
#4
01/15/2010 (2:13 pm)
The stock fall damage code is done based on impact velocity, which is accurate to how things work in real life, however onImpact never gets called at the script level in T3D. Looks like that fix covers the problem.

Technically, damage based on fall distance only makes sense up until terminal velocity, which is why Torque always used impact velocity.. but if you really wanted to calculate it by fall time or -z movement, it's not too hard to just check... is the player falling? (like the check for fall anim), store the sim time (or z coord) when that happens, and then get the time difference (z dif) next time the player has ground contact. I wouldn't personally want this in stock because it doesn't fit the physical semi-realism I'm going for, but it would make sense in certain styles of games where falling damage is a carefully-calculated design issue.

As for the issue people might be noticing with their feather-like player bodies, check out your Player datablock and you'll see there are some limits to fall speed placed in there in the form of resistance and maximum velocity values. Those values probably made sense for whatever Gideon is intended for internally, but are not especially realistic. Adjust until you've found a better balance.
#5
01/15/2010 (3:15 pm)
@Henry
Yeah, I'd been having difficulty getting a reasonable damage result from falling that also covered being knocked (impulsed) into things ... one would either be too high or too low, hence why I thought splitting them up might help with fall damage being seperated and time/height based.

I'll go back and have a play with player mass etc to see if I can get something that works for falling, then alter all my impulses until I get a happy median.