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

Bloc Alignment and Spheres of Influence

Last updated 2026-10-29
Source files

Summary#

Player guide: Bloc Alignment & Spheres of Influence

Alignment tracks how drawn each nation is toward each Cold War pole (0-100 shares that sum with an "uncommitted" remainder). Spheres of influence are the downstream effect: which patron a nation actually belongs to right now. Alignment is the cause, sphere membership is the effect, sphereProjection.ts is the seam between the two systems.

Location: src/lib/alignment/, with the per-turn driver in .

Key files:

Rules#

Shares and lead#

Each nation has one share per pole of the live topology plus nonAligned. normalizeShares() in is the only write path: every share is a multiple of 0.01 in [0, 100], computed in integer hundredths (UNITS_PER_POINT = 100), and sum(shares) + nonAligned = 100. A row summing over 100 is scaled proportionally with largest-remainder apportionment, so the ordering of poles is preserved.

leadFor() (project.ts) is the top share minus the runner-up share, snapped to the hundredth grid. All gates compare against lead, not the top share. statusFor() returns the first match of: player, locked (lead >= 85), loyal (member and lead >= join gate), defection-risk (member below the gate), eligible (non-member, lead >= join gate), non-aligned (lead <= 20), else contested.

Gates#

Constant Value File
ALIGNMENT_GATES.locked 85
ALIGNMENT_GATES.nonAligned 20
JOIN_GATE_BY_POLE_COUNT 2 poles: 50, 3 poles: 40, 4 poles: 35
PER_NATION_TURN_CAP 5
CRISIS_TURN_CAP 7.5

joinGateForPoleCount() falls back to 50 below two poles and 35 above four. The gate loosens as poles multiply because a four-way split cannot produce a fifty-point lead. This is the same gate the alignment Ledger bands use, so the page and the sphere system cannot disagree about who is committed.

Bloc stress#

A bloc's own cohesion is modeled, not just its members' individual shares: an alliance that grabs half the map should not defend all of it as easily as a compact one. Stress is a 0-1 gauge (computeBlocStress()) built from three weighted components of the bloc's own membership:

Component Weight Meaning
Contested 0.45 Fraction of members where a rival pole holds >= CONTESTED_RIVAL_MIN (25) share
Wants out 0.35 Fraction of members with wantsOutSinceTurn set
Digesting 0.20 Fraction of members with joinedTurn > 0 that joined within DIGESTION_WINDOW_TURNS (12 turns)

Constants live in : the weights (CONTESTED_WEIGHT, WANTS_OUT_WEIGHT, DIGESTION_WEIGHT), CONTESTED_RIVAL_MIN = 25, DIGESTION_WINDOW_TURNS = 12 and STRESS_MAX_DAMPING = 0.4.

Formula: stress = clamp01(0.45 * contested + 0.35 * wantsOut + 0.20 * digesting), where each term is a fraction of the bloc's members. It runs from 0 (no member contested, leaving or recent) to 1 (all three at 100%). An empty bloc has stress 0.

joinedTurn > 0 excludes founding and seeded members, which the seeders stamp with turn 0. Raw member count is deliberately not an input: a large bloc of settled, uncontested members should not be penalized for size alone.

blocPlayEffectiveness(stress) returns a multiplier on the bloc's own plays: 1 - STRESS_MAX_DAMPING * clamp01(stress). A fully-stressed bloc is impaired (60% effectiveness), never inert. blocStressLabel() buckets the gauge into Settled (< 0.25), Strained (< 0.6), or Overextended (>= 0.6) for player-facing display.

Sphere projection#

projectSphereAlignment() converts a nation's pole shares (0-100) into the sphere system's per-sponsor alignment scale (0-1) by dividing by 100, one entry per sponsored pole in the current era (including zero-share sponsors, so a lapsed patron shows as lapsed rather than disappearing). A pole with no sponsor (sponsorForPole() returns null) is skipped. If one country leads two poles, its strongest channel wins.

primarySphereFor() determines which patron a nation is actually committed to: it takes the nation's top pole and requires lead >= joinGateForPoleCount(poleCount) before returning that pole's sponsor. Below the gate, nobody has committed the nation and there is no primary sphere.

applyAlignmentToMembership() writes projected alignment through onto an existing SphereMembership document:

Era crossing#

applyEraCrossing() re-projects a nation's pole shares onto the poles of a new alignment era, run exactly once per crossing (guarded by the stored eraKey, so a long game converts cleanly instead of drifting between vocabularies or re-converting every turn).

Drift (passive movement)#

