Sub topic 7
Unlocks and Gating
This chapter assumes you understand basic game progression, can read short Python programs, and know elementary algebra. You will design gates that control when players can access content without making progress feel arbitrary.
What an Unlock Gate Does
An unlock gate is a rule that determines whether a player can access something. The target might be a level, area, quest, weapon, character ability, or story scene.
A gate usually has three parts:
- A target, such as the caves or a boss encounter.
- One or more conditions, such as a minimum level or a required item.
- Feedback that tells the player what remains to be done.
Gates support pacing. They can introduce systems gradually, protect players from content they are not ready for, and create goals. However, a gate becomes frustrating when its rule is unclear, impossible to satisfy, or unrelated to the player's choices.
A hard gate blocks access completely. A soft gate allows access but makes the content more difficult or less rewarding. Use a hard gate when entering early would damage the experience. Use a soft gate when experimentation should remain possible.
Combining Unlock Conditions
Conditions often work together. A player might need to reach a level, complete earlier content, and collect a key. Treat these rules as data instead of scattering them through gameplay code. Data-driven rules are easier to inspect and balance.
UNLOCKS = {
"forest": {"level": 1},
"caves": {"level": 5, "requires": ["forest"]},
"boss_gate": {
"level": 10,
"requires": ["caves"],
"items": ["silver_key"],
},
}
def is_unlocked(name, player):
rule = UNLOCKS[name]
if player["level"] < rule.get("level", 1):
return False
if any(required not in player["completed"]
for required in rule.get("requires", [])):
return False
return all(item in player["items"]
for item in rule.get("items", []))
player = {
"level": 6,
"completed": {"forest"},
"items": set(),
}
print(is_unlocked("caves", player)) # True
print(is_unlocked("boss_gate", player)) # FalseThe example uses an AND relationship: every listed condition must be true. Some designs also use OR relationships. For example, a door might open after the player reaches level 10 or finds a master key. Choose AND when you want a sequence of preparation. Choose OR when you want multiple valid routes.
Keeping Gates Fair
A fair gate communicates its requirements before the player spends significant effort. Show the missing condition directly, such as “Complete the forest” or “Find the silver key.” Avoid hiding a required item behind an unrelated puzzle unless discovery is part of the intended experience.
Check these questions during playtesting:
- Does the player know what is blocked?
- Does the player know how to satisfy the condition?
- Is there another meaningful activity available?
- Can the player become permanently unable to progress?
- Does the gate support the story or gameplay purpose?
Use alternative routes when possible. If one quest can fail permanently, provide another way to earn its required item. This protects player agency while preserving the gate.
> callout warning > Never use a level requirement as a substitute for explaining why content is unavailable. A visible requirement and a clear next step make the same gate feel much fairer.
Exercise
Exercise
The boss requires level 10, completion of the caves, and a silver key. A player is level 12, has completed the caves, but lacks the key. Should the boss be unlocked by the sample function? Why?
Show answer
No. The function uses an AND relationship, so every listed condition must be satisfied. The player still needs the silver key.