Skip to content

GameSimulation

Role

GameSimulation (src/sim/core/GameSimulation.ts) is a small, headless simulation stub. It is designed to hold deterministic, serializable game logic independent of rendering.

Current state

  • GameState{ tick: number } (tick counter only)
  • update(deltaTime) – increments tick; no other logic
  • serialize() / deserialize() – JSON round-trip for save/load or network sync

Usage

  • Exported from sim/core but not used by the current client. Game loop, jobs, needs, and objects live in IsometricMap, JobSystem, ObjectManager, etc.
  • Intended as a placeholder for a future ECS-style or headless sim: move tick-based logic here, keep rendering in the client.

Extending

To use it later:

  1. Add state to GameState (e.g. global flags, world time).
  2. Move deterministic logic into update() (e.g. world tick, weather).
  3. Ensure all state is serializable so serialize()/deserialize() stay valid.