godot icon indicating copy to clipboard operation
godot copied to clipboard

MultiplayerSynchronizer throwing Error when connected client is not in same scene as Host

Open baumland opened this issue 2 years ago • 5 comments

Godot version

4.0-Beta8

System information

Windows 11

Issue description

MultiplayerSynchronizer throws Error E 0:00:06:0199 _send_sync: Condition "!sync || !sync->get_replication_config().is_valid() || !sync->is_multiplayer_authority()" is true. Continuing. <C++ Source> modules/multiplayer/scene_replication_interface.cpp:647 @ _send_sync() if connected client is not in the same scene as the Host (and the Host's Scene has an MultiplayerSynchronizer)

Steps to reproduce

  • Create a server on the first client using ENetMultiplayerPeer
  • change Scene to a Scene containing a MultiplayerSynchronizer
  • Connect to the server using a second Client
  • It should continuously throw a error on the Server-Client

Code handling Connecting: image image

Scene host changes to after connecting: image

Minimal reproduction project

BugTest.zip (Contains GDScripts and c# source files)

baumland avatar Dec 19 '22 14:12 baumland

cc @Faless

Calinou avatar Dec 29 '22 21:12 Calinou

I can confirm this for beta 10 as well. Have you tried adding a node between the root node and the synchronizer? Does the synchronization still work even with the error? And last, it is only on server side correct? Are there any client side errors related?

NOTE: I have this error when the client is ALSO IN the same scene as the host peer. I am working on trying to add certain nodes to the replication process to see if a certain scene changes things due to maybe not needing to be replicated by that node. WIll watch :)

mojoyup avatar Jan 29 '23 16:01 mojoyup

@baumland So, it seems, by the project, that you don't have any sync vars for the multiplayerSync node. That could be the issue. It may be looking for something in the backend code that doesn't check for errors if nothing is there. Adding a variable to it stopped the error for me on your test project. Can you confirm and test maybe different nodes as well? Ill do the same

NOTE: Unless you change the scene also to the same as the host, you will get an error as well saying that the synchronizer can't be found (because it's in the multiplayerscene node).

mojoyup avatar Jan 29 '23 16:01 mojoyup

Tracking a property of another object seems to fix this issue. Still, throwing any error if it isn't tracking anything could limit potential dynamic tracking.

baumland avatar Jan 29 '23 16:01 baumland

Tracking a property of another object seems to fix this issue. Still, throwing any error if it isn't tracking anything could limit potential dynamic tracking.

Agreed. It seems that an implementation of error checking or making this a warning instead may be needed? Warning I say mainly because it doesn't actually affect the synchronization of the node that I can see. So that brings up a question then. Are you trying to synchronize the scene? Or just have it try to do that for everything in the scene?

mojoyup avatar Jan 29 '23 17:01 mojoyup

Can you still reproduce this in 4.0.3 and 4.1-beta3 or later?

CC @godotengine/network

akien-mga avatar Jun 23 '23 13:06 akien-mga

Yes, this is still valid, change_scene doesn't work well with multiplayer sessions. See also https://github.com/godotengine/godot/issues/68407#issuecomment-1445858643

Faless avatar Jun 23 '23 13:06 Faless