Replicating generated levels

I’m after some advice\strategies on how to replicate a randomly generated level in a multiplayer game. At this stage the level will most likely be generated by placing static meshes the clients have rather than generated geometry.

Two approaches I can see:

Replicating an array.

UDP socket transfer. (Will need to implement a reliable transfer if UE4 doesn’t support it).

Does anyone have any better ideas? I’m all ears :slight_smile:


I do something very similar already with my multiplayer level editor

there’s nothing to it really

Just make sure your fundamental building block / wall has a blueprint, and in that blueprint, set all of the replication stuff to true. (or you could do it in code of course, you need simulated proxy and replicate movement and the like)

then, spawn the meshes on the server!


Clients will replicate all spawned static meshes automatically as simulated proxy

This even works with moving walls / moving static meshes, just make sure you set this:

bStaticMeshReplicateMovement = true;

UE4 Network Code Robustness

UE4 Network code has some new ways to determine whether actors need to be updated, and will not update them if it is unnecessary.

So having many many replicated wall actors is not an issue, as they wont all be updated all the time, and since a lot of them wont be moving they are guaranteed to not be updating a lot.

This new UE4 Network code optimization is really handy for what you want to do!

C++ Code

Here’s the C++ code for my replicating wall:

in the constructor

bReplicates = true;
bReplicateMovement = true;
bStaticMeshReplicateMovement = true;

The new UE4 Net Optimization

Check this out in the Source Code


 enum ENetDormancy
: {
// This actor can never go network dormant
// This actor can go dormant, but is not currently dormant. Game code will tell it when it go dormant
// This actor wants to go fully dormant for all connections
// This actor may want to go dormant for some connections, GetNetDormancy() will be called to find out which
 // This actor is initially dormant for all connection if it was placed in map.


Thanks Rama! I’ll go down this path first, seems nice and easy.