Game Loop and Timing
Makes movement, timers and physics behave the same at any frame rate in Unity, Godot, Bevy and web games.
Claude's review
7/10 Compact cross engine table of frame vs fixed clocks with a correct accumulator loop, delta scaled smoothing, pause and determinism rules.
We asked Claude the question you would ask: would I be glad I installed this? We only sell skills it rates 7 or higher.
In detail
Use when writing anything that moves, animates, counts down or simulates - per-frame vs fixed-step callbacks per engine, the accumulator loop with interpolation, delta-scaled smoothing, pause and time scale, and determinism.
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: game-loop-and-time
category: gameplay
description: Use when writing anything that moves, animates, counts down or simulates - per-frame vs fixed-step callbacks per engine, the accumulator loop with interpolation, delta-scaled smoothing, pause and time scale, and determinism.
tech_stack: Game core
source: informed by Glenn Fiedler's Gaffer on Games articles (Fix Your Timestep) and the engines' own docs; own wording
---
# Game Loop and Time
## Overview
Two clocks run in every game: the render frame (variable, as fast as the machine allows) and the simulation step (fixed, so physics and rules behave the same everywhere). Most "it moves faster on my machine", tunnelling, jitter and desync bugs come from putting work on the wrong clock or forgetting to scale by the right delta.
**Core principle:** Simulate on a fixed step, render with interpolation, and scale every time-based value by the delta of the clock it runs on.
## Where each clock lives
| Engine | Per frame (variable) | Fixed step | Default fixed rate |
|---|---|---|---|
| Unity | `Update`, `LateUpdate` — `Time.deltaTime` | `FixedUpdate` — `Time.fixedDeltaTime` | 0.02 s (50 Hz) |
| Godot | `_process(delta)` | `_physics_process(delta)` | 60 ticks/s (`physics/common/physics_ticks_per_second`) |
| Unreal | `Tick(DeltaSeconds)` | physics substepping / async physics tick | project physics settings |
| Bevy | `Update` — `Res<Time>` | `FixedUpdate` — `Res<Time>` is `Time<Fixed>` there | 64 Hz |
| Phaser | `update(time, delta)` (ms) | Arcade physics' own step (`fps`, `fixedStep`) | 60 |
| PixiJS 8 | `ticker.add(t => …)` — `t.deltaMS` | your accumulator | — |
| three.js / Babylon.js | `setAnimationLoop` + `THREE.Timer` / `engine.getDeltaTime()` (ms) | your accumulator, or the physics plugin's | — |
| MonoGame | `Update(GameTime)` | `IsFixedTimeStep = true` (default) | 1/60 s |
| pygame | `dt = clock.tick(60) / 1000` | your accumulator | — |
Use the engine's fixed callback for physics and authoritative rules. Write your own loop only where the engine has none (web renderers, pygame, custom servers).
## The accumulator loop (web, pygame, servers)
```ts
const STEP = 1 / 60;
const MAX_FRAME = 0.25; // clamp: a 3 s tab-switch must not run 180 steps
let acc = 0;
let last = performance.now();
function frame(now: number) {
...From makifbaysal's repository, Apache-2.0 licence.
Related skills
-
Checked
Godot game optimisation
Profiles a Godot game and fixes common slowdowns in draw calls, physics and memory so it runs more smoothly.
7/101 credit -
Checked
Game Audio Mixing
Sets up game audio buses, volume sliders, music ducking and adaptive music for Godot, Unity or FMOD.
8/101 credit -
Checked
Game camera tuning
Builds and tunes follow, orbit and first person game cameras in Godot or Cinemachine so they stop jittering.
8/101 credit -
Checked
Game Enemy AI
Designs enemy AI with perception, pathfinding and steering so enemies chase fairly and never get stuck.
8/101 credit -
Checked
Blender asset optimisation
Cuts Blender assets down to each platform's budget with LODs, decimation and texture atlases before export.
7/101 credit -
Checked
Roblox Game Structure
Helps you organise a Roblox game's client and server code, data flow and streaming so it stays secure.
7/101 credit