From bc8e4a56536263834ee1216b9511661be67f5560 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Fri, 10 Apr 2026 08:53:49 -0700 Subject: [PATCH] =?UTF-8?q?build(simulator):=20=F0=9F=93=A6=EF=B8=8F=20Reb?= =?UTF-8?q?uild=20simulator=20binaries=20and=20fingerprint=20files=20after?= =?UTF-8?q?=20dependency=20or=20source=20code=20updates=20across=20all=20m?= =?UTF-8?q?odules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../memory/feedback_balance_philosophy.md | 18 ++ .../balance/axis-viability.md | 67 +++++++ .../simulation-report/balance/tournament.md | 166 ++++++++++++++++++ .../simulation-report/pvp/combat-stats.md | 61 +++++++ .../simulation-report/pvp/conquest-map.md | 57 ++++++ .../simulation-report/pvp/victory-paths.md | 68 +++++++ .../resources/ai/personalities/balanced.json | 6 + public/resources/ai/personalities/boom.json | 6 + .../ai/personalities/expansionist.json | 6 + .../resources/ai/personalities/merchant.json | 6 + .../ai/personalities/militarist.json | 6 + public/resources/ai/personalities/rusher.json | 6 + .../ai/personalities/tech_rusher.json | 6 + public/resources/ai/personalities/turtle.json | 6 + 14 files changed, 485 insertions(+) create mode 100644 .claude/projects/-var-home-lilith-Code--projects--magic-civilization/memory/feedback_balance_philosophy.md create mode 100644 .project/simulation-report/balance/axis-viability.md create mode 100644 .project/simulation-report/balance/tournament.md create mode 100644 .project/simulation-report/pvp/combat-stats.md create mode 100644 .project/simulation-report/pvp/conquest-map.md create mode 100644 .project/simulation-report/pvp/victory-paths.md create mode 100644 public/resources/ai/personalities/balanced.json create mode 100644 public/resources/ai/personalities/boom.json create mode 100644 public/resources/ai/personalities/expansionist.json create mode 100644 public/resources/ai/personalities/merchant.json create mode 100644 public/resources/ai/personalities/militarist.json create mode 100644 public/resources/ai/personalities/rusher.json create mode 100644 public/resources/ai/personalities/tech_rusher.json create mode 100644 public/resources/ai/personalities/turtle.json diff --git a/.claude/projects/-var-home-lilith-Code--projects--magic-civilization/memory/feedback_balance_philosophy.md b/.claude/projects/-var-home-lilith-Code--projects--magic-civilization/memory/feedback_balance_philosophy.md new file mode 100644 index 00000000..0e4fb9c5 --- /dev/null +++ b/.claude/projects/-var-home-lilith-Code--projects--magic-civilization/memory/feedback_balance_philosophy.md @@ -0,0 +1,18 @@ +--- +name: Balance philosophy — luck and timing over strategy dominance +description: All AI strategies should be equally powerful; outcomes determined by map seed, spawn position, and timing, not inherent strategy advantage +type: feedback +--- + +Strategies should be equally powerful — the winner in any matchup should depend on luck (map seed, spawn position, encounter timing) not on which strategy inherently dominates. + +**Why:** The user explicitly stated "luck and timing are more important than the AI strategy because they are equally powerful (except where timing-based attack is the point, like rushing)." This is the StarCraft balance model — all races have ~50% win rates at high level. + +**How to apply:** +- In 1v1 tournament bench: run each matchup across MULTIPLE SEEDS (5+), not just seed=42 +- A healthy matchup: 3-2 or 2-3 across 5 seeds (winner varies by spawn/map) +- A broken matchup: 5-0 across all seeds (one strategy inherently dominates) +- Balance lever priority: map RNG > encounter timing > axis values +- Diminishing returns on axis investment (5→5 shouldn't be 2× better than 3→3) +- Rushing IS allowed to be timing-dependent — that's the design intent +- Victory threshold tuning should make all paths REACHABLE but none GUARANTEED diff --git a/.project/simulation-report/balance/axis-viability.md b/.project/simulation-report/balance/axis-viability.md new file mode 100644 index 00000000..6d393ede --- /dev/null +++ b/.project/simulation-report/balance/axis-viability.md @@ -0,0 +1,67 @@ +# Axis Viability Assessment + +## Dominion Bench — iter 8d (2026-04-10) + +### Axis ranking by final game state (4AI, T500) + +| Rank | Axis | Profile | Cities | Units | Gold | Culture | Victory? | Competitive? | +|------|------|---------|--------|-------|------|---------|----------|-------------| +| 1 | **Culture** | scientist (c=5) | 20 | 1,159 | 33,700 | 421,450 | YES (T179) | Dominant | +| 2 | Expansion | expansionist (e=5) | 26 | 611 | 45,560 | 228,000 | Yes (T254 in 2AI/3AI) | Strong | +| 3 | Wealth | merchant (w=5) | 17 | 202 | 68,020 | 136,240 | Structurally outpaced | Moderate | +| 4 | Production | militarist (p=5) | 17 | 64 | 27,244 | 136,240 | No | Weakest | + +### Comparison: iter 8c → iter 8d + +| Axis | Rank (8c) | Rank (8d) | Victory (8c) | Victory (8d) | Change | +|------|-----------|-----------|-------------|-------------|--------| +| Wealth | 1st (dominant) | 3rd | YES (T394) | Outpaced by culture | Dethroned | +| Expansion | 2nd | 2nd | No | YES (2AI/3AI) | Gained win-con | +| Culture | 3rd | **1st** | No (unwired) | YES (T179) | New dominant | +| Production | 4th | 4th | No | No | Still weakest | + +### Per-axis breakdown + +#### Culture (scientist) — DOMINANT + +- **Strength**: Fastest culture accumulator at ~560 culture/turn. Wins 4AI by turn 179, 215 turns before the economic threshold would fire. Largest army at T500 (1,159 units) despite heavy PvP losses. +- **Weakness**: Lower city count (20 vs 26 expansionist). Takes the most PvP deaths (1,765) but compensates with massive production (1,262 units produced). +- **Verdict**: Auto-wins 4AI and would win any scenario where it's present with enough cities. Culture victory threshold may be too low relative to accumulation rate. + +#### Expansion (expansionist) — STRONG + +- **Strength**: Most cities (26), most raw map presence. Wins 2AI and 3AI by culture (reaches 100K at T254). Zero PvP contact in 3AI/4AI due to corner placement. +- **Weakness**: Lower culture axis (2) means slower culture accumulation per city. Loses to the scientist in 4AI despite having 6 more cities. Gold curve (45K at T500) is competitive but outpaced by culture victory timing. +- **Verdict**: Wins when the scientist isn't present. Strongest by territory but second in culture rate. The expansion axis indirectly enables culture victory through city count. + +#### Wealth (merchant) — MODERATE, DETHRONED + +- **Strength**: Highest gold (68K at T500). Economic victory would fire at T394 if culture didn't exist. +- **Weakness**: Culture victory fires 140-215 turns before economic. The merchant's economic advantage is real but strategically irrelevant — another player always reaches culture 100K first. No way to interfere with opponents' culture accumulation. +- **Verdict**: Went from the only viable winner (iter 8c) to structurally outpaced. Needs either a lower gold threshold, a higher culture threshold, or the ability to spend gold to disrupt opponents. + +#### Production (militarist) — WEAKEST, BUT NOW LETHAL + +- **Strength**: Most lethal combatant — 1,834 PvP kills at a 1.7:1 kill ratio. The production axis now has real military impact. Units actively seek and kill enemies. +- **Weakness**: PvP kills don't translate to strategic advantage. Zero cities captured. Unit count collapses to 64 by T500 (from peak 76). Culture rate is identical to merchant (272/turn), reaching 100K at ~T367 — too slow to win. +- **Verdict**: The fixes made the militarist dangerous in combat but the axis still has no path to victory. Needs city siege capability and domination victory to be functional. + +### Blockers to balanced axis viability (updated) + +| Issue | Blocks | Status | Fix priority | +|-------|--------|--------|-------------| +| ~~PvP damage non-persistent~~ | ~~Domination, militarist~~ | **FIXED in iter 8d** | — | +| ~~Culture accumulation unwired~~ | ~~Culture victory~~ | **FIXED in iter 8d** | — | +| ~~AI doesn't target enemies~~ | ~~PvP interaction~~ | **FIXED in iter 8d** | — | +| **Culture threshold too low** | Economic viability | NEW | P1 — culture fires 140-215 turns before economic | +| **No city siege AI** | Domination victory, militarist viability | Open | P0 — AI fights units but doesn't target cities | +| **Tech tree progression too slow** | Science victory | Open | P1 — tech progresses but no one reaches arcane_ascension | +| **City count threshold too high** | CityCount victory | Open | P2 — lower to 25 or scale by map size | +| **No gold raiding / pillaging** | Economic counterplay | Open | P2 — units can't reduce enemy gold | + +### Recommended next steps + +1. **Add city siege AI targeting** — when an enemy city is within range, target it for siege. This unlocks domination victory and gives the militarist a win condition. +2. **Rebalance victory thresholds** — culture at 100K fires too early relative to economic at 50K. Either raise culture to 200-300K or lower economic to 20-30K so both are competitive. +3. **Wire science victory fully** — ensure at least one player can research arcane_ascension within 500 turns to validate the science path. +4. **Lower city count threshold** — 30 exceeds the cap for all profiles. Lower to 25 (reachable by expansionist at 26 cities). diff --git a/.project/simulation-report/balance/tournament.md b/.project/simulation-report/balance/tournament.md new file mode 100644 index 00000000..d544b7aa --- /dev/null +++ b/.project/simulation-report/balance/tournament.md @@ -0,0 +1,166 @@ +# 1v1 Tournament Results (iter-8j: spawn variance) + +**Date**: 2026-04-08 +**Map**: 64x64, 1K ecology ticks, 3 seeds (42, 123, 456) +**Max turns**: 1000 +**Profiles**: 8 (loaded from `public/resources/ai/personalities/*.json`) +**Total games**: 24 (8 key matchups x 3 seeds) +**World gen time**: ~32-33s per seed (T5 ecology, 589 named species) +**Match time**: ~5.1s total (avg 213ms/game) + +## Changes Since iter-8i + +1. **Reverted axis^0.7 diminishing returns** — raw victory axis values restored (no scaling) +2. **Added spawn jitter (0-5 hexes)** — seed-based offset per player from corner bases via SplitMix64 hash, creating natural asymmetry per seed + +## Rankings (across all 3 seeds) + +| Rank | Profile | W-L | Win% | Primary Victory | Notes | +|------|---------|-----|------|-----------------|-------| +| 1 | Militarist (exp2/prod5/wealth2/culture2) | 8-1 | 89% | city_count/domination | Lost to Expansionist on seed 456 | +| 2 | Turtle (exp2/prod4/wealth4/culture1) | 5-1 | 83% | economic/city_count | Lost to Expansionist on seed 456 | +| 3 | Tech Rusher (exp1/prod3/wealth2/culture5) | 3-3 | 50% | culture | Beats Merchant 3-0, loses to Militarist 0-3 | +| 4 | Expansionist (exp5/prod3/wealth2/culture2) | 3-6 | 33% | domination | 3 wins on seed 456 — spawn variance unlocked viability | +| 5 | Boom (exp5/prod2/wealth5/culture1) | 2-1 | 67% | city_count | Lost to Balanced on seed 123 | +| 6 | Rusher (exp1/prod5/wealth2/culture1) | 2-4 | 33% | city_count | Beats Expansionist on 42/123, loses on 456 | +| 7 | Balanced (exp3/prod3/wealth3/culture3) | 1-2 | 33% | domination | Won 1 on seed 123 — first Balanced win since 8h | +| 8 | Merchant (exp2/prod3/wealth5/culture2) | 0-6 | 0% | none | Lost to both Militarist and Tech Rusher | + +## Head-to-Head Results (3 seeds each) + +| Matchup | Winner | Record | Variance | Victory Types | Avg Turn | +|---------|--------|--------|----------|---------------|----------| +| Rusher vs Expansionist | Rusher 2-1 | **SPLIT** | seed 456 flips | city_count / domination | T126 | +| Rusher vs Turtle | Turtle 3-0 | consistent | — | economic | T321 | +| Militarist vs Expansionist | Militarist 2-1 | **SPLIT** | seed 456 flips | city_count / domination | T114 | +| Militarist vs Merchant | Militarist 3-0 | consistent | — | city_count | T223 | +| Militarist vs Tech Rusher | Militarist 3-0 | consistent | — | domination | T179 | +| Expansionist vs Turtle | Turtle 2-1 | **SPLIT** | seed 456 flips | city_count / domination | T115 | +| Balanced vs Boom | Boom 2-1 | **SPLIT** | seed 123 flips | city_count / domination | T128 | +| Merchant vs Tech Rusher | Tech Rusher 3-0 | consistent | — | culture | T276 | + +## Comparison: iter-8h → iter-8i → iter-8j + +| Metric | iter-8h (terrain) | iter-8i (axis^0.7) | iter-8j (spawn jitter) | Change 8i→8j | +|--------|-------------------|---------------------|------------------------|--------------| +| Split matchups | 3/8 (37.5%) | 0/8 (0%) | **4/8 (50%)** | **+4 splits** | +| PvP kills/game | 462.3 | 368.8 | 218.2 | -41% | +| City captures/game | 32.7 | 26.5 | 17.5 | -34% | +| Victory types active | 4 | 4 | 4 | Same | +| Domination victories | 2 (8%) | 3 (12.5%) | **7 (29%)** | +4 | +| Expansionist wins | 0 | 0 | **3** | **FIXED** | +| Balanced wins | 1 | 0 | **1** | Restored | +| Merchant wins | 2 | 0 | 0 | Still 0 | + +## What Spawn Variance Changed + +### Positive +- **Split rate 50%** — best ever, up from 37.5% (8h) and 0% (8i). Four matchups are now seed-dependent. +- **Expansionist finally viable** — 3 wins on seed 456 (was 0-9 for two iterations). Seed 456 gives Expansionist a favorable spawn that enables early domination at turn ~87-98. This is the spawn jitter working as intended. +- **Balanced restored** — 1 domination win on seed 123 vs Boom (was 0-3 in 8i). +- **Domination 29%** — up from 8-12%. Proximity-dependent aggression creates more decisive military outcomes. +- **Militarist no longer undefeated** — 8-1 (was 9-0 in 8i). Expansionist beat it on seed 456. +- **Four victory types remain active** — city_count (46%), domination (29%), economic (12.5%), culture (12.5%). +- **Raw axis values restored** — reverting axis^0.7 removed the artificial compression that killed economic/culture win paths. + +### Seed 456: The Proximity Seed +Seed 456 produced dramatically different outcomes in 3 matchups: +- Expansionist beat Rusher (domination T98) — reversed from Rusher 3-0 +- Expansionist beat Militarist (domination T97) — reversed from Militarist 3-0 +- Expansionist beat Turtle (domination T87) — reversed from Turtle 3-0 + +All 3 wins were fast domination (