Server architecture for MOBA Like Game Types


I am currently prototyping a MOBA Style game. Usually when you have MOBAs, you have multiple matches running at the same time. I wonder how the server structure for this kind of games would look like. My guess would be, that you have a master server which will relay the player to a match. I wonder how your matches are handled. Does every match have to run on an instance of the dedicated server (speaking of UE4 Server) or can one UE4 Server handle multiple matches and how do you transition between multiple server.

Do you guys have any experience with these architectures?

I can’t directly mention the game that I’m familiar with, but with at least one very large MOBA (and probably the others) it works basically like any other lobby system with games such as Counter Strike or Battlefield, with a little bit of obfuscation between the layers.

Basically you would make your arena (or arenas) as your level, with the server hosting that one match on that one map. Separately (in something to your own crafting, however you liked to build it) comes in your matchmaking. This is where (if you have enough players) you try to match skill level to the other players, this is harder to do and will require you to put in some time of your own designing the scoring/ranking system and how wins/losses effect it.

When a client logs in, they don’t login directly to a game server or to matchmaking, they’d basically authenticate against whatever you wanted to and be sitting at a ‘not in any lobbies’ state. Your match making system would wait for clients to flag themselves as ready to play, they get collected into that process (grab their ID so you can message them directly). You would insert your matchmaking process here, whatever you determine for your game, in order to selectively build a group of players for your gamesize (10 if it’s 5v5 or 6 if it’s 3v3 or whatever).

Once a player has opted in and matchmaking has found the appropriate number of players, you’d send a command to your game server (you can usually run multiple instances on one actual piece of hardware, but how many is dependent on your abilities and the type of game) to spin up the map and only allow connections from the people in your list of players for that particular game. You would then send the clients messages directly with the information to join the server - at this point it’s normal, join server (you’re already authenticated when you logged in before you joined a match, you just literally need to get them to the right server). At the conclusion of the game report the stats back to your matchmaking system, force disconnect all the players and spin down that instance.

You will not need to change from this model until you get a whole ton of players, at which point you could squeeze more into a single piece of hardware by doing things like replacing the server’s Unreal instance with a custom coded solution (whereby you recreate everything the server needs to do so that there is no visual rendering of any kind for example), but this may not even be necessary depending on your project and your goals.

In a corporate environment (not a MOBA, but actually very similar needs) I’ve had some very nice success with using virtual machines from service companies that allow you to create them and resize them through your control panel and have your VMs up within seconds. I built this into our “matchmaking” (equivalent for the project) service so that it would build the list of clients, check what servers were running and what their capacity/usage was, and if one was capable of taking the load it’d go to them, otherwise it’d use the API of our 3rd party VM host, spin up a new instance, load the required packages automatically, spin up a server and then join the clients in, you could perhaps do something similar depending on what your server solution ends up being.

I hope this helps, although it probably was not the answer you wanted.

This actually was exactly the kind of answer I was hoping for. Especially the last paragraph caught my attention. So I assume this third party service is something like the Amazon cloud? This is something I wanted to ask about anyway because I was thinking of a smiliar approach.

Thank you very much for your insights, It’s a greathigh level overview :slight_smile:

Amazon could possibly work, I’ve only used their CDN/Cloud Storage capabilities personally. I avoid listing a particular provider (as I don’t want to endorse anyone in particular), however I’ve had success with a few of the major names. It simply boils down to what you need at that point, for us the major requirements were obviously the OS, hardware and the interface to setting up additional VMs. I like the (handful) of providers that will provide you with an API you can tie into your project directly. The most recent provider I used for these projects allowed you to not only spin up new instances completely as needed (with virtually no limit), but also to resize/reallocate existing VMs on the fly, and had a decent built in intranet type system between their different datacenters, which meant storing the VM image I wanted to use on their network allowed me to basically instantly copy it over from their CDN to the new VM to have an entire install up within about 15 seconds.

I haven’t tried this with unreal, I’m not sure if the dedicated server is headless and would run well in a VM, however as I said. This shouldn’t be an issue for you for a long time, you should be able to make it work using Unity’s preexisting server/client architecture and if you grow later you can design a backend to work however you need it to. At this point you will have enough customers that cash flow for someone who already knows how to solve this problem won’t be a major deal, just keep it in mind.