RPC vs (MultiplayerSynchronizer and MultiplayerSpawner)

Godot Version

v4.3.stable.steam [77dcf97d8]

Question

Can somebody explain me the pros of using MultiplayerSynchronizer despite to RPC. If I got concept right, I can do everything in RPC without MultiplayerSynchronizer Node. Although, I think there’s differences between, which one is better to use and when?

  1. Updating Position (each frame) - RPC or Sync properties
  2. Spawning Objects - RPC or MultiplayerSpawner Node (another related question)
  3. Updating State of Object (sending signal, not each frame) - RPC or Sync properties

For now, I think that MultiplayerSynchronizer makes synchronization easier with flexible properties built-in but about differences between - I don’t know yet

2 Likes

You are right on the nose with the similarities between using the MultiplayerSynchronizer and using RPC calls.

The pro I find with using the MS is that it there is less code for me to write when syncing multiple variables across the scenes. I’m up to ~30 variables synced across my game and growing and itd be annoying to have each updated via an RPC.

Whereas I generally use RPCs when I have some logic I’d like to perform with the state on a particular or all clients such as logging an action a particular player took on all clients or updating the turn order in a turn based game.

2 Likes

Got you, I’m still using MS in my projects (cause as you said, it gives less code), wanted to be sure before developing game, thanks)

1 Like

MultiplayerSynchronizers and MultiplayerSpawners work in tandem with the default multiplayer API, SceneMultiplayer. They have a lot of convenient features built in that you would need to build manually when using RPCs.

Using the multiplayer nodes properly can allow you to inject a very minimal amount of multiplayer code into your classes, but it does require some planning to execute correctly. You can avoid having any RPCs altogether if done right, but sometimes RPCs are more convenient for one off signalling.

You will still need to add higher level features like client side prediction and server reconciliation on your own though. But extending the multiplayer node classes is easily done for such things.

2 Likes

I understand you, I didn’t even think about the fact that MS can essentially work without RPC too, thanks)