world-store
A pure, Babylon-free, deterministic reference implementation of [[world-contract]].
It is the systemic spine of the simulation: it holds the serializable
WorldState, resolves systemic causality (interactions, pickups, damage) in
itself with no external blessing, emits best-effort events, and answers
queries. A Babylon scene is later a view reconciled from this state — the
store never imports a 3D engine, so it is fully unit-testable and can host a
headless driver.
Two method groups make the boundary legible in code:
WorldApimethods — what an external driver (e.g. a narrative engine) may call.- simulation methods — what the engine's own gameplay systems (player input, an interaction system, combat) call. A driver must NOT call these; they represent the player and world acting.
Determinism: ids come from a counter and time advances only via tick() — no
Date.now/Math.random — so the same inputs always produce the same trace.