A House Divided A House DividedDocumentation
↵
Changelog
Game Design/World & Simulation

World and era systems as shipped

Last updated 2026-10-29
Source files

Summary#

The game world is wider than the set of countries a player can enter. Historical presets, the world-entity manifest, macro countries, spheres, and transition engines work together to keep the wider map economically and politically meaningful without pretending that every entity has the same simulation depth.

This page describes the current runtime model. For individual subsystems, see Bloc alignment and spheres, Statehood admission, One-party states, Constitutional conventions, and Conflict.

Player guide: this page has no single player wiki page; the player-facing country and era pages link here for the exact rules.

Rules#

Presets are world starting conditions#

RESET_PRESETS () currently exposes eight entries, six of them dated starts:

Preset Starting frame Important distinction
1953-default Early Cold War Broad historical roster, world transitions, and founding-phase support
1979-default Late Cold War Broad economy roster and Cold War political structures
1991-default Post-Cold-War transition Historical legislature and demographic anchors for supported countries
2019-default Contemporary baseline The default fallback when a world carries no explicit preset
2023-default Recent US baseline US 118th Congress data, with non-US systems falling back to their 2019 bundles where stated by the preset
2027-default Five-country modern world January 2027 projection with playable US, UK, Japan, Germany and China, using projected US congressional control and the latest completed national elections elsewhere

Two additional reset modes provide clean-slate variants: empty (named "2019 Start Date - No NPPs", no seated officials, all seats vacant) and 2019-no-parties (no NPPs and deleteDefaultParties: true). Both have an empty countries list. A preset is not merely a displayed year. It selects seat maps, election anchors, demographics, budgets, policy catalogs, currencies, and feature gates throughout bootstrap and turn processing.

The admin reset registry is the authority for selectable presets. Seed helpers must receive the selected preset or read it from gameState; silently assuming a contemporary bundle can contaminate a historical world. The one remaining fallback is DEFAULT_SEED_PRESET = "2019-default" in .

Four simulation tiers#

Every entity in the world manifest has one of four simulation tiers (WorldSimulationTier in ):

Tier Meaning
full-autonomous Backed by a deep country or macro-country simulation and able to operate independently
sphere-macro Simulated primarily through sponsor, sphere, trade, and macro relationships
background-macro A sovereign polity simulated only as a light background macro country, taken from the background roster () when the alignment catalogue lacks it
historical-presence Present for geography, recognition, history, and transition rules without a full country loop

Tier is separate from player access. legacyAccess (LegacyCountryAccess) distinguishes player, economy-preview, hidden, and config-fallback access, while readiness records explain why an entity is or is not autonomous or playable. This prevents a map entity, an economy-preview country, and a player-enabled country from being treated as equivalent.

The static country configs (status in each src/lib/countries/<id>/institutionsFacts.ts) mark the United States, United Kingdom, Germany, Japan, Ireland, and China as active; other configured countries (for example Nigeria, Russia, France, Brazil) are coming-soon. Historical presets may register many more entities for economic, one-party, macro, or transition behavior. Country status and preset membership therefore answer different questions.

The world manifest#

assembles the preset-scoped world view. An entry can carry:

The 1953 registry is assembled from regional modules in src/lib/world/registry/. Tier 2 macro specifications live in src/lib/world/macro/; sphere mechanics live in src/lib/world/spheres/; sovereignty transitions live in src/lib/world/transitions/.

Era progression#

The live era is a decade bucket derived from the live in-game year, never from the seed preset string (eraFromYear in ). The year is clamped to ERA_DOMAIN = { min: 1950, max: 2049 }, startYear = floor(year / 10) * 10, id and label are "{startYear}s", and endYear = startYear + 9.

When eraSystemEnabled is true, the era-crossing phase (runEraCrossing, ) fires when currentYear % 10 === 0 and currentYear > lastEraCrossedYear. It stamps currentEraId and lastEraCrossedYear and posts one world-news item titled "The {era} Begin". If the feature is enabled in the middle of a decade, the marker quietly self-heals without a news item. No preset start year (1953, 1979, 1991, 2019) is divisible by ten, so nothing fires at bootstrap. Scoring never reads the stamp (it computes from the year), so a missed stamp cannot skew math.

Metric activation (runMetricActivation) uses the same conservative pattern. Its first enabled run records lastMetricActivationYear without dumping missed historical events into the news feed. Later year crossings publish only newly activated metric-catalog events, one post per activation event, also sent to the news webhook. Other systems, including military branches, technology lanes, election anchors, and catalog selection, read the live year or preset through their own explicit gates.

Historical transitions#

Historical outcomes are modeled as pressure and bounded windows where possible, not unconditional scripts.

US statehood (, ). In the 1953 preset, Alaska and Hawaii begin outside the apportionment map. Once per in-game year the statehood phase makes an iteration-keyed deterministic draw per pending territory.

Decolonization (). The phase evaluates the authored roster DECOLONIZATION_ROSTER_RULE_IDS once per in-game year, only when currentTurn % TURNS_PER_YEAR === 0 (TURNS_PER_YEAR = 48, ). It returns without work after DECOLONIZATION_ERA_LAST_YEAR = 1980, because the evaluator's prior for a year past a rule's window is 0.95 and would fire every rule at once. Applied rules are recorded in appliedWorldTransitions and skipped on later turns. One rule failing is caught and logged without stopping the rest. Pressures are left at their authored defaults: the evaluator's historical calendar and priors drive the timing.

