DEV Community

Cover image for Build a Quick Game using Amazon GameLift service
Nandini Rajaram for AWS Community Builders

Posted on

Build a Quick Game using Amazon GameLift service

Image description

Game software is created using a game engine, such as Unity, Unreal, or Lumberyard, and is then run on the player's gaming device, such as a game console, computer, phone, tablet, TV set top box, or web browser.

Game Server

A game server is a piece of software that manages multi-player activities and offers accurate game state. it also communicates and provides services to the Game Software during gameplay.

The Game Server software runs on an EC2 instance on AWS.

Game Hosting Service

The system that provisions game server instance and manages the loading and running of the Game Server is called the Hosting Service. The minimum work that a Game Server Hosting Service performs is infrastructure Management (provisioning compute resources on which to host Game Servers)

AWS Game Server hosting solutions go far beyond that.

  • Session Management involves staying connected to the Game Server
  • Reporting information like the available slots in a multiplayer game.
  • Recognizing when a game session has ended, or when a new game session is started and whether it is currently ready to receive players or not.
  • Finding an available Game Server to host a game that is within latency tolerances and located near players (Game Session Placement)
  • Shifting placement to different regions as availability of instances and location of player demand changes.
  • Matchmaking where multiple players can request to play a game together on the same Game Server

Amazon GameLift

Amazon GameLift is a managed service that provides Game Server hosting abstractions on top of Amazon EC2. GameLift is designed for session-based games. It has features to build multiplayer games and battle royale games with 100 or more players. And it scales to multiple Regions and globally.

Fleet

  • Instances are grouped into fleets and are composed of identical instances.
  • Each instance is loaded with Game Server software, which is used to start one or more Game Sessions.
  • A fleet can be manually or automatically scaled

GameLift supports for Spot Instances. This can provide up to 70 percent cost savings compared to existing on-premises deployments.

Image description

GameLift includes a feature called FleetIQ

FleetIQ

FleetIQ manages availability by backing it up with an On Demand fleet and designating the Spot fleet as unavailable to maintain the quality of the gaming experience. This minimizes Spot disruption of game sessions.

Queue

Fleets are placed in a queue. When a request comes in to play a game, the system uses the queue to find an acceptable fleet and identify an available Game Session.

The game software measures latency to regional endpoints and provides this information in the game request. The lowest-latency fleet is selected. If it is not available or has no open Game Sessions, the next one is chosen. The system is also aware of fleet costs, and it will choose an available lower-cost Spot fleet before an equivalent On-Demand fleet when other factors are equal. You can set up multiple queues for global Game Server hosting.

FlexMatch

Amazon GameLift’s FlexMatch capabilities let you match players together based on rules you define.

For example, you can have a rule for the game that the match be accepted by all the players before the Game Session is placed.


Lets Build a game now

  • Navigate to Amazon GameLift console

Image description

  • On the left pane, click Try a Sample game link

Image description

You will be navigated to Try a sample game page where create and deploy a sample game server using Amazon GameLift.

  • Click Add build button which will Create an example game build.

Image description

  • Once build is added, Click Create fleet button to run the sample game

Image description

Fleet creation might take some time to complete

Image description

  • Once the fleet is created, Click Start game session button

Image description

  • Now, Click Generate player token button and connect up to 8 players to the game

Image description

  • You will be navigated to Connect Players screen where you need to download and open game client by clicking Download game client button

Image description

  • For every game client session, a player token need to be generated and this need to be pasted it to the client. Click Generate player token button to generate Player token and copy the token by clicking copy button

Image description

  • Extract the GameLiftClientPackage and open the Bin64vc141.Release\MultiplayerSampleLauncher.exe to launch the game

Image description

  • Click the player session token text area, and paste the player token copied

Image description

  • Now, Click Connect button and start playing the game

Image description


Now that we have successfully built a game and the take away is

Amazon GameLift is an ideal solution for hosting multiplayer games with the most focus on developing the Game Server and the least work required on development operations.

Quit the game and Delete the resources once you have finished playing the game

Top comments (3)

Collapse
 
vijay_21 profile image
Vijay Ramanathan

Nice article

Collapse
 
ferreirowsabr profile image
Info Comment hidden by post author - thread only accessible via permalink

It's a very good tutorial, thanks ! Besides I can't help noticing that I love gaming, in fact I spend a lot of time on the computer, it attracts me a lot, especially since I found this source casinosanalyzer.com/bonuses-by-cou... I understood that gaming is mine, this source gave me the possibility to choose the casino with the best bonus, now I have a lot of money in my account because I managed to win, I enjoy it so much that I can't stop talking about it everywhere!

Some comments have been hidden by the post's author - find out more