Upstream/docs/BALANCE.md
jvanvik cc0524de5e Smoke e2e, docs consistency pass, status summary
Built: e2e/run.js + lib.js (playwright-core, in-process server, temp DB): desktop flow, phone touch portrait/landscape, layout matrix on 5 viewports x pop/map/trade/world (overflow + console errors), WebSocket push incoming-banner without reload. 61/61 checks, ~54 s, identical over 4 runs; the push and overflow checks were shown to fail when the behaviour is removed.
Docs: fixed stale numbers/claims in DESIGN, DECISIONS, BALANCE, API (undocumented routes, rate limits, notification types), DEPLOY, NEXT (status-at-a-glance on top). Deploy path exercised in a scratch dir: migrations, healthz, signup/build, admin CLI, SIGKILL catch-up, backup restore.

Tested: npm test 207/207, npm run e2e 61/61, bot run 50x14d INVARIANTS OK.
NOT tested: Chromium only; no systemd/nginx Proxy Manager/Node 22.13 run; e2e does not cover units, alliances, messages, trade or end-game flows beyond empty-state rendering; no nb, PWA or polling-fallback e2e; docs/workflows/ still empty.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q2MJaQ5LXAHzGnTDgceT14
2026-10-11 20:34:35 +02:00

419 lines
34 KiB
Markdown

