Files
Battle-for-Tismo/docs/simple_economy/04-warmup.md
T
adrien d5305da449 Gave the world a simple economy: one pool per nation and a global market
The simple economy is now the default and the old simulation is frozen as the hard model, selectable per game. A nation keeps one resource pool available in every region, fed by public production works rather than private per-region stores, and construction and training begin at once, paced by the region's spare power instead of gathering materials over days.

Money is euro only: a per-inhabitant daily tax funds a treasury spent in a global market, where buy and sell lots trade against the world stock and move its price. The hard economy keeps its per-nation currencies, central banks and exchange rates.

Simple games skip the price-settling warmup and economic migration; the snapshot carries the economy model, the market and the pool figures the client draws. Added the matching test suites and the design briefs under docs/simple_economy.
2026-09-25 14:58:49 +02:00

2.0 KiB

04 — No warmup in the simple economy

Depends on: 01-.

Goal

The simple economy needs no warmup. The server should open directly on the starting scenario.

Current behaviour (hard economy)

  • server/server.js reads --warmup (env WARMUP, default 150), logs "settling the world...", and passes warmupDays into the setup object.
  • GameServer.configureGame(setup) (server/game_server.js) calls GameState.warmUpToStability({ maxDays }) when warmupDays > 0, records this.settledDays, and only then calls applyStartingScenario().
  • GameState.warmUp(days) and warmUpToStability live in shared/game_state.js / shared/game_state/resources.js. They settle commodity prices (pricesAreSteady, nextMarketPrice) — a hard-economy concept.

Target behaviour

  • When economyModel === "simple", skip the settle entirely: settledDays = 0, no warmUpToStability call, and apply the starting scenario directly. No UI/market state should depend on a settle having run.
  • --warmup is a hard-economy flag. In simple mode it should be ignored; log a short note if it was explicitly set (rather than silently dropping it). Keep the existing default and behaviour for --economy hard.
  • Do not remove warmUp/warmUpToStability; they remain the hard economy's settle and are exercised by existing tests.

Files

  • server/game_server.js — branch in configureGame.
  • server/server.js — pass economyModel in the setup; adjust the startup log and --warmup help text to say it applies to the hard economy.
  • tests/simple_economy_test.js or the decoupling test — assert a simple game reports settledDays === 0 and that no price-settle ran.

Acceptance criteria

  • A simple server starts without the "settling..." phase and settledDays is 0 in the state/snapshot (if it is exposed).
  • The starting scenario and pool contents are exactly as authored, with nothing spent by a settle.
  • --economy hard --warmup 0 and the default 150 keep working as before.