Skip to content

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.

Game logic ​

Inside the guest: systems, input, the HUD, and the component that ships them.

Gameplay building blocks ​

Small guest parts with a shared reset, snapshot and restore lifecycle.

Actors and level files ​

Start these recipes from templates/blank; use premade actors before writing custom systems. Actors explains the lifecycle.

First-person ​

Recipes that build on templates/fps.

Third-person ​

Recipes that build on templates/third-person.

  • Add an interactable — a lever the hero walks up to and presses E at, 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 Ctrl at 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 — V waves: 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.

World and physics ​

Characters and animation ​

  • Turn on a feature — declare characters in the game definition and the page loads the rig stack only because you did.

  • Use the sample character — the aosrig_v0 skinned 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.

  • VR room.

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 ​