How to model a good machine gun?

Started by
7 comments, last by Interesting Dave 19 years, 8 months ago
Do you shoot a ray out and just apply constant damage on the object? Is there a better way? A more realistic way? How does medal of honor do it? Thanks
--m_nPostCount++
Advertisement
I don't know about medal of honor specifically but most FPS games just use 'hitscanning' for such weapons which is exactly what you describe (trace a ray out to see what is hit). For 'added realism', some games will have some kind of 'noise' they add to the direction/origin/etc of the ray to simulate 'recoil'/'breathing'/'accuracy'.

Bullets move so quickly that accurately simulating an actual projectile isn't really worth it (since it would be at the end of it's path in a timestep or two, it is almost exactly the same as the ray method unless you do MANY physics step each frame for bullet movement).
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Quote:Original post by Extrarius
Bullets move so quickly that accurately simulating an actual projectile isn't really worth it (since it would be at the end of it's path in a timestep or two, it is almost exactly the same as the ray method unless you do MANY physics step each frame for bullet movement).


Or use a ray from lastPos to currentPos at each timestep.
I think I'd initially shoot a ray out for each bullet to simulate the scattering effect, then the visual effect matches the bullet. I'd like to trace the path of the bullet so it can go through walls, smash windows enroute etc as well (even being deflected in the process) and obviously you have to detect if the bullet reaches player via 6 feet of concrete and prevent this!
Hey,

I've been analysing this in my own game as well and decided to go with ray tracing as well. As Extrarius said, trying to model the real velocity of a bullet is almost a waste of time, particuarly in regards to a floating framerate. You'd have to make the velocity vector of the bullet so large that the client rendering wouldn't really notice it anyways.

I as well am unsure about MoH, but I do know that all Quake engines (as far as I can tell) use ray tracing and simply spawn a tracer every now and then to provide the user with a graphical effect which doesn't exactly simulate the bullet, but gives the user a better feel of unloading on another player ^_^.

Permafried-
Actually, some games model the bullet's velocity, because there IS a slight delay when you're sniping long range, and it's totally unrealistic to expect the bullet to hit a guy instantaneously a mile away. So if it's close range, save CPU and shoot a ray, if it's long range, shoot a ray but make it extend over .3 second or something.
I eat heart attacks
When using flare ammunition at night you can see the bullets flying through the air. It looks like starwars, and the bullets need some time to reach their target 400m away...

So if you want to keep it realistic you should consider this.
ever see those Desert Storm nighttime cams? Awesome stuff, with all those tracers zipping through the night.
I eat heart attacks
Max Payne (I/II) tracks and renders each bullet doesnt it?

Im planning on something like it..
Roger that, lets run like hell!

This topic is closed to new replies.

Advertisement