Sub topic 3
Designing Lose Conditions
This chapter assumes you understand the core gameplay loop, basic conditionals and functions, and common game genres. You will use that knowledge to define when a player has truly lost, rather than merely encountered a setback.
What a lose condition means
A lose condition is a measurable rule that ends the current attempt, round, or session in defeat. Examples include:
- The player character's health reaches zero.
- A timer expires before the objective is complete.
- The player loses all required resources.
- The opponent captures the target.
- Too many civilians are harmed.
- The player fails a required objective permanently.
A lose condition should answer three questions:
- What exactly is being measured?
- What value or event triggers defeat?
- What happens immediately after the trigger?
A player losing one life is not always the same as losing the game. If the player returns to a checkpoint with lives remaining, the event is a fail state: a setback that can be recovered from. If no lives remain, it becomes a lose state.
Make defeat measurable
Avoid vague rules such as “the player is doing badly” or “the base is almost destroyed.” Use a value, event, or deadline that the game can evaluate consistently.
| Condition | Measured value | Lose trigger | Possible recovery |
|---|---|---|---|
| Character death | Health | Health is 0 or less | Restart at checkpoint |
| Timed mission | Remaining time | Time reaches 0 | Retry the mission |
| Base defense | Base integrity | Integrity reaches 0 | Restart the round |
| Stealth mission | Alert level | Alert reaches its limit | Hide and continue, if allowed |
The boundary matters. Decide whether defeat occurs at zero, below zero, or after an event. For example, “lose when health is 0 or less” prevents an attack that deals more damage than the remaining health from producing an undefined result.
Decide what ends
A lose condition can end different scopes of play:
- An encounter ends, but the level continues.
- A level ends, but the campaign continues.
- A round ends, but the match continues.
- A run ends, but the player keeps permanent upgrades.
- The entire game ends.
State the scope in the design specification. “The player loses” is incomplete unless it says what is reset and what persists.
from enum import Enum, auto
class Outcome(Enum):
PLAYING = auto()
WON = auto()
LOST = auto()
def evaluate(health, relics, relics_needed):
# Lose takes precedence when both conditions are true.
if health <= 0:
return Outcome.LOST
if relics >= relics_needed:
return Outcome.WON
return Outcome.PLAYINGThis function has explicit precedence. If the final attack reduces health to zero while also awarding the last relic, the player loses because the lose check runs first. That choice is a design decision, not a technical accident. You could reverse the checks if completing the objective should always count as a win.
Make defeat fair and readable
A lose condition feels unfair when the player cannot predict it, understand it, or respond to it. Give the player:
- A visible current value, such as health or remaining time.
- Warnings before an irreversible threshold.
- A clear explanation of what caused defeat.
- Enough time to connect an action with its consequence.
- A reliable way to avoid the condition through skill or strategy.
Do not hide a strict timer behind a long unskippable cutscene. Do not remove all health without communicating the source. If a rule is intentionally hidden, teach it through safe experimentation before making it costly.
Use a state model
Treat defeat as a transition between named states. This makes the rule easier to inspect and prevents unrelated systems from displaying conflicting results.
A common error is allowing gameplay to continue after defeat. Stop damage, movement, scoring, and win checks at the appropriate point. Otherwise, one frame may award both a win and a loss, or multiple systems may subtract lives repeatedly.
Tune the cost of losing
The condition itself is only part of the experience. The cost after defeat affects motivation. Consider:
- How much progress is lost?
- Which resources persist?
- How long does a retry take?
- Can the player learn something from the failure?
- Does the player have a meaningful choice before trying again?
A short retry can support strict conditions. A long retry usually needs checkpoints or persistent progress. The harsher the cost, the more clearly the game should teach the rule and warn the player.
During playtesting, ask players to predict what will cause defeat before it happens. If their predictions differ from the implemented rule, improve the rule's feedback or revise the rule itself.
Exercise
A mission is lost when the timer reaches zero. At the same moment, the player delivers the final objective. Which result should your design choose, and what must the implementation define?
Show answer
Choose a precedence rule, such as checking the timer first for a loss or the objective first for a win. Document that order and test the exact boundary so the result is consistent.