The case file — planning a mystery before building it
A good adventure game is a clue graph with rooms and puzzles hung on it. Build the graph on paper first, then let the tools prove it. This page is the template (fill it in yourself, or hand it to an AI agent with the MCP tools connected — every
section says which tools build it, so "turn this case file into a game" is a mechanical job); docs/HANDBOOK.md is the production side (roles, milestones, release).
Copy the headings below into a new file (game/CASE_FILE.md is a good place — it is not shipped) and fill them in. Short is fine; specific is what matters.
From this page to a game in one call: the same facts, written as a blueprint (BLUEPRINT.md) — rooms as lists, no coordinates — become a whole game with
scaffold_from_blueprint(make blueprint), and the validator applies the fairness rules below before anything is written.
1. The premise (one paragraph)#
Who is the player, where are they, what has happened, what is at stake, and by when (the clock: a deadline, a storm, a train)? Builds: update_project_info (title, start scene, time), the opening narration (start_actions), the first objective.
2. The truth (what really happened — the player never sees this page)#
| Culprit | who |
| Means | how it was done |
| Motive | why |
| Opportunity | when and where they could |
| The secret in one sentence | the thing the player should feel clever for working out |
Builds: set_mystery (culprit(s), the three proofs, the accusation's four outcomes), check_mystery proves that the clues you place can reach a conviction. Each of means / motive / opportunity needs at least two independent clues — one is a coincidence, two is a case.
3. The cast#
| id | name | role | wants | hides | says when you ask about… |
|---|
Aim for 4–6 suspects with different reasons to lie, plus 1–2 helpers (the friend on the phone, the local who gives hints). A suspect is only interesting if the player can be wrong about them for a while: give each a secret that is not the crime and an alibi that is almost true.
Builds: upsert_character (portrait, talk topics, schedule for who is where when), upsert_topic + upsert_dialogue, upsert_contact (phone), the dossier / case board (upsert_clue, upsert_deduction).
4. The map#
List every room, its group (floor / area), what it is for, and the doors between them. A first game wants 12–25 rooms; keep a hub (a lobby, a courtyard) so the player is never more than three doors from anywhere.
| room id | name | group | purpose (a clue? a puzzle? a person? a way on?) | doors to |
|---|
Builds: create_scene / create_scenes_from_template (many alike rooms), upsert_link (a door written once, both ends made), upsert_region (the map), add_hotspot. Panoramas for rooms you stand in, flat pictures for rooms you look at.
5. The clue graph (the heart of it)#
One row per clue. Where it is found, what gates it (an item, a puzzle, a conversation, a time of day), what it proves, what it unlocks.
| clue id | text the player reads | found where | gated by | proves / points to | unlocks |
|---|
Rules that make a case fair — each is checked by a tool, so the list is also your test plan:
- Every clue is reachable (
analyze_game,find_softlocks: no state from which the case cannot be finished). - The proof of means, motive and opportunity each has two clues, found in different places (
check_mystery). - A red herring points at an innocent person and has a clue that clears them — otherwise it is a lie, not a puzzle.
- No clue requires knowing something only a later clue tells you (the graph has no cycles you cannot enter).
- Anything the player must notice is also somewhere they must go — never a pixel hunt for the only way forward (hints: section 8).
6. The puzzles#
One row per puzzle. A puzzle is a gate with a reward, not a decoration: what does it hold back, and what do you get?
| id | type | where | what the player has to work out | what it gives | what the world tells them |
|---|
Choose the type for the kind of thinking (54 built in — list_puzzle_types; every one proves its own instances winnable): codes and locks (keypad, combo lock, safe dial, pin tumbler, ring lock), ciphers (cryptogram, cipher wheel, word lock, word ladder),
deduction (logic grid, mastermind, truth and lies, seating plan, number cages, nonogram), machines (mechanism, gear train, pipes, wiring, logic circuit, switch board, mirror beams), spatial (sliding, jigsaw, packing, maze, sokoban, rush hour, map route, knight's tour), a match against the computer (duel), sound and memory (music box, simon,
memory match, sound match, radio tuning), measuring (water jugs, balance weights, counterfeit coin, torch and bridge, river crossing, color mixing). The answer should usually be in the world — a clue elsewhere tells the player the code, the tune, the order — and {$var} text with
random_var lets that code change each playthrough. Builds: upsert_puzzle (with difficulty overrides for junior and senior detective), check_puzzles.
7. Items#
| id | name | found where | used where / combined with | what it opens |
|---|
Builds: upsert_item (+ recipes for combining), a hotspot's use_items. Every item has a use; every use has an item someone can actually find.
8. Help for a stuck player#
Three levels per important beat — a nudge ("have you looked closely at the study?"), a pointer ("the desk"), the answer ("the second drawer; the key is under the blotter"). The Hint button reads the first level whose condition holds.
Builds: upsert_hint (and skip_after on puzzles). The playtest report (playtest_report) shows where real testers got stuck: write the hints for those first.
9. The ending(s)#
The accusation: right person with proof, right person without enough proof, wrong person. Add a star ladder if you want replay (one star for the culprit, three for the whole truth).
Builds: upsert_ending, the accusation's on_solved / on_weak / on_wrong steps in set_mystery, achievements (upsert_achievement).
10. The look and the sound#
- Style paragraph (the single biggest lever on art quality): medium, palette, light, era, camera — and three reference pictures.
- Voice: who is recorded, who is synthesised for the first draft.
- Music: a theme, a tension bed, a stinger for a find.
Builds:
art_set_bible,art_plan,art_generate(cost first:art_estimate),generate_voicefor placeholder lines,upsert_score_entry. Layout-aware prompts mean room pictures are painted to fit the hotspots you already placed;art_calibratechecks them afterwards.
11. The proof before anyone plays#
validate_project → analyze_game (can it be won? does every clue and puzzle matter?) → find_softlocks (can it be lost?) → check_puzzles → autoplay_game (a bot wins it through the real UI) → release_check at alpha. If all of those pass on a case file's first build, the case file was good.
This page as Markdown: /docs/case-file.md · Engine 0.101.0