Jump to content
901234

The World of Warships Ballistics Model - Solved

20 comments in this topic

Recommended Posts

58
[O7]
Members
197 posts
9,148 battles

Before we start, special thanks are given to:

TTaro (SEA server) for bringing the various discrepancies and the reverse engineered code to my attention as well as testing the USN 5" max ranges.

warabi99 (SEA server) for helping me implement the updated model.

@CVsNTCsmolRUBBPay2Rico19 for testing and corroborating some of these cases before hand.

In summary:

Based on reverse engineered code (found in this EU forum post) from earlier an World of Warships client, we were able to piece together the formulae and methods used to generate a ballistics model that closely matches the one seen in game. This new model is able to accurately predict shell behavior in numerous situations where even the previous model failed.

Note: the previous model refers to the model first created by fnord_disc on EU [more info on Reddit] and is used on most penetration implementations

Model Performance:

Cases where the new model out performs the previous model [all of which are reflected in game]:

1. The new model correctly predicts the maximum range of Yamato HE - previous model predicts a maximum range of ~29km; new model predicts a range of ~32km

Spoiler

New Model predicts ~32.7km

856187877_ShellFlightTimeandImpactVelocity(19).thumb.png.576b00d79d49abdd64c102acafe3d503.png

Previous Model predicts ~29.3km

278463654_ShellFlightTimeandImpactVelocity(20).thumb.png.d01c00d70c0e5c32f9c6b62b1cc68e1a.png

Note: These graphs are looped because the elevation range is set from 0 degrees to 90 degrees - what matters is the maximum ranges these reach

Note: 45 degrees is not a guaranteed to reach maximum range due to the effects of altitude dependent air drag.

In game observation:

shot-20_09.14_12_24.18-0845.thumb.jpg.c99d432ef639a14bfb781962ed37ab30.jpg

[Note: The maximum range [including circle] actually changes to ~37km if you switch to AP in this configuration of Range Mod + Spotter Yamato]

2. The new model requires a time multiplier that is nearly identical to the stated in game time multiplier of 2.61 - previous model used a time multiplier of 3.1

3. The new model correctly predicts the distance at which ships like North Carolina begin to and consistently "deck pen". - tested by @CVsNTCsmolRUBBPay2Rico19

Spoiler

New Model (chance: 25km+, always: 32km+)

 390990168_DeckPenetrationandImpactAngle(4).thumb.png.d334c5fdeb0a20a746a29b1d489199fb.png

Previous Model (chance: 21.4km, always: 28km+)

1263413295_DeckPenetrationandImpactAngle(5).thumb.png.632b50726f27efafe824f8fb94f8707c.png

Observations indicate that they start roughly around 26km, and always roughly around 32km.

4. The new model correctly predict the maximum ranges of USN 5" Shells

Spoiler

New Model: Max range AP: ~16.7km; HE: ~16.4km

1212851512_ShellFlightTimeandImpactVelocity(22).thumb.png.2f3a635ade19cb9b0e78f1c6838bb34b.png

Previous Model: Max range AP: ~15.7km; HE: ~15.4 km

134517317_ShellFlightTimeandImpactVelocity(24).thumb.png.6289cf086f9575ecdc95be5e6ab9b08d.png

Note: These graphs are looped because the elevation range is set from 0 degrees to 90 degrees - what matters is the maximum ranges these reach

Note: 45 degrees is not a guaranteed to reach maximum range due to the effects of altitude dependent air drag.

In game observation (from TTaro):

AP:

fletcherAPmax.thumb.png.28ca5fc7ecf9d208b59390922d6f469c.png

HE:

fletcherHEmax.thumb.png.ea6ada385d9adc232cec291ec971bd4a.png

Implementation differences:

The previous model contained a linear drag component partially determined by the caliber of the shell. [code here] L44 - 45 for drag implementation

The new model only contains a quadratic drag component - that is partially determined by total velocity. [code here] L206 - 211 for drag implementation [note: cw_2 is 0]

