Roll-up patch · v0.20.11 → v0.20.22 · 28 April 2026
By the book. Player and AI.
Commanders,
The last twelve patches have hammered out the parts of HexArmy where the rules-as-written and the rules-as-played didn't match. The AI now fights by the same combat doctrine as you. Force caps mean what they say. Faction modifiers actually apply on deploy. Stats and Dossiers persist end-to-end. The Field Manual was rewritten from scratch so every number in it reflects the current build. Three serious freeze and start-flow bugs are dead.
This is the build to play if you bounced off any version after 0.20.11.
⬢ COMBAT — THE AI PLAYS BY THE SAME RULES
Movement-gated attacks now apply to AI units (v0.20.17)
v0.20.9 introduced the rule for player units: spend all your MP on movement, you don't get to attack on that turn. The AI was supposed to follow the same rule but a couple of attack-after-move branches in aiActUnit bypassed the gate. Enemy units that walked across the map could still punch you at the end. They can't anymore. The check now lives at the top of the combat resolvers themselves — every code path, player and AI alike, is uniformly restricted.
The Assault Veteran exemption applies on both sides: Infantry with the Assault promotion can attack with 0 MP, one attack per turn. Player and AI Infantry alike.
Practical result: late-turn AI positioning tightens significantly. The AI now has to choose between closing distance and attacking — just like you.
Faction MOV modifiers actually apply on deploy (v0.20.22)
If you ever felt like Iran's helicopters were faster than they should be, or India's infantry slower — they were. New units were spawning with the BASE movement value displayed (movRemaining) instead of the faction-modified one (mov). The mismatch self-corrected on turn 2, but mattered immediately for Iran (whose units act on the spawn turn) and on turn 1 for any drafted faction with MOV modifiers.
Now correct from the moment of deploy:
Iran helicopters show 4/4 MP (was 5/4)
India infantry show 4/4 MP (was 3/4)
NK tanks/recon show 2/2 MP (was 3/2)
Canada engineers, Australia recon, and every other MOV-modified unit also corrected
⬢ FORCE CAP — A NEW ZEALAND DOCTRINE, NOT A UNIVERSAL RULE
v0.20.14 made the per-faction maxDraft cap a hard limit on alive units mid-match, which was correct for New Zealand's "Lean Volunteer Force" doctrine but over-applied — it silently capped UK at 7 alive units mid-match too. Players of every faction except NZ could lose a unit and never produce a replacement.
v0.20.16 narrowed the rule. The alive-unit cap now applies only when your faction is New Zealand. Every other faction can field replacements without limit. UK's maxDraft: 7 still constrains the initial draft (it's a starting-force constraint, not an in-match constraint). NZ stays capped at 6.
So:
NZ: 6 alive max, ever. Lose a unit → produce a replacement, but never field 7.
UK: 7 in the initial draft, unlimited mid-match production.
Everyone else: unlimited mid-match production.
Lean into your faction's economy without worrying about hitting an invisible ceiling.
⬢ STATS & DOSSIERS — PERSISTENCE THAT ACTUALLY PERSISTS
Two silent-failure modes were dropping match results before they reached the database. Both are closed.
Client side (v0.20.13). Steam autoLogin on game launch could land asynchronously after the match ended. finalizeGameStats saw playerAccount = null and bailed silently. v0.20.13 retries loadAccount() once before giving up, so a Steam-authenticated session that came in late still gets credited.
Server side (v0.20.15). The UPDATE player_stats SET ... WHERE user_id = $1 query is a no-op for any user without a pre-seeded player_stats row. The transaction committed cleanly, the endpoint returned 200 OK, the client logged success — and zero rows were actually changed. v0.20.15 prepends an INSERT ... ON CONFLICT (user_id) DO NOTHING upsert before the update so a row is guaranteed to exist. Server logs now print [stats/game] OK user_id=X result=victory faction=usa turns=15 on success and a clear WARN if anything ever fails to update.
From v0.20.15 forward, every match POSTs cleanly. (Matches that failed silently on builds prior to v0.20.15 cannot be retroactively recovered, but no future match will be lost.)
⬢ MAP-START AND APC — TWO FREEZES KILLED
10x10 maps start cleanly (v0.20.18)
Switching to a smaller map (10x10) after playing a larger one (default 20x20) would crash with Cannot set properties of undefined (setting ''). The visibility-tracking list still held tile coordinates from the previous larger grid; the next visibility pass tried to clear row 15 on a 10-row grid and threw. Now every map-size change purges all grids and tile-tracking lists, and the visibility loops are bounds-checked as a permanent guard.
10x10 maps now start cleanly from any prior state.
APC loading no longer freezes the AI turn (v0.20.21)
Loading a unit into an APC stored the embarked unit at (row=-1, col=-1). The AI's spatial-index builder then bucketed it via Math.floor(-1 / 5) = -1, producing a negative array index that crashed _buckets[-N].push(). The exception killed the AI's setTimeout chain and the game appeared frozen.
SpatialIndex.build() now skips off-map and embarked entities, the AI's enemy-unit list excludes embarked cargo, and aiActUnit is wrapped in try/catch so any future single-unit exception logs to console and the queue continues instead of silently halting the turn.
⬢ FIELD MANUAL — REWRITTEN TO MATCH THE GAME
The in-game Field Manual was audited section-by-section against the actual game data (UNIT_DEFS, FACTIONS, CITY_DEF_STATS, TERRAIN_DEF, UNIT_EFF). Roughly 80 stats and rules were out of date. v0.20.20 fixed all of them and added the missing pieces.
Highlights:
Unit costs — the previous manual was 2-3x off. Infantry 400g (not 150g), Tank 800g (not 300g), Bomber 1300g (not 500g), Nuclear 3500g (not 1500g). Every unit now reflects its real cost.
Draft budgets — USA 1020g (not 1200g), Canada/Australia/China 935g (not 1100g), India 1020g (not 1200g). Default 850g.
Garrison costs — City 525g, HQ 800g, FOB/FAB/Port 400g (was 200g/300g/150g).
NZ infantry — 260g, not 100g. The faction's strength was never cheap units; it's the capture-heal doctrine and turn-1 Deep Scan.
All 10 factions are now documented as player-pickable. The manual previously framed Russia/Iran/NK/China/India as AI-only opposing forces. They've been selectable from the faction overlay for many builds; the docs finally caught up.
Move-then-attack rule, Assault Infantry exemption, NZ-only force cap, multi-AI matches (1v1/1v2/1v3), per-slot AI difficulty, all 8 map types, engineer camp construction (FOB/FAB/Port) — every one of these now has a section.
A standalone PDF copy of the manual is also available — same content as the in-game guide, suitable for printing or reference.
⬢ STEAM BUILD HEALTH
The single-file client/index.html artifact crossed 1.6 MB during this cycle, which exposed a recurring tool-truncation failure mode in our build pipeline. Three releases (v0.20.18, 0.20.19, 0.20.20, 0.20.21, 0.20.22) had to ship with explicit recovery steps. The Decision Log lists the migration back to a modular Vite build as the next major engineering task; until then, every build runs node --check against the inline script before shipping.
If you saw v0.20.18's broken main screen — that was the truncation. v0.20.19 was the hotfix. From v0.20.19 forward the parse-check gate has been in place.
⬢ THE BOTTOM LINE
The rules now read the same on the page and on the board. The AI fights to the same standard as you do. Your faction's modifiers fire on the very first turn they're supposed to. Your matches reach the database. Force caps stop where doctrine says they stop. Two freeze paths are dead.
This is the build that earns its name.
Read the manual. Promote your Veterans. Win by the book.
v0.20.22 — Roger, Command.
