Does MultiplayerSynchronizer and MultiplayerSpawner support late joining?

Godot Version

4.2.1

Question

From my initial testing it appears that the Godot network nodes, MultiplayerSynchronizer and MultiplayerSpawner, doesnt support the late joining of players, IE many errors are thrown if the player joins a server when the game is already in play. I get a lot of errors in the console when I try to have a player join after a game has already started(scene is loaded with a MPSpawner/Synchronizers), due to the client missing whatever scene/nodes need to be synchronized initially.

The issues I have observed:

1.) Errors in debugger on newly joining clients into existing running game session(Seems unavoidable?).

Error examples:
E 0:00:13:0124 get_node: Node not found: “Tavern/MultiplayerSpawner” (relative to “/root”).
E 0:00:13:0124 process_simplify_path: Parameter “node” is null.
E 0:00:13:0124 get_cached_object: ID 1 not found in cache of peer 1.
E 0:00:13:0124 on_spawn_receive: Parameter “spawner” is null.
E 0:00:13:0124 on_delta_receive: Ignoring delta for non-authority or invalid synchronizer.

2.) MultiplayerSpawner not spawning new nodes even after client loads the scene with the correct MultplayerSpawner after joining. Additionally it does not seem to synchronize with the new client and have it spawn previously spawned nodes.

Errors:
E 0:00:17:0120 get_cached_object: ID 1 not found in cache of peer 1.
E 0:00:17:0121 on_spawn_receive: Parameter “spawner” is null.

My assumption is that I will need to just manage this on my own with RPC calls which is totally fine, however I would like to use these nodes if I can since they make things a bit easier to manage and maybe I am just doing something wrong.

Thank you!

I was definitely doing it wrong. I followed this article.

The trick seems to be to make sure to have a multiplayerspawner present at like a main/root/close to root level always.

So the way I did this was I made a scene which I just called main.tsn, its only purpose is to hold the main game start menu, any newly added level/zone/scene, and the multiplayersynchronizer configured specifically just for spawning levels into main.tsn.

Since the client will already have main.tsn loaded just like the server, when the client joins it just sort of works, the server mpspawner tells the client to spawn the level, and in the level since I have another mpspawner for players it also just spawns the player objects too.

Its not immediately obvious that this is how its supposed to be done but I guess its working?

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.