Bullet Trajectory?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

-Freshmeat

Eternally noob
Dec 4, 2003
207
0
0
50
Denmark
Visit site
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
 
Apr 11, 2002
796
0
16
Dallas, TX
www.google.com
[NL]Freshmeat said:
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.
 

yurch

Swinging the clue-by-four
May 21, 2001
5,781
0
0
USA, Maryland.
Visit site
Demosthanese said:
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.
 
Last edited:

gal-z

New Member
May 20, 2003
420
0
0
Ramat-Hasharon, Israel
Visit site
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

Eternally noob
Dec 4, 2003
207
0
0
50
Denmark
Visit site
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