fixed-timestep-simulation

Implements deterministic fixed-timestep simulation loops for RTS gameplay and ECS update pipelines.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/Ohmnia/site-build --skill fixed-timestep-simulation-ohmnia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fixed-timestep-simulation
Source: https://github.com/Ohmnia/site-build/tree/main/.opencode/skills/fixed-timestep-simulation
Command: npx skills add https://github.com/Ohmnia/site-build --skill fixed-timestep-simulation-ohmnia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Frame-dependent gameplay logic causes non-deterministic behavior, unstable physics, and unreproducible bugs in real-time strategy games. This Skill provides architectural rules for decoupling simulation from rendering using fixed ticks. ## Core Features & Use Cases - Fixed Tick Simulation: Enforces a 20 Hz fixed delta with accumulated lag handling capped at 5 catch-up ticks per frame to prevent death spirals. - Render Interpolation: Decouples rendering from simulation by interpolating entity positions between ticks using the fractional remainder of accumulated time. - Determinism Rules: Mandates stable entity iteration order, seeded RNG with no silent fallback, and integer or fixed-point arithmetic for simulation state. - Use Case: When building an RTS game with lockstep multiplayer or replay systems, apply this Skill to structure the update pipeline (Input → Commands → Pathfinding → Steering → Combat → Resources → Visibility → Rendering) so every client produces identical simulation results. ## Quick Start Use the fixed-timestep-simulation skill to design a deterministic game loop for my RTS prototype with a 20 Hz tick rate and render interpolation.

Frequently Asked Questions about fixed-timestep-simulation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a fixed timestep game loop?

Accumulate wall-clock elapsed time and run fixed ticks of FIXED_DELTA (1/20 second) whenever enough time has accumulated. Cap catch-up at 5 ticks per frame and discard remaining time to prevent a death spiral.

How to decouple rendering from simulation in games?

Keep simulation state updated only inside fixed ticks, then interpolate rendered positions between the previous and current tick using alpha = accumulatedTime / FIXED_DELTA. Never mutate simulation state during the render pass.

Why is my RTS simulation not deterministic across clients?

Non-determinism usually comes from unseeded RNG, unstable entity iteration order, or floating-point differences. Use a mandatory seed at initialization, stable iteration, and integer or fixed-point arithmetic instead of platform-dependent floats.

What happens when a simulation tick exceeds its time budget?

Each tick must complete within FIXED_DELTA seconds of wall-clock time. If a tick exceeds its budget, log a warning and never attempt to catch up beyond 5 accumulated ticks per frame.

When should I avoid fixed timestep simulation?

Avoid fixed timesteps for frame-dependent gameplay, render-driven logic, or systems where variable update rates are acceptable. Fixed ticks add complexity that is only justified when determinism, reproducibility, or stable update ordering is required.