Not every game is strictly turn-based. Bidding rounds, planning phases, and games like paper-scissors-rock let multiple players act at the same time. Gamekit’s phase-levelDocumentation Index
Fetch the complete documentation index at: https://openturn.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
activePlayers plus move.stay express this cleanly.
The idea
- Declare a phase where multiple seats are active.
- Each player’s move does not end the turn; it records their input and returns
move.stay({ ... }). - When everyone has submitted, the last submission transitions (
move.endTurnormove.goto).
Worked example
Fromexamples/simultaneous-moves/paper-scissors-rock:
activePlayersfilters by “has not submitted yet.” Players who already submitted are no longer active, so the engine rejects their retries withinactive_player.move.stayrecords one submission without ending the turn. The turn counter does not advance; the phase stays the same.- The last submission triggers the resolution. When
allSubmittedis true, the move returnsmove.endTurnwith the next round’s state, advancing the turn counter.
Hide other players’ submissions
Submissions are secret until everyone has committed. That is a hidden-info pattern, so useviews.player:
What about deadlines?
If you want a timer that forces resolution, enqueue a tick event from the first submission and usecontext.now to decide when it fires. The engine records now in the replay, so timer-driven transitions stay deterministic.
For stricter deadline handling, use @openturn/core’s deadline.after(context, durationMs) to compute a fixed target timestamp, and store it in G. Moves then compare context.now to G.roundDeadline.
Related
- Concepts: turns, phases, and control on active players.
- How-to: model hidden information for the private-submission pattern.