This causes shells in the new model to be considerably faster which also contributes to the lower impact angles at a given distance.

Remaining questions:

Penetration Formula:

In order to make penetrations work properly (due to the higher impact velocities) I had to generate a new equation regressed from WG Armada data which is as follows:

Raw Penetration(mm) = 0.00046905491615181766 * V(m/s)^1.4822064892953855 * D(m)^-0.6521 * M(kg)^0.5506 * K/2400

R²: 0.9955230522916081

While the regression performs well, the lack of data outside of the range [5km, 15km] means that the prediction is less certain when outside of these bounds.

Deck Penetrations:

According to previous testing, deck penetrations do not work at expected ranges for Minotaur even with the new model. - tested by @CVsNTCsmolRUBBPay2Rico19

There are some theories ranging from deck penetration may not be correctly applied properly for ships with improved autobounce to height compression. But no evidence currently points to or excludes either.

Spoiler

Current predictions: start ~11.2km; always~16km - not observed in testing

1725592510_DeckPenetrationandImpactAngle(6).thumb.png.f17143c8186eb1698266326e2db902c2.png

Viewable Implementation:

Currently you can view an implementation of this new ballistics model here at: https://jcw780.github.io/wows_ballistics/

Additional Notes:

- The previous model graphs are generated from a local instance of the website that I use for testing purposes - the site originally used that model.

- In the spirit of full disclosure, I do actually run wows_ballistics and maintain a library that models this. - pardon me for the spaghetti code though :)

- This post is not meant to bash the original model or author(s) - I actually use fnord_disc's post-penetration velocity formula on my site and if it wasn't for his work I probably would not have gotten so far into this and gone to create the updated model.

- If you have any additional questions feel free to ask me in this thread or join this discord server: https://discord.gg/fpDB9y5

Edited by 901234
  • Cool 10
  • Thanks 4

Share this post


Link to post
Share on other sites
58
[O7]
Members
197 posts
9,148 battles
12 minutes ago, LowSpeed_US said:

I found the secret to the 07.  

They have their own in house "Q".

 

Technically I only joined a few weeks ago, but we can roll with that. 

Share this post


Link to post
Share on other sites
2,722
[WPORT]
Members
7,235 posts
12,248 battles

There are ballistics calculation equations used to calculate the flight path of rifle bullets.
Is there a reason such established equations could not be used and combined with the time multiplier of "2.61" ?  (Lack of certain data such a coefficient-of-drag for a given projectile, for example.)

Does WOWs use or omit the Coriolis effect?

Are there variables that simulate the effects that water & waves or wind & weather have on the hull of a ship and thereby tilt the gun barrels in 3-axis by a small amount?

Is wind simulated for its' effects on the flight path of a projectile (by WOWs or by your modeling program)?

What other factors were used-or-not-used by either WOWs or your modeling program?

  • Cool 1

Share this post


Link to post
Share on other sites
579
[TIMT]
Members
1,144 posts

Great Work!

I do have a few thoughts on this and things I am curious about:

  • It makes sense to me that the drag equation is quadratic in nature, since most ballistic drag is turbulent as far as I know. Still struggling with understanding the exact equation you are using in your code, so I cannot really see why cw_2 is zero?
  • Given that the game uses a multiplier for almost everything in terms of size and speed, is there a good source for how these are implemented? In other words, is it just a scaled physics simulation or is WG using their own models? Is there any info on that, because it might help to understand the udnerlying assumptions for the ballistics.
  • I have suspected that there is something like height compression, the shell arcs are just too flat and weird at long ranges. Do you know whether this is a continuous thing or based on a 'cutoff height'? It might be interesting to see if something like a coordinate transformation could solve the issue.

Again , great work and thanks for sharing!

Share this post


Link to post
Share on other sites
58
[O7]
Members
197 posts
9,148 battles
3 minutes ago, Wolfswetpaws said:

