diff --git a/docs/tickets/todo/002-fixed-step-replay.md b/docs/tickets/todo/002-fixed-step-replay.md --- a/docs/tickets/todo/002-fixed-step-replay.md +++ b/docs/tickets/todo/002-fixed-step-replay.md @@ -31,7 +31,7 @@ - Advance gameplay only through fixed simulation ticks. - Keep variable rendering independent from simulation advancement. - Track a monotonically increasing simulation tick for the current run. -- Define a normalized `Input_Command` or equivalent per simulation tick. +- Define a normalized, quantized `Input_Command` or equivalent per simulation tick. - Record one input command per simulated tick for a run. - Provide a way to replay a recorded command stream from tick `0` into a fresh simulation state. - Add deterministic test coverage for replay behavior without requiring Raylib rendering. @@ -41,11 +41,13 @@ - Treat `sim_tick` as the only authoritative gameplay mutation path. - Store gameplay timers as integer ticks, not seconds. - Avoid authoritative simulation dependence on pointer addresses, unordered iteration, global random state, wall-clock time, render frame count, or raw struct memory layout. +- Replace or wrap the current float-based command axes before they become persistent replay data. - Prefer quantized/integer/fixed-point simulation values for replay-relevant state. Rendering may convert simulation state to floats later. ## Suggested Implementation Direction -- Use an accumulator in `game_update` or an app-level update function. +- Add the fixed-step accumulator to app/game state, not `Sim_State`; frame time is an app concern, while ticks are a simulation concern. +- Use the accumulator in `game_update` or an app-level update function to produce `0..MAX_TICKS_PER_FRAME` simulation ticks per rendered frame. - Clamp frame delta to avoid huge catch-up spikes. - Cap max simulation ticks per rendered frame to avoid death spirals. - Store timers as ticks, not seconds, for gameplay-relevant state. diff --git a/docs/tickets/todo/003-headless-run-harness.md b/docs/tickets/todo/003-headless-run-harness.md --- a/docs/tickets/todo/003-headless-run-harness.md +++ b/docs/tickets/todo/003-headless-run-harness.md @@ -14,7 +14,7 @@ ## Requirements -- Add a headless executable or `just` recipe that runs `src/sim` without Raylib. +- Add a headless executable package and `just` recipe that run `src/sim` without Raylib. - Accept a small deterministic input script or hard-coded fixture format for prototype runs. - Convert scripted input into the same normalized simulation command type used by replay. - Emit a stable text transcript with tick-indexed simulation facts. @@ -23,6 +23,8 @@ - Keep the transcript derived from simulation state. It must not become the authoritative replay source. - Add at least one fixture that can be re-run from the command line. - Keep the harness small and deleteable if a better test runner replaces it later. + +Suggested location: `src/lib/headless` or another small package outside `src/sim` that imports simulation code but no renderer/platform code. ## Suggested Script Shape