Sub topic 8
Push-your-luck mechanics and stopping rules
This chapter assumes you know expected value and variance from the earlier chapters. It also assumes you can read short Python programs. We now apply those tools to one common mechanic: the player keeps taking a risk for a growing reward, and can stop at any time.
What makes a mechanic push-your-luck
A push-your-luck mechanic has four parts:
- Pot: unbanked reward the player has built up this turn.
- Push: a repeatable action that adds to the pot but risks a bust.
- Bust: a random event that destroys the pot, and sometimes more.
- Bank: a safe action that keeps the pot and ends the turn.
Examples include Pig, Can't Stop, Incan Gold, Blackjack against a fixed bust line, and loot-run modes in video games where dying drops what you carry.
The core decision is the same each time: bank what you have, or risk it for more. The pot grows, so the cost of a bust grows with it. The reward for one more push stays roughly constant. That asymmetry creates a stopping point, and your job as a designer is to decide where it sits.
The marginal decision
Do not evaluate the whole turn at once. Evaluate the next push. Ask what the expected change in score is if the player pushes once from the current pot.
Take the dice game from the spine. Roll a six-sided die. A 1 loses the pot. A 2 to 6 adds that value to the pot. From a pot of p:
- With probability 1/6, the player loses
p. - With probability 1/6 each, the player gains 2, 3, 4, 5, or 6. These sum to 20.
The expected gain of one push is (20 - p) / 6. It is positive below a pot of 20 and negative above it. The break-even pot is 20.
def roll_gain(pot, sides=6):
# Expected change in score from one more roll.
# A roll of 1 loses the pot; rolls 2..sides add their face value.
gains = sum(range(2, sides + 1))
return (gains - pot) / sides
for pot in (10, 19, 20, 21, 30):
print(pot, round(roll_gain(pot), 2))This prints 10 1.67, 19 0.17, 20 0.0, 21 -0.17, 30 -1.67.
The marginal view gives a quick design check. The break-even pot is the total reward of one safe push, divided by the bust probability. Here that is 20 over (1/6 bust chance times 6 faces) in the form above, but the general rule is simpler: break-even pot = (sum of safe gains) / (number of bust outcomes). Change the bust chance or the gain sizes and you move the break-even point directly.
Stopping rules
A stopping rule is a policy that tells a player when to bank. Designers use stopping rules to describe how players might play, then test whether the game rewards them. Three common kinds:
| Rule | Example | Strength | Weakness |
|---|---|---|---|
| Fixed threshold | Bank once the pot reaches 20 | Easy to simulate and teach | Ignores the game state |
| Fixed number of pushes | Push exactly three times | Easy for players to remember | Ignores the pot size |
| State-dependent | Push further when behind, bank early when ahead | Closest to real play | Harder to analyze |
Fixed thresholds are the first thing to simulate. Here is the simulation from the spine:
import random
def play_turn(threshold, rng):
# Roll a six-sided die repeatedly. Rolling a 1 loses the whole pot.
# Otherwise add the roll to the pot and stop (bank) once it reaches the threshold.
pot = 0
while pot < threshold:
roll = rng.randint(1, 6)
if roll == 1:
return 0
pot += roll
return pot
def average_score(threshold, turns=100_000, seed=1):
rng = random.Random(seed)
return sum(play_turn(threshold, rng) for _ in range(turns)) / turns
for threshold in (5, 10, 20, 40):
print(threshold, round(average_score(threshold), 2))Your numbers will depend on the seed, but the shape will not. A threshold of 5 averages close to 4.8, which you can verify by hand with the recursion below. The average climbs as the threshold rises toward 20 and then falls. A threshold of 40 plays worse than 20 because most turns bust before reaching it. The marginal analysis predicted this: pushing beyond 20 has negative expected value.
A hand check for threshold 5 shows why the simulation is trustworthy. Let V(p) be the expected final score from a pot of p. From pot 4, every safe roll reaches at least 6, so V(4) = (6+7+8+9+10)/6 = 6.67. Working back through pots 3 and 2 gives V(0) ≈ 4.82.
Expected value is not the whole story
The threshold that maximizes average score is not always the one players should choose, and it is not always the one that feels right. Look at spread as well as mean. This function reports both the mean and the standard deviation, and how often the turn busts:
import random
import statistics
def play_turn(threshold, rng):
pot = 0
while pot < threshold:
roll = rng.randint(1, 6)
if roll == 1:
return 0
pot += roll
return pot
def summarize(threshold, turns=100_000, seed=1):
rng = random.Random(seed)
scores = [play_turn(threshold, rng) for _ in range(turns)]
bust_rate = sum(1 for s in scores if s == 0) / turns
return statistics.mean(scores), statistics.pstdev(scores), bust_rate
for threshold in (5, 10, 20, 40):
mean, spread, busts = summarize(threshold)
print(f"{threshold:>3} mean={mean:5.2f} sd={spread:5.2f} bust={busts:.0%}")Run it and compare the columns. Higher thresholds raise the bust rate steadily, while the mean peaks near 20. The standard deviation shows how swingy each strategy is. A player who is behind late in a match may want high variance, even at a lower mean. A player who is ahead wants low variance. That is why a state-dependent rule is often the best one, and why score deficits change how the game plays.
Design levers
You can move the stopping point and the feel of the game by changing a few numbers:
- Bust chance: more bust faces lower the break-even pot. Fewer raise it. Doubling the bust chance roughly halves how long a turn lasts.
- Gain size: larger safe gains raise the break-even pot and make pushing more tempting.
- Bust penalty: losing only the current pot is mild. Losing banked score too makes players bank sooner.
- Escalation: if each push is riskier than the last, as in Can't Stop or Incan Gold, the stopping point arrives by itself and players need less guidance.
- Visible risk: if players can see how many bust outcomes remain, they decide more accurately. Hidden risk adds tension but also misjudgment. The chapter on information covers this trade-off.
Edge cases and common errors
Overshoot. The threshold rule banks when the pot is at least the threshold, so the final pot is usually above it. Averages therefore differ slightly from the threshold itself. Do not treat the threshold as the expected payout.
Single-turn optimization. The break-even rule maximizes one turn. A multiplayer game has a target score and an opponent. Players who are far behind should accept a worse mean to get a chance at catching up.
Dominant stopping. If the break-even pot is tiny, banking after one push is always best and the mechanic becomes a formality. If it is huge, players never bank and the bust rule disappears. Check that the break-even pot sits at a value the player can reach in a few pushes.
Seed reuse. Using the same seed for every threshold compares strategies on the same random stream, which reduces noise, but a single seed can still mislead. Run a few seeds and confirm the ranking does not change.
Too few trials. The standard error of a mean shrinks with the square root of the number of turns. With the standard deviation above 10 and 100,000 turns, the mean is accurate to about 0.03. That is fine for comparing 20 against 40. It is too coarse for comparing 19 against 20.
Exercise
A push-your-luck die has eight faces. A roll of 1 busts and loses the pot. A roll of 2 to 8 adds its face value to the pot. Using the marginal rule, what pot size is the break-even point, and should a player with a pot of 25 push?
Show answer
The safe gains are 2+3+4+5+6+7+8 = 35. The expected gain of one push from pot p is (35 - p) / 8, so the break-even pot is 35. At a pot of 25 the expected gain is (35 - 25) / 8 = 1.25, which is positive, so a player maximizing average score should push. Note that the bust chance is 1/8, lower than in the six-sided game, so the break-even pot is higher.
Exercise
You run the threshold simulation and find that a threshold of 20 has the best mean but also a bust rate above 60%. Name one design change that would make the game feel less punishing without moving the break-even pot.
Show answer
Reduce the penalty rather than the chance. For example, let a bust keep half the pot, or give a consolation reward. This leaves the bust probability alone, but it changes the marginal calculation too, so recompute the break-even pot and re-run the simulation to confirm. Another option is to show the remaining risk so busts feel fairer.