A House Divided A House DividedDocumentation
↵
Changelog
Game Design/Elections & Campaigns

Demographics & Targeting

Last updated 2026-10-29
Player wikiDemographics & Targeting
Source files

Summary#

Player guide: Demographics & Targeting. Also see Demographics and Canvassing.

Understanding voter demographics is key to winning elections. Each state has a unique demographic profile that determines which candidates appeal to which voters. This page is the strategy-level technical summary: which constants matter when choosing where to spend actions. Full formulas and sources for the census itself are in Demographics.

Note on the live model: the electorate that actually casts votes is a granular census lattice of cells, not 12 archetypes, see Granular Electorate (as shipped). The archetypes (Young Renters, Evangelicals, Rural Traditionalists, Union & Trades, Soccer Moms, College Liberals, Small Business, Public Sector, Retirees, Libertarians, New Americans, Secular Professionals) are legacy authoring vocabulary that gameplay effects (approvals, legislation, GOTV) are still keyed by; they project onto the real electorate via src/lib/demographics/archetypeBucketMap.ts rather than having independent vote logic.

Why cells: a single archetype lump hid that, for example, a young voter and a rural voter can be the same person. Cells let a voter belong to one bucket of every census dimension at once (race, age, education, wealth), so turnout and appeal act on real overlaps.

The per-archetype lean table that used to sit here is removed: those numbers are authoring defaults that differ by country and are not live vote inputs. Live leans come from the era census tables in src/lib/demographics/.

Rules#

How Demographics Affect Elections#

  1. Reach: your Political Influence determines how many voters you can reach: sqrt(min(100, max(0, PI)) / 100) (normalizeNPI in ). PI 25 gives 0.5, PI 50 gives 0.707, PI 100 or more gives 1.0.
  2. Appeal: policy alignment between your positions and each cell's leans (). APPEAL_POSITION_EXPONENT = 1.5, APPEAL_POSITION_FLOOR = 0.5, MAX_APPEAL = 50.
  3. Turnout: each bucket has a baseline turnout rate modified by canvassing and GOTV.
  4. Vote share: cells where you have high appeal and they have high turnout give you more votes.

Turnout System#

Each demographic bucket has a turnout modifier from -20 to +20 points (TURNOUT_CAP = 20, ). Two parallel modifier sets are kept (see Data): the current-rules set campaignModifiers and the legacy set modifiers.

Targeting decisions#

Action Effect Cost Best when
Canvass a bucket 2 × fit² (× 2 closing) turnout points, immediate 100 funds, 1 action Your positions sit close to the bucket and a race ends within 4 turns
Party GOTV spend / 5000 × alignment points per turn percent of party revenue, 0 to 25 percent Sustained, passive support for one bucket the party aligns with
Targeted ad Capped competitive bonus, AD_BONUS_CAP = 0.25, AD_BOOST_PER_ACTION = 0.01 per action, 24 turn half-life (AD_HALF_LIFE, rules.ts) 100 funds (AD_FUNDS_PER_ACTION), 1 action (AD_ACTION_COST), up to 50 per buy (AD_MAX_ACTIONS) You need persuasion rather than turnout
Poll Reveals appeal and turnout per bucket see Stats & Actions Before committing any of the above

A bucket that loves you but does not vote is worth nothing, and a bucket that votes but sits far from you gains little from canvassing (fit floor 0.2 gives a boost of only 2 × 0.2² = 0.08 points).

Ad bonus mechanics (rules.ts): a purchase sets bonus = min(0.25, current + 0.01 × count) and stamps lastPurchaseTurn; exposure then halves every 24 turns (adExposure). A cell's bonus is 0.25 × (1 - Π(1 - coverage × campaignResponse)) over all live ads, where coverage = exposure / 0.25. campaignResponse multiplies the candidate's fit to the audience, the candidate's fit to the cell, a cross-identity agreement = 0.25 + 0.75 × exp(-conflict / 12.5) and the audience cohesion = 0.5 + 0.5 × exp(-variance / 4.5).

Ideology-Modulated Leans#

Some groups (Retirees, Soccer Moms, Union & Trades, Rural Traditionalists) shift their leans based on state ideology composition. A conservative state will push these groups further right; a progressive state pushes them left.

State Political Lean#

State lean is a turnout-weighted average of all group leans (calculateStateLean, ): each group's weight is population share × turnout × category weight, and a category the region does not weight contributes 0. The display value is getDisplayLean: the average of the two axes when they share a sign, otherwise the stronger axis. The label rounds the lean to the nearest whole step on the -5..+5 ruler (Far Left, Strong Left, Left, Lean Left, Center-Left, Centrist, Center-Right, Lean Right, Right, Strong Right, Far Right, getEconomicPositionName in ). Any lean under 0.5 in absolute value reads Centrist, so most states do. Full table in Demographics.

