UE4 Server with multiple player instances

It appears to me that UE4 built-in server (like the ShooterGame example) can’t host multiple level/sessions without spawning additional processes for each level. Can anybody confirm? Before I run off into the weeds does anybody have any kind of load statistics about how many players per server could be accommodated?

As an example:
If I was building a Call of Duty clone and I wanted x number of maps/sessions with n number of players per map/session to all be playing at the same time (but potentially different levels). Is this built in functionality or will we have to start working on a custom solution for our server hosting?

I’ve tried searching and found varying degrees of useful (mis?)information.

You would need to spin up multiple instances of ShooterGame in this example.

“Before I run off into the weeds does anybody have any kind of load statistics about how many players per server could be accommodated?”

You’re mileage will vary based on number of relevant actors, replicated properties, etc.

There are a few things to think about (security being the most important) that make it a good idea to generally keep players that aren’t playing together in separate instances. UE4 is built with this in mind, and our goals are also aligned here so this will only get better!

“Is this built in functionality or will we have to start working on a custom solution for our server hosting?”

The management of server instances in this context can be a bit complex and very different base on needs. So in this regard, it is currently up to you in how you implement this, but we try to make things as painless as possible by building the tech around this concept.

Thanks a ton for the quick response :slight_smile:

John,

How does the UE4 dedicated server handle having multiple instances of itself running on a single machine?

Certainly from a security point of view I can understand running separate instances but I worry about the added overhead of doing so. Can you shed some light on what we could expect?

Just to put things into context I’m planning to do something similar as Cynistyr. I’d like to have a single machine running multiple instances of a game. Currently we’re looking at 8 players max per instance. This game is a top down shooter with no physics, limited actors, with replication only occurring on any players/ai. My original plan was to roll our own server software but I started to realize that UE4 may be capable of doing what we’re planning on doing.

Just to put my questions in a quickly readable format…

  1. How much overhead can I expect each UE4 server instance to create.
  2. If I go the multiple server instance route rather than single server instance with multiple rooms route how does UE4 deal with ports? Will I need to keep track of the various ports used or will UE4 find the first open port?

The overhead will mostly be redundant usage of memory, but this shouldn’t be too bad as we’re constantly making sure this is where it needs to be. We don’t plan on doing anything like sharing assets across instances since this probably isn’t worth the complexity.

For ports, you specify the initial port in the ini, and then inside IpNetDriver.cpp we’ll pick the first available port from there.

For security, if you are using a single instance, if one player was able to find an exploit, it would affect all players on that machine rather than be confined to that single instance.

I would be nice if all instances could potentially share static geo and have only dynamic objects duplicated across game instances though…

Thanks John! This about solidifies my choice.

Hi, John, in the case of multiple server instances on a single box, I wonder how many server instances can a box supports, assuming that I have 1000$ budget per month on VPS like amazon or linode. Our game is an intermediate one like Payday2 FPS game.