Game Development Community

Realistic weapons - projectiles or rays?

by Mike Stoddart · in Torque Game Engine · 05/23/2002 (9:56 am) · 9 replies

I remember reading a forum post (which I can't find anymore) about using rays instead of projectiles for ballistics. I'm looking to have realistic WW2 weapons, such as a pistol, rifle and machine gun.

1) Can the engine cope with using projectiles to simulate realistic ballistics? Will projectiles be fast enough to simulate bullets?

2) Have there been any other resources or forum posts relating to this topic?

3) What are the units of the muzzle velocity for the projectile? Currently the crossbow is 100, so is that 100 game units per second (whatever game units are)?

Thanks

#1
05/23/2002 (10:32 am)
Quote:I remember reading a forum post (which I can't find anymore) about using rays instead of projectiles for ballistics. I'm looking to have realistic WW2 weapons, such as a pistol, rifle and machine gun.

1) Can the engine cope with using projectiles to simulate realistic ballistics? Will projectiles be fast enough to simulate bullets?

2) Have there been any other resources or forum posts relating to this topic?

3) What are the units of the muzzle velocity for the projectile? Currently the crossbow is 100, so is that 100 game units per second (whatever game units are)?

I started one of those, seems that it could go either way, and will require stress testing.

Personally I don't like hit-tracing bullets because they don't allow for modeling of bullet travel time not to mention drop or any other physical characteristics, no matter how small that time may be and severly compromise "realistic" or "sim" game play with bullets that travel at the speed of light.



Personally I am subclassing projectile and creating a Bullet class that has no model, no emitters or anything and takes into consideration any time aliasing that will occur with high speed projectiles ( if there needs any new code so far it seems to do collions with the environment just fine, players might be a different story )

1. My testing indicates yes, projectiles will work fine for bullets with realistic ballistics. Just set the velocity of the crossbow or rifle up really high and test it yourself.

2) yes, they are probably hard to find without body text searching

3) My understanding it everything in the game is in METERS or METERS per second. ( except player speed which I still have not gotten a satisfactory answer on )

Settting the crossbow or rifle to 2500 should be 2500 meters per second, which is MUCH faster than any bullet would travel. It is instaneous hits except at long ranges and there is only a slight pause before you see the explosion.

One of the FASTEST rifle/machine gun rounds typically used is a .50 BMG ( 2250 Feet Per Second ) for pistol rounds the fastes are the .50 AE ( 1850 fps ) or the .440 Corbon ( 2000+ fps I think ).

See my resource I submitted on Ballistics for way to much detail on this topic.

So I think that projectiles will work fine.

I even set the rate of fire up really high, to like 1200 rnds minute ( MG42 ) and the engine handled it fine.
#2
05/23/2002 (10:44 am)
Excellent reply Jarrod - thanks!
#3
03/15/2004 (3:39 am)
I don't know that much about Torque yet but wouldn't the server have to communicate the spawning/destruction of all those bullets? to all the clients?
imagine 64 players firing rapid fire machine guns all spawning bullets... thats not good, even if the engine can 'handle' it, it seems very wasteful to use a projectile who would be hitting a wall in the next frame. surely there is a way to optimize bullets using 'traces' or whatever torques implimentation of them are, also using traces has advantages for coding in 'zero ping' weapons, so even someone with a 300 ping would not have to 'aim infront' of a target

(this is done by timestamping events and rolling back based on someones latency to get the proper positioning and do a trace like that)
#4
03/15/2004 (3:52 am)
UltraRenegades for Tribes 1 was a mod that would allow you to shoot I know at least 30 shots a second with near instantanious impact to its target at 500m and with 20 people all shooting and flying around there was no lag what so ever, back then I was on dialup so a 300 ping was not uncommon and I was cappin MoFo's all day..

I hated that mod :-/

So how do you figure it will effect a much better/faster engine? It probably wont if the shape of the projectile is optimal.
#5
03/15/2004 (4:22 am)
"I don't know that much about Torque yet but wouldn't the server have to communicate the spawning/destruction of all those bullets? to all the clients?"



My post was made under the assumption the server would need to communicate projectile data like any other object (location rotation etc)

For that the engine has nothing to do with anything its simply a matter of x amount of data being sent to y amount of clients at z intervals requires b bandwidth

where you would want to keep b as low as possible or you get PL
#6
03/15/2004 (4:28 am)
Also from what you are saying how do you know it isnt using rays?
'near instantanious' sounds like your 300 ping was causing lag,
furthermore how can you have 'no lag' with a 300 ping
#7
03/15/2004 (4:37 am)
Also from what you are saying how do you know it isnt using rays?
'near instantanious' sounds like your 300 ping was causing lag,
furthermore how can you have 'no lag' with a 300 ping
#8
03/15/2004 (4:55 am)
Projectiles or rays the server still has to communicate their creation to the clients, 300 ping is pretty low for dial up back then. And well within the limits of the prediction code in Torque
#9
03/15/2004 (4:57 am)
Projectiles or rays the server still has to communicate their creation to the clients, 300 ping is pretty low for dial up back then. And well within the limits of the prediction code in Torque