Data#

Collection / field Read or written Notes
stateDemographicTurnout (StateDemographicTurnout, ), one doc per region, _id is the region id read and written modifiers (legacy set), campaignModifiers (current rules), campaignContactModifiers (canvassing-only part, kept for participation receipts), lastDecayApplied, lastUpdated. Each is category -> group -> number in -20..+20. Turnout effects are visible to players through polls and the Demographics tab, not as raw modifiers.
partyBudget (PartyBudget, ) read; spend recorded gotvBudgetPercent (0 to 25), gotvTargetCategory, gotvTargetGroup, scope (national or state), stateId, plus the suppression and registration equivalents. The deprecated gotvBudgetPerTurn is only used when the percent is 0. Visible to party officers.
characters written by canvassing and ads actions and the campaign funds balance (funds, or currencyBalances.campaign under forex) debited; targetedAds and targetedAdsRevision hold standing ads.
elections and electionCandidates read; ads written campaignRulesVersion selects the rule set; targetedAds on a candidate holds {stateId, dimension, bucket, bonus, lastPurchaseTurn}.
moneyFlowReceipts written One receipt per canvass keyed by the Idempotency-Key header, used for crash-safe replay.
politicalParties written National GOTV and suppression spend is deducted from the party treasury.

Configuration#

Setting Default Where set
CAMPAIGN_RULES_VERSION 1 . Stamped on newly inserted elections by withCampaignRules; races already in progress are never retrofitted.
TURNOUT_CAP, TURNOUT_HALF_LIFE, CANVASS_BASE_BOOST 20, 6, 2 rules.ts
AD_BONUS_CAP, AD_HALF_LIFE, AD_BOOST_PER_ACTION, AD_MAX_ACTIONS, AD_ACTION_COST, AD_FUNDS_PER_ACTION 0.25, 24, 0.01, 50, 1, 100 rules.ts
DOLLARS_PER_TURNOUT_POINT 5000
gotvBudgetPercent, suppressionBudgetPercent per party, validated 0 to 25 party treasury-plan routes under src/app/api/country/[code]/
Legacy decay DECAY_RATE 0.02 , used only for the legacy modifiers set
Forex campaign rate 1 when forex is off isForexEnabled and campaignLocalRate; the 100 funds anchor is converted to the campaign currency when forex is on
Native vs legacy canvass targets per race canUseNativeCanvassTargets (). A race on legacy rules only accepts its original demographic groups.

No era or country preset changes these constants. Country differences enter through the census buckets and leans (src/lib/demographics/countryDemographics.ts).

Timing#

Decay and GOTV run once per turn inside the demographicsAndPartySetup phase (); canvassing and ad purchases are immediate API actions between turns.

player canvass (API)  -> campaignModifiers / modifiers += boost   (immediate)
player ad buy (API)   -> candidate.targetedAds updated            (immediate)
turn N:
  turnoutDecay   (applyDecayToAllStates)   all regions decay
  partyGOTV      (processPartyGOTV)        GOTV and suppression applied on decayed values
  partyOrgTurn ... (later steps in the same phase)
vote resolution reads campaignModifiers and ad bonuses  (src/lib/elections/resolveElection.ts)

Decay runs before GOTV in the same turn, so a fresh GOTV boost is not decayed until the next turn. A canvass made between turns is decayed at the next turn start.

Worked trace#

A candidate at economic 2, social 1 canvasses an audience at economic 3, social 3 three times, outside the closing window, starting from a modifier of 0. Cost is 300 funds and 3 actions.

Step Calculation Result
Squared distance ((2 - 3)² + (1 - 3)²) / 2 2.5
Fit 0.2 + 0.8 × exp(-2.5 / 18) = 0.2 + 0.8 × 0.8703 0.8963
Boost per canvass 2 × 0.8963² 1.6066
After canvass 1 0 + 1.6066 × (1 - 0/20) 1.6066
After canvass 2 1.6066 + 1.6066 × (1 - 1.6066/20) 3.0841
After canvass 3 3.0841 + 1.6066 × (1 - 3.0841/20) 4.4429
Six turns later 4.4429 × 2^(-6/6) 2.2214

The stored campaignModifiers[category][group] is 4.4429 after the third canvass, and the same bucket in campaignContactModifiers records the realised 4.4429 (clamped to +/-20). If a qualifying race ended within 4 turns the per-canvass boost would be 3.2131.

GOTV example: a state budget with revenue 50,000, gotvBudgetPercent = 5 spends floor(50,000 × 0.05) = 2,500. Party at (1, 1) targeting a bucket at (2, 2.5): distance 2.5, alignment 1 - 0.15 × 2.5 = 0.625, boost 2,500 / 5,000 × 0.625 = 0.3125 points.

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