Deterministic simulation
2025/12/27
- Type
- Learning Resource
- Format
- Glossary Article
- Version
- General
- Subject Tags
- Created
- Updated
- 2026/02/16
- 2025/12/27
A deterministic simulation is a simulation that produces the same results every time it is run with the same initial conditions. In other words, if you run the simulation twice with the same inputs, you should get the same outputs.
In games, deterministic simulations are essential for online multiplayer, where there are slight delays in what each player sees because it takes time for the network to send inputs between players. The game simulation must be deterministic to ensure consistency when players receive inputs from other players.
Note that Godot, like most game engines, is not deterministic. Calculations with floating-point numbers, which are used for most things in a game engine under the hood, can produce slightly different results on different platforms or with different compiler settings. The differences can be tiny, but when your game uses physics, the tiniest differences can lead to major differences in the game state. Godot's physics engine extensively uses floating-point numbers, so it is unsuitable for deterministic simulation.
However, Godot provides tools to help you make your game simulation deterministic. You can use different physics engines as a plugin, like SG Physics 2D or Jolt Physics for 3D. Be sure to read their documentation to understand how they work and the limitations you face with deterministic simulation.
You also need to write a lot of your own code using fixed-point math to ensure that your game is deterministic. In Godot, you can use the Vector2i, Vector3i, and PackedInt64Array classes to always work with whole numbers, which are not subject to floating-point errors.
Don't stop here. Step-by-step tutorials are fun but they only take you so far.
Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.
Get help from peers and pros on GDQuest's Discord server!
20,000 membersJoin ServerThere are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!
Sponsor this library by learning gamedev with us onGDSchool
Learn MoreImprove and build on assets or suggest edits onGithub
Contributeshare this page and talk about GDQUest onRedditYoutubeTwitter…