From 7c5611af7ae571d5c5582b932c7e3fac854cdbae Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 23:51:54 -0500 Subject: [PATCH] [sim-balance] SIM_LOCATION_DRAW hook (T2 draw rider experiment); v1 tables in DUEL_BALANCE Co-Authored-By: Claude Opus 5.5 --- docs/game/DUEL_BALANCE.md | 32 +++++++++++++++++++++++++------- scripts/sim/duel-core-sim.ts | 5 ++++- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/docs/game/DUEL_BALANCE.md b/docs/game/DUEL_BALANCE.md index af640bb..b146f33 100644 --- a/docs/game/DUEL_BALANCE.md +++ b/docs/game/DUEL_BALANCE.md @@ -32,6 +32,30 @@ npx tsx scripts/sim/duel-run.ts --engine duel --rules '{"startingLife":18}' --la ## Results +### v1 runs: engine-wip 4623930 + duel-cards 067de83 (Doctrines working) +Run by ui-duel on inspiron-3670 with this harness (duel-adapter acd2c49/7102239), Node 24, 4 workers, `--mix fast`, 120 decks. Not yet the frozen head; see "Frozen head" below. + +| Run | Overrides | n | First player (sym) | Turns each p10/med/p90 | >20 turns each | Library-out | Loc-heavy | Doc-heavy | Fig-heavy | +|---|---|---|---|---|---|---|---|---|---| +| v1-base | `{}` | 3000 | **60.1%** [58–62] | 6 / 8 / 12 | 3.4% | 2.0% | 20.5% | 42.8% | 66.6% | +| v1-spc1 | `{"secondPlayerCitations":1}` | 1500 | **54.4%** [52–57] | 6 / 8 / 12 | 3.9% | 2.2% | 20.8% | 45.9% | 63.0% | +| v1-extra1 | second seat +1 opening card (sim-only hook) | 1500 | 60.7% [58–63] | 6 / 8 / 12 | 3.6% | 2.3% | 16.8% | 52.9% | 64.7% | +| v1-garr15 | derive `garrisonStep` 15 | 1500 | 58.5% [56–61] | 6 / 8 / 14 | 4.5% | — | 24.9% | — | — | + +v1-base other numbers: est. minutes 5.4 / 7.9 / 13.2; Connected 17.2% of pairs, 28.1% of plays (6.96 per game); fame vs card WR r = 0.20 (top vs bottom decile 62.1% vs 53.6%, both above the played-card baseline); card type WR Doctrine 55.8%, Event 51.1%, Location 48.1%. + +### Old-tree sweep (engine 5cd0ffb + duel-cards ae14bc7, Doctrines inert): relative effects only +| Run | Overrides | First player | Turns each p10/med/p90 | >20 turns | Loc-heavy | Doc-heavy | Fig-heavy | +|---|---|---|---|---|---|---|---| +| alpha-base (4000) | `{}` | 57.8% [56–59] | 6 / 8 / 21 | 10.3% | 23.2% | 29.5% | 73.1% | +| p1draws | `{"firstPlayerDraws":true}` | 59.5% [57–62] | 6 / 8 / 19 | 9.4% | 24 | 27 | 74 | +| life24 | `{"startingLife":24}` | 55.0% [52–58] | 6 / 9 / 24 | 12.2% | 21.8% | 29.7% | 72.3% | +| life16 | `{"startingLife":16}` | 57.3% [55–60] | 5 / 8 / 16 | 7.7% | 27.9% | 29.1% | 68.2% | +| terr3 | `{"territoryCap":3}` | 56.0% [53–59] | 6 / 8 / 18 | 9.3% | 23.9% | 30.2% | 71.1% | +| loc2 | `{"locationsPerTurn":2}` | 55.1% [52–58] | 6 / 8 / 20 | 9.8% | 24.4% | 29.1% | 71.1% | +| stub1 | `{"stubMax":1}` | 55.0% [52–58] | 6 / 8 / 17 | 7.7% | 20.3% | 30.8% | 68.2% | +| reshuffle | `{"libraryEmpty":"reshuffle"}` | stopped after 9 min: games stretch out | | | | | | + ### Baseline, engine alpha (duel-core `engine-wip` 5cd0ffb + duel-cards ae14bc7, merged locally). Not the frozen head. > **Superseded:** at duel-cards ae14bc7 Doctrines attached but gave no ±k (fixed in 067de83). Doctrine numbers below are therefore wrong, and everything else is slightly off. See the v1 runs. @@ -57,10 +81,4 @@ npx tsx scripts/sim/duel-run.ts --engine duel --rules '{"startingLife":18}' --la Caveats: the heuristic bot may under-use Doctrines and Events, and may be too cautious to attack into walls (the MC-mirror check was stopped, see below), so the Doctrine/Event numbers and the stall rate are upper bounds on the problem. -### Variant sweep (1500 matches each, same decks and seeds) -| Variant | Rules | First player | Turns each p10/50/90 | >20 turns | Library | Fig-heavy | Loc-heavy | Doc-heavy | Low-curve | Cost-6 WR | -|---|---|---|---|---|---|---|---|---|---|---| -| alpha-base (4000) | `{}` | 57.8% [56–59] | 6/8/21 | 10.3% | 7.2% | 73 | 23 | 29 | 35 | 61 | -| p1draws | `{"firstPlayerDraws":true}` | 59.5% [57–62] | 6/8/19 | 9.4% | 6.3% | 74 | 24 | 27 | 30 | 60 | - -The rest of the sweep (`startingLife` 16/24, `territoryCap` 3, `locationsPerTurn` 2, `stubMax` 1, `libraryEmpty: reshuffle`, `turnCap` 40, `citationsPerTurn` 2) was **stopped at 23:00 when r350 ran out of memory** and has not been re-run yet. +The sweep on r350 was stopped at 23:00 when r350 ran out of memory; ui-duel re-ran it on inspiron (tables above). diff --git a/scripts/sim/duel-core-sim.ts b/scripts/sim/duel-core-sim.ts index 8645184..ab65718 100644 --- a/scripts/sim/duel-core-sim.ts +++ b/scripts/sim/duel-core-sim.ts @@ -37,7 +37,10 @@ export async function makeDuelSim(sampleFile: string, overrides: Record DuelRuleset }; const rules = rs.mergeDuelRuleset(overrides); - const cards = await loadCards(sampleFile); + let cards = await loadCards(sampleFile); + // SIM_LOCATION_DRAW=n: experiment for duel-design's T2 rider ("When this enters, draw n cards") on every Location. + const locDraw = Number(process.env.SIM_LOCATION_DRAW ?? 0); + if (locDraw > 0) cards = cards.map(c => (c.type === 'Location' ? { ...c, effects: [...c.effects, { trigger: 'onEnter', op: 'draw', amount: locDraw, target: 'controller' } as DuelCard['effects'][number]] } : c)); const pool: DuelPoolCard[] = cards.map(c => ({ id: c.cardId, title: c.title, type: c.type, portal: c.portal, cost: c.cost, keywords: [...c.keywords], fame: (c as any).basis?.fame, card: c,