Download

Multiplayer Performance (Blueprint) - Replications, Multicasts

I would like to know the best practices when it comes to creating a Multiplayer Game using Blueprints.
What should I avoid, what would cost performance and latency issues, what would affect the least/most amount of bandwidth when playing over a network?

From what I have read (I may be wrong) **Multicasts **costs more than using **‘Replicated Variables’ **and should be limited. But what about having 30-50 Replicated Variables, would that be worse?

For e.g. if I had a player ‘block animation’ - should I use a **‘Run on Server’ **with a ‘replicated variable’ to play this Animation from a Animgraph in the Animation Blueprint or
would it be better to use a **Multicast **to play the Animation Montage? Both would give the same result and everyone playing would be able to see it. But which is less costly?

If anyone could give me any do’s and don’ts, and anything else I could do to avoid **cost in performance **when it comes to Creating a Multiplayer Game?

Any advice would be appreciated.
Thanks

All this depends on many factors and there is no one-size-fits-all solution other than testing and trying out what is best.
For example, when replicating variables it is good to know when you will use RepNotify or Replicated variable. If the variable does not change often and quickly or if it is boolean, then it is best to use RepNotify. You also need to know exactly which variables need to be replicated. Someone may replicate all possible variables, but there is no need for that.
For instance, you have variable “StrongAttack” which will player perform some special attack. You do not need to replicate animations, functions, all multicast etc. You just need to set variable on the server to true (RepNotify) and in the function OnRepNotify_StrongAttack connect Remote Node and play animation (what will all other client see). So instead of multicast animation and other function you have only one boolean variable “StrongAttack” which you need to set on the server to True or False. It is similar with other variables.

Avoid ticks or if you really have to use it try to use functions that are not complex.
Monitor the flow of network traffic, test it.

Thanks for the info. Much appreciated.

@AJ270284

Here’s a great introduction series on replication. - YouTube

Networking Overview: Networking Overview | Unreal Engine Documentation

Cedric’s Networking Compendium: http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf

Personally I’d view the content in the order I presented. Less confusing.