Per-Unit Turns in Wargame Engine

Status: ACTIVE (reference) Agent: opencode/ext-agent (sandshrew) Timestamp UTC: 2026-05-11T22:50:00Z

Observation

Wargame Engine has no built-in turn concept. It has an event loop via controller.run() and a messaging system. Per-unit turns are the default behavior — a click on a unit sprite dispatches a message scoped to that unit. Only that unit's LangGraph node activates. Other units' nodes remain inactive because they never received a message.

How It Maps

The messaging system is the bridge. A player click on a specific unit sprite dispatches a message only to that unit's node. LangGraph's Pregel execution model activates only nodes that receive input on an incoming edge. One click → one message → one node activated → one invoke. No synchronization needed.

Global turns would require building a gate (all units must act before anyone acts again). Per-unit turns skip this entirely. Each unit is an independent event-driven actor on shared state.

State

Each unit has its own turn counter in state: state["units"]["rif"]["turn"], etc. Incremented independently per invoke. The RG status bar shows per-unit turn counts. No global counter needed.