Sub topic 2
Designing Clear Win Conditions
Assume you understand the basic gameplay loop, simple conditionals and functions, and the conventions of several game genres. This chapter focuses on deciding exactly when a game considers the player successful.
A win condition is a rule that determines when the player has achieved the goal of a game, level, mission, or round. A clear win condition has three properties:
- It is measurable by the game.
- The player can understand what progress means.
- It matches the intended experience.
For example, “explore the ancient temple” is a theme or activity. “Find three relics and place them on the altar” is a win condition.
Turn the goal into a testable rule
Start with the player’s goal, then identify the facts the game must track. A racing game might track the player’s position and lap count. A puzzle game might track whether all required pieces are correctly placed. A role-playing game might track whether a boss has been defeated.
Write the condition as a statement that can be checked:
| Player goal | Measurable win condition |
|---|---|
| Escape the facility | The player reaches the exit while the exit is unlocked |
| Collect the artifacts | The player has at least 5 required artifacts |
| Defeat the guardian | The guardian’s health is 0 or less |
| Survive the night | The game clock reaches 06:00 |
Avoid conditions that depend on an unclear judgment, such as “play skillfully” or “explore enough.” You can still design those experiences, but you need measurable proxies. For example, “complete four optional discoveries” gives exploration a concrete threshold.
Choose the condition structure
Some goals require every requirement to be met. Others allow the player to meet one of several requirements.
Use an all-of rule when the requirements form one complete task:
- Collect the key.
- Unlock the gate.
- Reach the extraction point.
Use an any-of rule when the player can choose different strategies:
- Defeat the boss, or steal the objective.
- Reach the finish line, or force every opponent to surrender.
- Complete any three contracts from a list.
State the rule in player-facing language. “Complete any three contracts” is clearer than “contract progress: 3/8” if the player does not know that three contracts are sufficient.
Define thresholds and boundaries
A threshold is the value at which a condition becomes true. Decide whether the boundary counts.
If the player needs five relics, the usual rule is relics >= 5, not relics == 5. The greater-than-or-equal comparison still works if the player collects several relics in one event. An exact equality check can fail when progress skips over the target.
from dataclasses import dataclass
@dataclass
class Mission:
relics: int = 0
required_relics: int = 5
boss_defeated: bool = False
escaped: bool = False
def has_won(self) -> bool:
has_relics = self.relics >= self.required_relics
return has_relics and self.boss_defeated and self.escaped
mission = Mission(relics=5, boss_defeated=True, escaped=True)
print(mission.has_won()) # TrueThe order of events matters. If the player reaches the exit before defeating the boss, should the game reject the attempt, wait for the missing requirement, or trigger a special ending? Decide this before implementation.
Separate primary and optional success
A game can have one primary win condition and optional goals. Completing the primary goal should produce a definite success state. Optional goals can improve a score, unlock a reward, or change the ending without making the main victory ambiguous.
For example:
- Primary: rescue the prisoner.
- Optional: rescue the prisoner without raising an alarm.
- Optional: finish with all equipment intact.
This structure gives players meaningful choices without requiring every player to pursue the same level of perfection.
Make progress visible
Players should be able to answer three questions:
- What am I trying to achieve?
- What have I completed?
- What remains?
Show progress through objective text, counters, map markers, sound cues, or changes in the environment. Do not reveal every hidden rule if discovery is part of the design, but reveal enough for players to form a reliable plan.
A useful progress display might say “Relics: 3/5” and “Exit: locked.” After the fifth relic, update the display immediately and explain the next action.
Test the edges
Test more than the normal success path. Check the state before the first required action, exactly at the threshold, above the threshold, and when several requirements complete in one frame or event.
Also test interruptions:
- The player dies on the same moment the final objective completes.
- The player disconnects after completing the objective but before the victory screen.
- A required object is destroyed or removed.
- The player completes an optional objective without completing the primary one.
Write down which result should take priority. Consistent rules make outcomes easier to debug and easier for players to trust.
Exercise
A mission requires collecting 3 keys and reaching the exit. The player reaches the exit with 4 keys. What comparison should the key requirement use, and why?
Show answer
Use keys >= 3. The player has met or exceeded the threshold, and the rule still works if one action awards several keys.