What is a lock key puzzle?.

The Lock and Key Design Pattern takes it's name from literal lock and key puzzles in many computer games.

Take Doom for example, each level has a start and exit but usually you can't travel directly between them. The direct path is blocked by locked doors, to open the doors you must find a matching key.

Doom; progress stops until a key is found.

Locks and keys make progression less linear and more interesting for a player. For Doom the lock and key are a literal lock and key but the concept can be applied more generally.

Here are the definitions:

An obstacle preventing the player from progressing.
Something obtained and used to remove the lock.

Perhaps you can already think of a few examples that fit this description? When designing an RPG, or any game, consider up-front how you would like to control the player's progress by using the lock and key pattern. What locks and keys do you want in your game? To give us some ideas let's look at a few examples.


  • Double Jump Platforms high in the air, that can only be accessed by a double jump, are the lock. The double jump ability is the key. It might be gained via an item (such as special boots) or just by leveling up.

  • Bombs A wall with a crack in it is the lock. Bombs are the key.

  • Scuba Gear The sea acts as the lock, the player dies if they try and swim too deep. Scuba Gear is the key, unlocking deep exploration of the ocean.

  • Charisma In Western RPGs a high charisma value may unlock special options when talking to people. These special options give access to new game content. For instance sweet talking a guard into letting you into the dungeon. The lock here is the conversation check and the key the charisma score.

  • Airship This is the classic JRPG example. The sea and mountains act as locks preventing your progress. Once you have the airship you're free to soar through the sky over any impediment.

  • Level In some RPG games content is locked off until a certain level. This game content might be using a weapon, accessing an area or a special ability. (Though a straight level-lock seems very 'gamey' and artificial, it's not suitable for all game-types.)

Common Uses

Lock and key puzzles excel at guiding players through a game. If you want the player to move, in order, from area A to B to C to D, then you can put a lock between each area. Area A contains the key to allow you to enter area B and B contains the key to move to C and so on.

Extra conditions can be added to find each key and pull the player through a story. A linear A, B, C, D progression is the simplest example; I'm sure you can imagine more detailed ones.

Locks and keys are effective for adding secret content and encouraging back-tracking.

Key items make great rewards for the player. Getting some rupees from a chest in Zelda is ho-hum, getting the boomerang is far more exciting. This is because rupees have a limited function, they accumulate then Link can buy something. The boomerang allows Link to interact with the game world in a new way and access undiscovered game content.

Remember! Locks and keys don't have to be literal locks and keys, try to apply this design pattern in a novel way for best results!


  1. Show content locked off content before you can find the key.

  2. Lock and Key content should be drip fed. We'll overwhelm the player if we present it all at the start of the game.

  3. The same kind of lock and key used over and over becomes boring quickly.

    Oh another blue door? Guess I have to find a blue key for the 300th time.

  4. Keys that are more than just a key are better. Double Jump has gameplay effects as well as allowing you to access new areas. Bombs in Zelda break down walls but are also a weapon.

  5. Keys requiring some skill mastery are better. Correctly using a grappling hook, more control over jumps etc. The key helps the player gain more mastery over the gamespace.

  6. Grading keys can be fun if it's not overdone. A blue, yellow and red key are more interesting than one white key. A bomb and super bomb are more interesting that just a bomb. A level with 100 key colors or 100 grades of bombs isn't fun.

Think about where to apply this pattern in your own game. Also identify the cases where you're already applying the pattern and consider if you could apply it more effectively.