Deterministic simulation

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

Deterministic simulation

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.

Become an Indie Gamedev with GDQuest!

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.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!