Files
kamilkrzywdaandOpenCode e2936e85bb History: AI-driven alternate-history simulator
Pax Historia-style sim where the LLM is the world engine.

- React 19 + Vite 6 + Tailwind v4 + shadcn/ui frontend
- Express single-port backend (/api + /sse + built client + SPA fallback)
- SQLite (better-sqlite3) persistence, one row per game
- MapLibre choropleth map (OpenFreeMap dark + ISO_A3 regions)
- Defensive turn loop: strip fences, balanced-{} extract, parse, clamp 0-100,
  retry-once nudge, generic 'unclear' fallback; never crashes on bad output
- 5 seed presets (wwii-1939, coldwar-1955, modern-2025, no-wwii-1940, aegis-2400)
- LLM client over native fetch w/ injectable transport (mesh-bot pattern);
  LLM_STUB=1 deterministic transport for tests/e2e
- Unit (vitest, 19) + deterministic Playwright e2e
- Multi-stage node:22-slim Docker + Traefik (history.dev.kkhost.pl:4321)

Co-Authored-By: OpenCode <opencode@users.noreply.github.com>
2026-10-10 21:20:23 +00:00

75 lines
4.2 KiB
JSON

{
"id": "wwii-1939",
"title": "World War II",
"startDate": "1939-09-01",
"summary": "The guns of September. Lead a major power through the greatest conflict in history.",
"worldBackground": "It is early September 1939. Germany has just invaded Poland, and Britain and France have declared war. Europe stands on the edge of the largest conflict the world has ever seen. The Axis powers — Germany, Italy, and Japan — are pressing their advantage across Europe and the Pacific, while the Allies — Britain, France, the Soviet Union, and a still-neutral but industrially immense United States — are marshalling their strength.\n\nThe balance of power is delicate. Germany's army is the most battle-hardened force on the continent, but its resources are finite and its flanks exposed. Britain commands the seas but is an island nation. The Soviet Union has a vast army and deep territory but a fragile industrial base. The United States has unmatched economic power but is geographically isolated and politically divided over entry into the war.\n\nYou are the head of one of these nations. Every decision you make — military, economic, or diplomatic — ripples across the world and reshapes the map, the alliances, and the fate of hundreds of millions.",
"simulationRules": [
"Serious, historically-plausible tone; write like a war correspondent and a policy analyst combined.",
"Prefer gradual change: 1-4 meaningful events per turn, never a single decisive world-ending event.",
"Respect existing borders unless a war is declared or a decisive military shift occurs.",
"No single nation may instantly dominate the world; power shifts are incremental.",
"Respect the player's chosen nation's resources, manpower, and geography.",
"Diplomacy can shift relations over time but rarely reverses a declared war in one turn.",
"Keep stat values (military, economy, stability, population) between 0 and 100."
],
"nations": [
{
"id": "de",
"name": "German Reich",
"type": "major",
"stats": { "military": 95, "economy": 70, "stability": 75, "population": 90 },
"territory": ["DEU"],
"relations": { "uk": "hostile", "fr": "hostile", "us": "neutral", "it": "ally", "su": "neutral", "jp": "ally" }
},
{
"id": "uk",
"name": "United Kingdom",
"type": "major",
"stats": { "military": 80, "economy": 75, "stability": 60, "population": 48 },
"territory": ["GBR", "IRL", "IND"],
"relations": { "de": "hostile", "us": "neutral", "fr": "ally", "su": "neutral", "jp": "neutral", "it": "hostile" }
},
{
"id": "fr",
"name": "France",
"type": "major",
"stats": { "military": 70, "economy": 60, "stability": 45, "population": 70 },
"territory": ["FRA", "DZA"],
"relations": { "de": "hostile", "uk": "ally", "us": "neutral", "su": "neutral", "it": "hostile", "jp": "neutral" }
},
{
"id": "su",
"name": "Soviet Union",
"type": "major",
"stats": { "military": 75, "economy": 55, "stability": 70, "population": 100 },
"territory": ["RUS", "UKR", "BLR", "GEO"],
"relations": { "de": "neutral", "uk": "neutral", "fr": "neutral", "us": "neutral", "it": "hostile", "jp": "hostile" }
},
{
"id": "us",
"name": "United States",
"type": "major",
"stats": { "military": 60, "economy": 95, "stability": 80, "population": 85 },
"territory": ["USA", "MEX", "BRA"],
"relations": { "uk": "neutral", "de": "neutral", "fr": "neutral", "su": "neutral", "it": "neutral", "jp": "neutral" }
},
{
"id": "jp",
"name": "Empire of Japan",
"type": "major",
"stats": { "military": 85, "economy": 60, "stability": 70, "population": 80 },
"territory": ["JPN", "KOR"],
"relations": { "us": "neutral", "uk": "neutral", "de": "ally", "it": "ally", "su": "hostile", "fr": "neutral" }
},
{
"id": "it",
"name": "Kingdom of Italy",
"type": "major",
"stats": { "military": 55, "economy": 50, "stability": 60, "population": 60 },
"territory": ["ITA", "ALB", "MAR", "TUN"],
"relations": { "de": "ally", "uk": "hostile", "fr": "hostile", "us": "neutral", "su": "hostile", "jp": "ally" }
}
]
}