You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the MultiplayerSynchronizer node when created during runtime, usually from an instantiated packed scene or spawned from a MultiplayerSpawner, tries to start doing its thing before it or the scene it was created in are initialized in the scene tree. This node is dependant on a fixed root path to sync over the network which does not yet exists, thus it fails whatever initialization it is trying to do and fails to synchronize on subsequent updates. The node tries to start regardless of process mode and before _ready() so there is nothing you can do during the normal update cycle to catch and delay this behaviour, rendering MultiplayerSynchronizer completely unusable if it does not already exist in the launch scene.
I've noticed similar behaviour in MultiplayerSpawner but its much harder to pin down. If it does just end up being an execution order thing, maybe take a look and see if that node is doing its stuff at the same time.
Steps to reproduce
Use the reproduction project below. launch 2 or more instances and attempt to host and connect. The isLoaded property on the root of enviroment_1.tscn should be synced by the child MultiplayerSynchronizer from the host to the clients. Client.cs is checking it every frame and will print to the console on each peer that makes it. The host will succeed since its the one setting it, but the property wont be synced to the clients, because the client Synchronizer should fail because of this bug.
Similar setup. Having a Server that spawn Level1 and Level2 at startup. Client 1 connect, spawn Level 1, and Spawnable_1 is spawned at the server. This seams to work ok. Then Client 2 connect, spawn the Level1 and call the server to spawn Spawnable_2 in Level1. None of the two spawnables are spawned at the Client2 :(
Give the following errors :
E 0:00:04:0887 get_node: Node not found: "Main/Levels/Level1/MultiplayerSpawner" (relative to "/root").
<C++ Error> Method/function failed. Returning: nullptr
<C++ Source> scene/main/node.cpp:1792 @ get_node()
E 0:00:04:0894 process_simplify_path: Parameter "node" is null.
<C++ Source> modules/multiplayer/scene_cache_interface.cpp:118 @ process_simplify_path()
E 0:00:04:0903 get_cached_object: ID 2 not found in cache of peer 1.
<C++ Error> Parameter "recv_node" is null.
<C++ Source> modules/multiplayer/scene_cache_interface.cpp:282 @ get_cached_object()
E 0:00:04:0908 on_spawn_receive: Parameter "spawner" is null.
<C++ Source> modules/multiplayer/scene_replication_interface.cpp:578 @ on_spawn_receive()
E 0:00:05:0873 get_cached_object: ID 2 not found in cache of peer 1.
<C++ Error> Parameter "recv_node" is null.
<C++ Source> modules/multiplayer/scene_cache_interface.cpp:282 @ get_cached_object()
E 0:00:05:0879 on_spawn_receive: Parameter "spawner" is null.
<C++ Source> modules/multiplayer/scene_replication_interface.cpp:578 @ on_spawn_receive()
Tested versions
reproduced in 4.2.1 stable mono b09f793
System information
Godot v4.2.1.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.4629) - Intel(R) Core(TM) i5-10600KF CPU @ 4.10GHz (12 Threads)
Issue description
the MultiplayerSynchronizer node when created during runtime, usually from an instantiated packed scene or spawned from a MultiplayerSpawner, tries to start doing its thing before it or the scene it was created in are initialized in the scene tree. This node is dependant on a fixed root path to sync over the network which does not yet exists, thus it fails whatever initialization it is trying to do and fails to synchronize on subsequent updates. The node tries to start regardless of process mode and before _ready() so there is nothing you can do during the normal update cycle to catch and delay this behaviour, rendering MultiplayerSynchronizer completely unusable if it does not already exist in the launch scene.
I've noticed similar behaviour in MultiplayerSpawner but its much harder to pin down. If it does just end up being an execution order thing, maybe take a look and see if that node is doing its stuff at the same time.
Steps to reproduce
Use the reproduction project below. launch 2 or more instances and attempt to host and connect. The isLoaded property on the root of enviroment_1.tscn should be synced by the child MultiplayerSynchronizer from the host to the clients. Client.cs is checking it every frame and will print to the console on each peer that makes it. The host will succeed since its the one setting it, but the property wont be synced to the clients, because the client Synchronizer should fail because of this bug.
Minimal reproduction project (MRP)
MultiplayerReplicationTest.zip
The text was updated successfully, but these errors were encountered: