PDA

View Full Version : Bullet Trajectory?


-Freshmeat
11th Dec 2003, 02:05 AM
Just out of curiosity: What model does the bullet drop-off follow? Line, parabolic, distorted parabolic or something else?

-Freshmeat

Demosthanese
11th Dec 2003, 02:22 AM
The game's gravity pulls the bullet downward, so I'd imagine it is parabolic.

yurch
11th Dec 2003, 02:28 AM
The bullet is also dramatically deaccelerated by air resistance.

-Freshmeat
11th Dec 2003, 04:09 AM
Thanks for the answer.

I am deeply impressed.

Honestly, I thought that the sheer amount of calculations for this kind of realism would kill off any processor, esp. with lots of full-auto fire.

Demosthanese, are you implying that the game uses a non-analytic approach? Or is it more along

y=-a*t^2 (gravity)
x= b*ln t (resistance)

For a fast approximation?

-Freshmeat

Demosthanese
11th Dec 2003, 04:37 AM
Freshmeat']Thanks for the answer.

I am deeply impressed.

Honestly, I thought that the sheer amount of calculations for this kind of realism would kill off any processor, esp. with lots of full-auto fire.

Demosthanese, are you implying that the game uses a non-analytic approach? Or is it more along

y=-a*t^2 (gravity)
x= b*ln t (resistance)

For a fast approximation?

-Freshmeat

The resistance is something the team has little control over, as it is a product
of the level in the variable of terminal velocity. Any object going faster than
what the level assigns as terminal velocity is slown down gradually (apparently
why the 40mms don't behave properly). Gravity affects the bullets in the
same way it affects the player or a flak shell in Vanilla UT.

I doubt that it uses the distance formula. I'd imagine that every unit of time,
the game subtracts or adds to the velocity of the pawn, and the position is
altered based on the speed.

Meplat
11th Dec 2003, 07:26 AM
Want another way to see it?

"Slow Bullets" and the recent "all tracer" mute. Then go to the range.

Meplat-

yurch
11th Dec 2003, 12:15 PM
The resistance is something the team has little control over, as it is a product
of the level in the variable of terminal velocity. Any object going faster than
what the level assigns as terminal velocity is slown down gradually (apparently
why the 40mms don't behave properly). Gravity affects the bullets in the
same way it affects the player or a flak shell in Vanilla UT.

I doubt that it uses the distance formula. I'd imagine that every unit of time,
the game subtracts or adds to the velocity of the pawn, and the position is
altered based on the speed.
Wrong and wrong. (40mm's are affected by the bBounce variable and will not display that behavior if it is set to false) :D

The ballistics are using a minor variation of the RAv2 ballistics, which work as follows:

Air resistance acceleration = negative constant per bullet * velocity * (another per bullet resistance constant ^ distance) * velocity

This is recalculated basically every .02 of a second. It is basically a changing air resistance based on distance and velocity, which models an approximation of the bullet flight pattern (speed, distance, ToF) that I have calculated beforehand. Acceleration decreases as the bullet slows down, and the rest of the calculation of the bullet (velocity, position) is left to the MUCH faster engine native code.

It is quite accurate and velocity is even added back to correct the small amounts of error that occur between the .02 second interval. Air resistance has a massive effect on ballistics (approximately half a 5.56's energy is lost in the first 200m) and this models it quite well.

On top of this manual gravity acceleration is added, not UT's gravity. Only disadvantage of this is that it will not be affected by lowgrav areas or mutators.

The code is executed seperately on client and server, meaning no information needed to be sent between them during the flight, only the initial characteristics. Like always, server has final say in case of a discrepancy.

-Freshmeat
11th Dec 2003, 01:50 PM
Thank you for the information. I think it is nice to know that the bullet that kills you has done so according to proper physics ;)

-Freshmeat

Alborda
12th Dec 2003, 02:31 PM
Are this ballistics (like those in RA) on 2.9? I tried the robar on the 500 long shooting range and it seems that the bullet lands where the crosshair is (more or less)

sublime
12th Dec 2003, 02:38 PM
That's because the robar is zeroed at 500m (or close to it believe, am at work and can't check). ;)

Shoot at at 100m and see if it's high. Shoot it at 700m and see if it's low.

gal-z
5th Jun 2004, 04:15 PM
Hmm... So what's the robar's max height and at what range?
And at what other range except 500m does it hit with 0 offset? As in M4A1 zeroes to 250m hits exactly where u aim at 250m AND somewhere around 45-50m (don't remember, I think it's 48m).

-Freshmeat
6th Jun 2004, 05:05 AM
I think only testing at the shooting range will sort that question out. Make notes on the average offset at all targets from 15 to 500 m, using screenshots for measuring. Use that for a graphical analysis of the trajectory. My guess is that the number is not hardcoded anywhere, and unless we get the exact formulae used for the calculation by the engine (including the error correction Yurch mentions), graphical analysis is the only wayy to go. And it will produce quite reasonable results if you use the average of, say 25 shots at each range for determining the offset.

The faster method would be to see between what ranges the offset goes from negative, and then presume that the flight path was linear between those two ranges. I guess the result produced from that would be quite close to the real number, and that could be worked out in a couple of hours or so. If you have no clue what I am taking about, I would be willing to do the measuring sometime next month (but not the shooting. You will have to do that for yourself and mail me screenshots of the targets).

-Freshmeat