Open FireCatMagic opened 1 year ago
When setting a custom MultiplayerAPI via the scenetree, the checksum fails unless the other peers have a custom API set as well.
Well, this is indeed the expected behavior.
Godot MultiplayerAPI requires node paths used for RPCs or synchronization to match across peers.
The paths are relative to the multiplayer root which is the path you set via get_tree().set_multiplayer
(/root/
for the default one).
When using custom multiplayer branches your scene tree should look something like:
/root
main
Server (custom)
game
Client1 (custom)
game
Client2 (custom)
game
Additionally, I strongly advise setting the custom multiplayer during _enter_tree
so it happens before the child nodes tree callbacks (as they may include other multiplayer nodes like MultiplayerSpawner or MultiplayerSynchronizer).
Godot version
v4.1.1.stable
System information
Godot v4.1.1.stable - Windows 10.0.19045 - Vulkan (Compatibility) - NVIDIA GeForce GTX 750 Ti (NVIDIA; 31.0.15.3623) - 12th Gen Intel(R) Core(TM) i5-12400F (12 Threads)
Issue description
When setting a custom MultiplayerAPI via the scenetree, the checksum fails unless the other peers have a custom API set as well. The behavior I expected is that since they are both SceneMultiplayer, have the same RPC methods, same nodepaths, that it would work even though the MultiplayerAPI is set to a different one.
Steps to reproduce
I've set up a simple test project with a few variables.
Setting the Custom Multiplayer export variable will create a custom multiplayerApi and set it, as the title of this post says:
Leaving it unchecked won't create the MultiplayerAPI.
Checking server just makes it the server, not a client.
I exported this project 3 times, with these options selected each time:
Export 1: Server Export 2: Client Export 3: Client, Custom MultiplayerAPI
I feel its easier to explain as a gif:
Despite the nodepaths being the exact same, it spits out errors about invalid paths in the console.
Minimal reproduction project
RPCChecksum.zip