How are the ballistics calculated?

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

LogisticEarth

FNG / Fresh Meat
Sep 24, 2007
831
132
0
Pennsylvania, USA
Quick, simple question: How are the ballistics in-game calculated? Is the path of each round individually calculated on the fly? Or what?

This includes bouncing tank shells and MG fire. How does that work?
 

UncleDrax

FNG / Fresh Meat
Oct 13, 2005
1,494
60
0
Florida, USA
www.endoftheworldfor.us
Quick, simple question: How are the ballistics in-game calculated? Is the path of each round individually calculated on the fly? Or what?

This includes bouncing tank shells and MG fire. How does that work?

I can't attest to the bouncing stuff right now (CBA to look it up), but with the other projectiles they are assigned a Speed and a Ballistic Coefficient, and I believe that the engine does the rest of the flight path stuff. Gravity of course is a engine-wide constant.

I have no reason to believe that anything like windage or gyroscopic drift is factored in.

small-arm Tracers do in fact have their own BCs/Speeds associated with them. I think in most instances the ranges in RO aren't long enough to really see the differences though.
 

Fedorov

FNG / Fresh Meat
Dec 8, 2005
5,726
2,774
0
the bullets dont fly, I think that when you press fire, there is some kind of invisible laser line created that stops at the first object that touches.

you may ask then whats that thing about leading the target?... that depends your ping and not on the flight time, there is no flight time, the higher it is the more you have to lead, notice that in practice mode, no matter how far away from the bots you are, they are insta kills

at least thats my theory, if anyone has a better explanation for this, i would like to read it
 

Hyperion2010

FNG / Fresh Meat
Nov 22, 2005
2,560
1
0
34
NC
the bullets dont fly, I think that when you press fire, there is some kind of invisible laser line created that stops at the first object that touches.

you may ask then whats that thing about leading the target?... that depends your ping and not on the flight time, there is no flight time, the higher it is the more you have to lead, notice that in practice mode, no matter how far away from the bots you are, they are insta kills

at least thats my theory, if anyone has a better explanation for this, i would like to read it
This is not correct. Some games use hitscan, but ROO does not. The trajectory is in fact calculated (its really not that hard all you need is the vector with the muzzle velocity of the gun and the direction which can be parsed directly from the core.player info) and then there is a very sophisticated system of hitboxes (2 or 3 layers even?) that the server will check for if the trajectory passes through them. It shouldnt be too much slower than a laser, a quick searching algorythm could find any hitbox along the trajectory, or an upper bound, lower bound and average laser could be used to get the x coordinate of the hitboxes and then just look up the y from the trajectory. Those all seem slow to me, I'm sure Ramm used something faster.

EDIT: definitely no bouncing, all tracers bounce because they are done client side.
 
Last edited:

Fedorov

FNG / Fresh Meat
Dec 8, 2005
5,726
2,774
0
This is not correct. Some games use hitscan, but ROO does not. The trajectory is in fact calculated (its really not that hard all you need is the vector with the muzzle velocity of the gun and the direction which can be parsed directly from the core.player info) and then there is a very sophisticated system of hitboxes (2 or 3 layers even?) that the server will check for if the trajectory passes through them. It shouldnt be too much slower than a laser, a quick searching algorythm could find any hitbox along the trajectory, or an upper bound, lower bound and average laser could be used to get the x coordinate of the hitboxes and then just look up the y from the trajectory. Those all seem slow to me, I'm sure Ramm used something faster.

EDIT: definitely no bouncing, all tracers bounce because they are done client side.

my point was not to say that it wasn't calculated, but was that there wasn't any traveling projectile
 

I. Kant

FNG / Fresh Meat
Apr 9, 2007
1,516
286
0
Lasers (if we are talking about pure light, not some plasma bolt) are not affected by gravity. Why, then, the need to aim ABOVE your target on REALLY LONG ranges?
Weapons ballistics has been a big selling point, or at least a marketing anchor, for RO, I imagine.
 

Fedorov

FNG / Fresh Meat
Dec 8, 2005
5,726
2,774
0
Lasers (if we are talking about pure light, not some plasma bolt) are not affected by gravity. Why, then, the need to aim ABOVE your target on REALLY LONG ranges?
Weapons ballistics has been a big selling point, or at least a marketing anchor, for RO, I imagine.

light IS affected by gravity =P

but again I failed to express my point, I didnt say the laser analogy to describe a straight line, but to describe something that is instantaneous
 
Last edited:

Fedorov

FNG / Fresh Meat
Dec 8, 2005
5,726
2,774
0
For anyone that has seen a tank shell coming at directly at them, you would know it is not instantaneous.

tank shells and tracers are not included. they use a diferent system (and thats why they are so bugged)

go and snipe bots in practise mode and see for yourself FFS, there is no travel time
 
Last edited:

Yoshiro

