How to best initialize newly connected multiplayer peers? (stop "node not found" errors when joining)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Frolicks

I’m building a lobby-based multiplayer game where players and freely connect/disconnect during the match.

When clients connect to the lobby, I notice that the debug terminal is flooded with “Node not found” / “Failed to get RPC” errors from the other players RPC’s. After a couple seconds, (presumably when the player nodes are all loaded), this stops and the game continues.

This is mostly harmless, except when my internet connection is poor. When I test the game on my phone’s hotspot, the errors may stall before crashing the game.
(Might be worth mentioning is that this is intended to be a browser game, so I’m using the WebSocketClient with the High Level Multiplayer)

My assumption is that this is because the server is trying to rpc real-time info of the pre-existing players onto the newly-connected client before that client has loaded the players.

How can I prevent this from happening?

In my current set-up, the client loads the World scene after it connects to the server as a peer. Then, the nodes in the World scene rpc “initialize_rpc_sender” on the server via the _ready() function.

How can I prevent this from happening?

Hard to tell without knowing your code and project. But usually this error occurs when you’re broadcasting an RPC to all peers even though only certain peers have the same path as the caller.

njamster | 2020-08-24 19:16