Show the Lock Before the Key

The lock-and-key puzzle is a popular pattern in video games. The player wants to bypass an obstacle but must first acquire something that allows them to do so, whether a literal key, as in the Legend of Zelda games, or an ability, such as HMs in the Pokémon series. When designing a lock-and-key puzzle, the order in which components are presented matters. You always want to present the lock before the key.

Presenting the lock first makes it easier for players to understand the key's purpose. A lock without a key is an obstacle to progress, but a key without a lock is confusing junk. Players need context to understand why they should care about what you give them. The best rules explanations start with the game's goal: goals motivate players to understand how to pursue them. Showing players a lock gives them a goal that contextualizes a key.

Presenting the lock first also makes acquiring the key feel more rewarding. A lock creates the tension of an unresolved problem, and the key relieves that tension. If you present the key first, there is no emotional relief when the player encounters the lock later because it hasn't been nagging at the back of their mind. According to the Zeigarnik effect, interrupting a goal makes it more memorable. By delaying the resolution of a lock, you add to the puzzle's emotional weight.

One final reason to present the lock before the key is to avoid teaching players to hoard. If your game often uses a pattern in which a lock's solution is something the player found earlier, players will hoard everything just in case it becomes relevant. Hoarding can lead to degenerate, unfun gameplay, especially if your game limits inventory.

Lock and key puzzles are a staple for a good reason: they are easy to design, rewarding, and legible to players. When making them, be sure to introduce players to the lock before the key to get them excited about solving the puzzle.