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

Non-Player Politicians (NPPs)

Last updated 2026-10-29
Player wikiNPPs Overview
Source files

Player guide: NPPs Overview

Summary#

NPPs are AI-controlled politicians who keep the world populated and politically active even when there are not enough players to fill every office. They can hold office, enter elections, vote on legislation, join caucuses, receive party pressure, and endorse candidates (only when a player asks).

The player-facing companion is npp-opponents.md.

Rules#

Personality traits#

Trait Range Current role in gameplay
loyalty 0 to 100 Party-discipline pressure, Slate acceptance, whip compliance, caucus stability
ambition 0 to 100 Reserved for deeper challenger tuning; current entry is mostly deterministic (challengers are weighted by officeSeekingMult from the career-archetype model instead)
stubbornness 0 to 100 Resistance to influence, Slate assignments, whips, and cooperation asks

Whip compliance (): compliance = (loyalty / 100) * 0.7 + (1 - stubbornness / 100) * 0.3. Missing personality values default to 50.

Constants#

Constant Value Source
NPP_POLITICAL_INFLUENCE_FLOOR 10 (decay never takes an NPP below it) shared/constants/formulas.ts
NPP_PRIMARY_SCORE_MULTIPLIER 0.5, when a player is in the NPP's party primary src/lib/electionEngine/constants.ts
NPP_GENERAL_WEIGHT_MULTIPLIER 0.8, when a player is in the race src/lib/electionEngine/constants.ts
NPP_STAGGER_EXTRA_MULTIPLIER 0.6, stacking with the above to 0.48 in presidential primary stagger waves src/lib/electionEngine/constants.ts
Cross-pressure verdict threshold VERDICT_THRESHOLD = 5: abstain when the sum is within -5 to +5
Force clamp -100 to 100 each, applied before summing
Compliance weights loyalty 0.7, pliability (1 - stubbornness) 0.3
Party whip base hard 60, soft 30, multiplied by 1 + cabinetDiscipline (0 to 0.2) and then compliance ,
Caucus whip base soft 40 (the resolver uses 40 for any caucus whip), +20 when it matches a caucus core position
Party-line default 20 times compliance, added to ideology
Local force weights ideology 1, whip 1, district 1.35, donors 0.65
Federal force weights 1 on every force
ADDRESS_AGENDA_FORCE_BIAS 8, added to ideology on a bill sponsored by the leader's party in an emphasized category
Hard whip willingness 55 + round(loyalty * 0.35) - round(stubbornness * 0.18) + mode bonus + Statecraft bonus, held to 40 to 95. Mode bonus hard 15, soft 6
Endorsement relationship gate 40 + min(10, abs(econ diff) + abs(social diff))
NPP_ENDORSEMENT_DIRECT_FAVORABILITY_PER_ENDORSEMENT / _CAP 1.5 per endorsement, capped at 6
Candidate influence fallback 10 when the stored value is missing or not finite src/lib/electionEngine/candidateEnrichment.ts
NPP_RELATIONSHIP_DECAY_PER_TURN 0.1 toward 0
CAUCUS_NPP_RECRUIT_MIN_RELATIONSHIP 60
CAUCUS_NPP_RETENTION_MIN_RELATIONSHIP 20
CAUCUS_NPP_RECRUIT_COOLDOWN_TURNS 12
Slate acceptance loyalty at least 40 and stubbornness at most 70 (local leaders get leeway)
CHALLENGER_BASE_PROBABILITY 0.15, times officeSeekingMult, times 0.5 in player-enabled countries
NPP_CHALLENGERS_PER_COUNTRY_PER_PASS 2
NPP_SPONSOR_ACTIVE_CAP / _COOLDOWN_TURNS 2 active bills / 12 turns (player-enabled countries: 1 / 36) ,
Party NPP capacity tiers 5 slots per member for members 1 to 5, 4 for 6 to 10, 3 for 11 to 20, 2 beyond
NPP ceiling max(25, 6 * regionCount)
Active member at least 2 actions in the last 14 days, not banned
Unknown race type priority 999 (last)

Entry rules#

Current NPP entry is deterministic and priority-based. An NPP can be filed only when:

Presidential entry is blocked by default. SP3 lifts the bar only in autonomy-active, non-player-enabled countries, where no player can contest the presidency (, ); direct Russian first-round ballots are the other exception. One-party states additionally restrict who can file ().

Entry order#

