Login

russian armor

The CoH2 Pen Calculator

MMX
24 Nov 2021, 12:20 PM
#1
avatar of MMX

Posts: 901 | Subs: 1

Hey everyone...

MMX here once again to present you another handy spreadsheet for your daily dose of CoH2 unit comparisons - this time on the menu: tank vs tank combat!

So without any further ado, here is what this thing can do:

  • Calculate the chance to hit (including scatter) and penetrate a chosen target at a given distance, allowing an estimate of the number of shots (S2K) and time (T2K) required to kill the target.
  • Calculate the probability that the target is killed after n shots fired or n seconds elapsed and display the results in fancy graphs for better visualization.
  • Simulate a fight between two tanks at a given distance and and selected modifiers to calculate the average chance to win and the most probable HP margin.


Where to get the Pen Calculator ?

First release version can be found here!


How to use the Pen Calculator?

Opening the spreadsheet, you should be greeted with the general interface of the calculator tab as in the picture below:



To calculate and visualize the hit and pen chance, as well as the average S2K, T2K and probability distributions, simply select the distance (col B), the attacker (col D:H) and target unit (col J:N) as desired and choose additional target modifiers, such as moving or FoW penalties (col O) as well as the facing (front or rear; col P) if necessary.
While the results are calculated and updated instantly, there is also the option to switch to a numerical simulation in situations where the standard calculation algorithm is inaccurate. This is the case for units with deflection damage (for example; the KV-2 as in the image below), for which I haven't figured out a way to calculate the results via standard binomials and, thus, deflected hits aren't properly modeled.