Drift is bounded background movement, small enough that a deliberate influence play always outweighs it (computeDrift(), ). NON_ALIGNED_RESISTANCE = 0.5 is defined in drift.ts; the gates and caps are in the table above.

  1. If lead >= 85 the nation is returned unchanged: only a deliberate play outside drift can shift it.
  2. resistance = 0.5 if lead <= 20, else 1. Genuinely uncommitted countries are hard to move.
  3. Per pole: if the pole's own pull is <= 0 it keeps that (negative) value. Otherwise net = max(0, own - strongestRivalPull). Opposing pulls cancel before the cap; allied pulls on the same pole share a key and add.
  4. requested = sum(abs(net)) * resistance. scale = cap / requested if requested > cap, else 1, where cap is PER_NATION_TURN_CAP (5) or the passed CRISIS_TURN_CAP (7.5) for a nation with an open crisis.
  5. next[pole] = share[pole] + net[pole] * resistance * scale, then normalizeShares(). A gain comes out of the uncommitted pool first and only bites a rival pole once that pool is exhausted.

The scale is one vector for the whole nation, so the cap bounds the nation's whole turn, not each pole separately. Overflow above the cap is discarded.

Membership pull#

Belonging to an alignment-channel organization exerts its own small passive pull toward that org's pole (membershipPullForTurn()):

Sanctions erosion#

SANCTIONS_ALIGNMENT_EROSION = 1 (). For each active sanctions organization legislation against a nation, the sanctioning org's pole receives a pull of -1 * channel.weight each turn. It is negative pull, not a push toward a rival: the uncommitted remainder absorbs it and a rival only gains by acting. It is deliberately much larger than one turn of membership pull but still bounded by the cap and resistance like everything else.

Influence plays and aid#

Plays and aid enter the same pull vector as membership pull, so they share the cap, the non-aligned resistance and the locked gate with drift ():

