Persistent Servers - GameLift or EC2 Only? (newb questions)

Hey folks, please excuse my ignorance because I’m fairly new to the world of dedicated server hosting.

I’m working on a game that requires a persistent world. I’ve managed to get an EC2 instance up and running and I’m able to start my dedicated server process(es) and connect as a client.

I’m trying to figure out how to fetch all running dedicated server processes from all EC2 instances (currently just one, but the idea is to create a server list to show the client).

Ideally we also want to keep track of the server age and have our servers get “wiped” after X weeks (kind of like Rust).

My current understanding is that GameLift is still using EC2 Instances, it’s just managing them for you to spin up additional servers to handle the extra traffic. Like there’s no special “GameLift server”, am I correct?

If so, I guess I don’t understand the best way to go about it so my questions are:

  1. Is GameLift needed for a long term servers or is it specifically for session-based games?

  2. If GameLift can be used for persistent servers, what features does it provide that would prove to be useful? (I don’t think auto-scaling would be necessary as we’d have a “fixed” amount of official servers - although that might need to change if the game does well so it’s not completely out of the question)

  3. If sticking with EC2 and not integrating with GameLift is the way to go, is there a way to “fetch” the dedicated processes from an EC2 instance and extract some custom data that we need from them? (i.e. server name, region, age since wipe, next wipe date, current/max players, etc.)

Thanks for your time :slight_smile:

PS. We’re developing our game using Unreal Engine.

2 Likes

First, yes GameLift servers are EC2 servers(which is the backbone of AWS Services) but they are specials server that have been installed with the GameLift Framework. They handle all the server admin, and updates and what not for you, and give you a connection framework so people can connect to the server easier.

  1. So GameLift can support long term servers and session-based server and mix. What you would do is a “persistent server” be a fleet on to it self, where you can set the min number of server to 1, and disable auto-scaling.
  1. no matter the option that you go with, you should have the server client submit that data to like a database or http end point, because most OS really dont like the idea of reading memory(data) from a process(hackers would have a field day if that was possible).

Most of the data that you have comes into two flavors: static data, and changing data. The static data(like server name, region, last wipe time, max player), the server client can submit when the server client boot up. You can give the server client an id that links to your records about the server(that links to server name, region, max player), then it just tells you when it bootup again(that way your records can calculate the next boot time. This solution pushes alot of the info from the server and to your database/record, that way it safe if the server ever get hacked and what not. For the current number of players you can have the server give you that information on like 5 mins base.

1 Like

Another thing to bear in mind is that all compute is fallible. You do need to plan for instances that go bad due to memory, thread leaks etc, network failures that prevent communication or instances that require reboots due to security patching etc.

So you should have a plan for instance migration of your simulation/persistent data so players get the experience you want.

My two cents on your questions

  1. You could use GameLift for a persistent worlds but I would make sure you are getting value add out of it. Are there other GameLift features that make sense to you ie player latency matching, Flexmatch etc? Note that GameLift is not going to be able to transfer your world data or players if you need to migrate an instance (in GameLift terms they would just start a new session on a new instance).
  1. Scaling/Flexmatch could still help you if you are grouping x players per server. What happens when more players come to your game? Do you need to spin up new worlds for them, are they on slices of the same world instance? What happens when your player population falls?

  2. Theres lots of ways of achieving this. You could do things via ServiceManager/SSM https://aws.amazon.com/systems-manager/ and step functions (if you want a poll model/query model). As @ravenboilinux suggested you’re probably better off building a publishing flow where processes can report in and your service layer consumes this data to its decisions (you would probably still use SSM to cull processes etc).

2 Likes

To allow your server client to talk to your backend services, I would recommend VaRest pluging, and wrap the calls into a server only module since your game client wont need this code. This Plugin allows make rest calls from UE4 and parse json response

This is Advice i got from game tech solutions Architect.

The gamelift is for session based if you are hosting matchmaking, or games like Call of Duty,

If you want to host games like GTA or Minecraft , you would use EC2.

Both are able to be scaled, and you can allow people to use the same image to host on AWS with them being charged (For if you want users to host lobbies as well).

If you want more help, feel free to reach me in the Lumberyard Discord, :slight_smile: