feat(SCOPONE-0008): complete iteration 0 improve ai rules

This commit is contained in:
Giancarmine Salucci
2026-04-02 20:10:55 +02:00
parent e4edc4d660
commit 747da35190
6 changed files with 397 additions and 122 deletions

View File

@@ -118,6 +118,18 @@ Phaser `Text` objects render to an internal Canvas. When the game uses `Scale.FI
- `scoreDump()` (ai.ts:103): Uses `caps` for threat checking — unaffected.
- `GameScene.onCardClick()`: Already routes `captures.length > 1` to `highlightMultipleCaptures()` — works correctly with new behavior.
### SCOPONE-0008: Phaser AI Turn Progress Timing (2026-04-02)
**Source**: Phaser 3 API docs (Context7 — `/websites/phaser_io_api-documentation`)
- `Phaser.Time.TimerEvent#getProgress()` returns the current iteration progress as a normalized value between `0` and `1`.
- `Phaser.Time.TimerEvent#getOverallProgress()` returns normalized overall progress when repeats are involved.
- `TimerEvent` instances are managed by the scene clock, so they are suitable for rendering an AI decision countdown bar that reflects elapsed scene time.
**Planning impact**:
- A visible AI countdown can be driven from elapsed timer progress instead of a blind tween.
- If the AI search budget increases beyond the current short synchronous window, the search loop must yield back to the browser between batches or Phaser will not repaint the progress bar while the AI is thinking.
### Minimax Feasibility Analysis
- 10 cards per player × 4 players = 40 total moves per round
- Full game tree: ~10^12 nodes — infeasible for exhaustive search