Step by step instructions for setting up matchmaking with dedicated servers

What are the steps required for setting up matchmaking with dedicated servers?

By that I mean the barebones that will be required for any real production multiplayer game: a system that automatically creates sessions and dedicated servers and then matches and connects players together based on custom logic specified by the developer.

Imagine the simplest game possible: each player can only move, and they can see the other players move. The movement part is very simple, but I don’t see any examples at all of achieving the multiplayer aspect in the manner of dedicated servers with matchmaking, which would be required for a production game.

For example this documentation: Online Subsystem Session Interface in Unreal Engine | Unreal Engine 5.2 Documentation
only gives a high level overview and doesn’t explain how to get matchmaking working with dedicated servers.

Similarly, all the code examples like Engine Feature Examples for Unreal Engine | Unreal Engine 5.2 Documentation that I’ve seen used the player-hosted server model, which hasn’t been the norm in the industry for decades. You can see that all the recent games like Paragon or Fortnite by Epic Games, or any other modern multiplayer game for that manner, uses dedicated non-player-hosted servers with matchmaking, because of the obvious stability issues wit player-hosted servers.

Are there no resources for a realistic multiplayer set-up?

Try looking into this plugin. Advanced Sessions Plugin - Community Content, Tools and Tutorials - Unreal Engine Forums

1 Like

The short and simple answer is: Because it has nothing to do with Unreal Engine.

You don’t create such a system within a dedicated instance of Unreal. Matchmaking systems are more like a webserver than a game.

The basic idea is this: You connect via some protocol to your matchmaking server. For example one could use WebRTC and nodeJS, though what tech you use ultimately depends on your needs and what you’re most comfortable with.

Now as long as you are connected to the server, it will put you into a player queue and attempt to match you into teams. Once a valid set of players is found, the matchmaking server will look for an available game server or, depending on your setup, may boot up a new server instance on AWS or whatever cloud host you may end up using.

Once a game server is found, the clients are sent the connection details, the server is sent the client details (to spawn the correct player characters and to assure the correct players join the game) and then you’re back on UE4 territory where you actually initiate the connection to the (game) server.

3 Likes

While I agree with the above statement, you can still setup a temporary mock system that works just fine using the plugin above!

1 Like