Goal: the authoritative simulation loop and the single-writer model.
Scope / deliverables:
engine:sim: fixed 20 TPS tick + Box2D subticks (e.g. 3×1/60) inside each tick; render interpolation via partialTick.
TickScheduler: scheduled tile ticks (delay+priority) + random ticks (randomTickSpeed).
- Command bus — the only way to mutate world/ECS (single writer).
- Context parameters:
WorldContext (read), CommandContext (write), ClockContext{gameTick, partialTick, seeded random}, EcsContext.
SessionScope on coroutines; heavy pure work off-thread returning commands.
- Migrate the old
*ControllerTask periodics here as tick phases / scheduled / random ticks.
Definition of Done: deterministic tick; mutations only via commands; golden tests of tick/scheduler behavior; determinism test (same seed+commands → same snapshot).
Depends on: E1
Goal: the authoritative simulation loop and the single-writer model.
Scope / deliverables:
engine:sim: fixed 20 TPS tick + Box2D subticks (e.g. 3×1/60) inside each tick; render interpolation viapartialTick.TickScheduler: scheduled tile ticks (delay+priority) + random ticks (randomTickSpeed).WorldContext(read),CommandContext(write),ClockContext{gameTick, partialTick, seeded random},EcsContext.SessionScopeon coroutines; heavy pure work off-thread returning commands.*ControllerTaskperiodics here as tick phases / scheduled / random ticks.Definition of Done: deterministic tick; mutations only via commands; golden tests of tick/scheduler behavior; determinism test (same seed+commands → same snapshot).
Depends on: E1