AWS GameLift is a service tailored to run your game’s backend servers. Before diving too deep into any new service, it is important to understand your project’s requirements. If you have a single player game or if you’re looking to host your game client (so not the server part), GameLift is not for you.
As a side note, if you’d still like to use AWS Services in your project, regardless if it is multiplayer or not, you can install the .NET SDKs into your project and access all of their service APIs like S3, DynamoDb, Lambda, CloudWatch, etc.
Some basic definitions:
Game Client this is the part that the player downloads and plays the game on, Unity game client. Most of us use Steam as a way to download the game clients when purchasing a new game.
Game Server this is the backend that the Game Client sends messages to. It can be comprised of multiple services like authentication, matchmaking, game simulation, session management, and storing data, etc. GameLift is an attempt to streamline these services.
- Unity can act as both a client and a server. See the Custom GameLift section below.
Game Session represents an active game where we group players together for a multiplayer game. We can configure how many players are allowed to play and how long the game should last. Players will join an active game session to play the game.
Player Session represents an active player participating in a multiplayer Game Session.
GameLift comes in two flavors: RealTime and Custom
RealTime servers is the lightweight approach to GameLift. This is not the
option for
hosting your Unity backend server build, use the Custom GameLift approach instead. AWS
provides a basic
Javascript template that has all the lifecycle code needed to kickoff
the RealTime server. It allows you to easily manage game and player sessions.
Basically, it provides a relay for your game clients to send and receive messages. You
probably won’t be using this option for a fast paced first person shooter or MMO, but
maybe for a small turn based game where you need to track turns and scores.
sources:
https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-intro.html,
https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-howitworks.html
Custom GameLift servers is the option where you want to run a Unity
project (or server
build) as your backend server. They also support Unreal and Lumberyard, but I will be
referencing Unity for my tutorials as the concepts are relatively the same. There are a
couple things you have to setup in your project for it to be able to communicate with
the GameLift internal services, but I cover all of that in the videos below. The
biggest difference between RealTime and Custom is for custom you have to setup your own
communication server. I cover this in Part 3 below.
sources:
https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-integration.html
If you’d prefer to not use GameLift, you can leverage other AWS services like Lambda, EC2, or Lightsail as your backend services. You’d have to manage everything on your own including matchmaking, game/player session management, auto-scaling, server security, etc.
Lambda is a possible alternative for simple games that don’t require a ton of processing power or complexity. I’ve actually created a video series on this topic with an example implementation. EC2 and Lightsail services will allow you to deploy basically anything that runs on Linux/Unix or Windows, so as they differ in cost and configuration complexity, they will probably work for whatever tech stack you’re comfortable with.
It’s important to think about where your project is currently at and where you see it going over the next several weeks or months. You get 125 hours of free GameLift per month, but that only lasts for the first year. If your game backend can run on Lambda, for example, and you’re comfortable with the pricing of the other services you’ll be using (Cognito, Dynamodb, S3, etc…), maybe stick with that. Maybe you don’t care about scaling, match making, or session management. My point is, just because GameLift is all inclusive and has “game” in its service name, doesn’t mean you have to use it. AWS offers numerous services that all work together, so go with what works best for you.