# BALANCE
First evidence-based balance pass, driven by `tools/bot.js`. **Nothing here says the game is balanced.** It says what 50 scripted
players did to the real server code, what looked wrong, what was changed in `public/js/data.js` because of it, and what is still
unknown. The bots are not humans (sections 1 and 8).
**How to read the run labels.** A label like `m2-before-d30-s1` names an option set: default mix, "before" = `--set FORMULAS.secondQueueCoreLevel=10`
(and, for the end game, `--set TRANSPORT.capacityPerLink=500`), 30 days, seed 1. The reproducible thing is always the command; the JSON
outputs (1 to 2 MB each) are not committed. Every run cited here finished with `INVARIANTS OK`.
## 1. The harness
```bash
node tools/bot.js --players 50 --days 14 --speed 1 --seed 1 # the run CLAUDE.md asks for
node tools/bot.js --players 50 --days 60 --seed 1 --sessions-per-day 2 # a casual player's pace
node tools/bot.js --players 50 --days 60 --seed 1 --set FORMULAS.secondQueueCoreLevel=10 # "before" of change B1
node tools/bot.js --help # every option
```
- **Driver: the commands layer, not HTTP.** `createServer({ dbPath: ':memory:', clock: FakeClock, autoArm: false })` runs in-process
and the bots call `srv.commands.run(name, args)`, the function every REST route calls: same validation, same one-transaction
commands, same events and notifications. HTTP, JSON and scrypt are skipped, which is what makes 50 players x 14 days take about
3 s and 50 players x 170 days about 140 s on one core (about 3 000 to 5 000 commands per second, p95 command latency 0.1 to 0.5 ms).
A route-level bug (schema, auth, rate limit) is therefore not covered by the harness; `npm test` covers those.
- **Time:** a `FakeClock` is advanced from stop to stop (next bot sitting, next 2 h economy sample, next midnight), and
`scheduler.runDue()` settles every event that fell due in between, each at its own `due_at`, in order.
- **Bots** (`tools/bot/bots.js`): builder, raider, conqueror (raider that also takes POPs over), turtle, expander, trader,
alliancer (founds and recruits for an alliance). Default mix of 50: 11 builder, 7 raider, 3 conqueror, 6 turtle, 8 expander,
6 trader, 9 alliancer. They read the world through the server's own modules (own POPs, the map's towns, their reports) and use the
`rules.js` previews (`buildPlan`, `trainPlan`, `footprintGate`, `resolveBattle` ...) before sending a command. Intel about another
POP comes only from a real scan (and the scan can fail). They never write to the database.
- **Human cadence** (this matters more than anything else in the numbers): a bot plays 3 to 5 short sittings a day at seeded times
between 07:00 and 23:00 (a builder 4, a raider 5, a turtle 3 ...; `--sessions-per-day N` forces N for everyone). A sitting lasts
5 minutes (`--session-min`, the first one 20): when the build in progress finishes inside the sitting the bot is still there and
starts the next, so cheap early builds chain and expensive ones do not. `--always-on` (a sitting every 10 minutes) is the upper
bound of what attention can do.
- **Player skill:** fields are chosen to keep the production mix at what the bot spends (`--field-policy marginal`, default) or all
fields level together (`balanced`, a lower bound). A bot that has been raided trains defence up to 1.25 x the strongest attack
it saw, for 5 days (`--no-adapt` turns that off, an upper bound on how badly defenders can do). A bot that sees every store full
upgrades the Rack hall first. Several of these were bot bugs before they were fixed, and each moved the results: see section 7.
- **`--set PATH=VALUE`** changes `data.js` in place for one run and restores it afterwards. It reaches every value the code reads at call time
(all the ones used here); a primitive copied when a module is loaded, e.g. `ENDGAME.scanStrength` in `server/military/landing.js`, is
not overridable and the run would silently ignore it.
- **Determinism:** every decision comes from a generator seeded with (seed, bot, purpose). The same options give the same stats;
`test/bot-run.test.js` runs 12 players for 6 days twice and compares everything except wall-clock `perf`.
- **Debug hooks:** `BOT_DEBUG=1` prints the first command errors of each kind, `BOT_DEBUG_DRIFT=1` prints the conservation drift
at every economy sample (that is how server finding S1 was found).
### Invariants (the run exits 1 when one breaks)
| invariant | how it is checked |
|---|---|
| resources are conserved | `pools = sources + production - sinks`, per resource, at every midnight and at the end. Pools: POP stock, open trade escrow, cargo of movements that are out, landing-site stockpiles. **Production is exact**: a tap on `db.run` books the difference every `state.settle` writes (and drops it if the transaction rolls back). Sources: start stock of operators and founded POPs, the incumbent Hardware bonus. Sinks: build/train/research costs (command results), Backbone node levels, `cargoLost` in notifications (overflow at delivery), trade refunds clipped by the Rack hall cap (tap on the refund statement). Tolerance 0.5 per rounding event. |
| units are conserved | alive (home + stationed + on the road) = trained (`trainDone` events that ran) - lost (battle, scan, incumbent, landing reports, decommission notifications) - consumed (3 crews per founded POP, 1 M&A team per loyalty hit). Exact. |
| no negative stock | SQL scan of towns and landing sites. |
| no failed events | `events.status = 'failed'` and any server log line mentioning a failure. |
| no unexpected error codes | every refused command is counted by code; `validation_failed`, `internal_error` or a non-GameError throw fails the run. |
`test/bot-run.test.js` also proves the checks bite: it conjures Fiber, deletes units, makes a stock negative and inserts an event
without a handler, and asserts the run reports BROKEN each time.
## 2. The state before this pass (what the bots saw)
"Before" in every table below means the data as it was: `--set FORMULAS.secondQueueCoreLevel=10` on top of today's `data.js`
(that is the only economy number this pass changed, plus `TRANSPORT.capacityPerLink` for the end game, see section 3).
Default mix, 50 players, per-archetype cadence (3 to 5 sittings a day), speed 1, three seeds, 30 days (`m2-before-d30-s1..3`):
- Field level (mean over the capital's 18 fields) 10.3 on day 30; Core router 10 reached on day 27 (median); first expansion
(a second POP actually founded) on day 27.5; median footprint 7 200.
- **The footprint gate is not what holds expansion back.** 84 to 100 % of operators are over the 500 footprint of the first
extra POP from day 8 on (`over gate` column); the Rollout depot needs Core router 10, and three Rollout crews cost
1 200 / 900 / 900. A bot that beelines for it (the "expander") has Core router 10 on day ~13 and its first new POP on day ~16.
- **Build time is irrelevant, the number of builds you can start is not.** A level costs one to three hours of one resource's production
and takes 2 to 15 minutes to build. A player gets one build slot (two from Core router 10) and a 5-minute sitting, so what limits
progress is how many builds can be started per sitting. Queue utilisation (share of POP-samples with a build running) is 0 to 6 %
all game, and 28 % (14 days) to 32 % (30 days) of the production that the rates would give is lost to full stores.
- Everyone who plays at all gets there; the question is when. 2 sittings a day: field level 9.8 after 60 days; 4 a day: 18.4
(`node tools/bot.js --players 50 --days 60 --seed 1 --sessions-per-day 2|4 --set FORMULAS.secondQueueCoreLevel=10`); a 24/7 player is not much
faster than 8 a day (field level 15.3 against 14.9 after 30 days, `--always-on` against `--sessions-per-day 8`).
## 3. What was changed
### B1. Second build slot at Core router 3 (was 10)
| parameter | old | new | file |
|---|---|---|---|
| `FORMULAS.secondQueueCoreLevel` | 10 | 3 | `public/js/data.js` |
Why: see above. The experiment that decided it (bots at 2 and 4 sittings a day, 50 players, seeds 1 and 2 averaged; "before" =
`--set FORMULAS.secondQueueCoreLevel=10`, "after" = the new default; command pattern
`node tools/bot.js --players 50 --days 60 --seed 1 --sessions-per-day 4 [--set FORMULAS.secondQueueCoreLevel=10]`):
**2 sittings a day, 60 days** (`--sessions-per-day 2 --days 60`, seeds 1+2):
| metric | before (second slot at Core 10) | after (Core 3) |
|---|---|---|
| day F>=10 | not reached | 39.0 |
| day F>=15 | not reached | not reached |
| day F>=18 | not reached | not reached |
| F at end | 9.8 | 13.9 |
| core10 day p50 | 53.9 | 35.7 |
| first expansion day p50 | 49.9 | 36.8 |
| footprint p50 | 13092 | 21607 |
| net worth (all) | 142818 | 365943 |
| storage waste % | 67.8 | 61.5 |
**4 sittings a day, 60 days** (`--sessions-per-day 4 --days 60`, seeds 1+2):
| metric | before (second slot at Core 10) | after (Core 3) |
|---|---|---|
| day F>=10 | 32.0 | 22.5 |
| day F>=15 | 47.0 | 37.0 |
| day F>=18 | 58.0 | 48.0 |
| F at end | 18.4 | 18.9 |
| core10 day p50 | 31.4 | 20.0 |
| first expansion day p50 | 29.6 | 18.7 |
| footprint p50 | 30849 | 42146 |
| net worth (all) | 1002649 | 1167173 |
| storage waste % | 53.9 | 67.2 |
(The 60-day waste rises because the economy saturates earlier: once every field is at its maximum the stores are full and the production has nowhere to go. At 14 days, before saturation, B1 halves the waste.)
**4 sittings a day, 14 days** (`--sessions-per-day 4 --days 14`, seeds 1+2):
| metric | before (second slot at Core 10) | after (Core 3) |
|---|---|---|
| F at end | 5.2 | 7.1 |
| core10 day p50 | not reached | 8.9 |
| first expansion day p50 | not reached | 10.8 |
| footprint p50 | 1473 | 1883 |
| net worth (all) | 35163 | 56845 |
| storage waste % | 37.0 | 16.4 |
Default mix, per-archetype cadence, seeds 1 to 3 (`node tools/bot.js --players 50 --days 30 --seed N [--set ...=10]`):
**30 days** (seeds 1 to 3):
| metric | before (second slot at Core 10) | after (Core 3) |
|---|---|---|
| day F>=10 | 29.7 | 21.7 |
| F at end | 10.3 | 13.2 |
| core10 day p50 | 27.0 | 16.7 |
| first expansion day p50 | 27.5 | 17.8 |
| footprint p50 | 7215 | 10329 |
| net worth (all) | 157200 | 307644 |
| net worth builder | 108835 | 295333 |
| net worth raider | 193321 | 277369 |
| raids | 253 | 189 |
| storage waste % | 31.8 | 26.0 |
**14 days** (seeds 1 to 3):
| metric | before (second slot at Core 10) | after (Core 3) |
|---|---|---|
| F at end | 5.5 | 7.3 |
| core10 day p50 | not reached | 9.0 |
| first expansion day p50 | not reached | 11.6 |
| footprint p50 | 1569 | 2045 |
| storage waste % | 28.1 | 13.2 |
World speed 2 and 3, 30 days, default mix, seeds 1 and 2 (`--speed 2|3`):
**Speed 2** (`--speed 2 --days 30`, seeds 1+2):
| metric | before (second slot at Core 10) | after (Core 3) |
|---|---|---|
| day F>=10 | 18.0 | 13.0 |
| day F>=15 | 28.0 | 23.0 |
| F at end | 16.2 | 18.0 |
| core10 day p50 | 15.9 | 10.1 |
| first expansion day p50 | 16.1 | 10.4 |
**Speed 3** (`--speed 3 --days 30`, seeds 1+2):
| metric | before (second slot at Core 10) | after (Core 3) |
|---|---|---|
| day F>=10 | 14.0 | 11.0 |
| day F>=15 | 21.0 | 18.0 |
| F at end | 18.6 | 18.9 |
| core10 day p50 | 11.5 | 8.1 |
| first expansion day p50 | 12.0 | 7.7 |
What it does not do: it changes nothing for a player who is always online (`--always-on`, 30 days: field level 15.3 before, 15.2 after, same day for Core router 10) and little at 8 sittings a day (field level 14.9 to 15.6); it helps most those who play 1 to 4 times a day (1 a day, 30 days: field level 3.8 to 4.6). A casual player is still behind a committed one (section 4, "attention"). Going further (slots
2/3/4/5 at Core router 2/4/7/10) was measured with a three-line hook in `rules.queueSlots` (`FORMULAS.extraQueueCores`, default
`[]`, so the committed behaviour is unchanged) and not adopted: slots 2/3/4/5 at Core 2/4/7/10 bring the 2-a-day player to level 18 on day 51 and everybody to saturation between day 40 and 51 (table in section 4). That removes most of the attention gap by speeding everybody up and leaves the committed player with nothing to build for ~60 days before the backbone opens, which is a pacing decision (how long should the economy last?) the bots cannot make.
Side effects worth knowing: builders now lose far less to raids (they are no longer slow targets, see "raiding" below), and the
first expansion comes ~10 days earlier. Both are consequences of the faster early game, not separate changes.
### B2. Transport capacity 1000 per link (was 500)
| parameter | old | new | file |
|---|---|---|---|
| `TRANSPORT.capacityPerLink` | 500 | 1000 | `public/js/data.js` |
Why: the end game was **shipping-limited**, not production-limited. The Backbone node costs 7.2 M of each resource over 100 levels
(21.6 M units in all) and the only way to bring them to the site is by transport, 500 units per link per trip, links = Internet
exchange level, one trip per sitting per link. By day ~50 to 60 (4 sittings a day, with B1) a committed player's 18 fields are at their maximum;
one 18-member alliance then produces roughly 2.6 M units a day (a world average of 600 / 600 / 480 per POP and hour on ~165 POPs, a third of
them the alliance's), so production would cover the cost in about eight days, while the same
alliance shipped 150 to 220k units a day (18 members x ~5 links x ~4 sittings x 500 = 180k). The early levels are cheap (level 1 is
4 000 of each, level 89 is 193 000 of each, 580k for one level) so the stockpile covers them at once; from level ~60 on a single level costs more than
a day of shipping and the alliance waits for trucks, not for the 2 h x 1.025^L build.
"Before" = `--set TRANSPORT.capacityPerLink=500`, "after" = the new default; commands
`node tools/bot.js --players 50 --days 175 --seed 1 [--set TRANSPORT.capacityPerLink=500]` (speed 1) and
`--speed 3 --days 110` (a 3x world). Winner = the first alliance to finish node level 100.
| world | before: 500 per link | after (B2): 1000 per link | measured, not adopted: 2000 per link | measured, not adopted: 500 per link and `ENDGAME.costGrowth` 1.035 (3.9 M of each) |
|---|---|---|---|---|
| speed 1, seed 1, 175 days | no winner by day 175, best node level 89 (about 45 more days at its rate) | winner day 164 (64 days after the sites opened) | winner day 143 (43 days after the sites opened) | winner day 159 (59 days after the sites opened) |
| speed 1, seed 2, 190 days | no winner by day 190, best node level 97 (about 12 more days at its rate) | winner day 156 (55 days after the sites opened) | not run | not run |
| speed 1, seed 3, 190 days | no winner by day 190, best node level 88 (about 61 more days at its rate) | winner day 178 (78 days after the sites opened) | not run | not run |
| speed 3, seed 1, 110 days | no winner by day 110, best node level 79 (about 114 more days at its rate) | no winner by day 110, best node level 94 (about 22 more days at its rate) | winner day 84 (51 days after the sites opened) | no winner by day 110, best node level 94 (about 17 more days at its rate) |
| speed 3, seed 2, 110 days | no winner by day 110, best node level 84 (about 76 more days at its rate) | winner day 109 (76 days after the sites opened) | not run | not run |
Reading it: at 500 per link nobody finished within 175 to 190 days at speed 1 (levels 88, 89, 97; the extrapolations are 12 to 61 more
days at the rate the leading site was fed), so a 1x world would run to day ~200 to 250. At 1000 the winner arrives 55 to 78 days after
the sites open, which is 1.5 to 2.2 times the 36 days that building the 100 levels takes on its own, so shipping still matters but does not
decide everything. 2000 gives 43 days: shipping is then barely a constraint. Lowering the cost (`ENDGAME.costGrowth` 1.035) helps about as
much as 1000 per link at both speeds (59 days at 1x; best level 94 on day 110 at 3x, the same as 1000 per link). Either dial works; capacity
was taken because the cost curve was set on purpose ("far more than anything else", DECISIONS E5, and DESIGN.md quotes 7.2 M) while carrying
500 units per trip is a convenience limit nobody argued for, and because it also lifts bulk trade a little.
**Not solved by B2:** speed does not shorten the end game the way it shortens everything else. A 3x world opens its sites on day 33, but
its alliances still take 76 days (seed 2) after that, about as long as a 1x world, because shipping is per sitting, not per hour (and
at day 33 the members are at field level ~12 with fewer links). `capacityPerLink x world speed` in `rules.transportPlan` would
restore the scaling (a 10x world with a final push finished 8.5 days after opening, below) but the client reads the constant directly
(trade form limits, send dialog), so it was left to the owner of that code.
## 4. Found, not changed
Each item: what the runs show, the run to reproduce it, and why nothing was tuned.
### Attention is still the biggest lever (B1 narrows it, does not remove it)
Days until the average capital's mean field level reaches 10 / 15 / 18 (all 18 fields, mean over the 50 operators; 50 players, seed 1, 120
days, `node tools/bot.js --players 50 --days 120 --seed 1 --sessions-per-day N [--set FORMULAS.secondQueueCoreLevel=10]`):
| sittings a day | before: second slot at Core 10 | after (B1): second slot at Core 3 | not adopted: slots 2/3/4/5 at Core 2/4/7/10 |
|---|---|---|---|
| 2 | 62 / 91 / 113 | 39 / 67 / 85 | 26 / 40 / 51 |
| 4 | 32 / 47 / 58 | 22 / 37 / 48 | 18 / 29 / 41 |
| 8 | 20 / 31 / 46 | 18 / 29 / 43 | 17 / 27 / 40 |
A 2-sittings-a-day player takes about 1.8 times as long as a 4-a-day player to level 18, and 2.0 times as long as an
8-a-day player. That is a lot less than before B1 (2 a day: 113 days to level 18 against 58 at 4 a day) but it is not "a few minutes a
few times a day is enough": the casual player gets level 18 on day 85, two weeks before the backbone opens, the committed one
on day 48. More slots narrow it further (last column), at the price of pushing the committed player to saturation even sooner;
that is a pacing decision (how long should the economy last?) that the bots cannot make for you, so it is left open.
### Raiding: profitable per raid, not a winning strategy at equal attention
Every bot at 4 sittings a day, B1 config, 30 days, seeds 1 to 3 (`node tools/bot.js --players 50 --days 30 --seed N --sessions-per-day 4`;
net worth = everything spent on buildings, units and research plus the stock left):
| archetype | n | net worth, seeds 1 / 2 / 3 | field level (seed 1) | POPs (seed 1) | raids won / sent (seed 1) | times hit, mean over the archetype (seed 1) |
|---|---|---|---|---|---|---|
| builder | 11 | 302k / 301k / 297k | 13.7 | 3 | - | 2.5 |
| raider | 7 | 214k / 232k / 216k | 11.9 | 1 | 63/63 | 0.3 |
| conqueror | 3 | 309k / 246k / 284k | 12.7 | 3.67 | 43/43 | 4.3 |
| turtle | 6 | 156k / 157k / 154k | 10.4 | 1 | - | 0.0 |
| expander | 8 | 384k / 385k / 386k | 14.2 | 6 | - | 4.6 |
| trader | 6 | 206k / 212k / 231k | 12.1 | 3 | - | 5.2 |
| alliancer | 9 | 286k / 289k / 291k | 13 | 3 | - | 2.3 |
- Raids are won (100 % in all three seeds, attack/defence median 4 to 27: the raider only attacks what it beats by a wide margin
after a scan that succeeds 81 to 86 % of the time), they return about 2.7 to 3.2 times the value of the units lost, 106 to 153 raids
per run. Nobody younger than 4 days is raided (72 h protection and the bots prefer rich targets); 3 to 8 raids per run hit
operators of 4 to 7 days.
- But the raiders end 23 to 29 % behind the builders in net worth and (seed 1) 1.8 levels behind in field level: a 1.5-day army is not paid back within
a month, and the 15 to 27k of loot per raider (nominal; see the overflow note below) is much less than the army costs. Builders lose
2 to 4k each, about 1 % of their output. Turtles (two days of production in defence) were never hit (0 hits in all three 30-day runs, and in a 170-day run made with the
bot build before B1) and are 48 % behind builders: defence is cheap per point (a Honeypot is 0.42 defence per resource point against 0.27 attack
per point for a Script crew, before the Firewall) but a turtle pays for it every day.
- `--no-adapt` (nobody answers a raid with more defence): 137 and 213 raids instead of 106 and 153, builders hit 24 and 13 times
instead of 27 and 19; net worth within 3 % for everybody except raiders (+3 to +12 %) and conquerors (+3 to +7 %). The army cost, not the
defenders' reaction, is what keeps raiding in check here.
- Earlier in this pass raiders looked dominant (net worth 1.8 times a builder's). That was the old single build slot (builders were
slow and easy to hit, raids 253 against 189 per run) plus a cadence difference: with per-archetype cadence a raider plays 5 sittings and a builder 4.
After saturation (day ~50 at 4 sittings a day) net worth stops being comparable: everybody turns the surplus into units
(60-day runs `arch-d60-s1/2` show raiders ahead 1.5 to 1.6 times, which says nothing about raiding).
- Sensitivity, so the next pass knows the dials (per-archetype cadence, 30 days, seeds 1+2, B1 config; builder loot loss per
builder / raids per run / raider net worth against the untouched run):
`MILITARY.cacheMax 0.7 + cachePerLevel 0.14`: 4-6k, 181, -4 to -5 %; `cacheMax 0.8 + cachePerLevel 0.2`: 2-3k, 87 to 164, -8 to -11 %;
`MILITARY.raidLossFactor 0.8`: 4-6k, 142-158, -4 to -6 %; `script_crew carry 30, botnet 90`: 3k, 137-197, -7 to -12 %. Untouched:
10-11k, 188-198. None adopted: the untouched game is not dominant and bots scout better than most players will.
- **Loot is mostly wasted on arrival** (`m2-after-d30-s1`): loot is split evenly over Fiber, Hardware and Capital whatever the raider
needs, the raider's Hardware and Capital stores are usually full, and overflow at delivery is destroyed: over all deliveries of that run 77k Hardware,
14k Capital and 2k Fiber vanished against 251k looted in total. Real value of a raid is mostly its Fiber. A rule that weights
the split by free storage would double the effective loot; that is a design change, not a number.
### Takeover is expensive enough
A conqueror-heavy world (12 of 50 conquerors, 20 expanders, 18 builders, 4 sittings a day, 45 days, seeds 1 and 2: `cq-base-d45`,
`cq-base-d45-s2`):
| run | POPs in the world | taken over | takeover battles (one M&A team each) | conqueror: net worth / footprint / POPs | expander: net worth / footprint / POPs | builder: net worth / footprint / POPs |
|---|---|---|---|---|---|---|
| seed 1, M&A team 700/600/800 (as shipped) | 279 | 42 | 613 | 911k / 21k / 5.83 | 981k / 27k / 7.7 | 934k / 25k / 3.06 |
| seed 1, M&A team x3 (2100/1800/2400) | 254 | 4 | 266 | 905k / 21k / 3.25 | 975k / 27k / 7.95 | 934k / 25k / 3.11 |
| seed 2, as shipped | 288 | 46 | 657 | 1000k / 22k / 6.17 | 984k / 27k / 8 | 937k / 25k / 3 |
| seed 2, M&A x3 | 252 | 3 | 304 | 979k / 22k / 3.17 | 978k / 27k / 8 | 934k / 25k / 3 |
Taking over costs about 14 to 15 M&A teams per POP (loyalty 100, 15 to 30 per hit, +1 per hour back, the bots hit once per sitting),
about 30k of resources, and the 12 conquerors in that world end level with the expanders and builders in net worth (911 to 1 000k
against 975 to 984k and 934k) and behind them in footprint (21 to 22k against 27k and 25k): not dominant. Tripling the M&A price
(2 100 / 1 800 / 2 400) leaves 3 to 4 takeovers: the mechanic dies. So 700 / 600 / 800 sits in a narrow working window. Not tuned.
(Net worth is read near saturation here, hence the footprint column.)
### Trade works but is thin, and escrow loses resources
38 to 47 offers completed per 30 days in the standard runs (volume about 40k units), roughly half of all posted offers expire. Every
operator is short of Fiber (buildings cost Fiber : Hardware : Capital in a ratio of about 1 : 0.7 : 0.5, the 18 fields give 5 : 5 : 4
plus 4 substations), so the market has no natural counterparties and trade is mostly Hardware or Capital surplus for Fiber or each
other. Completed offers trade at 1.00 give/want (median). Not tuned: a thin market is an observation about this bot population, not a
number to move.
**Server finding S2 (not fixed):** the escrow of an offer that expires or is cancelled after the POP's store filled up again is
refunded only up to the Rack hall cap (`trade.refund`, decision R1). The harness books it: 36 refunds per 30-day run (all three seeds) lose
12 to 15k Hardware and Capital in total (`arch-d30-s1`: 3.3k Hardware, 11.2k Capital in 36 events), invisibly to the player.
DESIGN.md used to say nothing is lost in trade (corrected to describe the cap). Fix options: credit the clipped part back as a transport that waits, or let escrow refunds
exceed the cap the way the existing "stock above a lowered cap is kept" rule does for stock.
### Power binds early and then recedes
Share of POPs that carry units whose net power is below 3 per hour: 64 to 77 % on day 4, 52 to 56 % on day 8, about 30 % on day 12,
6 to 11 % from day 20 (`arch-d30-s1..3`). The bots size armies to net power, so no unit went offline in any standard run (0 `units_offline`
notifications, 0 decommissioned); that path is covered only by the unit tests. Units on the road draw power from nobody, so a raider that is
out frees headroom, trains more, and finds the POP over its output when the army returns: in a one-off probe (not part of the harness) 22 of 1 039 raiding sittings of a 20-day run found
the capital's units offline (transient, fixed by the next substation level). Not tuned.
### Everything else that looked fine, with numbers
- **Footprint gate vs reachable footprint:** the gate for the first extra POP (500) is passed on day ~8 by 84 to 100 % of operators; the
8th extra POP needs 21k and the median footprint is 10k on day 30 and 40k on day 60 (4 a day). The gate never binds before Core
router 10 and the crews do.
- **Incumbent sites:** 14 to 21 attacks per 30-day run (raiders and conquerors only), all won, +2 500 Hardware each (35 to 52k in total)
for units worth 1.4 to 1.6k lost per attack: farmable, not a runaway (defence grows 4 % a day, the bots' armies and travel time cap the
rate). Not tuned.
- **Storage:** with B1, 13 % (14 days) to 26 % (30 days) of the production the rates would give is lost to full stores, mostly Hardware and
Capital (28 to 30 % against 19 % Fiber), and from saturation on (day ~50 at 4 sittings) nearly all of it. Stores are meant to cap
the economy; the point is that a committed player has nothing left to spend on in the capital for ~50 days before the backbone
opens, except units and extra POPs. A pacing decision, not changed.
- **Beginner protection** (72 h): 0 raids against operators younger than 4 days in any run.
- **Rack hall cache** and **loyalty/takeover** behave as described above.
- **Performance:** 50 players x 60 days in 17 to 30 s (the higher figure with 16 runs in parallel), 200 players x 14 days (radius 100) in 14 s, p95 command latency 0.1 to 0.5 ms,
no failed event and no unexpected error code in any run listed here.
## 5. The end game
### What the bots do
When the world is at day `ENDGAME.openDay / speed` every alliance with at least 3 members plans (a shared in-memory plan, what an
alliance would agree in its chat): the site with the lowest static defence (a little weight on distance); ONE member with an Ops lab trains
Script crews to 1.12 times the site's defence at arrival and attacks with everything it has (an attack is one movement from one POP and is resolved
against the full static defence, so attacks cannot be added up); once the alliance holds a site every member ships its spare Fiber, Hardware and Capital
(`backboneShip`, up to its free links per sitting) and anyone starts the next level when the stockpile pays for it (`backboneBuild`).
`--endgame-step-min N` adds a final push: those members also act every N minutes after the sites opened.
### What the runs show
- **Capturing is not hard for a developed alliance.** In the 1x runs three alliances took a site within 0.1 to 2.5 days of the opening (the
first attack that was strong enough; 3 of 3 landing attacks won), in the 3x world six sites were held by six alliances after 14 won attacks (sites
change hands while the defence is still low). The static defence of a site at day 100 is 27k to 45k depending on the site (600 x 5.0 x 12 x a seeded +-25 %), i.e. an army of
700 to 1 150 Script crews before research, which the striker (the member with the best economy and an Ops lab) had within days.
- **Nothing is contested afterwards, and nothing can be.** The biggest army any single POP held at the end was 55 to 62k attack before research;
the defence of a built-up site was 200 to 240k at speed 1 (levels 89+), 370 to 440k at speed 3. Defence passes what one POP can send
at node level ~25 (weakest site) to ~40. That is E1 (no garrisons) showing up: after the opening days the race is shipping and node build
time, not war. The only interaction is the opening scramble (the 3x world saw 14 won attacks for 6 sites; the 1x worlds none after the
first three).
- **Is 7.2 M of each resource feasible or trivial?** Not infeasible, not trivial: with the capacity it was (500) the leading alliance (13 to 19 members) needed
more than 90 days after opening at 1x (extrapolated 100 to 150); with 1000, 55 to 78 days (seeds 1 to 3). Production is not the limit (previous section).
- **With attention it is fast.** A 10x world, seed 1, members of the alliances that chase the backbone online every 30 minutes after the
sites opened (`--speed 10 --days 24 --endgame-step-min 30`): the winner finished 13.8 days after opening with 500 per link and 8.5 days
with 1000 (85 world days; the node build time alone is 3.6 days at 10x). Without the final push (`--speed 10 --days 30`, 500 per link) the best
node was at level 58 nineteen days after opening. So the race is decided by who is online, as designed, and 1000 per link does not make it trivial
for people who are not.
- **Conservation holds through all of it**: shipments, bounces, stockpiles and Backbone levels are in the ledger; every run above finished
`INVARIANTS OK` (the first speed-1 runs of this pass were flagged only because the bots kept commanding an ended world; the harness now stops
and treats `world_ended` as expected).
## 6. Server findings
| # | finding | status |
|---|---|---|
| S1 | **Cargo above the Rack hall cap was destroyed silently on bounced shipments.** A shipment that comes home (landing site changed hands, POP gone) rides back on a `link` return leg; `events/return.js` sent no notification for link legs, so the overflow was invisible to the player and to any audit. The conservation ledger found it as 1 000 Hardware + 2 718 Capital of drift in the first speed-10 end-game run (`node tools/bot.js --players 50 --days 14 --seed 1 --speed 10 --endgame-step-min 30`; with the fix the same command shows no drift, and it reproduces the bug if the `carrying` condition in `return.js` is taken out). | **fixed** (`return.js` notifies when a link leg carries cargo), `test/bot-server-fixes.test.js` fails without the fix |
| S2 | Trade escrow refunds are clipped at the Rack hall cap and the loss is not reported (section 4). | open, design decision |
| S3 | `reports.id` is `INTEGER PRIMARY KEY` without `AUTOINCREMENT`; the 14-day cleanup can empty the table and SQLite then reuses low ids. A consumer that keeps "the last report id I saw" (the harness did, and silently missed every report after the first cleanup in a 170-day run) skips new reports. The API's own cursor (`GET /reports?after=` with `r.id < after`, newest first) is not hurt unless a client mixes old and new ids. Repro in five lines: insert three reports, `DELETE FROM reports`, insert one more: its id is 1 (the harness hit it in 170-day runs, where raids stop and every report expires). | open, low severity |
| S4 | Loot is split evenly over the three resources and destroyed on overflow (section 4). | open, design |
| S5 | `ensureSites` is lazy (E2): the first touch of a landing site writes `backbone_open`; the harness reads sites with `E.siteStates` and never triggers it. No bug, noted so nobody expects the push in a bot run. | known |
## 7. Bot bugs that moved the numbers (so nobody trusts an early number from this pass)
- Bots read reports with "id greater than the last id": after the first 14-day cleanup new reports were skipped and the unit ledger
drifted (phantom `script_crew -855`). Fixed with a (created_at, ids at that instant) cursor (S3).
- The wish list offered the field that was already being built, so a bot with two or more build slots could only ever have ONE field
upgrade running. That understated B1: before the fix the second slot at Core 3 looked like +25 % net worth for casual players, after
it 2.6 times (2 sittings a day, 60 days). Every table in this document was produced after that fix.
- Bots tried to send raids from POPs whose units were offline (676 refused commands in one 30-day run) and ran a fixed "balanced"
field policy that wasted Capital; both fixed (`--field-policy balanced` keeps the old one as a lower bound).
## 8. What is still unknown
- Bots are not humans. They never forget to log in, never panic, never coordinate beyond a shared in-memory plan, never mis-click, and play
the same sittings every day. They do not use reinforcement, recall, the shared report folder, messages, sitters, or night play. They
never choose a different capital or sell their stock off before an attack.
- No real players means no data on how many sittings a day people really play; the whole B1 argument rests on the 2-to-8 sittings-a-day
band that the CLAUDE.md pitch implies.
- Rural bonuses, wild slots and the Peering office size ladder were not examined. The offline/decommission power path never ran in a bot
run. The alliance war/peace states were exercised (NAP, confederation, war appear in the runs) but never made to matter in a fight.
- The end game was run with a single plan per alliance that nobody contests after the first days (section 5); a determined rival with
several armies cannot beat a built-up site (single-POP attack ceiling), so there is no data on what an actual fight for a site would look like.
- `--always-on` is an upper bound on attention, not a model of a person.