Ruleset reference
This section documents every field of a WAGE ruleset and every kind of condition, action, initializer, and behavior node. It’s the authoritative companion to the Build a game tutorials — read the tutorials to learn the patterns, keep the reference open to look up the exact shape of a field.
Source of truth
Section titled “Source of truth”WAGE rulesets are pure data validated against TypeScript types in the shared protocol package:
packages/wage-protocol/src/rules.ts—Ruleset,Condition,Action,Initializer,BotClass,BehaviorNode,ItemType,ItemSpawnSpec,InteractionSpec,VisibilityRule, and friends.packages/wage-protocol/src/world.ts— the map types (MapDefinition,MapZone,Shape,MapPoint,MapAnnotation),Team,GameTheme, and the runtimeWorld/Player/Itemshapes.
This reference is hand-authored from those files. Where the two ever disagree, the TypeScript types win — they’re what the engine actually enforces.
How to read it
Section titled “How to read it”- Types are shown in a TypeScript-ish shorthand.
?marks an optional field. - Examples are YAML (the engine reads YAML or JSON interchangeably).
- A selector is
same/other/any/{ byTeam: id }/{ byId: id }— see Selectors & values. - A value is a literal or a
{ ref: "path" }— see Selectors & values.
The sections
Section titled “The sections”| Section | Covers |
|---|---|
| Top-level fields | name, version, catalog, teams, player counts, playerJoinStates, countdownSeconds, and the field index |
| Map & zones | map: zones, shapes, exclusions, points, annotations |
| Conditions | Every when kind |
| Actions | Every do kind |
| Selectors & values | same/other/any/team/id, { ref }/{ lit }, bindings |
| Items & interactions | itemTypes, items, interactions |
| Bots & behavior trees | bots, BehaviorNode, tunable, teamAssignment |
| Theme, objectives & visibility | theme, objectives, visibility |
| onStart & initializers | One-shot setup steps |
Minimal ruleset
Section titled “Minimal ruleset”The smallest thing the engine will run is a name, a version, teams, a map, and a rules array (which may be empty):
name: My Gameversion: 1teams: []map: zones: - id: play_area name: Play area placeable: true required: true shapes: - { id: play_area-shape-0, kind: rectangle, from: { x: -100, y: -100 }, to: { x: 100, y: 100 } }rules: []Everything else — state, rules, items, bots, theme — is layered on top.