0% for April

  • 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.

    • Mitchell

  • @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:

    1. Precompute everything up front
      For each node (unique sub-army)
      get any needed probability with an array lookup
      get the next state index for any casualty type with an array lookup.
      I don’t use any hash/maps in the tight inner loop. Only for postprocessing the output, or preprocessing the input.
    2. Pruning. I use a pruning threshold 1e-12. If a state’s seed probability is smaller than this threshold – I prune to zero – and don’t update child states.
    3. Roundless evaluation. I don’t roll multiple rounds of battle. The 2-D probability matrix is solved only one time.

  • @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×
T-shirts, Hats, and More

Suggested Topics

  • 34
  • 3
  • 10
  • 3
  • 7
  • 362
  • 36
  • 39
Axis & Allies Boardgaming Custom Painted Miniatures

32

Online

18.1k

Users

40.9k

Topics

1.8m

Posts