Peer2Peer Scene Structure

Godot Version

Godot 4.3 Steamworks 1.6 GodotSteam MultiplayerPeer 4.1

Question

Info:
Using GodotSteam for Steam peer2peer lobby setup.
----==============================----
Problem:
Having trouble figuring out how to structure my multiplayer game. I’ve been looking at the MultiplayerSpawner and MultiplayerSynchronizer nodes, and while they’re great, they seem to rely on all clients having the same nodes in their scene tree.

I wanted to optimize memory usage by having only one level loaded at a time per client, with all level information going through the host for saving and retrieval. However, this approach seems to break the functionality of rpc calls since they require both peers to have the same node with the script in their tree, similar to how the spawn and sync nodes work.

To go this route, I would need to write custom spawner and sync logic. Do you think it’s better to go with all peers having all maps loaded where a player is, or does anyone have advice for working around this?

Multiplayer nodes and RPCs both require the same node path to work. They are part of the SceneMultiplayer (Multiplayer API) implementation.

Syncers have network visibility settings and will despawn the subject node if the it is a spawnable scene. You will also have to manage child syncer visibility too, as it does not cascade down a scene branch. Which is exactly what you need for changing levels.

Be aware everything is authed to the server by default and in peer2peer you will need to auth to the peer spawners and syncers. And this auth should be replicated to all peers. Luckly setting auth os recursive but not automatic.