Recipes
A recipe answers exactly one question and is completable by editing at most two files. Every one has the same five headings — Goal, Files you will edit, Steps, Verify, See also — so you can skim straight to the part you need.
Getting started
The path from nothing to a game you are editing.
- Scaffold a new game —
npm create gameable, a playable game in its own directory with nothing to configure. - Create an engine around a canvas — boot
gameable/coreyourself, for a custom host rather than a template. - Debug with doctor — take
gameable doctorfrom red to green, one check at a time. - Use the placeholder assets — render the CC0 arena and its spawn points before you have content of your own.
Game logic
Inside the guest: systems, input, the HUD, and the component that ships them.
- Write a game system — one more function per fixed step, allocating nothing.
- Walk with character movement — guest-owned walking capsules, blocking NPCs and tile walls.
- Backpedal with a held facing — retreat facing an opponent.
- Click in the world.
- Read player input — named actions, not key codes.
- Build a game screen — menus, answer grids and draggable cards, with state-driven UI updates.
- Add effects — hit sparks, attached fire, bloom and fog through the VFX facade.
- Add a HUD element — a value on screen that only crosses the boundary on the frames it changed.
- Tell a playtest what happened — mark deaths, the goal and the win, so the agent can learn the game and the reports say where players die.
- Build the wasm guest — the shipping path:
jco componentize,jco transpile, and what each step is for. - Write a guest in Rust — the same WIT world from a Rust crate; the host cannot tell the difference.
Gameplay building blocks
Small guest parts with a shared reset, snapshot and restore lifecycle.
- Count down with a timer — fixed-step countdowns.
- Ease a value with a tween — named numeric lanes.
- React when something enters a zone — guest geometry.
- Deal damage and heal — Health, death and invulnerability.
- Give the player an inventory — stacks and overflow.
- Add an ability with a cooldown — charges and use gates.
- Track a quest — objectives and prerequisites.
- Spawn enemies in waves — Spawner and TargetPoints.
- Unit orders.
- Take turns — authority validation, timeouts and wake catch-up.
Actors and level files
Start these recipes from templates/blank; use premade actors before writing custom systems. Actors explains the lifecycle.
- Place actors from a level file — placements as data.
- Switch levels at runtime — several level files.
- Move on a grid — tile stepping, blocking NPCs and bumps.
- Make your own actor — components, props and hooks.
- Add a pickup — rewards and respawning.
- Pick the right door — doors, keys and switches.
- Add a door that needs a key — inventory and interaction.
- Add a checkpoint and kill zone — no custom system.
- Run a match with a game mode — rules and scores as data.
- Spawn enemies in waves — Spawner and TargetPoints.
First-person
Recipes that build on templates/fps.
- Add a weapon — a second fire mode with its own ammunition, rate and sound.
- Add an enemy — a heavier variant sharing the existing chase-and-attack behaviour.
- Make enemies chase around obstacles — paths around crates, crowd steering and an interruptible behaviour tree.
- Change the level — your own splat environment, your own collider, your own spawns.
Third-person
Recipes that build on templates/third-person.
- Add an interactable — a lever the hero walks up to and presses
Eat, declared with a tag, with a HUD prompt when it is in reach. - Add NPC dialogue — a third person with a script of their own, in a JSON file and a prefab, without touching the dialogue system.
- Set up talking characters — the relay that keeps the API key on the dev server, and the page's voice, face and talk box.
- Write a character's story — a talking character's persona, voice, knowledge and objectives, for Convorcher.
- Talk to a character — a talking character (AI NPC, Convorcher) the player types or speaks to in their own words, with voice, subtitles and a moving face.
- Let the game decide a conversation — a gatekeeper the player must convince: the game owns permission, refusal and retry, and a slow reply never costs an attempt.
- Tune the follow camera — boom length, height, pitch range, shoulder offset and collision.
- Top-down camera.
- Add a locomotion state — a crouch on
Ctrlat half walk speed, reported to the animator. - Play with friends — one line in
src/game.ts, a room server beside the dev server, two tabs in one room. - Send a message —
Vwaves: a message declared once, read on the room's authority and answered to everyone. - Add a lobby — nothing starts until every connected player has pressed
R: the ready set and the start rule.
Race
Obstacle recipes build on templates/race; the vehicle recipe starts from templates/blank.
Racing and vehicles — cars, lap gates and a CPU rival.
Recover a stuck racer — a racer wedged for twelve seconds goes back to their checkpoint, and every teleport starts the clock again.
Place finishers by when they crossed — two racers over the line on the same step are placed by which crossed first within it, not by seat.
World and physics
- Load a splat environment — a gaussian-splat capture as the world, by id, drawn in the right order.
- Load a made world — a world package in place of the arena: the place, its things as bodies with their sounds, and their names.
- Make a swinging door — push a hinge and drive it with a motor.
- Build a physics puzzle — lever, slider gate and swinging weight.
- Cast a shape — throw clearance, teleport checks and pressure plates.
- Add a physics body — a crate that falls, lands and reports its collisions.
- Play a sound — positional audio that falls off with distance and tells you when it ended.
- Play music that changes in combat — stems that bring drums in on the next bar when a fight starts, and a crossfade to another track.
- Trigger on the beat — react to every beat, schedule a sound exactly on the next one, and judge a press by how close to the beat it was.
Characters and animation
Turn on a feature — declare
charactersin the game definition and the page loads the rig stack only because you did.Use the sample character — the
aosrig_v0skinned body in place of a capsule, idling, walking and running from the state the game already publishes.Load a character — a splat avatar in the scene, by id, with a graceful answer on a machine without WebGPU.
Load a character from the Asset Manager — the same, sourced from AAM, without a URL ever being written down.
Play an animation on a character — idle, walk and a one-shot wave, driven from the character state game logic already produces.
Preview a rig without decoders — a freshly baked rig on screen as one gaussian per vertex, months before anyone has trained a decoder for it.
Give an NPC a face — wire the guest's character commands to a real splat head, so dialogue expressions and look-at are drawn rather than recorded.
Build a fighting game — the fight pack, the pose layer, the rag-doll and the stagger, the fight camera and your own pose on the bones: the fight kit Fight Lab plays on.
The rules, in one line each
- Two files maximum. A third file means two recipes, or a design problem.
- Never
packages/. A recipe that needs an engine change is a missing feature; file it instead of documenting it. - Assets by id. Recipes add manifest entries; they never hardcode a URL.
- No allocation in systems. Recipe code is copied verbatim, by humans and by language models. Preallocate.
- Runnable code only. Every snippet is checked against the engine's real exports.
See also
Concepts — the model a recipe assumes you have
Build your first FPS — the long-form version
Troubleshooting — when a recipe does not do what it says
Start a game — one Play action for people, capture and playtest.