godot icon indicating copy to clipboard operation
godot copied to clipboard

on_delta_receive: Ignoring delta for non-authority or invalid synchronizer

Open FeralBytes opened this issue 1 year ago • 8 comments

Godot version

4.1.beta1

System information

Linux Mint 21.1; Kernel: 5.15.0-73; CPU: AMD Ryzen 9 3900X; GPU: AMD 5700XT, Vulkan

Issue description

When attempting to create a 3 player chat program. I am getting an error and I can not trace how or why it is happening. I believe it is something that is mis-configured but given the documentation and examples I do not directly see anything wrong with the code. I think it might be helpful if the error could perhaps provide additional debugging such as node that is causing the problem: https://github.com/godotengine/godot/blob/37d1dfef9d81aade27ab0c56fc6b6f12f6a08045/modules/multiplayer/scene_replication_interface.cpp#LL771C9-L771C13

E 0:00:28:0433   on_delta_receive: Ignoring delta for non-authority or invalid synchronizer.
  <C++ Error>    Condition "true" is true. Continuing.
  <C++ Source>   modules/multiplayer/scene_replication_interface.cpp:774 @ on_delta_receive()

Steps to reproduce

I created a 3 player game with two synchronizers one for the host and one for the client. I then use the MultiplayerSpawner to instance the scene and set_multiplayer_authority() on both the client and the host side. But any time a message is sent to the server by either the second client of the third client the opposite (2nd or 3rd) client will generate this error. I also believe that as a result of the error the message does not get sent to the clients but only makes it to the host. But I could be wrong in trying to understand how this all works.

The key for reproduction is to start 3 instances, 1 as a host the the other 2 can just join and the error will start happening.

Minimal reproduction project

ChitChatv0.1.zip

FeralBytes avatar Jun 10 '23 21:06 FeralBytes

provide additional debugging such as node that is causing the problem

From the actual condition I don't know if that's possible, the check could be made clearer in some cases but it's hard to tell which of the conditions that is fired in this case, I don't know enough about the system to tell if the p_from and net_id would be obvious enough to the user to actually add any more useful information

AThousandShips avatar Jun 11 '23 08:06 AThousandShips

@AThousandShips good point. In 2 months I will have a lot more free time and worst case scenario that is when I will dig into the engine and attempt some deeper debugging. I was hopping that node might be set by then, and that it would also be able to provide the path of that node for additional troubleshooting. This situation is most likely due to a poor implementation on my part, but was still something I encountered.

FeralBytes avatar Jun 11 '23 17:06 FeralBytes

same problem here, Im using a MultiplayerSynchronizer node to sync the player id on spawn and the player position on physicsprocess. Everything was fine at first but for some reason the position isnt syncing anymore, and I get this on_delta_receive error every frame. Not sure if this is related, but I also get on_spawn_receive: Condition "parent->has_node(name)" is true. Returning: ERR_INVALID_DATA at the start of the communication, when I spawn the hosting player's player in the client (which is the one who's position isnt syncing).

jorgegayoso avatar Oct 01 '23 04:10 jorgegayoso

Error "on_delta_receive..." cause when u do bad configure with multiplayer_authority on MultiplayerSynchronizer node which using for player input. By default MultiplayerSynchronizer node working on serverToClient mode, if u want to change direction to clientToServer u must set_multiplayer_authority(client_peer_id) on MultiplayerSynchronizer node on server and on client. That mean when other players joins to server u must set player_input synchronizer node on that player to his unique multiplayer id. Example: server has 2 joined players, that mean it has 2 MultiplayerSynchronizer nodes(one for each player) which uses for player input. Multiplayer authority on each of this node on server == unique multiplayer id of client. Client have 2 players - first - self, and second - enemy. Each player have MultiplayerSynchronizer node, one have multiplayer_authority == miltiplayer.get_unique_id(), but enemy sync node have multiplayer authority == 1(by default when server replicates) - its mean u got invalid states on MultiplayerSynchronizer nodes on server and client. That mean u must ON CLIENT change multiplayer_authority on enemy player_input(MultiplayerSynchronizer) node to enemy_unique_multiplayer_id. Hope its helpful

boxlifestyle avatar Jan 09 '24 20:01 boxlifestyle

@boxlifestyle I appreciate the information, but can you format your text when you have time. I am finding it difficult to break out what you are stating. I think using the code block for formatting would help immensely with understanding.

FeralBytes avatar Jan 09 '24 23:01 FeralBytes

@FeralBytes Better to show u simple example. Pay attention at callback on client "_on_players_child_entered_tree" on else branch. input.set_multiplayer_authority(int(str(node.name))) - with this u synchronizing with server of who have authority at this node. After this, ur error is gone. Multiplayer Synchronizer Server.zip Multiplayer Synchronizer Client.zip godot 4.2.1 stable WASD control for movement

boxlifestyle avatar Jan 10 '24 08:01 boxlifestyle

@AThousandShips good point. In 2 months I will have a lot more free time and worst case scenario that is when I will dig into the engine and attempt some deeper debugging. I was hopping that node might be set by then, and that it would also be able to provide the path of that node for additional troubleshooting. This situation is most likely due to a poor implementation on my part, but was still something I encountered.

@FeralBytes Hi!, have you investigated it?, I'd love that error to have more info :P. I'm getting some of those errors and I have many MultiplayerSinchronizers scattered through the scene tree so it's not obvious which one's wrong.

JuanFdS avatar Feb 08 '24 14:02 JuanFdS

@JuanFdS I am sorry I did not get back to this. I have been working on other project that have not involved Multiplayer. If you could post some additional details with the errors that you are seeing that may be helpful to the developers.

FeralBytes avatar Feb 08 '24 21:02 FeralBytes