Is there any way to replace the multiplayer spawner node with RPC calls?

Godot Version

4.3

Question

Ok, I asked a very similar question a while back:

HOWEVER, I have new knowledge on Godot multiplayer architecture and the experience from building my game’s netcode. Plus, I’m refactoring my netcode as well. So, I wanted to ask a similar, but more specific question.

Can you use RPC functions to do what the multiplayer spawner node does?

I very much understand the use cases for the multiplayer spawner node from my own experience and from the Godot docs.

The spawner node syncs the spawning of objects/nodes and their children across all clients. For my game, it’s very useful for things like:

  • Spawning/Respawning the player.
  • Loading the map.
  • Loading map items.
  • Etc.

I’m wondering if doing the same thing via RPC calls would be viable. I could be missing something crucial. That’s why I’m asking.

Also, I managed to replace the multiplayer synchronizer node with custom RPCs and it works great. I also like RPCs better because I see exactly what happening, when it’s happening, and it keeps the code local and easy to read.

It shouldn’t be too hard to replace the spawner, it’s not a super complicated node. Godot exposes Node.scene_file_path and the Node.tree_exiting signal which should allow you to recreate basically everything the spawner does.

But if the spawner is already working for you there’s no need to change it up :smiley:

1 Like

The multiplayer spawner does work, but RPCs are easier to work with personally. Plus, I’m refactoring my netcode right now, making this the best time to unify everything.