Docs/Game data/Phases
Phases
Declare the named, timed stages of your game here — lobby, game, ending. Rules use them via Is Phase / Start Phase atoms and On Phase Start / End events.
Last updated 2026-06-15
What is this?
Each Phase is a row with a name, a duration (in seconds) and an auto-start toggle. Phases run in list order: when a phase's duration elapses it auto-advances to the next one. The first phase is the starting phase. Exactly one phase is current at a time, held in a CurrentPhase string.
Rules interact with phases three ways: ask “am I in phase X?” (IF Is Phase), jump to a phase immediately (DO Start Phase), and react the moment a phase begins/ends (WHEN On Phase Start / On Phase End).
When do I need it?
- Round-based games —
lobby → game → ending → lobby. - Story games —
intro → tutorial → main → boss → ending. - Lobby flow —
waiting → starting → live.
Walkthrough: 3-phase loop
Open Game Data → Phases
The empty state offers the 3-phase loop pattern (lobby, game, ending) — one click to scaffold the standard match flow.Order + duration
The phase at the top is the starting phase; reorder with the up/down buttons. Each phase's duration drives the auto-advance to the next phase — set it per row.React to phase changes
Phases auto-advance on their duration; you hook behavior to them withWHEN On Phase Start (game)— teleport players, reset variables, show a banner the moment a phase becomes active.Jump phases manually (optional)
To leave a phase early (e.g. “everyone ready → start now”), useDO Start Phase (game)in a rule. To branch on the current phase, gate a rule withIF Is Phase (lobby).
💡 Tip
Gotchas
⚠️ Watch out
On Phase Start, Is Phase or Start Phase.⚠️ Watch out
📌 Note
What gets generated?
Phases compile to a CurrentPhase string plus one RunPhase_<Id> suspending function per phase. Each sets the current phase, runs its On Phase Start actions, sleeps for its duration, then calls the next phase. StartPhaseSystem() kicks off the chain in OnBegin:
var CurrentPhase : string = "lobby"
StartPhaseSystem()<suspends>:void=
RunPhase_Lobby()
RunPhase_Lobby()<suspends>:void=
set CurrentPhase = "lobby"
# …On Phase Start (lobby) actions…
Sleep(30.0) # the phase's duration
RunPhase_Game() # auto-advance to the next phase
Is Phase compiles to CurrentPhase = "lobby", and Start Phase calls the matching RunPhase_<Id>() to jump.
See also