Spielerando

Recipe Discovery

Recipe discovery lets players find recipes by trying things out instead of reading a list. Mixing the right ingredients, in any order, reveals a recipe, and the game remembers it for good. After several wrong tries in a row, the game points at one missing ingredient, so a stuck player keeps going.

Also called: Experimental crafting, Discovery by experiment, Hidden recipes, Recipe unlocking.

A small mole in an apron drops berry juice into a copper pot, which bursts into lilac sparkles while a picture of a potion bottle draws itself on the open page of a recipe book.
Quillnibble Larder, an invented cosy cooking-puzzle game. Invented game, image generated with AI.

Paste this to your AI

Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.

Add "Recipe Discovery" to my game.

What it should do: A recipe the player found by experimenting feels like an earned discovery, and a hint after a run of misses keeps a stuck player from giving up or opening a guide.

Build it exactly as this state machine. First check that it fits my game, then build it like this:

```mermaid
stateDiagram-v2
  [*] --> blank
  blank: Nothing found
  hinted: Hint showing
  growing: Some found
  complete: All found
  blank --> blank: wrong mix
  blank --> hinted: hint appears
  blank --> growing: first find
  hinted --> hinted: still stuck
  hinted --> growing: a find
  hinted --> complete: last find
  growing --> growing: find or wrong mix
  growing --> hinted: hint appears
  growing --> complete: last find
  complete --> complete: nothing left
  complete --> [*]
```

Use these starting values:
- hintAfter: 5
- maxIngredients: 4

Watch out for these common mistakes:
- Water then herb works, herb then water does not: Tell your AI: compare a mix as a pile. Sort the ingredients before comparing, so the order is ignored.
- Two herbs find the one-herb recipe: Tell your AI: keep repeated ingredients when comparing. Two herbs and one herb are different mixes.
- Repeating a found recipe resets the hint: Tell your AI: a mix that matches a known recipe changes nothing at all.
- A recipe that can never be found: Tell your AI: check the recipe book when the game starts. Report any recipe with more ingredients than the table takes, and any two recipes that are the same pile.
- A hint that gives the game away, or points at nothing: Tell your AI: a hint is one ingredient of a recipe that is still missing, and every find clears it.
- Found recipes vanish on loading: Tell your AI: save the list of found recipes with the game, and load it back before the first mix.

Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP

What it does

A recipe the player found by experimenting feels like an earned discovery, and a hint after a run of misses keeps a stuck player from giving up or opening a guide.

How it runs, as a diagram

Everything it can be in, and what moves it on. Your AI builds from exactly this.

wrong mixhint appearsfirst findstill stucka findlast findfind or wrong mixhint appearslast findnothing leftNothing foundHint showingSome foundAll found
How it runs, as a diagram
  • Nothing found → Nothing found: wrong mix
  • Nothing found → Hint showing: hint appears
  • Nothing found → Some found: first find
  • Hint showing → Hint showing: still stuck
  • Hint showing → Some found: a find
  • Hint showing → All found: last find
  • Some found → Some found: find or wrong mix
  • Some found → Hint showing: hint appears
  • Some found → All found: last find
  • All found → All found: nothing left

Good starting values

ValueStart withWhat it changes
hintAfter5How many wrong mixes in a row before the game gives a hint. Too low and the hint replaces experimenting, too high and a stuck player gives up first.
maxIngredients4How many ingredients one mix can hold. It must be at least as many as the biggest recipe needs, or that recipe can never be found.

What usually goes wrong

Water then herb works, herb then water does not

The mix is compared as a list, so the same two ingredients in the other order find nothing. The player concludes the recipe is wrong and moves on.

Fix: Tell your AI: compare a mix as a pile. Sort the ingredients before comparing, so the order is ignored.

Two herbs find the one-herb recipe

Ingredients are compared as a set, which forgets repeats. Herb, herb and water then finds the tonic that wants a single herb, although the player used more than that.

Fix: Tell your AI: keep repeated ingredients when comparing. Two herbs and one herb are different mixes.

Repeating a found recipe resets the hint

The player mixes a known recipe to check something. The game treats it as a find and clears the count of wrong mixes, or as a miss and moves the hint closer. Either way the hint timing is wrong.

Fix: Tell your AI: a mix that matches a known recipe changes nothing at all.

A recipe that can never be found

A recipe needs five ingredients but the table takes four. Or two recipes use the same ingredients. The player can mix forever and never find it.

Fix: Tell your AI: check the recipe book when the game starts. Report any recipe with more ingredients than the table takes, and any two recipes that are the same pile.

A hint that gives the game away, or points at nothing

The hint shows the whole recipe, so the discovery is gone. Or it keeps pointing at a recipe the player found a minute ago.

Fix: Tell your AI: a hint is one ingredient of a recipe that is still missing, and every find clears it.

Found recipes vanish on loading

The list of found recipes is kept only while the game runs. After a restart the player has to find everything again.

Fix: Tell your AI: save the list of found recipes with the game, and load it back before the first mix.

How to check it works

Works well with

Common questions

how do recipe discovery systems work in games

The player puts ingredients together and the game checks the pile against its recipes. A match unlocks the recipe for good. Most games add a hint after a run of failures so nobody stays stuck.

should crafting recipes be hidden or shown from the start

Hide them if experimenting is the fun of your game, and show them if players should plan ahead. A middle way is to show the recipe's name and result but hide the ingredients until it is found.

how many wrong tries before a hint

Start with 5 wrong mixes in a row. With few ingredients to choose from, 5 is a lot of guessing, and with many ingredients you can raise it to 10 or more.

what do i tell my ai to add recipe discovery

Paste this: Players find recipes by mixing ingredients on a table. The order does not matter but the amounts do. A found recipe is saved for good. After 5 wrong mixes in a row, show one ingredient of a recipe that is still missing.

Where it comes from

We could not find a reliable origin for this one yet.

Where this mechanic comes from has not been researched yet.

Games are named only as references. Names and marks belong to their owners, and nothing here is endorsed by them.

What was checked

This is what separates the blueprint from a catalogue entry: the values on this page come from code that runs.

Your AI gets the code

Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it