quest'n'click 4.5.0 · r1

Built for quest'n'click 4.5.0, revision r1. Whether it is published, and which one is current, is recorded at publication.json.

Puzzle design

Français · Type: explanation · Audience: author · Context: engine repository, created project · Status: ready · Applies from: 4.2.5

A practical, opinionated guide for an author, often working alone with an AI assistant: what to write so that the game is fun, fair and finished. The format is in the Create a game pages, the method in Working with an AI; this page is about taste.

The running example

The sample game, The Pantry Key (games/demo/ in the engine repository): Pixel the cat, three rooms (house, garden, market), about 15 minutes. Every id quoted here exists in that folder. The game's texts are in English and quoted as they are. The code excerpts are simplified: the sample game's files also carry each line's stable id ({ id, text }), which the identity contract adds (State and saves).

What makes these games work

The classic LucasArts adventures (Monkey Island, Day of the Tentacle) settled a few rules. They still hold.

RuleWhat it means here
No deathThe hero never dies and never loses. A built-in minigame cannot be failed: winning or skipping it plays then.
No dead endsThe player can never reach a state where the game cannot be finished. npm run solve -- --prove proves it (npm run solve finds one winning path).
Every action is answeredAny verb on any thing gets a line. A wrong try is a joke, not a silence.
Humour lives in the failuresMost of what a player reads is a reaction to a wrong idea. That is where the voice is.
Thinking, not pixel huntingEvery useful thing is named, visible and has a Look line. The puzzle is in the head, not in the hitbox.
A small cast with strong voicesFour or five characters you can tell apart from one line.
One goal per roomThe player always knows what they want here. The storyboard says it in goal.
10 to 20 minutes per roomLong enough to explore, short enough to finish on a bus.

The sample game follows all of them. Pixel cannot fail. Pulling Biscuit gives "Never pull a cat. Cat law, article one." The key is never hidden in a corner: it is in a tank that a character tells you about.

In a created project the solver runs as npx quest-n-click solve (and npx quest-n-click solve --prove). What each result lets you conclude is in What the solver proves.

Story first

Write the story before any room file. Four answers, one line each:

QuestionThe sample game
Premise in one sentenceGrandma locked the sardines in the pantry and lost the key.
The hero's wantPixel wants the sardines.
The obstacle per roomHouse: nobody knows where the key is. Garden: it fell in a tank with a stuck tap. Market: it is a deposit for a lantern.
The endingThe pantry opens, two cats share one tin, the sealed card judges the player's guess.

If you cannot fill this table, do not open the editor yet. Then write the story as the storyboard, one board per room and one panel per beat, and review it on a phone until the author says it is final: see The storyboard, source of truth. Only then write rooms.

The rhythm of repeated looks

A look list cycles, one line per look. Use the rhythm normal, normal, normal, absurd: three useful or plain lines, then a joke that rewards the player who keeps clicking. The sample game's pantry:

pantry: ['The pantry cupboard. The sardines live in there.',
  'Locked. I can hear the sardines. (Sardines are silent. I hear them anyway.)',
  'Still locked. Still sardines.', 'I could stare at it all day. I might.'],

Two lines are fine for decor (gnome: "He has seen things." then "He never blinks. Respect."). Never put the solution only in the fourth line.

Puzzle design with this engine

The five shapes the DSL handles well

ShapeHow it is writtenIn the sample game
Fetch and givegive rule with a = item, b = actorbouquet → seller gives the key
Combine two items (or item on a thing)use rule with a and b; in rules.on if it works everywherepipe on tank
State machine propstates + { prop: [...] } command + if: { prop: [...] }armchair: remote → searched; tank: full → draining; pantry: locked → open
Dialogue unlocka talk topic that sets a flag or unlocks a placeGrandma's "Where is the key?" unlocks garden; Lou's topic sets deposit_known
Minigame as a gate{ minigame, params, then } inside a rulepipes drains the tank, pick wins the bouquet

Anything else (timers, real-time action, random outcomes) fights the solver. Avoid it. When a famous mechanic seems to need something else, Classic mechanics shows how the DSL writes it.

Chains and the "aha"

Hints in puzzle order

Each room has hints. The engine gives the first entry whose until condition is still false. Write them in the order of the puzzle, one entry per step, vague then precise inside an entry. The garden:

hints: [
  { until: { any: ['pipe_taken', 'tank_drained'] }, lines: ['There is a spare pipe on the ground. Take it, sweetie.'] },
  { until: 'tank_drained', lines: ['Use the pipe on the water tank.', 'Pipe. Tank. Together. Go!'] },
  { until: 'lou_has_key', lines: ['Something came out of the tank. Look at it.'] },
  { until: { unlocked: 'market' }, lines: ['Talk into my shell phone and call Lou.'] },
  { until: { has: 'key' }, lines: ['Lou is at the market. Open the map.'] },
  { until: 'pantry_open', lines: ['Come home with that key, sweetie!'] },
],

Two habits: use any when a step can be skipped (the pipe is gone once the tank is drained), and always cover the rest of the game, so the hint voice is never silent in a room the player comes back to.

Reading the puzzle graph

Before touching a puzzle, ask the graph what hangs on it: npm run page:puzzles (engine repository), the Puzzles panel of the Studio's Check tab (either context), or the MCP tool puzzle_graph with an id. The card of the pantry key in the sample game reads: acquired by give bouquet + seller; used by use key + pantry and the finale's goal; requires first bouquet, flowers_done, bouquet_given; unlocks the pantry and the end. Remove the bouquet trade and the card tells you what breaks before the solver does. The overview lists three smells: a thing read but never produced (a flag nobody sets), a thing produced but never used (a flag or item that leads nowhere), and a flag set only by actions that already need it (it can never become true; the validator warns too). The page itself: Review pages.

The solver's warnings (dead ends, items never used, items never obtained) and how to read them are in What the solver proves.

Rooms

ElementRule of thumb
Hotspots + named props + actors8 to 15 per room. Fewer feels empty, more feels like pixel hunting. The sample game's house has 11 named things.
Props with statesOnly for things the story changes (armchair, tank, pantry).
Decor propsNo name = not clickable (table, chair, stall_left). Use them to dress the scene.
ExitsOne obvious way out, at the edge of the screen, named after where it goes (back_door: "Back to Grandma's house.").

The reference for all of this is in Rooms, Geometry and Exits.

Dialogue

The format is in Dialogues.

The fallback layer

Most clicks hit no written rule. What answers them is the game's voice.

The format is in Reactions.

Minigames

Use one as a gate the player understands: the fiction says why you play it. The tank needs another way out, so you lay pipes. The seller wants flowers, so you pick them.

MinigameFits a fiction about
pipeswater, plumbing, irrigation, anything that flows
cableselectricity, a switchboard, a tangle behind the TV
pickshopping, choosing the right one, a recipe, a line-up
hidehide and seek, finding someone or something in a scene
runnera chase, an escape, a race to catch a bus
strokecalming an animal, putting a baby to sleep
scratchthe sealed ending only
code-wheela paper code wheel, the 1990s "copy protection" played as a joke (4.1.15)

Limit · code-wheel-can-fail The "no failure" rule holds for the built-in minigames above, with one exception: a code-wheel in story mode, lost after its tries, ends failed. The parameters of every minigame are in Built-in minigames.

The map

The format is in World map.

Sound

What this design sets aside

Trade-offs

These rules make games that are fair and provable, and short sessions that fit a phone. They cost tension: no deadline, no loss, no luck. A game that wants those leans on a custom minigame, whose inside the solver does not see (only its declared effects), and gives up part of the proof for it.

Decisions and references


Edit the source of this page · Report an error