Build a Quick Game using Amazon GameLift service
Nandini Rajaram
Posted on May 28, 2023
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.
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
- On the left pane, click Try a Sample game link
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.
- Once build is added, Click Create fleet button to run the sample game
Fleet creation might take some time to complete
- Once the fleet is created, Click Start game session button
- Now, Click Generate player token button and connect up to 8 players to the game
- You will be navigated to Connect Players screen where you need to download and open game client by clicking Download game client button
- 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
- Extract the GameLiftClientPackage and open the Bin64vc141.Release\MultiplayerSampleLauncher.exe to launch the game
- Click the player session token text area, and paste the player token copied
- Now, Click Connect button and start playing the game
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
Posted on May 28, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.