Network optimization

Hi there. I am new to network programming and am trying to figure it out. Let’s say you want to do something like a battle royale and you need to spawn a lot of actors. How best to do it:

  1. Spawn on the server and replicate.
  2. Spawn on each client separately via RPC Multicast.

Or are there other better options?

I think this totally depends on your game’s network design. If the actor you want to spawn is something you want the server to have the authority to spawn, then spawn it on the server and replicate, if you want the client to be the authority to spawn it then doing it on clients via Multicast.

In my experience, spawning things like projectiles were done better on each client via multicast, but spawning players worked better when spawned on the server in the game mode

When you spawn Actors on the client then they can’t replicate. This means you lose track of it as soon as it is spawned and you can’t make any RPC’s on it. You also risk that the client never got the RPC and therefore never spawns the Actor.

Therefore you should always spawn replicated Actors on the server.
If you manage the relevancy and net dormancy for the Actors then it won’t have any significant overhead compared to attempting the workaround of spawning non-replicated Actors on the clients.

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