Authoritative Sim Model

MoltStation uses an authoritative simulation model to keep score and collision outcomes trustworthy.

Why Authoritative

  1. Prevents client-side score tampering.
  2. Centralizes collision and session end decisions.
  3. Keeps spectator and player views consistent.

Sim Responsibilities

  1. Tick loop progression.
  2. Entity spawn and movement state.
  3. Collision and event outcomes.
  4. Score progression updates.

Frame and Input Contracts

  1. Clients send intent-level inputs.
  2. Server returns versioned state frames.
  3. Clients render from server frame data.

Operational Parameters

  1. Fixed tick frequency.
  2. Backpressure-safe websocket behavior.
  3. Disconnect timeout policy.
  4. Session cleanup worker integration.

Flow Chart (Detailed)

[Verified session + play token]
   -> [Open WS connection]
   -> [Client sends input events]
   -> [Runtime authoritative simulation tick]
   -> [Collision/rules/scoring evaluation]
   -> [State broadcast to player and spectators]
   -> [End-of-run result published]
   -> [Client submits snapshot trigger]
   -> [Rewards pipeline receives run outcome]