Early-level build discount (B4) and start stock 1000 (B5)

Playtest on the live world: first hour feels a bit slow. B4: levels 1-3 of any building take x0.5/x0.67/x0.83 of the time (FORMULAS.earlyLevels/earlyTimeFactor, off at earlyLevels 0). Builds at 1 h (4 sittings/day) 8.9 -> 11.4, at 24 h 16.5 -> 20.4; mid game moves ~1 day head start (default mix), more for 2 sittings/day. B5: start stock 750 -> 1000 (measured separately: mid game unchanged, 60-min first sitting 12.1 -> 15.4 builds at 1 h). Numbers in docs/BALANCE.md.

Tested: npm test 208/208, openapi check, npm run e2e 61/61 (before B5), 50x30-day bot run INVARIANTS OK after B5. NOT tested: humans (bots only, 2 seeds), B4+B5 combined beyond one run, e2e does not exercise the discount (runs at 4000x speed). Not claimed: balanced.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q2MJaQ5LXAHzGnTDgceT14
This commit is contained in:
jvanvik 2026-10-11 22:38:37 +02:00
parent cc0524de5e
commit bf7af0679c
10 changed files with 194 additions and 12 deletions

View file

@ -24,6 +24,7 @@ test('bot run: invariants hold and the same seed gives identical stats', async (
assert.ok(a.perf.commands > 50 && a.botLogs.builds > 20 && a.botLogs.trains > 0, 'the bots built and trained');
assert.ok(a.days.length === 6 && a.meta.players === 12);
assert.ok(a.combat.scans.n > 0, 'and scouted (the military paths ran, so determinism covers them)');
assert.ok(a.early && a.early['1h'].n > 0 && a.early['1h'].builds > 0 && a.early['24h'].builds >= a.early['1h'].builds && a.early['1h'].core >= 1, 'the first-hours view (builds and Core router at 1/6/24 h) is filled');
const c = await runBot({ players: 12, days: 6, seed: 8 });
assert.notDeepStrictEqual(strip(a).days, strip(c).days, 'a different seed should change the world');
assert.ok(Date.now() - t0 < 15000, 'the harness must stay fast (took ' + (Date.now() - t0) + ' ms)');