Game Development Community

Inconsistent weapons and projectiles

by Mike Stoddart · in Torque Game Engine · 06/11/2002 (6:58 pm) · 1 replies

I've added a new weapon into my game, which is meant to be a pistol. I'm messing around with the data values in the script to try to increase the muzzle velocity and alter the effect that happens when the projectile hits something.

One thing I am noticing is that the weapon is inconsistent. If I repeatedly fire at the same spot, sometimes I see a trail (even though I thought I turned it off), sometimes I can see the projectile and sometimes I don't see the projectile. This is more noticable over longer distances obviously.

I have the muzzle velocity set to between 600-1000 (trying different values). Could it be that something running in the background is affecting the weapon projectile, or is it that the engine can't handle such projectiles reliably and consistently?

Thanks

#1
06/11/2002 (7:18 pm)
It's because of how data is sent to the client, the projectile is first instantiated on the server and then ghosted on the client. If the projectile is too fast it may explode even before it gets sent to the client (at which you'd probably only see the explosion). That's also why you won't see particle trails straight from your muzzle or right up to the explosion point. If you have a very fast projectile you may want to consider just making it a straight ray cast (from muzzle point to a very large distance), emit particles every x units directly in one tick, and explode in the same tick.