Skip to content

What is GameLift and how to use it

A series of tutorials focused on the various AWS GameLift features

Back to Dev Log

What is GameLift?

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.

Official feature list

Official - How GameLift works

Server types

GameLift comes in two flavors: RealTime and Custom

RealTime GameLift

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

Video resources to get started

  • Unity + Amazon GameLift RealTime Servers Part 1: SDK Setup
    Part 1 of this series demonstrates how to build and enable the GameLift Realtime client SDK for use in your multiplayer Unity project. Setting up the SDK was not a trival task so if you want to get started with RealTime servers, start here.
    https://youtu.be/hWmw3neX0hc
  • Unity + Amazon GameLift RealTime Server Part 2: Setup in web console
    Part 2 of this series demonstrates how to setup Amazon's GameLift RealTime Server for basic multiplayer functionality. We explore Amazon's web console to enable GameLift's RealTime Server, upload the basic game server script, create a fleet, and enable authentication through Cognito.
    https://youtu.be/WaAZyqgkXDY
  • Unity + Amazon GameLift RealTime Servers Part 3: Integrate GameLift
    Part 3 of this series details how to integrate with the Amazon SDKs in your Unity project to communicate with the GameLift RealTime servers. It demonstrates that clients can join a game session and send and receive messages based on player actions.
    https://youtu.be/1U5A01JuDJ0
  • AWS GameLift: debug with server logs
    This video reviews how to debug remote GameLift servers by connecting to the instances within the Fleet and viewing the logs.
    https://youtu.be/8kQIG8YB4q0

Custom GameLift

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

  • Part 1: Client Side Setup

  • AWS SDK for Unity to Connect to Custom GameLift Server
    This video shows you how to add the AWS SDK to your Unity project. Amazon calls this SDK “Client Services”, which is used to connect to custom GameLift servers.
    https://youtu.be/rUAhtlD-wXg
  • Part 2: Server Side Setup

  • Unity Custom GameLift Server Initialization with Fleets
    This is a review of how to initialize a Unity game server and deploy it as a Custom GameLift Server to a Fleet.
    https://youtu.be/IL2BRxJZdUA
  • Part 3: Complete Unity Client to Unity Custom GameLift Server

  • Unity Game Client to Unity Custom GameLift Server
    As the third part in the series, this completes the Unity Client to Unity Custom GameLift Server setup. The video covers the remaining sections in the AWS diagram starting with “Start game” (linked below). The demo is split into two projects, client and server, where I cover how to use the basic GameLift APIs and how to setup a TCP server (Telepathy) for client to server communication, along with any AWS Console configuration.
    https://youtu.be/cOS4Ax85elQ

Alternative AWS Services

For game servers (Lambda, EC2, & Lightsail)

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.