Game development (engine-independent)¶
Scope: architecture concerns that every game shares, whatever the engine: the game loop and time steps, core game patterns, entity-component systems, data-driven design, multiplayer networking, save data, frame budgets, version control for large assets, and accessibility. GPU rendering and shaders are in Graphics and GPU rendering, dedicated servers and online services are in Game servers and online services, engine-specific guidance is in Unity, Godot, Unreal Engine and GameMaker, and the general guidelines still apply. Games that run in the browser are in Web games. Accessibility law and cross-platform principles are in Accessibility.
Entries are sorted by score from 1 to 10 (criteria): 9โ10 start here or strongly recommended, 6โ8 recommended, 1โ5 further reading or conditional.
Adopted references¶
No single official guide covers game architecture across engines. These primary sources are the baseline. The rules below combine them and add choices they leave open.
- 8 Game Programming Patterns (Robert Nystrom): the baseline for code structure. Free online. It covers the game loop, update method, component, event queue, object pool, data locality and more.
- 8 Fix Your Timestep! (Glenn Fiedler, Gaffer On Games): the standard fixed-time-step loop with an accumulator and interpolation.
- 8 Fast-Paced Multiplayer (Gabriel Gambetta): the baseline for client-server netcode. A four-part series on authoritative servers, client-side prediction and server reconciliation, entity interpolation, and lag compensation.
- 8 Game Accessibility Guidelines: the baseline for accessibility. Guidelines grouped as basic, intermediate and advanced, with examples, and advice on when and how to apply them.
- 8 Xbox Accessibility Guidelines (Microsoft): best practices developed with the gaming and disability community, for designers, developers and test teams.
- 7 Networked Physics (Glenn Fiedler, Gaffer On Games): compares deterministic lockstep, snapshot interpolation and state synchronisation for networking a simulation.
- 7 Save Game Best Practices (Meta Horizon OS developer docs): versioning, migration, integrity checks and backups for save files. Apart from the cloud backup section, the advice applies to any platform.
- 6 ECS FAQ (Sander Mertens, author of Flecs): what an entity component system is, when it helps, and how implementations differ.
Key rules¶
Game loop¶
- 8
GAMEDEV-1Advance the simulation in fixed time steps, decoupled from the render rate, and interpolate between the last two simulated states when rendering. Cap the number of steps per frame so that a slow frame can't start a "spiral of death". (Gaffer On Games, Fix Your Timestep!, Nystrom, Game Loop)
Code structure¶
- 7
GAMEDEV-2Build game entities by composing components, not through deep inheritance hierarchies. (Nystrom, Component) - 7
GAMEDEV-3Define entity types and tuning values as data that designers can change without recompiling, not as one subclass per type. (Nystrom, Type Object, Unity: ScriptableObject data) - 5
GAMEDEV-21Model an entity whose behaviour depends on its current mode, such as a character, an enemy or a menu, as a finite state machine: one current state out of a fixed set, with explicit transitions, instead of boolean flags and nested conditionals. When a state needs its own data or behaviour, make it an object (the State pattern), and put behaviour that several states share in a superstate; for complex AI, consider behaviour trees instead. The engine files name the built-in mechanisms of Unreal (UNREAL-25) and GameMaker (GAMEMAKER-CODE-12). (Nystrom, State, Unity e-book, Level up your code with design patterns and SOLID) - 4
GAMEDEV-4Adopt an entity component system (ECS) deliberately, when you need very large numbers of entities, and prefer an established framework to writing your own. A home-grown ECS rarely matches the performance of established ones. (Mertens, ECS FAQ, Unity: Entities package)
Multiplayer¶
- 8
GAMEDEV-5In competitive multiplayer games, make the server authoritative: clients send inputs, and the server runs the simulation and sends back the results. Never trust game state reported by a client. (Gambetta, Client-Server Game Architecture, Gaffer On Games, What every programmer needs to know about game networking) - 7
GAMEDEV-6Hide latency with client-side prediction and server reconciliation. The client applies its own inputs at once and numbers them. When an authoritative update arrives, it starts from that state and re-applies the inputs the server hasn't processed yet. (Gambetta, Client-Side Prediction and Server Reconciliation) - 6
GAMEDEV-7Render other players slightly in the past, interpolating between buffered server updates, instead of snapping to each update as it arrives. (Gambetta, Entity Interpolation, Gaffer On Games, Snapshot Interpolation) - 5
GAMEDEV-8For hit detection in fast-paced shooters, use lag compensation: the server rewinds the world to the moment the shooter saw it and checks the hit there. (Gambetta, Lag Compensation) - 5
GAMEDEV-9Choose deterministic lockstep, which sends only inputs, only if the simulation is bit-for-bit deterministic on every platform you ship to. Otherwise, synchronise state. Floating-point results can differ between compilers, operating systems and CPUs. (Gaffer On Games, Deterministic Lockstep, Floating Point Determinism)
Save data¶
- 8
GAMEDEV-10Version the save-data schema from the first release, and migrate older saves to the current version when loading them. (Meta, Save Game Best Practices) - 7
GAMEDEV-11Keep the last good save until the new one is completely written, and store an integrity check so that a corrupt or partial save falls back to the previous one. (Meta, Save Game Best Practices)
Performance¶
- 8
GAMEDEV-12Set a frame-time budget for each target platform (33.3 ms at 30 fps, 16.7 ms at 60 fps), and measure against it with a profiler on the target hardware, before and after each optimisation. (Unreal Engine, Introduction to performance profiling and configuration, Godot, General optimization tips, Unity: profiling) - 5
GAMEDEV-13Pool objects that are created and destroyed often, such as projectiles and particles, instead of allocating and freeing each one. (Nystrom, Object Pool, Unity: object pooling) - 4
GAMEDEV-14Rearrange data for cache locality only where profiling shows that cache misses cost time. The resulting code is more complex and less flexible. (Nystrom, Data Locality)
Version control and assets¶
- 8
GAMEDEV-22Commit the project and metadata files that the engine needs to open the project, and keep the folders it regenerates, such as caches and build output, out of version control, starting from the ignore file that the engine generates or the engine's template in GitHub'sgitignorecollection. Commit the ignore file too, so that everyone who clones the repository uses the same rules. Platform examples:GODOT-1,UNITY-STRUCT-7,UNITY-STRUCT-8,UNREAL-37andGAMEMAKER-STRUCT-1. (GitHub Docs, Ignoring files, github/gitignore) - 8
GAMEDEV-15Pick version control that handles large binary assets before the project grows: Git with Git LFS, or a system built for binaries such as Perforce. GitHub blocks files larger than 100 MiB and recommends keeping repositories under 1 GB. Git LFS stores large files on a separate server and keeps only pointers in Git. The Unreal Editor follows Perforce's check-out workflow. (GitHub, About large files on GitHub, Git LFS, Unreal Engine, Using Perforce as source control) - 7
GAMEDEV-16Lock binary assets that can't be merged, such as levels, textures, models and audio, before editing them: mark their typeslockablein.gitattributeswith Git LFS, or check them out exclusively in Perforce. Concurrent edits to large binary files cause merge conflicts that are very difficult to resolve. (Git LFS, File Locking, Unreal Engine, Using Perforce as source control)
Accessibility¶
- 7
GAMEDEV-17Plan accessibility at the design stage: review the Game Accessibility Guidelines before work starts, choose the ones that apply, and schedule early the ones that are costly to add later. Many guidelines can be met with simple design decisions early on, and retrofitting them later costs significantly more. (Game Accessibility Guidelines, Why and how) - 7
GAMEDEV-18Address the four most common complaints first: control remapping, text size, colour blindness and subtitle presentation. (Game Accessibility Guidelines, Basic) - 6
GAMEDEV-19Give sound effects, speech and music separate volume controls or mutes. Not conveying information by colour or sound alone isA11Y-11. (Game Accessibility Guidelines, Basic) - 5
GAMEDEV-20Use the Xbox Accessibility Guidelines as a test checklist for your game's accessibility features. (Xbox Accessibility Guidelines)
Tutorials and further reading¶
- 7 Game Engine Architecture (Jason Gregory): a comprehensive book on how game engines are built, from engine subsystems and game world object models to tools and asset pipelines.
- 6 Accessible Player Experiences (APX) (AbleGamers): access patterns for game design, such as Flexible Controllers, Clear Channels and Distinguish This From That.
- 6 What every programmer needs to know about game networking (Glenn Fiedler): a short history from peer-to-peer lockstep to client-side prediction.