TickContext
In one line: what a system's
Executereceives each tick — its transaction, its read accessor, its entities, the frame's delta time, and the escape hatches.
A system never creates a unit of work or calls Commit — it is handed a TickContext and works through it. The context exposes: Transaction (the system's own per-tick transaction, committed for you by the scheduler); Accessor (a PointInTimeAccessor for lock-free parallel reads); Entities (the view's matched set, for a QuerySystem); DeltaTime (seconds since the last tick); and SpatialGrid (assign a SimTier per cell, read tier budgets).
It also carries the escape hatches from the one-transaction-per-tick default: typed event queues for inter-system signalling, and side transactions — ctx.CreateSideTransaction(DurabilityMode.Immediate, DurabilityDiscipline.Commit) opens an independent transaction mid-tick for an immediate, ACID write (a player purchase, a teleport) that must not ride the tick's shared commit.
How it relates
- System — receives a
TickContextinExecute; it is the system's window on the world. - Tick — one context per system per tick; side transactions and event queues are how you step outside the default.
- Transaction —
ctx.Transactionis the system's;ctx.CreateSideTransactionopens another. - PointInTimeAccessor —
ctx.Accessor, for parallel reads across worker threads.
In the API
TickContext—Transaction/Accessor/Entities/DeltaTime/SpatialGrid.TickContext.CreateSideTransaction(DurabilityMode, DurabilityDiscipline)— an independent mid-tick transaction.- Typed
EventQueue<T>— single-producer inter-system signalling, drained per tick.
Learn & use
- Feature detail: Tick-based execution engine · side-transactions · typed event queues
- Narrative: Guide ch.5 — systems