Game Development Community

Wacky default projectile behaviour

by Daniel Buckmaster · in Torque Game Engine · 08/04/2008 (3:24 am) · 2 replies

I'm starting to play with projectiles. The main thing I want is projectiles that ricochet when hitting a surface at a certain angle. Not too hard. But wanting to program this prompted me to do some research into how Torque currently handles projectile bounces, arming delays, etcetera.
The answer is: wierdly.
If I fire a non-ballistic projectile, it won't collide with anything until it's armed. If I fire a ballistic projectile with an armingDelay similar to its lifetime and 0 elasticity, it will stick to whatever it collides with, then at the end of its life, it may or may not explode.
Projectiles with armingDelay reasonably lower than lifetime explode reliably. What's the problem when the gap is closer?

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!


#1
08/04/2008 (10:42 am)
ArmingDelay is the number of ticks until that projectile can explode, which is why it isn't exploding until armingDelay is finished. I'm not exactly sure why it's there, I think so a projectile can be shot out of some vehicles and by some player models without exploding on the user.
#2
08/04/2008 (12:18 pm)
Yeah - so the bullet doesn't collide with the gun, basically. Also, you can use it for grenades like in Tribes - they bounced a few times and then exploded, but if you fired a long arcing shot, it'd explode as soon as it hit.

I'm just wondering what the cause of the random explosions is - I'm assuming that it's a client/server issue. Either way, I'm ewriting the projectile code, so...