Sub topic 8
Retry, Checkpoints, and Recovery Cost
This chapter assumes you know the difference between a win, lose, and fail state, and that you can read short Python functions. It builds on fail states (setbacks the player can recover from) and on the idea that failure should be fair and readable. Here the question is what happens after the player fails: how fast they get back into play, and what it costs them.
Why recovery cost matters
A fail state is only as frustrating as what follows it. Two games can kill the player in the same way. In one, the player is back in control within two seconds. In the other, they sit through a loading screen, a cutscene, and a five-minute walk. The first game invites another try. The second makes the player wonder whether the game respects their time.
Designers call the total price of a failure the recovery cost. It has three parts:
- Lost progress. How much of what the player already did must be done again.
- Lost time to return. The time between failing and being back in control at the point of the next attempt. This includes death animations, menus, and loading.
- Lost resources. Items, currency, or lives that the failure removes.
Recovery cost is separate from the stakes of failure, which are covered in a later chapter. Stakes ask what failure takes away permanently. Recovery cost asks how much effort it takes to get back to where the player was.
Retry: the basic loop
A retry is a new attempt at the same challenge after a failure. The retry loop is: attempt, fail, learn, try again. Learning is the point of the loop. If the player cannot tell why they failed, a fast retry only repeats the mistake faster.
A good retry has these properties:
- Fast. The gap between failure and the next attempt is short. Many action games restart within one to three seconds.
- Informative. The player knows what caused the failure before they try again.
- Faithful. The retry presents the same challenge, or a clearly equivalent one. If enemy positions or timings change unexpectedly, the player cannot apply what they learned.
- Chosen by the player. The game should not force a retry or block one. A "Retry" option on the failure screen should be the default focus.
The following diagram shows the loop and the points where recovery cost accumulates.
Every box between "Failure event" and "Return control to player" adds time. A designer's job is to keep those steps short and to remove any that do not help the player.
Checkpoints
A checkpoint is a saved point in the game. When the player fails, the game restores the state from the most recent checkpoint instead of from the start. Checkpoints limit lost progress.
What a checkpoint stores
A checkpoint is a snapshot of the state needed to resume play. At minimum it stores the player's position. Usually it also stores some of the following:
- Health and other stats
- Inventory and ammunition
- Which enemies are alive and which objects have been triggered
- Quest or objective progress
- Score and timers
Each item you store is a decision, because it controls what the retry feels like. Restoring health fully makes the retry fresh. Restoring health to the value at the checkpoint can trap the player in a loop where they arrive at a hard fight with almost no health and fail every time.
Where to place checkpoints
Place checkpoints by balancing how long a stretch of play takes against how hard it is. Useful guidelines:
- Before difficult challenges. A checkpoint should come just before a boss or a hard sequence, so a failure does not replay the easy section leading up to it.
- After meaningful progress. Put one right after a hard challenge, so the player's success is preserved.
- Not inside a challenge. A checkpoint in the middle of a fight can save the player in a bad state, for example with one health point and no ammunition, and leave them with no way to win.
- At natural pauses. Doorways, room transitions, and calm spaces suit checkpoints, since the player has just finished one thing and is about to start another.
Types of checkpoints
| Type | How it works | Strength | Weakness |
|---|---|---|---|
| Automatic | The game saves when the player crosses a trigger | No effort from the player | The player may not know where the last save was |
| Manual or activated | The player touches an object or uses a save point | The player knows exactly where they restart | The player can forget to use it and lose progress |
| Player-created (quick save) | The player saves at any time | Maximum control | Can break pacing, and players may save in unwinnable states |
| Rolling or continuous | The game saves constantly and restores a few seconds back | Almost no lost progress | Works poorly with long, slow challenges |
Automatic checkpoints are the common default. Pair them with a visible signal, such as an icon or a short message, so the player learns that the game has saved.
Modeling retry and checkpoints in code
The chapter on outcome state machines defined an Outcome enum with PLAYING, WON, and LOST. The class below builds on that. It combines lives, a checkpoint, and a stored snapshot of the state, so a death restores more than a position.
from enum import Enum, auto
class Outcome(Enum):
PLAYING = auto()
WON = auto()
LOST = auto()
class Run:
def __init__(self, lives, start_position, start_health):
self.lives = lives
self.max_health = start_health
self.health = start_health
self.position = start_position
self.checkpoint = {"position": start_position, "health": start_health}
def reach_checkpoint(self, position):
# Store a snapshot. Health is topped up so the retry starts in a fair state.
self.health = self.max_health
self.checkpoint = {"position": position, "health": self.max_health}
def on_player_death(self):
# A death is a fail state while lives remain and a lose state when they run out.
self.lives -= 1
if self.lives == 0:
return Outcome.LOST
self.position = self.checkpoint["position"]
self.health = self.checkpoint["health"]
return Outcome.PLAYING
run = Run(lives=3, start_position=(0, 0), start_health=100)
run.reach_checkpoint((40, 5))
print(run.on_player_death(), run.position, run.health, run.lives)Running this prints Outcome.PLAYING (40, 5) 100 2. The player died once, returned to the checkpoint at (40, 5) with full health, and has two lives left.
Notice the design decision inside reach_checkpoint. The snapshot stores max_health, not the health at the moment of saving. That choice means a checkpoint can never put the player in a state where they are likely to fail again immediately. Changing one line changes the feel of the whole game.
Common error: saving a state that cannot be won
The most damaging checkpoint bug is the soft lock: the player is saved in a state from which the win condition can no longer be reached. Examples include saving after using a key that opens the only door, or saving with a timer almost expired. Guard against it in two ways:
- Store only states that your design has verified as winnable, such as the beginning of a room.
- Make sure consumed resources are restored together with the position. If a checkpoint restores the player but not the used key, the key is gone and the door stays locked.
Choosing the recovery cost
Recovery cost is a tuning dial. Setting it correctly depends on how often failure is expected and what the game wants the player to feel.
| Game style | Expected failure rate | Typical recovery approach | Reason |
|---|---|---|---|
| Precision platformer | Very high | Instant restart at the start of the room, no life limit | Players retry dozens of times, so each retry must be nearly free |
| Action game with bosses | Moderate to high | Checkpoint before the boss, short walk back, full health | The challenge is the fight, not the travel |
| Survival or roguelike | Failure ends the run | Restart the whole run, keep some unlocks | Failure is the point, so persistent rewards soften it |
| Story-driven adventure | Low | Frequent automatic checkpoints, small penalty | Failure should not interrupt the narrative |
| Puzzle game | Low to moderate | Undo button or instant reset | The player is thinking, not performing |
A useful rule: the cost of recovery should be proportional to the cost the designer wants the player to feel, and never larger than the cost of the failure's cause. A trivial mistake, such as stepping on a spike, should not cost five minutes. A major mistake, such as dying to a boss after a long fight, can cost more because it was more significant. Even then, the cost should come from the challenge, not from walking back through content the player has already mastered.
Run-back distance
Run-back is the stretch of already-cleared content a player must cross to return to a challenge after failing. It is one of the most common causes of frustration in boss design. A long run-back turns a three-minute fight into a ten-minute loop in which seven minutes teach the player nothing. Remedies include:
- Placing a checkpoint immediately before the encounter.
- Opening a shortcut after the player clears the route once.
- Letting the player skip travel through a fast-travel option.
Some games keep run-back on purpose, to raise tension. That is a valid choice, but treat it as a deliberate cost, and check in playtests that players still consider it fair.
Time to return
Even with a perfect checkpoint, the delay between death and control can ruin the loop. Measure it from the moment of failure to the moment the player can act. Typical sources of delay include the death animation, a fade to black, a loading screen, a "Game Over" menu, and a restored scene that plays an intro. For a game with a high failure rate, shorten each one. Let the player skip the death animation. Keep the scene in memory so a restart does not require loading. Remove confirmation dialogs.
Other recovery tools
Checkpoints are not the only way to soften failure. Games combine several tools.
- Lives. A limited number of attempts before a lose state. Lives turn individual deaths into a resource the player manages.
- Health restoration. Healing items or regeneration let the player recover within an attempt, so some failures never occur.
- Revive and second chance. A downed state gives the player or an ally a short window to recover. This turns a lose event into a fail state.
- Rewind or undo. The game steps back a few seconds or moves. The cost of failure drops close to zero.
- Soft penalties. The game takes a small amount of currency or experience instead of progress. The player recovers by earning it back.
- Assist options. Skippable challenges or reduced difficulty, covered in the chapter on adaptive assistance.
Common errors
- Checkpoints too sparse. The player repeats large sections of easy content. Fix: add checkpoints before hard challenges.
- Checkpoints too dense in a tense game. If checkpoints appear every few seconds in a game meant to be dangerous, failure loses its weight. Fix: match density to the intended stakes.
- Unfaithful retries. Randomized enemies or changed layouts after a restart mean the player cannot practice. Fix: use a fixed layout for the challenge, or randomize in ways the player can read.
- Restoring partial state. The player returns with less health, fewer items, or missing resources. Fix: snapshot everything that affects winnability.
- Hidden save points. The player has no idea where they will restart. Fix: signal every save.
- Slow failure screens. Long animations and loading before every retry. Fix: let the player skip and keep the restart in memory.
Measuring recovery cost
You can estimate recovery cost with simple numbers gathered in playtests: the average time between a death and the next attempt, the number of attempts before the player passes each challenge, and the share of players who quit after each death. A large drop in players after one specific encounter often points to run-back or a missing checkpoint there.
def average_recovery_seconds(deaths):
# Each entry is (seconds_of_death_screen, seconds_of_run_back).
if not deaths:
return 0.0
total = sum(screen + run_back for screen, run_back in deaths)
return total / len(deaths)
boss_deaths = [(3, 20), (3, 20), (3, 18), (4, 20)]
print(average_recovery_seconds(boss_deaths))This prints 22.75. A boss fight that lasts about 90 seconds and has a 23 second recovery is healthy. If the same fight had a 120 second run-back, the recovery would outweigh the challenge, and the checkpoint should move.
Exercise
A player reaches a checkpoint inside a boss fight with 5 health and no healing items left, then dies and restarts there repeatedly. Name the problem, and give two changes that fix it.
Show answer
This is a soft lock caused by saving an unwinnable state. Fixes: move the checkpoint to before the fight starts, or store full health and restore consumed items in the snapshot so each retry starts in a winnable state. Removing the mid-fight checkpoint entirely also works.
Exercise
A precision platformer gives the player 3 lives and, after the third death, sends them back to the start of the world, which takes 10 minutes to replay. Players routinely die 40 times on a single hard room. Why does this design fail, and how would you change it?
Show answer
The expected failure rate is very high, so a life limit with a large reset makes the recovery cost far larger than the cost of the mistake. Remove the life limit, or make lives refill at each room, and restart the player at the start of the current room within about a second. The challenge then comes from the room, not from replaying earlier content.
Exercise
A boss fight takes 2 minutes. After a death, the player sees a 6 second death animation and a 4 second loading screen, then walks 90 seconds back to the boss. Calculate the recovery time, and list three changes that reduce it.
Show answer
Recovery is 6 + 4 + 90 = 100 seconds. Changes: place a checkpoint just outside the boss room to cut the walk, let the player skip the death animation, and keep the scene in memory so no loading screen appears. These bring the recovery to a few seconds.