GM dashboard
The optional top-level dashboard block declares metrics — labeled values
aggregated from live player state — that the GM web renders on the Game tab.
It’s how a GM watches a game’s progress at a glance: live standings, totals, or
per-team rows that update each tick.
It’s fully data-driven and game-agnostic. The engine never interprets a
metric; on createWorld it just mirrors the dashboard spec onto the world.
The GM web reads each metric, aggregates over the current players, and renders
the values. Metrics are pure data — a label, an aggregation, and a state key.
dashboard
Section titled “dashboard”interface Dashboard { metrics: DashboardMetric[];}
interface DashboardMetric { label: string; // display label, e.g. "Treasure banked" agg: "sum" | "count" | "max" | "min" | "avg"; key?: string; // player.state key to read; required for every agg except "count" where?: { key: string; value: unknown }; // only include players whose state[key] === value groupBy?: "team" | "none"; // "team" → one row per team; "none" (default) → single total}Fields
Section titled “Fields”label— the display name shown next to the value, e.g."Treasure banked".agg— how the per-player numbers are combined:sum,max,min,avg— reduce overNumber(state[key])across the included players.count— ignoreskeyand counts the players that passwhere.
key— thePlayer.statekey to read. Required for everyaggexceptcount(which counts players rather than reading a value).where— an optional filter. Only players whosestate[key] === valueare included in the aggregation. Omit it to include every player.groupBy— how rows are emitted:"team"— one value per team, aggregated over that team’s players, rendered as per-team rows with each team’s color."none"(the default) — a single value aggregated over all players.
Example
Section titled “Example”Pirate’s Booty ships the first dashboard: each crew’s banked loot is the sum
of score across its pirates, grouped by team so the Game tab shows live
standings.
dashboard: metrics: - { label: "Treasure banked", key: score, agg: sum, groupBy: team }Source: apps/wage-engine/src/games/pirates_booty/game.yaml.
Behavior
Section titled “Behavior”- Aggregates over all player kinds. Human, bot, and demo players all feed the numbers, so a demo-only preview (no phones connected) still reads correctly.
- Shown whenever a game is loaded. The section renders on the GM web’s Game tab during setup, while running or paused, and after the game ends.
- No
dashboard, no section. Rulesets that don’t declare adashboardsimply show nothing — the panel is hidden for them.
See also
Section titled “See also”- Top-level ruleset — where
dashboardis indexed alongside the other ruleset blocks. - Running a game as GM — the GM web’s Game tab in context.