RPG Stats & Debates
The RPG Stats system is an optional gameplay layer that gives characters measurable attributes affecting debate performance, election efficacy, and long-term ideological drift. The system is gated behind a single feature flag — when disabled, the entire layer is inert and the game plays as a pure political simulation.
Feature Flag
The master gate is isRpgStatsEnabled() in src/lib/stats/featureFlag.ts. It reads gameState.rpgStatsEnabled from the database and returns a boolean.
| State | Behavior |
|---|---|
false or absent | System is inert — creation doesn't allocate stats, grandfathered characters aren't prompted, Debate Prep and election debates are unavailable, all efficacy/drift hooks stay neutral |
true | Characters get stats that affect debate performance, election efficacy, and drift over time |
Because the flag is a single boolean on the gameState document, admins can flip the system on or off at any time. When off, no character has a stat block, so every downstream hook short-circuits cleanly without runtime errors.
What RPG Stats Affect
When enabled, the RPG stat layer touches three distinct gameplay loops:
1. Debate Performance
The Debate Prep action and election debates are only available when RPG stats are enabled. Stats determine how well a character performs in a debate:
- Higher relevant stats improve debate performance scores
- The debate engine reads the character's stat block to compute performance
- Election debates between candidates resolve using stat-driven scoring
When the flag is off, the Debate Prep action is hidden from the actions page and election debates are never scheduled.
2. Election Efficacy
Stats modify a character's election efficacy — how effectively they translate campaign resources (ads, canvassing, fundraising) into vote share. A character with high relevant stats gets more votes per dollar spent than a character with low stats, all else equal.
When the flag is off, efficacy hooks stay neutral — all characters use the baseline efficacy formula with no stat modifiers.
3. Drift Over Time
Stats drive long-term ideological drift. Characters with certain stat profiles shift their political positioning over time based on their stat allocations. This creates dynamic NPP behavior — characters aren't static ideologues, they evolve.
When the flag is off, all drift hooks are neutral — characters retain their original ideological positions indefinitely.
Integration with PREE
The RPG stats system integrates with the Player Random Events (PREE) driver. When both flags are enabled:
- The PREE driver calls
isRpgStatsEnabled()at the start of each turn - If true, the driver processes election debates — rolling debate challenges and resolving overdue debate sessions before offering normal random events
- Characters locked into an election debate this pass are excluded from the standard random-event offer loop (the "supersede" rule) — a debate takes precedence over a standard event
- If RPG stats are off, the debate-processing step is skipped entirely and all eligible characters receive normal event offers
This means the two systems are coupled: enabling RPG stats activates debates, and debates consume the "event slot" that would otherwise go to a standard PREE event.
Grandfathered Characters
When the flag is flipped from off → on mid-game, existing characters don't have stat blocks yet. The system handles this through a grandfathering prompt:
- When
rpgStatsEnabledtransitions totrue, grandfathered characters are prompted to allocate their stats - Until they do, they operate with baseline (neutral) stats
- The prompt is only shown when the flag is on — when off, no prompt appears
When the flag is off, grandfathered characters are never prompted and creation doesn't allocate stats — the system is fully inert.
Strategic Implications
| Decision | Impact |
|---|---|
| Play with RPG stats off | Pure political simulation — no debates, no stat-driven efficacy, no drift. Campaigns are purely about fundraising, ads, and positioning. |
| Play with RPG stats on | Debates become a decisive election tool — high-stat characters outperform in debates and gain vote share. Drift creates dynamic NPP behavior over long games. |
The flag is a game-admin decision, not a per-player choice. Once on, it applies to all characters in the game.
Related Systems
- Player Random Events — PREE driver integrates with RPG stats for debate scheduling
- Crisis Interaction — Separate feature flag, independent of RPG stats
- Election Mechanics — Debates are an election-phase activity gated on RPG stats
- Core Systems — Turn structure, action economy