@Young:
They look fantastic, good work DCC… much appreciated.
I just re-uploaded it, correcting a few mistypes.
EDIT: My sincere apologies to the gentleman in Ohio who had to download it 3 times :/
I’ve also been working on a calculator based on math.
Here’s a link: https://mshih01.github.io/aacalc2/
It has most of the features of aa1942calc.com… multiwave support, rounds of battle, amphibious assault. (the missing feature is the monte carlo analysis to support extra large battles )
It also has advanced retreat options…
number of rounds.
number of attacking units <=
expected profit continuing < threshold
probability of winning < threshold
probability of losing air > threshold.
probability of killing defenders > threshold (strafe analysis).
The territory can also be marked as deadzone in the profit computation – in which case attacking captured land units count inf(-2), art(-3), arm(-4.5) towards the profit computation.
I think it’s even faster than your implementation. If you like, we can discuss implementation details.
@mshih I’ve taken a few extra passes to improve the speed of my implementation. When is the last time you’ve tested it?
At the time of my post. So last couple days. For example. Try 80 inf/art vs. 80 inf/art (160 vs. 160). My calculator runs in 0.2 seconds. I think yours currently crashes. But if you reduce to 120 vs. 120 (60 each), then yours takes 10+ seconds.
My calculator can handle 400 vs 400 (200 inf/art vs. 200 inf/art) in 10 seconds.
You can check out my repo on github: https://github.com/mshih01/aacalc2
The readme has a discussion on the algorithm… and it should be pretty fast – and memory efficient.
@djensen If you’re using typescript/javascript, my engine is available on npm.
npm install aacalc2
The webpage is basically something I vibe coded to showcase the engine.
@mshih Thanks. The engine won’t work for me because I support multiple games. I’m working on some changes.
@djensen Sure. Even if you don’t directly use the engine., maybe you can take advantage of some of the techniques?
I think the speed of my engine is due to:
@mshih Yeah, I’m trying to update the calculator to use some of your techniques.
I started with som benchmarks, yours blew mine out of the water. Your two subs got 2s and sunk my battleship.
Really nice work! You can probably guess which column is yours.
tiny-3v3 |
2.47 | 0.17 | 14.7× |
small-mixed |
7.27 | 0.34 | 21.6× |
medium-mixed |
74.9 | 1.20 | 62.3× |
aa-medium |
265.1 | 2.07 | 127.9× |
aa-heavy |
2484.7 | 6.29 | 394.9× |
large-mixed |
538.9 | 2.20 | 245.5× |
@djensen Aside from the pure speed. My calculator has some neat advanced features like:
Compute the probability of winning for all sub-battles in one pass. This allows a second pass to implement things like retreat if the probability of winning the battle is too low.
Compute the Expected profit for all sub-battles in one pass. This allows a second pass to implement retreat if the EV profit is too low (typically retreat if EV is negative).
Strafe analysis is_deadzone, combined with the territory value can be used to model a variety of strafe scenarios.
e.g. If strafing from a capital with a large army next door… a large negative value is warranted. (russia IPC’s * 2 + russia territory IPC value. + value of other allied units lost if the strafe turns into take. Using large values like -50 IPC’s is fair.
If strafing from W.Russia… and W Russia is safe even if the strafe fails and the territory is captured, a normal positive territory value is good enough.
#1 and #2 are simple recurrence relations that I can share