There are ballistics calculation equations used to calculate the flight path of rifle bullets.
Is there a reason such established equations could not be used and combined with the time multiplier of "2.61" ?  (Lack of certain data such a coefficient-of-drag for a given projectile, for example.)

I am not sure what equations you are referring to. The reason why the previous model could not use 2.61 is because it underestimated shell velocity [had a linear drag component whereas the new model does not.]

4 minutes ago, Wolfswetpaws said:

Does WOWs use or omit the Coriolis effect?

I have never heard any so about this so AFAIK no.

5 minutes ago, Wolfswetpaws said:

Are there variables that simulate the effects that water & waves or wind & weather have on the hull of a ship and thereby tilt the gun barrels in 3-axis by a small amount?

Ship list is modeled but AFAIK it is only affected by turning and not by waves - or the effects are very minor. Also I think even if it does affect elevation the turrets might compensate.

6 minutes ago, Wolfswetpaws said:

Is wind simulated for its' effects on the flight path of a projectile (by WOWs or by your modeling program)?

In game AFAIK, no; In my model no.

6 minutes ago, Wolfswetpaws said:

What other factors were used-or-not-used by either WOWs or your modeling program?

Stuff like relative humidity (which affects air density and thus drag force) are not modeled.

  • Cool 1

Share this post


Link to post
Share on other sites
58
[O7]
Members
197 posts
9,148 battles
9 minutes ago, shinytrashcan said:

Great Work!

I do have a few thoughts on this and things I am curious about:

  • It makes sense to me that the drag equation is quadratic in nature, since most ballistic drag is turbulent as far as I know. Still struggling with understanding the exact equation you are using in your code, so I cannot really see why cw_2 is zero?
  • Given that the game uses a multiplier for almost everything in terms of size and speed, is there a good source for how these are implemented? In other words, is it just a scaled physics simulation or is WG using their own models? Is there any info on that, because it might help to understand the udnerlying assumptions for the ballistics.
  • I have suspected that there is something like height compression, the shell arcs are just too flat and weird at long ranges. Do you know whether this is a continuous thing or based on a 'cutoff height'? It might be interesting to see if something like a coordinate transformation could solve the issue.

Again , great work and thanks for sharing!

- Since cw_2 used to be affected by shell caliber which may be distinct for each shell it is defined in another file - now it is just set to zero.

- 2.61 is just a time multiplier and iirc there is a 2x distance/size multiplier for ships and torpedoes. source

- There is height compression function it is actually in the reverse engineered code. From a cursory glance it logarithmic-ally compresses the height as it get higher whereas close to sea level height compression is almost unnoticeable. This makes sense since it makes it easier to see shells as they all fly in a relatively similar heights. If this wasn't implemented there would be considerable variance in shell trajectory heights making shell observation more difficult.

BALLISTIC_FLATTENING = 1.0 #Line 117 here: https://pastebin.com/GXUt7BMJ
BALLISTIC_SCALE = 60.0
 
 
def flatten_traj_height(h):
    if BALLISTIC_FLATTENING != 0.0 and h > 0:
        h = log(BALLISTIC_FLATTENING * h + 1.0) / BALLISTIC_FLATTENING
    return h

 

Edited by 901234
wording / grammar; added link
  • Cool 1

Share this post


Link to post
Share on other sites
2,722
[WPORT]
Members
7,235 posts
12,248 battles

@901234, thank you for answering my questions.
And thank you for your efforts to improve the life of the WOWs community.

 

Share this post


Link to post
Share on other sites
SuperTest Coordinator, Volunteer Moderator, Privateers
41 posts
207 battles

Wow, thank you 901234, and those who helped out to figure everything. This is big and a game-changer for people who want to understand the ballistics better and have been frustrated. I think this is worthy of a pin here to give people something to discuss and look over.

Share this post


Link to post
Share on other sites
579
[TIMT]
Members
1,144 posts
1 hour ago, 901234 said:

