Dedicated servers, Master server and Databases interactions

Greetings.
I’m attempting to create basic proper master server-dedicated servers interaction (like Dauntless or The Cycle: Frontier, for example) where you don’t have any server listing, but instead directly taken to dedicated servers using info from master server, but as i’m kinda new to this, i have some general architectural questions:

  1. should master server be a web server? if so, is asp.net a good choice? (cause i’m pretty good with c# and have a friend who works with web servers and databases a lot and can explain this to me)

  2. as there should be per-player data stored in any case (their inventory, for example), i understand that master server should have a database to interact with, that’s not a problem, what is a problem is that, as far as i understand, master server is always only one, so all database related interactions (buying/selling items to npcs, for example) will go through it, which means potentially too big of a server load, or is it fine?

  3. should master server somehow communicate with dedicated servers to configure them (for example, to open safe-zone map or gameplay map) or it’s always purely developers responsibility to have a pool of dedicated servers for each purpose? (and is it even possible to dynamically create new dedicated servers? does it require dynamic creation of VMs too?)

  4. i want to try to interact with steam (because why not, should be interesting, as all of this, and also because i need some way of player identification anyway) and i found some info about master servers provided by steam or something like that, is it only for dedicated server listing and i can’t put any logic on it (matchmaking or database interactions, for example) or i can feed steam my own master server app that it will host?

any info or reading material on those topics will be really helpful as i can’t seem to find it on google (or my queries are poorly formulated)

Bump, general architecture is still in question, any reading material is helpful as google looks really scarce on this topic

Also to catch-up: currently, just to figure things out, i’ve managed to set up database server (MicrosoftSQLServer), a master server (webapi server via ASP NET) that can connect to the database and respond to http requests, and an unreal engine dedicated server and client that connects to steam and can send requests to the master server (like the dedicated server registering itself and client requesting a dedicated server address to connect to), but safeness of all this is in question (for example - what if random user sends server registering request to the master server), as well as how the master server can be sure the dedicated server is still alive (i’ve found some info about master servers heartbeat, but not sure how a web server can actually request anything from the unreal engine dedicated server)

Our company is doing this type of architectural for our game. I don’t know much about networking but I’d like to share what I know.

To your questions

  1. You can have a web server as your master server I assume. We have a web server just for the log in. Separate from the game server.

  2. Our game haven’t been stress tested yet so I don’t know how much data would actually overload the master server. As long as the net package is well designed, it should be fine. You can implement batching if needed. We currently do not.

  3. We set up so each dedicated server to only handle certain maps. It’s better for managing server’s memory. As to the dynamically create new dedicated server, we are also looking for ways to achieve it.

  4. I know little about steam’s server system I’ve only tried steam server listing for single/multiplayer project, not online project.

Clients connects to our master server post log in through tcp. We make Subsystem for maintaining the cannel. Dedicated servers also connect to master server through the same subsystem.

  1. so your master server is a normal tcp server that standalone servers (and clients themselves? is it safe?) connect to? and it handles databases interactions and matchmaking (if any)? do you handle all the edge cases (disconnection from master server, reconnection, packet loss, packets merging etc) yourself? do you sync connection statuses of client to dedicated server and to master server? (but safety of having clients connect to master server is still in question)
  2. so master server tells a connected dedicated server what map to open/how to configure itself? i can see how it can be done in case of tcp master server, maybe this is actually a way to go…
  3. i’ve connected to steam mostly for identification purposes (getting nickname and SteamID) to avoid having to create custom registration and login system, but still have to find some info about user verification (how can i know that client is actually the user with steamid he says he is)… i’ve seen some mentions of steamauth system in docs, but haven’t read more about it yet

Yes, the master server handles databases mainly. The matchmaking is done on a dedicated server. The main hub server does the matchmaking then send the players to another dedicated server.

We do handle most edge cases ourselves.(dc, repeated log in, packets) The dedicated server doesn’t know player’s data other than their outfits and name. I don’t work on networking, but there should be safety methods implemented. We do not expose our servers ip.

Master server doesn’t know which dedicate server does what. All dedicated server have already launched with the map opened. Codes/classes on the maps determined what the dedicate server does.

Master server gives players their own data when logged in. Dedicated servers would send something like “PlayerGather” to master server so that it would give player gathered items. Dedicated just do destroy/respawn the actors.

We don’t use steam other than installation/distribution. We have custom log in with web page verification. (Though maybe we should use some.)

how do you protect your master server if clients also connect to it? (which means user with malicious intent can see where connection goes from his pc, connect manually and try to do something)
how do you make sure (on the master server and everywhere else but the login server that actually verifies it somehow (even tho how exactly is a question too)) the client is actually who he says he is? As, i guess, user can fake the identification data sent to master server and dedicated servers

I’m only using Unreal’s Replication so I can only tell you what it looks like from dedicated servers/client.

Server:

  • Read local config to connect to master server.

Client:

  • Log in from web server to get tokens
  • Account token
  • Access token for initial connect to the master server
  • Refresh token for validation during connection, it would change every few minutes

Hi,

I would like to add my 2 cents to your initial questions (I havent read through the whole thread) because there is limited resources on the topic and I have built these kinds of systems before. I am currently working on a similar setting with Unreal, but my previous games were not Unreal games.

There are several ways to achieve what you want.

  1. There are services like Epic Online Services (EOS) or Playfab that can do the job, depending on what exactly you have in mind. We chose to use EOS for our current project, but we are not quite there yet. But from my understanding these can absolutely do the job of player matchmaking.

  2. If you choose to go without such service and build your own master server, you may choose whatever you prefer. I am thinking about Smartfox Server just because I have used it before and its a great, reliable tool that can easily handle tens of thousands of connections. Its Java though. Just identify what you want to build and choose the toolset you are comfortable with. You can use a webserver or use AWS Lambda funstions with a lightweight data storage like DynamoDB to manage sessions and gameservers, too.
    We actually plan to do both, using EOS for session management, Steam login, etc. and our own game server for spooling up dedicated game servers.

  3. The question about database connection and pass through master server: First of, if you choose a lightweight solution you can totally pass all data through the master server. We did this in my previous projects with Smartfox with 20,000 users. These events happen rarely enough so that you will not have too much load. The calls to your dabatase can be HTTP requests from the master server to your backend or a direct database connection, e.g. using a MySQL connector, and in both cases it will not be very costly to do in terms of performance. But depends on your usecase of course.
    You can also choose to pass this data from the dedicated game servers to your database directly, if you are sure that the dedicated servers stay on your systems and are not available for users to reverse engineer. If you plan to do it from the dedicated game servers you should guard your server code containing sensitive information with the appropriate protection in C++ so that passwords or calls are not being compiled into the game clients that users will download.

  4. For scaling dedicated game servers dynamically, you will need some sort of cloud solution like AWS or Azure. You may choose to spool up your new instances by hand from your master server, e.g. if the master server knows that only 5% of game servers are free, it will start new ones and vice versa. Or you use an automated solution like AWS Gamelift, but it will charge additional cost for this service. You may also choose to set up a limited number of dedicated game servers manually and not scale dynamically, but you risk paying too much if you have too many available, or not being able to add more servers quickly enough if your game is a success. But of course its the easier, indie dev friendly version and may be a good starting point.
    For AWS Gamelift with Unreal there is a great lengthy course on youtube that I can recommend: https://www.youtube.com/watch?v=tOy0xYaP3wA&list=PLa1dM5bPQv0u2IWZRIxtRqwWVJNOUtlbF

  5. Should your master server communicate with your game servers: I think yes thats the way I would do it, making sure that the master server can tell a free game server to load map XY. Much more flexible than keeping enough reserve of all maps at all times. But matter of preference and use case.