Download

Replication. Managing the 2048 network channel limit.

My game is a building game, with each building piece being an actor that is bAlwaysRelevant.

Each actor opens a network channel with the client and there is a limit of 2048 channels per client.

I’m hoping to find a way so that actors only open a channel when a replicated var changes. Anyone know if this is possible (or any other ideas of how to get around the limit)?

the problem lies in the amount of things you can replicate at once at any given time, and any actor that replicates will keep its network channel open.

I was able to get around the problem by setting my custom-staticmeshactor-spawnable class to have bNetTemporary=true, which causes tear-off in the network. so it’s a spawn and “fire and forget” approach.
and yes I also needed bAlwaysRelevant=true so they would actually get to the clients.
This was enough for me to replicate the entire dungeon generation in my game to clients.

In my case this is enough because I don’t ever need to mess with the actors after they are spawned since they are static structures. In your case if the building parts can be destroyed later or have replicated variables changed this approach might not be enough (since bNetTemporary is const and after tearoff IIRC the link between the server and client version of the actor is lost)

I ended up creating “connection pool” actors that handle the replication data for 20 building pieces, which is bAlwaysRelevant for clients. The pools are dynamically created as new building items are placed in the world. Building items that get deleted then free-up their replication info slot in the pool for other new building items to then take. The building piece actors themselves are not replicated directly at all (RemoteRole=Role_None) so are spawned independently on both the server and client.

It seems to be working well and has cut down my network channel usage to a tiny fraction of what it was before, allowing for many thousands of building items to be placed in the world and replicate. I have players testing it on my Experimental branch on Steam with no problems so far.