NPP filing runs in a deliberate order inside processElectionEntry:

  1. Defending incumbents auto-file first for the seat they already hold.
  2. Accepted Slate NPPs file next, even if this creates a same-party primary against a defending incumbent.
  3. Fallback fill adds at most one generic same-party NPP to an otherwise open primary, in RACE_PRIORITY order.
  4. Consolidation (autonomy v6): in the closing window of a primary with no player in it, a clearly trailing non-incumbent NPP withdraws and gets a cooldown.
  5. Ambitious challengers (autonomy v3 and above): for a primary with exactly one active same-party candidate, a seeded roll random < 0.15 * officeSeekingMult * countryMult adds one second same-party NPP. Capped at 2 per country per pass, and a lone player candidate is challenged at most once per election.

Priority order for generic fallback fill#

Race priority (highest first)
stateSenate
regionalCouncil
peoplesCongress
republicSupremeSoviet
landAssembly
sangiin
house
milletMeclisi
commons
special_commons
senate
senato
shugiin
npcDelegate
supremeSovietDeputy
nationalitiesDeputy
unionCongressDeputy
governor

Source: RACE_PRIORITY in (18 types). Snap variants share their regular race's priority.

Cooldowns and dropout#

Bill voting#

Handled by (federal bills in bills), (state and regional bills in stateBills, voted by the country's sub-national legislature, for example stateSenate and regionalCouncil), and .

Each vote is the deterministic sum of four signed forces, each clamped to -100 to 100:

Force Formula
ideology clamp(alignment * 100), where `alignment = clamp(dot(NPP policies, bill vector) / (
whip clamp((party whip +-60 or +-30, times 1 + cabinetDiscipline) + (caucus whip +-40, +-20 on core position)) * compliance
district clamp(sum over home-state archetypes of (group population / total) * approval of the selected option)
donors clamp(donorBaseLevel / 5 * alignment * 100), 0 when the donor level is 0 or the bill is not policy-coded

Verdict: total above +5 is for, below -5 is against, otherwise abstain. After the forces are computed:

Federal versus local weighting. Federal voting uses weight 1 on every force. Local voting weights home-region pressure more heavily and donors more lightly (district 1.35, donors 0.65).

Whips in auto-voting. Party whips are found by resolveWhipForNPP: a state-party whip wins over a national-party whip for in-state NPPs, and a national whip applies only when the state party has no player chair or vice chair. hard contributes 60, soft 30. Caucus whips are scoped to caucus members only, but see Known issues.

Immediate whips versus autonomous resolution. The Whip Room can also apply a hard NPP bill whip immediately with a hidden roll (resolveNppWhipSuccess). On success the vote is written at once. A soft whip forces nothing and only shifts later autonomous cross-pressure.

Multi-seat weighting. An NPP holding multiple seats contributes its weight to the tally: seatsHeld for state chambers, and the mandate weight from aggregateNppMandateWeights for federal chambers. One vote per NPP per bill chamber; an NPP that has already voted is skipped.

Leadership voting#

US congressional leadership elections are player-only for NPP behaviour. NPPs do not autonomously vote in Speaker, House leadership, or Senate leadership elections; the NPP turn pass reports speakerVotes: 0. castLeadershipVote in is shared infrastructure used when a player's whip routes direct NPP votes ().

Influence system#

The NPP profile panel offers a deterministic player-to-NPP surface in . There is no hidden-roll request table.

Action Actions Campaign funds Relationship gate Effect
request_endorsement 6 $0 hidden, 40 to 50 Creates or refreshes an arranged endorsement
private_meeting 3 $0 at least -50 +5 relationship
boost_favorability 5 $10,000 none +3 favorability, +2 relationship
reduce_favorability 5 $10,000 at least -100 -3 favorability, -2 relationship
boost_influence 6 $20,000 none +2 influence, +2 relationship
reduce_influence 6 $20,000 at least -100 -2 influence, -2 relationship

Direct interactions spend the player's actions and campaign funds, and are deterministic once resource gates and the hidden endorsement check are met. Positive relationship and favorability gains are multiplied by the player's charisma (statMultiplier(stat) = 1 + (stat - 5.5) * 0.04, rounded). They write to the capitalActionLogs audit trail and roll back fully on failure.

Party-led NPP management#

See party-influence.md for the party-side surface.

Party whips#

See party-whips.md for the full whip design. For NPPs: a hard bill whip uses the hidden willingness roll above; a soft whip is advisory pressure only. Active non-compliance is surfaced through Defiance views rather than a permanent shame ledger, and defiance disappears if the NPP later votes back into line.

Endorsements#

Endorsements are manual-only for NPPs. They do not organically endorse, switch, or re-evaluate campaigns in the turn system. Any legacy organic row is withdrawn on the next turn (manual_only).

Caucus interaction#

Party NPP capacity#

A party's NPP allowance grows with active members. The first 5 members add 5 slots each, the next 5 add 4, members up to 20 add 3, and later members add 2, capped at the country ceiling max(25, 6 * regionCount) (calculatePartyNppCapacity, calculateNppCeiling). Examples: 4 members give 20 slots, 8 give 37, 20 give 75, 30 give 95.

Data#

Core fields (npps collection)#

Field Type Description Visible to players
name string Procedurally generated politician name Yes
countryId CountryId Country ownership; always required for cross-country safety Yes
homeState string Home state, region or prefecture key Yes
party string Party slug or sequential-id-backed party reference Yes
avatarUrl string? Optional portrait URL Yes
politicalInfluence number 0 to 100, decay floor of 10 Yes
favorability number 0 to 100 Yes
policies PolicyPositions economic, social (-5 to +5) and optional domainPositions Yes
currentOffice OfficeType or null Current office held, if any Yes
personality NPPPersonality loyalty, ambition, stubbornness Partly (Slate and whip outcomes)
donorBaseLevel number? 0 to 5, scales the donors force Yes
electionCooldowns Record<string,string> Election re-entry lockouts (ISO expiry) No
retiredAt Date or null Retirement marker Yes
isTechnocrat boolean? Excluded from entry, voting, action AI and fund generation No
funds, actionPoints number? Resources for the action AI No
archetypeApprovals Record<string, number>? Per-group approval modifiers, decay 0.5 percent per turn No

Other collections#

Collection Read or written
electedOfficials Read: seats held by each NPP, seatsHeld, officeType
electionCandidates Written: NPP candidacy docs (isNPP, nppId) on filing; read for duplicates
elections Read: open primaries, primaryEndTurn, primaryEndTime
bills, stateBills Read open bills; written: votes.npp_<id>, votesFor/Against/Abstain (and the other-chamber and override equivalents)
nppVotePredictions Written: forces, donorsLabel, verdict, resolvedVote, computedAtTurn, keyed by NPP and bill or state bill
billWhips Read: party and state whips by bill
statePartyOrg Read: regional presence and leadership
nppRelationships Read and written: relationshipScore (-100 to 100), attempt counters
capitalActionLogs Written: direct action audit rows
nppEndorsements Read and written: arranged endorsements and their withdrawal reason
caucuses, caucusMemberships Read and written: NPP membership and removal
characters Written: actions and funds on a direct action
governorAddresses Read: active agenda effects
stateDemographics Read: home-state group populations for the district force
gameState Read: autonomy level, preset

Configuration#

Setting Effect Default and where set
gameState.nppAutonomyLevel (off, v0 to v6) Gates challengers (v3), opposition behaviour (v1), engine 6 features (v6: consolidation, government whip, business interest, presidential challengers) and presidential entry off; v0 when only the legacy nppAutonomyEnabled boolean is set. Read through getNppAutonomyLevel (). NPP_ENGINE_LEVEL is v6 ()
Player-enabled country Halves challenger rate, tightens sponsorship limits, blocks NPP presidential entry isCountryEnabledForPlayers (src/lib/countryAccess)
Difficulty behaviour policy oppositionCoordination scales the opposition bloc force; hosted and multiplayer worlds use normal (1) loadNppBehaviorPolicy ()
statePartyOrg.hasPresence Gates new NPP candidacies in a region Per region and party row
Government type One-party states restrict who can file and vote CountryConfig.governmentType ()
Office partyStrengthWeight Not an NPP setting; see national-metrics.md per country institutions files

Timing#

NPP work is spread across several named turn phases (registry in , order in ):

nppRelationshipMaintenance   relationship drift + caucus retention
nppBillSponsorship           NPP-sponsored bills
generateChallengers          challenger supply
nppBehavior                  processNPPTurn:
                               mortality -> context load -> slate sync -> slate responses
                               -> election entry -> endorsement cleanup
                               -> federal bill voting -> local bill voting
playerEndorsementPartySweep
billLifecycle                NPP votes are already in before bills resolve
nppActionProcessing          action AI, every 4 turns per NPP
primaryResolution
electionResolution           closes the races NPPs entered

Player influence actions run at request time, not in the turn. They spend actions and funds immediately and write to capitalActionLogs. Slate responses run before election entry so accepted Slate rows are ready for the filing pass.

Worked trace#

Cross-pressure vote. A federal bill carries a provision with policy vector (economic 3, social 4), so |vector| = 5. The sponsor is in party P. Three NPPs vote.

NPP A (party P, economic 4, social 2, loyalty 80, stubbornness 40, donor level 3), hard party whip For, home-state option approval -20:

Force Calculation Value
compliance 0.8 * 0.7 + (1 - 0.4) * 0.3 = 0.56 + 0.18 0.74
ideology projection (4 * 3 + 2 * 4) / 5 = 4; alignment 4 / 5 = 0.8; 0.8 * 100 80
whip 60 * 0.74 44.4
district weighted approval -20
donors 3 / 5 * 0.8 * 100 48
total 80 + 44.4 - 20 + 48 152.4, for

NPP B (economic -2, social -4, loyalty 50, stubbornness 50, donor level 3), same hard whip For: compliance 0.5; projection (-2 * 3 + -4 * 4) / 5 = -4.4, alignment -0.88, ideology -88; whip 60 * 0.5 = 30; district -20; donors 3 / 5 * -0.88 * 100 = -52.8. Total -130.8, so against despite the whip. In a state chamber the same inputs give district -27 and donors -34.32, total -119.32.

NPP C (party P, loyalty 50, stubbornness 50, donor level 0), no whip, alignment -0.1: ideology -10 plus party line 20 * 0.5 = +10 gives 0; district +3; donors 0. Total 3, within -5 to +5, so abstain. On a veto-override bill the abstain becomes against.

Each vote is stored in bills.votes.npp_<id>, the weighted tally is incremented, and the force vector is upserted into nppVotePredictions.

Endorsement. Player policies (+3, -2), NPP policies (+2, -1): distance abs(2 - 3) + abs(-1 - -2) = 2, so the gate is 42. The relationship starts at 30. Two private_meeting (+5 each, neutral charisma, 6 actions) reach 40; two boost_favorability (+2 relationship each, 10 actions, $20,000) reach 44. The check passes (likely_accept), request_endorsement (6 actions) creates an arranged endorsement. Total 22 actions and $20,000. In the election, the endorsed candidate gets +1.5 favorability (one endorsement) in candidate enrichment. The relationship then drifts down 0.1 per turn.

Entry. In a House primary where defending NPP I, accepted Slate NPP S and generic same-party NPP G are all eligible: I files in step 1, S in step 2, G is skipped in step 3 because the party already has an active candidate. The challenger pass skips the race because it already has two active candidates. In an open primary with no candidate, G fills it; at v3 in a non-player country the chance of a second same-party challenger is 0.15 * officeSeekingMult (0.15 at multiplier 1), and 0.075 in a player-enabled country.

Edge cases and limits#

Invariants#

Invariant Enforced by
Verdict is a pure function of the four forces; the same inputs give the same vote , crossPressure.v2.test.ts
Each force is within -100 to 100 clamp100 in crossPressure.ts; tested in crossPressure.test.ts
An NPP votes at most once per bill and chamber Skip on existing vote in billVoting.ts and stateBillVoting.ts; the federal case is tested in billVoting.test.ts ("skips an NPP that already voted")
An NPP never votes on another country's bill Country guard in billVoting.ts; billVoting.test.ts (#0699)
An NPP is in at most one active race Upsert keyed on { characterId, status: "active" }; tested in electionEntry.test.ts
No ambitious challenger below autonomy v3 electionEntry.test.ts
Direct actions cannot overdraw actions or funds; relationship stays in -100 to 100, favorability and influence in 0 to 100 Conditional update and clamps in ; validation in
Endorsement gate is 40 + min(10, distance)
Party NPP capacity respects tiers and ceiling
Caucus retention floor and relationship drift
Every counted vote has a stored forecast row Not enforced; the bulk write after the bill update is not in the same transaction

Failure and recovery#

Connections#

Driven by:

Affects:

Related docs:

Tests#

Area Test files
Cross-pressure forces and verdict ,
Federal and state voting , ,
Entry and priority , ,
Challenger rails
Slate
Endorsements ,
Direct actions ,
Whip willingness
Party capacity
Caucus upkeep
Mortality
Influence floor shared/constants/formulas.test.ts

Gaps: no test drives a full processNPPTurn from entry through votes; the caucus whip path is untested end to end because no caller feeds it; the charisma scaling of direct actions has no dedicated test.

Known issues and history#

Last checked: 2026-10-29, version 1.18.0

Ask