Disasters & pandemics: earthquakes / famine / pandemics that hit a nation or region; pandemics spread to adjacent nations #63

Closed
opened 2026-10-15 17:05:42 +02:00 by kamilkrzywda · 0 comments
Owner

What

Add world events: natural disasters (earthquake, flood) and famine/pandemics that hit a specific nation or region, with a pandemic that spreads to adjacent nations over subsequent turns.

Mechanism

  • TurnResult gains disasters: { events: { type: 'earthquake'|'flood'|'famine'|'pandemic'; target: string /* nationRef or regionKey */; severity?: number }[] } — required, default [].
  • A disaster applies stat hits (a famine → economy/population down; an earthquake → a region's infrastructure/marker loss; a pandemic → a tracked pandemics: {origin:string; affected:string[]}[] that spreads each turn to nations sharing a border with an affected one, until contained).
  • Can be triggered by the LLM (deliberate, e.g. bioweapon) or the engine (a deterministic periodic roll).
  • Builds on: per-region stats, relations, adjacency (for spread), no-man's-land.

Acceptance

  • e2e safety (critical): stub returns disasters: { events: [] } (no spontaneous disaster in the deterministic stub), deterministic; additive; must not break the UK-in-wwii-1939 e2e (empty frontier, military 80→85, 7-item legend).
  • Unit tests in server/engine.test.ts (each disaster type, pandemic spread over turns, containment).
  • Version bump at PR time.
## What Add **world events**: natural disasters (earthquake, flood) and **famine/pandemics** that hit a specific nation or region, with a pandemic that **spreads** to adjacent nations over subsequent turns. ## Mechanism - `TurnResult` gains `disasters: { events: { type: 'earthquake'|'flood'|'famine'|'pandemic'; target: string /* nationRef or regionKey */; severity?: number }[] }` — required, default `[]`. - A disaster applies stat hits (a famine → economy/population down; an earthquake → a region's infrastructure/marker loss; a **pandemic** → a tracked `pandemics: {origin:string; affected:string[]}[]` that **spreads each turn** to nations sharing a border with an affected one, until contained). - Can be triggered by the LLM (deliberate, e.g. bioweapon) or the engine (a deterministic periodic roll). - Builds on: per-region stats, relations, adjacency (for spread), no-man's-land. ## Acceptance - **e2e safety (critical):** stub returns `disasters: { events: [] }` (no spontaneous disaster in the deterministic stub), deterministic; additive; must **not** break the UK-in-`wwii-1939` e2e (empty frontier, military 80→85, 7-item legend). - Unit tests in `server/engine.test.ts` (each disaster type, pandemic spread over turns, containment). - Version bump at PR time.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/History#63