Resources & Industry: per-region resource/industry profile that drives a nation's economy #59

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

What

Give each region a resource/industry profile (oil, iron, food, industry) and make a nation's economy stat partly derived from what it controls — so territory conquest has an economic consequence.

Mechanism

  • Extend public/region-geo.json (or a new region-resources.json) with a per-region profile: { oil, iron, food, industry } (0–1 or weighted counts), built by a deterministic turf-free .mjs script (idempotent, byte-identical re-run) from existing geo data.
  • A nation's effective economy = its derived stat adjusted by a weighted sum of its owned regions' resource profiles (missing resources → lower economy; resource-rich territory → bonus). The LLM can declare industry projects (TurnResult.industry or via markers/factories) that boost a region's industry over time.
  • Builds on: per-region stats (#46/#48), territory, markers (factory).

Acceptance

  • e2e safety (critical): stub returns any new fields empty, deterministic; additive; must not break the UK-in-wwii-1939 e2e (empty frontier, military 80→85, 7-item legend).
  • A new manifest test (idempotent build) + unit tests in server/engine.test.ts / server/regions.test.ts (resource-derived economy).
  • Version bump at PR time.
## What Give each **region** a resource/industry profile (oil, iron, food, industry) and make a nation's `economy` stat partly **derived** from what it controls — so territory conquest has an economic consequence. ## Mechanism - Extend `public/region-geo.json` (or a new `region-resources.json`) with a per-region profile: `{ oil, iron, food, industry }` (0–1 or weighted counts), built by a deterministic turf-free `.mjs` script (idempotent, byte-identical re-run) from existing geo data. - A nation's effective economy = its derived stat adjusted by a weighted sum of its owned regions' resource profiles (missing resources → lower economy; resource-rich territory → bonus). The LLM can declare **industry projects** (`TurnResult.industry` or via markers/factories) that boost a region's industry over time. - Builds on: per-region stats (#46/#48), territory, markers (`factory`). ## Acceptance - **e2e safety (critical):** stub returns any new fields empty, deterministic; additive; must **not** break the UK-in-`wwii-1939` e2e (empty frontier, military 80→85, 7-item legend). - A new manifest test (idempotent build) + unit tests in `server/engine.test.ts` / `server/regions.test.ts` (resource-derived economy). - 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#59