Game-Engine Architecture (engine-agnostic)
Generalizes the Unity-specific gamedev/* skills into engine-agnostic design.
For Unity APIs/DOTS specifics, defer to those skills.
The game loop
The heartbeat: process input → update simulation → render. Key decision is the
timestep:
- Fixed timestep for the simulation (deterministic physics, stable netcode),
decoupled from a variable render rate with interpolation. This is the
standard for anything needing determinism (multiplayer, physics).
- Variable timestep is simpler but makes physics/netcode non-deterministic.
Data model: ECS vs scene-graph/OOP
|
OOP / scene graph |
ECS (entity-component-system) |
| Layout |
Objects with inheritance |
Data in contiguous component arrays |
| Cache |
Pointer-chasing, poor |
Data-oriented, cache-friendly, SIMD-able |
| Logic |
Methods on objects |
Systems iterate components |
| Fits |
Small/simple games, editor tooling |
Many entities, performance, parallelism |
ECS is the modern default for performance and parallelism (see
hardware-aware-design); OOP scene graphs remain fine for simpler titles.
Render pipeline
- Forward (shade per object) vs deferred (G-buffer, shade per pixel —
many lights) vs forward+ / clustered. Choose by light count and platform
(mobile/bandwidth favors forward/tiled).
- A render graph / frame graph declares passes + resource dependencies so
the engine schedules and aliases GPU memory — the modern structuring approach.
Core subsystems
Physics, audio, animation, scene/asset streaming, and a memory strategy
(pools/arenas/frame allocators rather than per-frame malloc — determinism +
no GC stalls). Keep subsystems decoupled behind clear interfaces.
Netcode (multiplayer)
- Lockstep (send inputs, simulate deterministically everywhere): tiny
bandwidth, needs full determinism; RTS.
- Client prediction + server reconciliation: responsive, authoritative
server; FPS.
- Rollback: predict + re-simulate on correction; fighting games.
Authority and determinism (fixed timestep) are the cross-cutting requirements.
Guidance
Prefer off-the-shelf (Unity/Unreal/Godot) unless you have a specific reason to
build. If custom: fixed-timestep loop, ECS for entity-heavy/perf games, a render
graph, arena memory, and a netcode model matched to the genre.
1---2name: game-engine-architecture3description: |4 Game-engine architecture, engine-agnostic: the game loop (fixed vs variable5 timestep), ECS vs scene-graph/OOP, the render pipeline, core subsystems6 (physics, audio, animation, assets, memory), and netcode models. Architect-7 level, beyond any specific engine.89 USE WHEN: designing/evaluating a game engine or game's architecture in general,10 "game loop", "ECS", "entity component system", "render pipeline", "forward vs11 deferred", "rollback netcode", "lockstep", custom engine vs off-the-shelf,12 data-oriented game design.1314 DO NOT USE FOR: Unity-specific work (use the `gamedev/unity-*` skills);15 low-level cache/SIMD detail (use `hardware-aware-design`); web graphics (use16 graphics skills).17allowed-tools: Read, Grep, Glob18metadata:19 source: https://skillmd.com/skills/claude-dev-suite/game-engine-architecture20---2122# Game-Engine Architecture (engine-agnostic)2324Generalizes the Unity-specific `gamedev/*` skills into engine-agnostic design.25For Unity APIs/DOTS specifics, defer to those skills.2627## The game loop2829The heartbeat: process input → update simulation → render. Key decision is the30timestep:31- **Fixed timestep** for the simulation (deterministic physics, stable netcode),32 **decoupled** from a variable render rate with interpolation. This is the33 standard for anything needing determinism (multiplayer, physics).34- Variable timestep is simpler but makes physics/netcode non-deterministic.3536## Data model: ECS vs scene-graph/OOP3738| | OOP / scene graph | **ECS** (entity-component-system) |39|---|---|---|40| Layout | Objects with inheritance | Data in contiguous component arrays |41| Cache | Pointer-chasing, poor | Data-oriented, cache-friendly, SIMD-able |42| Logic | Methods on objects | Systems iterate components |43| Fits | Small/simple games, editor tooling | Many entities, performance, parallelism |4445ECS is the modern default for performance and parallelism (see46`hardware-aware-design`); OOP scene graphs remain fine for simpler titles.4748## Render pipeline4950- **Forward** (shade per object) vs **deferred** (G-buffer, shade per pixel —51 many lights) vs forward+ / clustered. Choose by light count and platform52 (mobile/bandwidth favors forward/tiled).53- A **render graph / frame graph** declares passes + resource dependencies so54 the engine schedules and aliases GPU memory — the modern structuring approach.5556## Core subsystems5758Physics, audio, animation, scene/asset streaming, and a **memory strategy**59(pools/arenas/frame allocators rather than per-frame malloc — determinism +60no GC stalls). Keep subsystems decoupled behind clear interfaces.6162## Netcode (multiplayer)6364- **Lockstep** (send inputs, simulate deterministically everywhere): tiny65 bandwidth, needs full determinism; RTS.66- **Client prediction + server reconciliation**: responsive, authoritative67 server; FPS.68- **Rollback**: predict + re-simulate on correction; fighting games.69Authority and determinism (fixed timestep) are the cross-cutting requirements.7071## Guidance72Prefer off-the-shelf (Unity/Unreal/Godot) unless you have a specific reason to73build. If custom: fixed-timestep loop, ECS for entity-heavy/perf games, a render74graph, arena memory, and a netcode model matched to the genre.