How Amazon GameLift works - Amazon GameLift

How Amazon GameLift works

This topic covers the core components for game hosting and describes how Amazon GameLift makes your multiplayer game servers available to players.

Ready to prepare your game for hosting on Amazon GameLift? Check out Amazon GameLift managed hosting roadmap.

Key components

Setting up Amazon GameLift to host your game involves working with the following components. The diagram in Game architecture with managed Amazon GameLift visualizes the relationships between these components.

  • A game server is your game's server software running on a fleet. You upload your game server build or script to Amazon GameLift and tell Amazon GameLift. When you use Amazon GameLift Anywhere or Amazon GameLift FleetIQ, you upload your game server build directly to the compute resource.

  • A game session is an in progress game with players. You define the basic characteristics of a game session, such as its life span and number of players. Players then connect to the game server to join a game session.

  • A game client is your game's software running on a player's device. A game client connects to a game server through backend services to join a game session, based on connection information that it receives from Amazon GameLift.

  • Backend services are additional, custom services that handle tasks related to Amazon GameLift. As a best practice, your backend services should handle all game client communication with Amazon GameLift.

Hosting game servers

With Amazon GameLift, you can host your game servers in three different ways: Managed Amazon GameLift, Amazon GameLift FleetIQ, and Amazon GameLift Anywhere. For more information about Amazon GameLift FleetIQ, see What is Amazon GameLift FleetIQ?

You can design a fleet to fit your game's needs. For more information about designing a fleet, see Amazon GameLift fleet design guide.

Managed Amazon GameLift

With managed Amazon GameLift, you can host your game servers on Amazon GameLift virtual computing resources, called instances. Set up your hosting resources by creating a fleet of instances and deploying them to run your game servers.

Amazon GameLift Anywhere

With Amazon GameLift Anywhere, you can host your game servers on compute that you manage. Set up your hosting resources by creating an Anywhere fleet that references your compute.

Fleet aliases

An alias is a designation that you can transfer between fleets, making it a convenient way to have a generic fleet location. You can use an alias to switch game clients from using one fleet to another without changing your game client. You can also create a terminal alias that you point to content.

Running game sessions

After you deploy your game server build to a fleet and Amazon GameLift launches game server processes on each instance, the fleet can host game sessions. Amazon GameLift starts new game sessions when your game client service sends a placement request to the backend service or to Amazon GameLift.

Game session placement and the FleetIQ algorithm

Queues use the FleetIQ algorithm to select an available game server to host a new game session. The key component for game session placement is the Amazon GameLift game session queue. You assign a game session queue a list of fleets, which determines where the queue can place game sessions. For more information about game session queues and how to design them for your game, see Design a game session queue.

Player connections to games

As part of the game session placement process, the queue or game session prompts the selected game server to start a new game session. The game server responds to the prompt and reports back to Amazon GameLift when it's ready to accept player connections. Amazon GameLift then delivers connection information to the backend service or game client service. Your game clients use this information to connect directly to the game session and begin gameplay.

Scaling fleet capacity

When a fleet is active and ready to host game sessions, you can adjust your fleet capacity to meet player demand. We recommend that you find a balance between all incoming players finding a game quickly and overspending on resources that sit idle.

Amazon GameLift provides a highly effective auto scaling tool, or you can manually set fleet capacity. For more information, see Scaling Amazon GameLift hosting capacity.

Auto scaling

Amazon GameLift provides two methods of auto scaling:

Additional scaling features
  • Game session protection – Prevent Amazon GameLift from ending game sessions that are hosting active players during a scale-down event.

  • Scaling limits – Control overall instance usage by setting minimum and maximum limits on the number of instances in a fleet.

  • Suspending auto scaling – Suspend auto scaling at the fleet location level without changing or deleting your auto scaling policies.

  • Scaling metrics – Track a fleet's history of capacity and scaling events.

Monitoring Amazon GameLift

When you have fleets up and running, Amazon GameLift collects a variety of information to help you monitor the performance of your deployed game servers. You can use this information to optimize your use of resources, troubleshoot issues, and gain insight into how players are active in your games. Amazon GameLift collects the following:

  • Fleet, location, game session, and player session details

  • Usage metrics

  • Server process health

  • Game session logs

For more information about monitoring in Amazon GameLift, see Monitoring Amazon GameLift.

Using other AWS resources

Your game servers and applications can communicate with other AWS resources. For example, you might use a set of web services for player authentication or social networking. For your game servers to access AWS resources that your AWS account manages, explicitly allow Amazon GameLift to access your AWS resources.

Amazon GameLift provides a couple of options for managing this type of access. For more information, see Communicate with other AWS resources from your fleets.