need some clarification on how dormancy really works

pedrohraissa
Thu, 01 Dec 2022 12:22:23 +0000
Programming & Scripting

Hello,
I have a level with many replicated actors of the same type (they’re called jelly hoops).

They have only one variable inside them that is replicated with a repnotify and only replicates when a pawn overlaps the actor.

Since the engine verifies all the time if the actor must replicate that frame or not, and the variable only replicates during overlaps, the server is wasting a lot of cpu cycles with that actor class because I have many of it in the level, as stated by the network profiler:

So I decided to make the class DormantAll so I can explicitly tell the engine when to replicate the actors. According to this video by epic: Networking in UE4: Server Optimizations | Live Training | Unreal Engine - YouTube
and this video: Unreal Engine 4 Understanding Net Dormancy (With Examples) - YouTube, when an actor is set to DormantAll, it will only replicate if I call FlushNetDormancy.

However, if I set the dormancy to DormantAll, the actor will still trigger the replication events (I don’t have to call FlushNetDormancy), however it will fix my problems with the cpu cycles:

So how dormancy really works? I thought it was used so I could tell the engine to make my actor awake at key moments, so I can specify exactly when I want it to replicate. However, a DormantAll actor is triggering replication events normally.

4 posts - 2 participants