fix(@projects/@magic-civilization): 🐛 fix auto-play victory timing lag

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-04-25 04:34:39 -07:00
parent 319fbc80e8
commit 480d04d4d2

View file

@ -102,6 +102,10 @@ a foregone conclusion; the grid is the precondition.
**Root cause 5 (fix landed 2026-04-25):** Per-slot pinning works for `meta.player_clans` (verified `huge-map-5clan-20260425_021822` → all 5 clans assigned correctly: ironhold/blackhammer/goldvein/deepforge/runesmith). Confirms `personality_assigner.gd` per-slot env-var fix.
**Root cause 6 (fix landed 2026-04-25, the actual `outcome:max_turns wi:-1` cause):** auto_play.gd's "done" state ran `_outcome = "victory" if _victory else "max_turns"` immediately when `_turn_count >= _max_turns`, but `vm.check_all` in `TurnManager.next_player()` had not yet fired the score-victory branch — `GameState.turn_number` lags `_turn_count` by 1-2 (depends on whether the round wrapped before the auto_play polling caught the limit). Fix: in auto_play.gd's "done" state, before quitting, bump `GameState.turn_number = max(turn_number, _max_turns)` and explicitly invoke `TurnManager._victory_manager.check_all(GameState.get_game_map())`. Verified `p0-22-vfb3-20260425_042503` (1-seed T50 5-player MCTS): debug print `turn_number 48→50, limit 50` confirms the lag bug existed; outcome wrote correctly as `victory wi=2 wp=goldvein` via score path.
Full huge-map-5clan re-run started 2026-04-25 with all 6 root-cause fixes in place. Awaiting verdict.
**Root cause 1 (fixed, confirmed):** Batch `000049` used a stale `.so` lacking `GdAiController` registration —
872 "not loaded" errors/game, tactical pass skipped, no capitals founded. Current `.so` (runs ≥035301) has 0 errors.