Note: This demo has been ported to Godot3. The original Godot2 version is located here for posterity.
In light of what I've learned since I made the snapshot interpolation demo, I have decided to write a new demo for Godot illustrating a technique called state synchronization. This is now my recommended approach for networked physics using Godot.
Both the client and the server run the physical simulation. State snapshots are sent from the server to the client at a high rate. The client stores the most recent update and then interpolates toward it, which has the effect of smoothing the motion of bodies in the simulation.
To start a dedicated server with the headless version of Godot type, "godotserver -server" in the project directory.
- Sequence checking for state updates
- Linearly interpolated error correction for position and rotation
- Experimental state expiration
- Jitter buffer
- Snap state when distance is greater than some threshold
- Compression
Ryan Roden-Corrent for the port to Godot3
Copyright (c) 2015 James McLean
Licensed under the MIT license.