- Since cw_2 used to be affected by shell caliber which may be distinct for each shell it is defined in another file - now it is just set to zero.

- 2.61 is just a time multiplier and iirc there is a 2x distance/size multiplier for ships and torpedoes. source

- There is height compression function it is actually in the reverse engineered code. From a cursory glance it logarithmic-ally compresses the height as it get higher whereas close to sea level height compression is almost unnoticeable. This makes sense since it makes it easier to see shells as they all fly in a relatively similar heights. If this wasn't implemented there would be considerable variance in shell trajectory heights making shell observation more difficult. 

Thanks for the quick reply, and especially the link!

I agree, a logarithmic compression of the height makes sense to facilitate observation, though I would wonder how that is exactly implemented. From a developers perspective you could do all the math in 'real space' and then just do the graphics with the adjustment, though any other way might work too.

Share this post


Link to post
Share on other sites
58
[O7]
Members
197 posts
9,148 battles
Just now, shinytrashcan said:

Thanks for the quick reply, and especially the link!

I agree, a logarithmic compression of the height makes sense to facilitate observation, though I would wonder how that is exactly implemented. From a developers perspective you could do all the math in 'real space' and then just do the graphics with the adjustment, though any other way might work too.

Just in case I wasn't clear enough, the math is done in real space [otherwise the altitude dependent drag will be a pain to implement], it's just not visually shown as such.

Share this post


Link to post
Share on other sites
202
[ARC]
Members
1,049 posts
11,356 battles

Just some questions @901234:

What's the difference between maximum and standard dispersion? I compared Cesare and Dunkerque and their max dispersion is the equation I knew from before, but the std dispersion is something new.

How is vertical dispersion modelled? I thougth it was an ellipse that depended exclusively on horizontal dispersion and the shell's falling angle. In your graphics it is plotted as someting that seems different.

Is there any page where we can check all ship dimensions? For some of the famous ships that info is available, but I don't seem to find any page that shows the model's hull dimensions in-game. The closest I can think about is gamemodels3d.com showing the displacement for each ship.

Edited by hanesco

Share this post


Link to post
Share on other sites
58
[O7]
Members
197 posts
9,148 battles
9 hours ago, hanesco said:

Just some questions @901234:

What's the difference between maximum and standard dispersion? I compared Cesare and Dunkerque and their max dispersion is the equation I knew from before, but the std dispersion is something new.

How is vertical dispersion modelled? I thougth it was an ellipse that depended exclusively on horizontal dispersion and the shell's falling angle. In your graphics it is plotted as someting that seems different.

Is there any page where we can check all ship dimensions? For some of the famous ships that info is available, but I don't seem to find any page that shows the model's hull dimensions in-game. The closest I can think about is gamemodels3d.com showing the displacement for each ship.

Technically the entire dispersion section is marked experimental due to lack of high resolution data - lower resolution data [2km intervals] pointed me towards these conclusions.

Also these conclusions were drawn from angles used in the old ballistics model, so I'll have to revisit it to verify whether it's still valid.

Regardless here are some explanations on how it currently works:

1. Std Dispersion is meant to be the axis or the area - depending on the chart - of the "standard deviation ellipsoid" and it's where sigma would have an effect.

- I might've over simplified the calculation for this so I'll probably try to patch it soonTM.

2. Vertical dispersion currently modeled as such:

  • Dispersion [on horizontal i.e. sea] ≈ Dispersion [from shell perspective] / sin(impact angle)
  • Dispersion [from shell perspective] = horizontalDispersion(dist) * verticalScaling (dist)
  • delimDist = delim * idealDistance
  • verticalScaling (dist) = radiusOnDelim / (delimDist) * distance + radiusOnZero                                                                              (for: dist <   delimDist)

                                                 = (radiusOnMax - radiusOnZero) / (idealDistance - delimDist) * (distance - delimDist) + radiusOnMax (for: dist >= delimDist)

3. There might be a sizes value in gameparams for ship hulls that has values on ship dimensions - but don't quote me on this.

