SetNet.StateSync.Godot 1.1.0

dotnet add package SetNet.StateSync.Godot --version 1.1.0
                    
NuGet\Install-Package SetNet.StateSync.Godot -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SetNet.StateSync.Godot" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SetNet.StateSync.Godot" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SetNet.StateSync.Godot" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SetNet.StateSync.Godot --version 1.1.0
                    
#r "nuget: SetNet.StateSync.Godot, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SetNet.StateSync.Godot@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SetNet.StateSync.Godot&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=SetNet.StateSync.Godot&version=1.1.0
                    
Install as a Cake Tool

<p align="center"> <img src="https://raw.githubusercontent.com/Povstalez/SetNet/master/assets/icon.png" alt="SetNet" width="96"> </p>

SetNet.StateSync.Godot

Godot 4 (C#) components for SetNet.StateSync — server-authoritative entity replication in the Godot scene tree.

Make a scene whose root is a NetworkObject, add the sync components you want (Transform, AnimationPlayer, RigidBody, or your own), register the scene with a NetworkManager, and it replicates from a dedicated server to every client — with client-side interpolation, delta compression, interest management and an input channel — all handled by the engine-agnostic core. This is the Godot analog of SetNet.StateSync.Unity.

What it syncs

Component Replicates
NetworkTransform position + rotation (interpolated), optional scale, optional position quantization, optional owner-authoritative (prediction)
NetworkAnimationPlayer the AnimationPlayer's current animation + playback position (non-owners Play + Seek to follow)
NetworkRigidBody a RigidBody3D's linear + angular velocity
NetworkBehaviour your own fields — subclass and declare/serialize/deserialize them (AOT-safe, no reflection)

An object's schema is the ordered concatenation of its child components' fields, built from the shared scene — so server and clients always agree.

Install

dotnet add package SetNet
dotnet add package SetNet.StateSync
dotnet add package SetNet.Godot
dotnet add package SetNet.StateSync.Godot

Requires Godot 4's .NET (C#) build.

NuGet vs. source. Referenced as a NuGet package these components work code-driven (create/configure nodes in C#). For editor/scene-driven use — [GlobalClass] node types in the Create Node dialog and [Export] fields in the inspector — Godot's source generators must run on your project, so add this package's .cs files to your Godot project as an addon instead of (or alongside) the NuGet reference.

Setup

1. Build a networked scene: root = NetworkObject (set a unique Archetype Id) with child nodes NetworkTransform, NetworkAnimationPlayer, etc. Save it as a .tscn.

2. A NetworkManager node with the scene(s) in its Registered Scenes.

3. Register a serializer once at startup:

SetNetSerializer.Use(new MessagePackNetSerializer());

4. Server (dedicated build or host):

var server = new MyServer(new Configuration { Host = "0.0.0.0", Port = 5000 });
await server.StartAsync();

networkManager.StartServer(server, new StateSyncOptions { TickRate = 30 });
var player = networkManager.ServerSpawn(archetype: 1, spawnPos, Quaternion.Identity, owner: peerId);

5. Client:

var client = new MyClient(new Configuration { Host = "server-ip", Port = 5000 });   // or .UseWebSockets()
networkManager.StartClient(client, new StateSyncOptions { InterpolationDelayMs = 100 });
await client.ConnectAsync();
// NetworkManager instantiates/frees scenes automatically as entities enter/leave your view.

NetworkManager._Process drains spawns/despawns onto Godot's main thread (via SetNet.Godot's dispatcher), pushes server object state each frame, and advances client interpolation — no per-object glue needed.

Structure

Because Godot uses inheritance for node types, a networked object is a NetworkObject (Node3D) root with child sync-component nodes (rather than Unity-style added components). NetworkTransform defaults to syncing its parent NetworkObject; NetworkRigidBody/NetworkAnimationPlayer auto-find (or you [Export]) the RigidBody3D/AnimationPlayer to drive.

Prediction

Set NetworkTransform.OwnerAuthoritative on the player scene and drive the owned object locally; send inputs with networkManager.Client.SendInput(bytes) and reconcile against Client.LastProcessedInput (see SetNet.StateSync.Prediction).

Notes

  • 3D-focused (v1): NetworkObject is a Node3D. A 2D binding would mirror this with Node2D.
  • Main thread: spawn/despawn and state application run on Godot's main thread via SetNet.Godot.GodotMainThreadDispatcher, drained in NetworkManager._Process.
  • Web/HTML5 exports have no threads/UDP — use SetNet.WebSockets.

Documentation & source

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 129 7/2/2026