Senior Community Manager
Staff member
Oct 10, 2005
13,575
4,165
113
I know Ramm did a detailed post about this crap around the release time of RO if anybody cares to use search to dig it up. Or maybe he'll pop in here and post. But from what I understand there is a projectile (physics, ballistics and what not) with a minor bit of hitscan (deviation from the pure caculated route) to simulate the accuracy of the weapon. Don't hold me to that however. Once again this is a Ramm question (and since search doesn't want to take me past mid 2007 on Ramm only posts this might be hard to find).
 

[TW]Wilsonam

VP, Tripwire Int.
Oct 17, 2005
4,060
2,618
113
63
Roswell, GA
www.tripwireinteractive.com
Yup, the game spawns a projectile for each bullet, as I recall, from the tip of the weapon, in the direction it is pointing. There is a ballistics algorithm that figures out distance travelled and drop between each tick, so that the round travels along a series of points that closely approximates the actual curve - watch a tank round in flight and you it will seem to fly on a nice curve at long ranges.

If I remember right (and as Yoshi says, Ramm is the guru wot built the system) the engine does checks each tick on where it would travel in a direct straight line - we had issues in testing with high-velocity tank rounds being one side of a tank one tick and the other side next tick, so appearing to pass right through without hitting.

Anyway - in answer to the bsaic question: all projectiles (bullets, tank rounds, rocketry) are individually calculated and follow a correct ballistic path (assuming we have the correct MV and BC data for each round, which can be a little tricky to calc!). For the mad detail, hunt for Ramm's detail post somewhere back in the mists of time!
 

BuddyLee

FNG / Fresh Meat
Apr 12, 2006
2,088
20
0
NCC 1701-D Neutral Zone
Pfft I remember when bullets came off the top of your avatars head before the clipping complaints and the following patch. :p

Try sniping across Barashka and you will in fact see a delay of impact.
 

Yoshiro

Senior Community Manager
Staff member
Oct 10, 2005
13,575
4,165
113
If I recall correctly the bullets always came out of the barrel, however it was discovered that a certain crouch lean combination moved the alignment very off the tip of the weapon in code.
 

LogisticEarth

FNG / Fresh Meat
Sep 24, 2007
831
132
0
Pennsylvania, USA
Try sniping across Barashka and you will in fact see a delay of impact.

Oh I know, I remember sniping on one of the Klin_Outer_Ring betas, and I saw a Soviet squad leader trying to sight in some arty, just at the edge of the view distance. I took a guess, aimed a good deal above his head, and fired. It seemed like it traveled for at least a second.

To everyone who answered the question, thanks. I was having a discussion over in the Insurgency (the Half-Life 2 mod) forums and people were telling me that it was impossible for computers to calculate ballistics in online FPSs without overloading the processors. I knew they were full of it, just wanted to get an example of how it's done. ;)

So, bounced tank rounds are done client side though? How do bounced rounds kill other tanks and infantry then?
 

Yoshiro

Senior Community Manager
Staff member
Oct 10, 2005
13,575
4,165
113
Since RO does do balistics it is one of the heaviest loads on the server. That is why we had to test to see how many machine and sub machine guns we could get going before servers started to crawl during early alpha testing. This was one of the main reasons TWI never did the oft wanted penitration. Strange things happen when servers get overloaded. Believe bounced tank rounds are still server side, however bouncing tracers are client side (I think) and won't do damage.
 

Bobdog

FNG / Fresh Meat
Nov 22, 2005
1,916
218
0
Texas
Bounced tank rounds are definitely server side; I remember once seeing a tank kill itself by firing on an enemy at very close range and having it come bounce back.

The ballistics calculations also account for the occasional occurrence of two players killing each other at long distances; the bullets pass each other in flight.
 

Sidus Preclarum

FNG / Fresh Meat
Oct 30, 2006
683
0
0
42
Civitas Osismorum
watch a tank round in flight and you it will seem to fly on a nice curve at long ranges.

Yeah, on Krivoi Rog, I once destroyed a stug which was behind a hill, 1200meters away, on which I couldn't have a visual with the gun sight, but could see its top through the binocs. THen as the explosion gave no kill report, I surmised the driver had abandonned the stug just before the last hit, and sprayed the area with MG fire at random, and killed him.

Bounced tank rounds are definitely server side; I remember once seeing a tank kill itself by firing on an enemy at very close range and having it come bounce back.
I once destroyed a pzIV in arad by shooting at the panther that was alongside it. Ricochet on the panther, side hit on the IV, kaboom.
Another game, I fired at another panther, ricochet, the shell bounced in an high arc, and fell right on a friendly sapper who had spent the last 20 seconds patiently crawling toward the camping Panther.

Can you experience those kind of gameplay moments in any other only FPS ? :D
 
Last edited:

=GG= Mr Moe

FNG / Fresh Meat
Mar 16, 2006
9,791
890
0
56
Newton, NJ
...Another game, I fired at another panther, ricochet, the shell bounced in an high arc, and fell right on a friendly sapper who had spent the last 20 seconds patiently crawling toward the camping Panther....

I have been killed by friendly ricochets a couple of times over the years, actually rather amusing and I always have a good laugh :p
 

{Core}Craig

FNG / Fresh Meat
Mar 2, 2008
756
178
0
what the hell, do people actually care about the maths??

Just shoot the gun at someone or throw a nade . .