# Cooking

Build one complete meal first. Catch two fish, grill them, feed one villager and show their next fishing job finish sooner. Connect to the existing inventory, job scheduler and save clock before expanding the menu.

## Give each station a reason to exist

Define recipes as data. Drive the menu, costs, world props, countdown, servings and effects from the same row. These examples use Bellwater’s balance.

| Station and recipe | Ingredients | Time | Servings | Effect for one diner |
| --- | --- | ---: | ---: | --- |
| Campfire · grilled fish | 2 fish | 8 s | 3 | 25% faster fishing |
| Hanging pot · fish stew | 2 fish, 1 cabbage | 14 s | 5 | 25% faster mining |
| Earthen oven · roast cabbage | 2 cabbages | 12 s | 3 | 25% faster harvesting |

Open the station on its available dishes. Show owned and required amounts, cooking time, servings, effect and duration together. When a recipe is blocked, explain the exact gap, such as **Need 1 more cabbage**. Let the player go to the source.

## Run a single batch

1. Anchor the station, approach point, working side, vessel, heat source and serving point in local space. Reserve a clear route for the cook. Test the rotated model near a wall.
2. Use `cold → heating → available → cooking → ready → empty`. Skip heating if the game has no fuel system. Show remaining burn time and define whether the heat must last through the batch. The example requires enough heat upfront.
3. On Start, validate the station ID, heat, free slot and every ingredient in one transaction. Save the debit alongside a unique batch ID, recipe, start time, ready time and portion count. Never charge when reopening the menu or replaying a stirring animation.
4. Pose the cook at the work point. Solve the spoon from the grip to a target inside the rim. Check the full arc against the tripod, handle and sleeve. Sync flame, steam, browning and the ready cue to batch progress. Restore the correct stage silently after loading.
5. On Serve, recheck the batch and diner. Spend one portion and attach the effect to that diner together. Keep leftovers available. If storing food, transfer the remaining count and clear the station in the same save.

## Prove the bonus changes play

Use a single active meal per diner. Reject a repeat while active and preview replacement before changing meals. A 25% speed bonus turns 10 seconds of work into 8 seconds. For a tick crossing expiry, multiply only the overlapping seconds. Apply this once in the job scheduler and derive the UI estimate from that same rate.

[Kitchen example](scripts/cooking.mjs) uses 120-second meals and absolute simulation times. Run `node --test scripts/cooking.test.mjs` from this folder.

Check a missing ingredient, insufficient fuel, simultaneous Start commands, a save halfway through, the last portion and a stale Serve command. Compare two workers on identical jobs and watch the bonus expire during fast-forward.

---

Copyright (c) 2026 Meng To

The license files are attached. [MIT](https://knowen.md/f/3c02f208-fea4-4055-a09c-593a4f764a38)

The attached ZIP contains the pinned supporting files and applicable license notices.