Custom Node Types

GD-Sync includes a variety of custom Node types that can be added directly to your scene. These Nodes are designed to automate and simplify common multiplayer tasks, reducing the amount of manual code you need to write. By using these built-in Nodes, you can implement synchronization, instantiation, and other networking features more quickly and with fewer potential errors.

PropertySynchronizer

GD-Sync includes a custom PropertySynchronizer that automatically keeps the value of a variable synchronized across all clients. You simply assign it to one or more variables, and it handles the synchronization process. It is optimized for minimal data usage and will only send updates when the linked property changes.

The PropertySynchronizer supports built-in interpolation for certain Variant types, including int, float, vector2, vector3, vector4, color, quaternion, and basis. If one of these types is selected, interpolation will be automatically be applied when enabled. Interpolation can also be paused temporarily with pause_interpolation(seconds : float), which is useful for situations like teleporting a Node to prevent unwanted sliding between positions.

Extrapolation is also supported for the same Variant types as interpolation. This predicts the future position or state of an object based on its previous values, helping to mask latency by smoothing motion.

The frequency of synchronization updates is determined by the refresh rate. For most cases, it is recommended to keep this relatively low (below 30) when using interpolation to reduce bandwidth usage.

When using the PropertySynchronizer, make sure its NodePath matches across all clients. If it does not, the synchronizer will not be able to find itself and perform updates. When spawning Nodes with the custom NodeInstantiator or multiplayer_instantiate, this is handled automatically.

To synchronize the rotation or orientation of a Node3D, use the property basis instead of rotation. Using rotation can cause the object to spin a full 360 degrees and flip back when interpolating, resulting in visual glitches.

NodeInstantiator

The NodeInstantiator is designed for scenarios where a Node needs to be spawned frequently, such as bullets fired from a weapon. To use it, add the NodeInstantiator to your scene, set the scene you want it to spawn, and then call instantiate_node() to create the Node. This method returns the instantiated Node locally while also creating it on all other clients. When a Node is successfully created, the node_instantiated(node : Node) signal is emitted.

If sync_starting_changes is enabled, any modifications made to the root Node of the instantiated scene within the same frame will automatically be synchronized when it is spawns on other clients. Scene replication is also supported through replicate_on_join, which allows newly instantiated scenes to be sent to clients who join the lobby after the object was created.

Scripts on Nodes created using the NodeInstantiator can optionally override _multiplayer_ready(), which is called after _ready() and after any starting changes have been applied.

The NodeInstantiator automatically ensures that the NodePath is identical on all clients so GD-Sync can properly synchronize it.

When instantiating Nodes with the NodeInstantiator, _multiplayer_ready() is called after _ready() and after all starting changes are applied. The order is: _ready()apply starting changes_multiplayer_ready().

SynchronizedAnimationPlayer

GD-Sync includes an extended version of Godot’s default AnimationPlayer called SynchronizedAnimationPlayer. This Node adds full multiplayer support to AnimationPlayers without requiring any additional setup.

Any function related to animation playback, such as play(), play_backwards(), pause(), stop(), queue(), seek(), or advance(), will automatically be called on all other clients when used. This ensures that animations remain in sync across the entire lobby.

The SynchronizedAnimationPlayer does not synchronize the playback of AnimationTrees, it only works with AnimationPlayers that directly play animations. For synchronizing AnimationTrees, please look at SynchronizedAnimationTree.

SynchronizedAnimationTree

GD-Sync includes an extended version of Godot’s default AnimationTree called SynchronizedAnimationTree. This Node adds full multiplayer support to AnimationTrees without requiring any additional setup. All variables and state machines within the tree are automatically synchronized across all clients, ensuring animations remain perfectly in sync during multiplayer sessions.

SynchronizedRigidbody3D

Experimental

The SynchronizedRigidBody3D provides simple physics synchronization between clients. Physics calculations still run locally on all clients, but the host broadcasts the state of its physics simulation to everyone else. If a client’s local simulation drifts too far from the host’s state, it is automatically corrected to maintain consistency.

For interaction between CharacterBody3D and these synchronized rigidbodies, all force and impulse functions such as apply_force and apply_impulse  include additional networking logic. This allows clients other than the host to directly interact with the rigidbodies while keeping their state synchronized across the lobby.

The SynchronizedRigidBody3D is an experimental Node. Please report any issues on GitHub.

VoiceChat

Experimental

The VoiceChat Node provides an easy way to add voice communication to your game. To use it, give each player their own VoiceChat Node and assign them ownership of it. Each VoiceChat Node must also be connected to an output AudioStreamPlayer to play back the recorded voice samples.

All required audio bus setup is handled automatically by the VoiceChat Node. You can optionally add recording effects to modify the voice audio before it is sent to other clients.

The VoiceChat Node also supports location-based audio. This can be enabled by setting the spatial_mode property to either 2D or 3D, allowing voice audio to be positioned in the game world.

The VoiceChat Node is an experimental Node. Please report any issues on GitHub.

The VoiceChat Node has known issues:

It does not work with audio devices that have more than 2 channels due to a bug in the engine itself. This means that some headsets will not work and will only hear crackling audio.

It does not have any background noise filtering.