Concepts → Luck and streak protection
Luck pools and streak protection — variance reduction without changing the mean
Hard West has an explicit Luck Bar. XCOM 2 has a hidden streak protection mechanic. Both share the same mathematical structure: cross-attempt state that modulates per-attempt hit chance based on prior outcomes. The user-visible effect: variance shrinks without the mean changing in the limit. The engine models both via a state-carrying Markov walk over the per-attempt distribution.
The core idea: state breaks independence
In the standard probability model, every attack roll is independent. P(hit) is fixed; whether the prior shot hit or missed has no bearing on the current one. Convolution of N independent attempts gives the chain damage distribution.
Streak protection / Luck pools break that. The per-attempt P(hit) depends on cumulative state — typically:
- Streak protection (XCOM 2-style): consecutive misses boost the next shot's hit chance. Hit resets the streak; another miss advances it.
- Luck pool (Hard West-style): a pool of "luck" that depletes on hits and refills on misses. Higher pool = bigger boost to the next attempt.
Both produce the same user-visible outcome: misses are anti-correlated with future misses. You can't realistically miss six 70% shots in a row — the engine pushes you back toward your "fair" hit rate.
The math: state-carrying Markov walk
Each attack expression carries a streak rule that defines:
- An initial state (e.g., "no misses yet" or "full luck pool")
- A modulate function:
(state, base_P_hit) → adjusted_P_hit - A transition function:
(state, outcome) → next_state
The engine evaluates the chain as a Markov walk over a joint
(state, cumulative_damage) distribution. Per
strike, branch into hit / crit / miss outcomes weighted by
the modulated per-state probabilities; transition state per
outcome; aggregate. Marginalize over end-state for the damage
PMF.
This is exact (not Monte Carlo) — the Markov chain over a bounded state space (Luck pool 0..=5, miss streak 0..=N) evaluates in closed form for any N strikes.
The user-visible contract: variance reduction
The mean damage stays the same (linearity of expectation; the modulator preserves expected value in equilibrium). What shrinks is variance — specifically the probability of "all misses." For a 5-attempt chain at 50% hit chance:
| Chain | Mean | P(all-miss) | Strike URL |
|---|---|---|---|
| Independent (no state) | ~25 | ~3.1% (0.5⁵) | /strike/1d10~hit50attacks5 |
| Streak protection | ~27 | much lower (state boosts later attempts) | /strike/1d10~hit50attacks5streak |
| Luck pool (starts full) | ~35 | much lower (first attempt at 75% from full pool) | /strike/1d10~hit50attacks5luck |
The "luck" version's higher mean isn't the modulator "cheating" — it's that LuckPool starts at full pool (max boost on the first attempt), which biases the chain mean up. Streak protection starts neutral (no boost on first attempt) and only kicks in after misses, so its mean stays close to independent.
The variance reduction is the user-visible feature both modulators provide: the "all-miss" tail of the distribution shrinks substantially in both cases.
Engine grammar
Two postfix keywords on attack chains:
<attack> @ hit P% attacks N streak
Adds XCOM 2-style streak protection — no boost on first attempt; +10% / +20% / +30% / +40% per consecutive miss (capped at the 4-miss state). Approximate community-derived ladder; exact game formula isn't officially documented.
<attack> @ hit P% attacks N luck
Adds Hard West-style Luck pool — pool of 5 capacity, +5% per pool unit (full pool = +25% boost on next attempt), each hit consumes 1 luck, each miss refunds 1. Approximate Hard West shape; exact game formula isn't officially documented.
Build planning: when does streak protection matter?
The variance reduction matters most when:
- You need a guaranteed kill window: clearing a turn-critical objective where 1-2 misses cascade into a wipe. Independent chains might whiff; streak protection bounds the worst case.
- Chain length is moderate (3-7 attacks): too few attempts and state doesn't have time to evolve; too many and the variance reduction relative to the long-run mean becomes a smaller fraction.
- Base hit chance is in the 30-70% range: below 30% even streak protection can't save you; above 70% the mean is already high and miss streaks are rare anyway.
Streak protection / Luck doesn't change the mean (much). What it changes is the SHAPE of the damage distribution — fewer catastrophic-miss outcomes, slightly more typical-roll outcomes. For tactical games where one bad turn is the difference between winning and losing, that shape matters.
What the engine doesn't model yet
The streak/luck modulators ship as standalone chain expressions. Composition with other engine features is partial:
- Composition with sneak / oncrit / bonus chains: not yet. Each chain layer would need its own state-walk extension. Future increment if a build genuinely combines streak protection with crit-fish or bonus-attack mechanics.
- Composition with cascade chain: not yet. Cascade and luck would need a joint state space (target_idx, luck_pool). Phase 4b inc 6 work.
- Composition with rounds_to_kill: not yet. Multi-round HP-vs-luck-pool joint Markov chain is the same substrate as cascade composition. Same future increment.
- Cross-encounter state persistence: each StatefulChain expression starts fresh. Real games may carry Luck pool across encounters or refresh per turn. Our model is per-chain (per-encounter, in tactical-game terms).
Why the formulas are "approximate"
Hard West's exact Luck consumption and refund formulas aren't
published in any official source we've verified. Community
datamining of XCOM 2's ConfigCharacter.ini
reveals the streak boost parameters but not the precise
activation thresholds. The presets here capture the
structural shape of both mechanics — pool depletes/refills,
streak boosts after misses — without claiming exact game
constants.
The math substrate (state-carrying Markov walk) is exact. The specific parameter choices (boost magnitudes, pool size, consumption rates) are documented approximations. Future ships can refine the parameters with verified sources or add explicit per-game presets.