Regime and constitutional change. One-party systems maintain their own stage and pressure state. Escalation, stabilization, collapse, and constitutional-convention paths can change runtime political structures instead of requiring a new seed. These paths are separate from ordinary election turnover and must preserve the country's historical and institutional context.

Imperial characters#

Imperial characters (ImperialCharacter, ) are economy-facing identities stored separately from ordinary political characters. Current UK and Japan setups use them for ceremonial monarchs who cannot stand in elections, hold elected office, or vote on legislation. They can manage their associated corporation and participate in financial systems such as dividends, bonds, portfolios, and foreign exchange. Which countries have the role is set by the country config (isImperialCountry, imperialTitles, imperialCorporation, imperialSharedWith in src/lib/constants/countries, used by ).

This separation is deliberate: the role can participate in the economy without acquiring the permissions of an elected politician.

Operational rules for contributors#

Source map#

Data#

Collection or field Read or written Notes
gameState.preset read Selects seat maps, anchors, catalogs. Never inferred
gameState.eraSystemEnabled read Gates era crossing and metric activation
gameState.currentYear, currentEraId, lastEraCrossedYear, lastMetricActivationYear read and written Era marker. currentEraId is shown in the admin panel and flags route
gameState.lastStatehoodYear, gameState.iteration read, lastStatehoodYear written Once-per-year guard and the roll key
states (admittedYear) written on admission Read by every statehood gate through admittedStateIdsAsOf
appliedWorldTransitions written _id is the rule ID; fields ruleId, turn, year, appliedAt. Decolonization idempotency record
News posts written Decade begins, newly activated metrics, state admissions. Player-visible
Imperial characters collection read and written by economy systems Separate from characters. Profile is player-visible

The world manifest itself is computed from code at request time and is not stored.

Configuration#

Setting Default Where set
gameState.preset none; callers fall back to DEFAULT_SEED_PRESET = "2019-default" ; chosen at world reset from RESET_PRESETS
eraSystemEnabled off when unset GameState (), toggled by admin. While off, era-aware systems keep legacy behavior
DECOLONIZATION_ERA_LAST_YEAR 1980
TERRITORY_ADMISSIONS windows 1950 to 1970, median 1959
POST_WINDOW_RAMP_EXPONENT 0.7
INITIAL_HOUSE_SEATS_ON_ADMISSION 1
ERA_DOMAIN 1950 to 2049
Country status active for US, UK, DE, JP, IE, CN each src/lib/countries/<id>/institutionsFacts.ts

The earlier text of this page said decolonization runs only when a worldTransitionsEnabled flag is true. No such flag exists in the code: the phase is gated only by the year boundary, the 1980 cutoff, and the applied-rules record.

Timing#

Turn phases run in the turn registry (, ). The authoritative turn-context year is used, not the persisted gameState.currentYear, which is only stamped at the end of a turn.

each turn:       eraCrossing (only acts in a year divisible by 10) -> metricActivation
once per year:   statehood (guard: year > lastStatehoodYear)
year boundary:   decolonization (turn % 48 == 0, year <= 1980)

The statehood, era crossing and metric activation calls sit in stateEffectsPhase.ts; the decolonization phase is registered in turnPhaseRegistry.ts.

Worked trace#

Alaska in a 1953-default world, iteration key I, in year 1956 (windowStart 1950, historical 1959, windowEnd 1970).

  1. Zero year is 1950 - 1 = 1949. F(1955) = 0.5 * (6/10)^2 = 0.5 * 0.36 = 0.18.
  2. F(1956) = 0.5 * (7/10)^2 = 0.5 * 0.49 = 0.245.
  3. Hazard 1956 is (0.245 - 0.18) / (1 - 0.18) = 0.065 / 0.82 = 0.0793.
  4. The roll is hash("statehood:I:AK:1956") / 2^32, a fixed value for that world and year. If it is below 0.0793, Alaska is admitted; otherwise it stays a territory and the year is stamped in lastStatehoodYear.
  5. If it survives to 1959: F(1958) = 0.5 * 0.81 = 0.405, F(1959) = 0.5, hazard 0.095 / 0.595 = 0.1597.
  6. If it is still pending in 1960: F(1960) = 0.5 + 0.5 * (1/11)^0.7 = 0.5 + 0.5 * 0.1867 = 0.5934, hazard 0.0934 / 0.5 = 0.1867.
  7. On admission, the state gets admittedYear, political rows, and 1 House seat; a news item announces it.

Decade crossing: at turn 480 of a world that started in 1953 the year is 1963, so nothing fires. In 1970, 1970 % 10 = 0 and 1970 > lastEraCrossedYear (for example 1960), so currentEraId = "1970s", lastEraCrossedYear = 1970, and the news post "The 1970s Begin" is created once.

Edge cases and limits#

Invariants#

Failure and recovery#

Connections#

Driven by

Affects

Tests#

Known issues and history#

Last checked: 2026-10-29, version 1.18.0

Ask