Level Actor Replication Size vs. SpawnActor Size

Hello, we have are trying to reduce our bandwidth usage and were hoping that by switching from spawned actors to level actors we could greatly reduce the amount of data needed to replicate when a client first joins a session. Using DormantInitial in this case does help, because only those actors with changes will replicate, but we have observed that the size-per-actor seem unreasonably large, given that a single boolean is being replicated. This will cause a scaling issue with playtime, since more and more actors will be changed.

When the actor is spawned in at runtime, it replicates the spawn event and the changed property, using about 250 bits according to unreal insights, with the property data itself being about 50 bits. This is with random spawn transforms (no scale). That same actor as a static actor replicates in two bunches: The second bunch is a NewActor bunch with the property data, and is about 100 bits total. However there is also the first bunch, which is over 400 bits and network insights does not capture any details other than the actors name (this is with -NetTrace=4).

What I think is happening, is that the level actor has its NetId assigned and mapped to the actor by its package path, which is all replicated so the client can find its corresponding actor and assign the NetId. In contrast, the SpawnActor version can just replicate the minimal info needed to create the actor (its transform) and the NetId so the client can recreate it.

So my question is: Can this be improved somehow? We already know these actors are static in the level, so it seems like the amount of info needed to map the NetID is overkill.

Steps to Reproduce
Create a simple actor with a single replicated property, and dormancy set to DormantInitial, and change the replicated property value at runtime such that the actor needs to replicate. Place many of these in an empty map and then use Unreal Insights network profiler to record a client joining a listen server.

Do the same as above, but with DormantAll, and spawn many actors instead of placing them in the map. You will see that while the size of the replicated property is the same between the two, the SpawnActor version uses much less bandwidth, even with random spawn transforms.

Hi,

Your understanding of what is happening is correct, and the extra bandwidth is expected. Because the actor already exists on the client and server, the server will send both the path and an ID when replicating a statically placed actor, and after the client acks this ID, the static actor is just replicated using the ID.

This does result in the initial replication for these actors using more bandwidth, which has been a common pain point for a while now. There’s no built-in way to improve this handling, but others have explored some custom changes to optimize how these paths/strings are sent. You can check out these related questions for more info:

[Content removed]

[Content removed]

[Content removed]

Thanks,

Alex