Game Development Community

Projectiles at non-relativistic velocities

by Orion Elenzil · in Torque Game Engine · 12/22/2004 (12:25 pm) · 4 replies

This is a small note for anybody so inclined -
Projectiles like a crossbow or bullet should really have the firer's velocity
added to their own initial velocity.

for example,
if you and i are both strafing due north,
and i aim right at you and fire,
and we both continue due north,
i should hit you.

- that's just basic physics.

(well except for wind resistance,
which i don't know if torque includes by default)

with the default crossbow as it is now
i won't hit you, i'll hit the spot
where you were when i fired.

i'm not really involved in using torque anymore,
so i won't be making the mod myself,
but someone might like to and
try the difference in gameplay.

orion

#1
12/22/2004 (1:06 pm)
I don't know if it gets the math right (haven't tried your experiment), but projectile initial velocities are affected by player movement. The code for this is in game/server/scripts/crossbow.cs in the onFire function.
#2
12/22/2004 (1:40 pm)
Drag is also applied to basically anything moving (as far as I understand) by default.
#3
12/22/2004 (1:50 pm)
Drag might explain Orion's problem. It would tend to make projectiles fall behind the two players who are running side by side. Looks like Torque failed Orion's physics test because it was more realistic than he expected :p
#4
12/22/2004 (1:57 pm)
Oops,
you're right.

I did some more careful tests
and yes, the player's velocity is added to the projectile.

Perhaps it's just that the drag is more than i would like
or that the projectile only gets some percentage of the player's velocity.

Anyhow.
I guess never mind!

orion