Constant Value
PLAY_MAX_POINTS 10 (ceiling on one play)
MIN_PLAY_POINTS 0.01 (the commit path refuses a smaller spend as below-min-points)
POINT_COST_GDP_SHARE 0.001 (one point costs 0.1% of the target's annual GDP)

pointsForSpend(amountUsd, targetGdpUsd) = min(10, amountUsd / (targetGdpUsd * 0.001)), and 0 for a non-positive spend or an unpriceable target. The pull toward the channel's pole is pointsForSpend * channel.weight, and the phase multiplies it by blocPlayEffectiveness(stress) of the paying org. Aid (queueAidAlignment.ts) can only reach a member and needs a member vote; a play can reach any nation. Aid is retention, plays are acquisition. A conquered nation swings by OUTCOME_SWING = PER_NATION_TURN_CAP (applyConflictOutcomeAlignment.ts) outside the turn vector, and that path does move a locked nation.

Membership eligibility#

standingFor() (membershipEligibility.ts) answers whether a nation can join, or should leave, an alignment-governed organization, measured on the nation's share in that org's pole, not its overall lead.

Crisis constants#

CRISIS_WINDOW_TURNS = 12, TUG_OF_WAR_MIN_SHARE = 25 (crisis.ts); MAX_OPEN_CRISES = 3 and DEFECTION_CRISIS_AT = SUSTAIN_TURNS / 2 = 12 (crisisTurn.ts). A tug of war needs the runner-up share at least 25 and the gap between top two at most ALIGNMENT_GATES.nonAligned (20). A crisis grants nothing itself: it only raises that nation's cap from 5 to 7.5.

Data#

Collection Fields read or written Player-visible
countryAlignments entityId, eraKey, shares, nonAligned, previous, joinReadySince, turn, updatedAt. Written every turn by the phase; previous is the pre-drift snapshot and is null on seed and on crossing Shares, remainder, lead and trend (shown with two decimals via formatShare)
organizationMemberships Read: organizationId, countryId, joinedTurn, wantsOutSinceTurn. Written: wantsOutSinceTurn; removed on defection Membership; the wants-out clock feeds warnings and stress
alignmentPlays Read pending rows (resolvedTurn: null). Written on resolve: resolvedTurn, appliedPoints, effectivePoints, refunded, effectivePoleId Resolved plays are shown to members as what their money bought
alignmentCrises kind, targetEntityId, openedTurn, closesTurn, status, resolvedTurn, retargetedFrom; opened and closed by the phase Crisis desk
sphereMemberships relationships[].alignment, primarySphereId; written through saveSphereMembership() Sphere ledger
organizationLegislation Read: active sanctions rows and sanctionsTargetCountryId Yes, as legislation
organizationProposals Inserted by the accession step (status: "pending", domesticApproved: true) Yes, as a membership proposal
gameState Read: intOrgAlignmentEnabled, year fields Not directly

The phase also writes refunds to the organization fund (creditOrganizationFund). Bloc stress is not stored: it is computed each turn per channel org and returned in the phase result (blocStress, rounded to 3 decimals); the Influence tab recomputes it in queries/orgInfluence.ts.

Configuration#

Setting Default Where set
gameState.intOrgAlignmentEnabled Off (fail-closed: only an explicit true enables) Admin Feature Gates panel; read by featureFlag.ts
Era table ALIGNMENT_ERAS cold-war 1945-1990: poles WEST, EAST; post-cold-war from 1991: WASHINGTON, MOSCOW, BEIJING
Channels, cold-war NATO to WEST, WARSAW_PACT to EAST, each weight 1 and alignmentAccession: true same file
Channels, post-cold-war NATO to WASHINGTON (weight 1, accession true), EU to WASHINGTON (weight 0.6, no accession). MOSCOW and BEIJING have no channel org same file
Player-founded Blocs Add an ORG:<id> pole and a channel with weight 1 and alignmentAccession: true buildAlignmentTopology() in rules/customBlocs.ts, loaded by topology.ts
Opening shares Authored per roster key and preset, with METROPOLE_RETENTION = 0.85, DECOLONISED_RETENTION = 0.3, DEFAULT_LEAN = 34, NON_MEMBER_SEED_CAP = 50

The Commonwealth deliberately carries no channel: stacking it behind NATO gave the West a permanent 1.75-to-1 advantage over the Warsaw Pact that no play could answer. Everything else in the Rules section is a compiled constant, not runtime config.

Timing#

Alignment runs once per turn as the alignment phase (processAlignmentTurn() in , registered in ). It is sequential and runs after the batch that contains the internationalOrganizations phase, because drift reads the organization memberships that phase writes. The settlement phase runs after it and reads live bloc membership; mutualDefence follows, reading alliance membership including alignment defections.

internationalOrganizations (batch)
        |
        v
alignment:  gate check -> load rows, memberships, plays, sanctions
            -> bloc stress per channel org
            -> self-heal missing rows
            -> close due crises, read open-crisis targets
            -> for each nation:
                 era crossing -> membership pull -> sanctions erosion
                 -> plays (x effectiveness) -> computeDrift -> write row
                 -> resolve plays -> sync sphere membership
            -> open new crises on the settled state
            -> defection sweep -> accession requests
            -> resolve orphan plays
        |
        v
settlement -> mutualDefence

With the master gate off the phase returns zeroed counters and touches nothing.

Worked trace#

A two-pole (1955) NATO member holds WEST 52, EAST 30, nonAligned 18, with no open crisis. The Warsaw Pact commits a play of USD 120 million against it; the target's annual GDP is USD 20 billion. The Warsaw Pact's stress is 0.225 (10 members: 3 contested, 2 wanting out, 1 digesting).

  1. Stress: 0.45 * 0.3 + 0.35 * 0.2 + 0.20 * 0.1 = 0.135 + 0.07 + 0.02 = 0.225 (Settled). Effectiveness 1 - 0.4 * 0.225 = 0.91.
  2. Era crossing: stored key is cold-war, no change.
  3. Membership pull (NATO, weight 1): max(0, min(0.04, 67 - 52)) = 0.04 on WEST. This is the background vector.
  4. Play: pointsForSpend = min(10, 120,000,000 / (20,000,000,000 * 0.001)) = 120,000,000 / 20,000,000 = 6. Times weight 1 and 0.91 gives 5.46 pull on EAST.
  5. Drift: lead = 52 - 30 = 22, so not locked (85) and not in the band (20), resistance 1. Net WEST = max(0, 0.04 - 5.46) = 0; net EAST = max(0, 5.46 - 0.04) = 5.42. requested = 5.42 > cap 5, so scale = 5 / 5.42 = 0.9225; EAST delta = 5.42 * 1 * 0.9225 = 5.00.
  6. Shares: EAST 35, WEST 52; normalizeShares leaves nonAligned = 100 - 87 = 13. The gain came out of the uncommitted pool.
  7. Play record: appliedPoints = 5.46 (pre-cap, rounded to a hundredth), effectivePoints = 5.00 (the observed gain; the background pull on EAST is 0, so the play takes all of it), refunded: false.
  8. Result: new lead 52 - 35 = 17, so the nation is now in the non-aligned band. NATO share 52 is above LEAVE_SHARE 40, so no wants-out clock. primarySphereFor() needs lead 50, so there is no committed sponsor; with 2+ sphere relationships the primary falls back to the highest-alignment one (projected 0.52 for the US, 0.35 for Russia).

If the nation had an open crisis, cap = 7.5 and the full 5.42 would apply, giving EAST 35.42.

An era crossing for the same row on 1991: WEST 52 -> WASHINGTON 52, EAST 30 -> MOSCOW 30, BEIJING 0, nonAligned 18; previous is set to null for that turn, and the join gate becomes 40.

Edge cases and limits#

Invariants#

Failure and recovery#

Connections#

Driven by:

Affects:

International organizations and their alignment channels are defined in .

Tests#

Gaps: no test for the exact sanctions-erosion magnitude against a mixed-weight channel set, and no test that scans for writes that bypass normalizeShares().

Known issues and history#

Last checked: 2026-10-29, version 1.18.0

Ask