Additional Notes:

It could also be that vertical dispersion is drawn on the vertical plane instead of being relative to the shell which would make it:

  • Dispersion (on horizontal i.e. sea) ≈ Dispersion (from shell perspective) / tan(impact angle

Ideal distance might actually just be max distance instead.

Acquiring good dispersion data is very difficult, due to issues like:

  • Gun drift - aim point lowering it self slowly over time - maybe this is the aim bug ppl are talking about? - though something else has to happen to make it noticeable
  • Ships never truly stop after having moved - this becomes a problem if you want to stay still for 60min
  • Actually measuring points of fall - there is a replay parser worked on by @JustDodge and few other people that does it now, but there are still some limitations.
  • Not mention that it takes a long time to get enough shells on target to get a good enough sample - especially for ships with shells / min.

All of this means that it could take a while before any high quality dataset is created and definitive proof is acquired.

 

Edited by 901234
  • Cool 1

Share this post


Link to post
Share on other sites
202
[ARC]
Members
1,049 posts
11,356 battles
43 minutes ago, 901234 said:

Technically the entire dispersion section is marked experimental due to lack of high resolution data - lower resolution data [2km intervals] pointed me towards these conclusions.

Also these conclusions were drawn from angles used in the old ballistics model, so I'll have to revisit it to verify whether it's still valid.

Regardless here are some explanations on how it currently works:

1. Std Dispersion is meant to be the axis or the area - depending on the chart - of the "standard deviation ellipsoid" and it's where sigma would have an effect.

- I might've over simplified the calculation for this so I'll probably try to patch it soonTM.

2. Vertical dispersion currently modeled as such:

  • Dispersion [on horizontal i.e. sea] ≈ Dispersion [from shell perspective] / sin(impact angle)
  • Dispersion [from shell perspective] = horizontalDispersion(dist) * verticalScaling (dist)
  • delimDist = delim * idealDistance
  • verticalScaling (dist) = radiusOnDelim / (delimDist) * distance + radiusOnZero                                                                              (for: dist <   delimDist)

                                                 = (radiusOnMax - radiusOnZero) / (idealDistance - delimDist) * (distance - delimDist) + radiusOnMax (for: dist >= delimDist)

3. There might be a sizes value in gameparams for ship hulls that has values on ship dimensions - but don't quote me on this.

Additional Notes:

It could also be that vertical dispersion is drawn on the vertical plane instead of being relative to the shell which would make it:

  • Dispersion (on horizontal i.e. sea) ≈ Dispersion (from shell perspective) / tan(impact angle

Ideal distance might actually just be max distance instead.

Acquiring good dispersion data is very difficult, due to issues like:

  • Gun drift - aim point lowering it self slowly over time - maybe this is the aim bug ppl are talking about? - though something else has to happen to make it noticeable
  • Ships never truly stop after having moved - this becomes a problem if you want to stay still for 60min
  • Actually measuring points of fall - there is a replay parser worked on by @JustDodge and few other people that does it now, but there are still some limitations.
  • Not mention that it takes a long time to get enough shells on target to get a good enough sample - especially for ships with shells / min.

All of this means that it could take a while before any high quality dataset is created and definitive proof is acquired.

 

Hmmmm

Definitely more complex than I expected. I am currently an engineering student (but English is not the language I did my studies in, I am a foreigner), and the model is definitely not that easy to code (I'm no expert in Matlab). But as far as I read, the only doubt I have is what the variables "delimDist" and "delim" mean. All others are rather obvious.

The other thing is related (still) to Std Dispersion. I know that in the maxDispersion ellipsoid, the shells have some preference to align with the horizontal axis (I don't remember the number of shells that do this but it was rather high). Is this how the Std Deviation ellipsoid is represented in-game?

PD. Forgot to thank you for this incredible piece of work. I think this is the most complex part of the game to understand, and I somewhat understand why WG don't want to give extra information related to this.

Edited by hanesco

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×