To generate the necessary data just switch the data source (col R) from "Calculator" to "Simulator", press the "Simulate" button and twiddle your thumbs for 1 or 2 minutes (or less, if you lower the # of iterations in the "Simulator" tab) until the sim finishes.

In order to customize the probability plots there are additional drop-down menus on the very left that allow switching between time elapsed and shots fired on the x-axis and continuous or stepwise display of the probability curves.

Last but not least, the "Head-to-head" tab, an hommage to (or rather a shameless rip-off of) Hannibal's DeCoHde 2.0 , contains a small simulator that can be used to calculate the win probability of a specific match up between two tanks by running a short numerical sim.



As in the calculator tab, simply choose the two contestants and desired conditions before pressing "Fight!!", and the sim should spit out the results in less than 2 minutes.


What can the Pen Calculator not (yet) do?

While most parameters in tank vs. tank engagements are relatively easy to compute, scatter has proven to be a bit tricky to incorporate into a rigid model, not least because the actual sizes and shapes of the tank's hit boxes aren't known very well. The fact these had to be estimated along with a couple of other simplifications means that the displayed scatter hit probabilities (and the results derived with them) should always be taken with a grain of salt. Nonetheless, in-game testing seems to confirm that the results are convincingly close and should serve as a good benchmark when comparing the combat effectiveness of certain tanks with each other.

As this is kind of a work in progress, further improvements along the way as well as a couple of other features currently still on my 'wishlist' (such as engagements at different angles other than 0 and 180°) are definitely planned if time permits.


Anyway, before signing off another big shout out to Hannibal for bringing many of the outdated info in the data page up to date.
And as always, any feedback or error report is very much appreciated!

--MMX--


EDIT 11/25/2021: Just noticed that some last-minute formatting totally screwed up the VBA cell references in the "Head-to-Head" tab, causing the simulator not to work at all -.-
Fixed version now live here or via the updated link in the OP.
24 Nov 2021, 14:06 PM
#2
avatar of Hannibal
Senior Moderator Badge

Posts: 2544 | Subs: 2

This is very cool stuff! Will be more helpful since people will rather user a table calculation program rather than Python where I cobble my stuff together. I'll have to have a look soon when I find the time!


Since I assume you referred to this calculator in the "Ostheer accuracy" thread, I have a question:
How did you get the 24% scatter hit chance in the PaK vs T70 match up? Don't you need some value for the vehicle size in that one, or at least the width of the T70? Since we don't have that, what did you take as a substitute for estimation?


EDIT:
The only thing I noticed at the moment is that some ROF times are a bit off? Units like the Panther for example fire a bit faster than they are in game.
24 Nov 2021, 14:23 PM
#3
avatar of Vipper

Posts: 12448 | Subs: 1

24 Nov 2021, 15:24 PM
#4
avatar of Klement Pikhtura

Posts: 659

Damn, imagine all this in JS available online sort of like sym.gg was for Battlefield games.
MMX
25 Nov 2021, 04:45 AM
#5
avatar of MMX

Posts: 901 | Subs: 1

This is very cool stuff! Will be more helpful since people will rather user a table calculation program rather than Python where I cobble my stuff together. I'll have to have a look soon when I find the time!


Since I assume you referred to this calculator in the "Ostheer accuracy" thread, I have a question:
How did you get the 24% scatter hit chance in the PaK vs T70 match up? Don't you need some value for the vehicle size in that one, or at least the width of the T70? Since we don't have that, what did you take as a substitute for estimation?


EDIT:
The only thing I noticed at the moment is that some ROF times are a bit off? Units like the Panther for example fire a bit faster than they are in game.



Thanks a lot!

You're right about the vehicle size being a bit of a" guesstimate" atm, since there's no way to extract these from the game files (at least that I'm aware of). Most of the values are therefore just rough measurements of the size of the model obtained using the grid in cheatmod. I did some validation for a couple of tanks which seem to coincide quite nicely with the visual dimensions of the respective units, but that of course isn't guaranteed to be the case for all tanks.

I'd probably try to 'measure' some more in the future, but my current approach is rather time-consuming. For those interested, this is what I used for calibration:



As to the ROF being a bit off for some units, I used an old formula to calculate the average time between shots that might be somewhat inaccurate, especially in light of what you dug up recently in your ROF thread. I don't think the deviation is too great (maybe a frame more or less here and there), but I'll probably try to update this in a future release...

Or are you specifically talking about the delays in the 'Head-to-head' tab? These are randomized between the theoretical min and max values on purpose to give the sim a more realistic 'feel'.
MMX
25 Nov 2021, 04:57 AM
#6
avatar of MMX

Posts: 901 | Subs: 1

Damn, imagine all this in JS available online sort of like sym.gg was for Battlefield games.


Yeah, I'd love to have this available as an online version as well, since I know not everyone, especially the younger folks, has excel to play around with spreadsheets all day. Unfortunately, I suck at programming and google sheets is quite limited in what it can do... but hopefully some day someone else will stand up to the challenge and code a html version of this. After all we still have unsung heroes like pageP in this community just waiting to step into the limelight.
MMX
25 Nov 2021, 15:42 PM
#7
avatar of MMX

Posts: 901 | Subs: 1

Just noticed that some last-minute formatting totally screwed up the VBA cell references in the "Head-to-Head" tab, causing the simulator not to work at all -.-
Fixed version now live here or via the updated link in the OP.
25 Nov 2021, 17:44 PM
#8
avatar of Hannibal
Senior Moderator Badge

Posts: 2544 | Subs: 2

jump backJump back to quoted post25 Nov 2021, 04:45 AMMMX


Took me quite a few reads to actually get what you're doing to test the length of the vehicle. I had to laugh a bit to be honest, it looks like the poor man's equivalent to analyse the velocity by analyzing frames in a video. At the same time it is super creative.

Anyway, the way I thought about this initially was closer to your second suggestion. Basically count how many shots have missed and how many hit with a modified unit (0 accuracy, 0 horizontal scatter, no impact etc). Based on the scatter angle and the ratio of hit shots, you should be able to estimate the length. Are you really sure you need so many repetitions? By gut feeling I would have assumed that probably 100 would already be at least okay, although I have not tried to estimate this with a calculation.

However, I had a second idea:
We could take a bunch of standardized vehicles (0 accuracy etc as above...) that just differ in their scatter angle. Each will then shoot at a target at fixed distance. If the scatter angle is too small, all shots will hit. If it is too large, there will be misses. At range 40, each 1° increment in the scatter stat would correspond to 0,35m in vehicle width. So depending on how the angle increments are set up, it would probably be possible to nail the width down by 0,2-0,3 meters.

On the other hand, I think your second method is probably more straight forward. I'd just take less shots, should be good enough. Especially if you can cross check with similarly sized units. If the test gives you similar results for the P4 and T34, I wouldn't worry too much about it.

jump backJump back to quoted post25 Nov 2021, 04:45 AMMMX
As to the ROF being a bit off for some units, I used an old formula to calculate the average time between shots that might be somewhat inaccurate, especially in light of what you dug up recently in your ROF thread. I don't think the deviation is too great (maybe a frame more or less here and there), but I'll probably try to update this in a future release...

Or are you specifically talking about the delays in the 'Head-to-head' tab? These are randomized between the theoretical min and max values on purpose to give the sim a more realistic 'feel'.

Yes, I was mostly asking about the head-to-head tab. If you'd have taken the average reload time, it could make the difference between consistently shooting 0,1 seconds earlier than the opponent which would lead to a clear victory. The randomization doesn't solve this, but at least will give some more realistic picture of the real variance.
25 Nov 2021, 18:11 PM
#9
avatar of Vipper

Posts: 12448 | Subs: 1

I am under the impression that one can see the actual hitbox by using the map editor...
MMX
26 Nov 2021, 05:32 AM
#10
avatar of MMX

Posts: 901 | Subs: 1


Took me quite a few reads to actually get what you're doing to test the length of the vehicle. I had to laugh a bit to be honest, it looks like the poor man's equivalent to analyse the velocity by analyzing frames in a video. At the same time it is super creative.

Anyway, the way I thought about this initially was closer to your second suggestion. Basically count how many shots have missed and how many hit with a modified unit (0 accuracy, 0 horizontal scatter, no impact etc). Based on the scatter angle and the ratio of hit shots, you should be able to estimate the length. Are you really sure you need so many repetitions? By gut feeling I would have assumed that probably 100 would already be at least okay, although I have not tried to estimate this with a calculation.

However, I had a second idea:
We could take a bunch of standardized vehicles (0 accuracy etc as above...) that just differ in their scatter angle. Each will then shoot at a target at fixed distance. If the scatter angle is too small, all shots will hit. If it is too large, there will be misses. At range 40, each 1° increment in the scatter stat would correspond to 0,35m in vehicle width. So depending on how the angle increments are set up, it would probably be possible to nail the width down by 0,2-0,3 meters.

On the other hand, I think your second method is probably more straight forward. I'd just take less shots, should be good enough. Especially if you can cross check with similarly sized units. If the test gives you similar results for the P4 and T34, I wouldn't worry too much about it.


Yeah, now that you say it the length measurement method surely is kind of the poor man's solution to frame-counting... albeit it did at least prove that the size of the in-game model seems to be roughly equivalent to that of the hitbox.

I've been thinking about your suggestion to reduce the number of rounds used for probing the dimensions of the hitbox, and you're definitely right that 5000 is way over the top. In theory, 100 sampling shots should give a standard deviation of +/- 5% in the worst case (50/50 chance of hitting) - not too bad for a rough estimate for sure. Upping the number to 500 would cut the standard deviation about in half and shouldn't be too taxing time-wise either, so maybe that's a good compromise between accuracy and effort. I'll try to set up some measurements later today and see how reproducible the results are and how well they line up with the visual estimates.

However, if Vipper is right and the hitboxes can be measured via the map editor, this would of course be even better!


Yes, I was mostly asking about the head-to-head tab. If you'd have taken the average reload time, it could make the difference between consistently shooting 0,1 seconds earlier than the opponent which would lead to a clear victory. The randomization doesn't solve this, but at least will give some more realistic picture of the real variance.


Fair point. Will definitely have a look into that one.
26 Nov 2021, 17:12 PM
#11
avatar of Hannibal
Senior Moderator Badge

Posts: 2544 | Subs: 2

jump backJump back to quoted post26 Nov 2021, 05:32 AMMMX


Yeah, now that you say it the length measurement method surely is kind of the poor man's solution to frame-counting... albeit it did at least prove that the size of the in-game model seems to be roughly equivalent to that of the hitbox.

I've been thinking about your suggestion to reduce the number of rounds used for probing the dimensions of the hitbox, and you're definitely right that 5000 is way over the top. In theory, 100 sampling shots should give a standard deviation of +/- 5% in the worst case (50/50 chance of hitting) - not too bad for a rough estimate for sure. Upping the number to 500 would cut the standard deviation about in half and shouldn't be too taxing time-wise either, so maybe that's a good compromise between accuracy and effort. I'll try to set up some measurements later today and see how reproducible the results are and how well they line up with the visual estimates.

However, if Vipper is right and the hitboxes can be measured via the map editor, this would of course be even better!

Map editor would be great, although these would probably also only be estimates. What good is it seeing the hit box when you can't really reference it that well? Although maybe a speed mod or something would help in that regard.

Anyway, I played around with the numbers. Running 500 shots should give you a 95% chance of having less than 15% error for smaller tanks (assuming those are only ~2m wide which would be in line with your 24% hit chance of a PaK40 on a T70 that you estimated), ~7% for mediums (assuming ~5m width) and about 4% for larger vehicles (assumed ~7 meters).
1000 shots improve these numbers to 11%, 5%, 3% for small/medium/large vehicles.
5000 shots improve to 5%, 2%, 1%.

But again, this means that in 95% of the measurements, you will have LESS error than this and be closer to the actual value.
26 Nov 2021, 22:07 PM
#12
avatar of DAZ187

Posts: 462

great work
MMX
27 Nov 2021, 07:33 AM
#13
avatar of MMX

Posts: 901 | Subs: 1


[...]


So I've been toying around with measuring the hitboxes a bit more and it seems the results are pretty close to the visual estimation. Using a scatter angle of 2.5 at a distance of 200 m and 500 shots per run this is what I got for the T-70, T-34 and Sherman:


The width is in pretty good agreement with what I measured before (2.5 m for the T-70, 3.75 m for the T-34 and 3 m for the M4C) and the standard deviation between the runs is rather small (< 3%). The length, however, seems a bit off for the T-70 and T-34, which I estimated at 5 and 6.5 m previously. Still not too bad.

All in all I'd say the visual measurements should be reasonably close to the ingame hitboxes for most tanks, but getting some more precise data would surely come in handy. Also, there are some tanks, such as the SU-76, that seem to rotate noticably off-center to what the visual model would suggest. I'll probably have to check if that also has some effect on the size and orientation of the hitbox.


1 user is browsing this thread: 1 guest
ML Scorched Earth 2

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

Board Info

67 users are online: 2 members and 65 guests
Siberian, thekessvn
111 posts in the last 24h
452 posts in the last week
1541 posts in the last month
Registered members: 27173
Welcome our newest member, brockmoses
Most online: 1221 users on 25 Feb 2020, 12:03 PM