As Covid-19 pandemic hit the world, everyone was locked down
in their own homes. At start, it was little fun to binge all
TV shows, Movies, etc. As physical sports were put on hold due
to lockdown, Virtual sports began to come into existence for
almost everyone. Earlier it was only few people who used to
play Mobile/PC games regularly, but since many of us getting
bored, we figured out how to play with friends virtually.
It comes as no surprise that gaming usage and viewership of
gaming video content spiked in 2020, as consumers spent more
time at home and the video game industry provided a means to
stay entertained and connected with friends.
With this spike in DAU’s many of gaming companies were not
able to manage load and hence it tampered user experience
along with revenue for gaming companies. Those who have their
own on-premise gaming servers, lost in their own game because
of scalability issues.
AWS GameLift is managed service which can be used to tackle
all types of Game Server Scalability issues. AWS GameLift
comes with multiple services as follows:
- AWS GameLift Custom Server
- AWS GameLift Realtime Server
- AWS GameLift FleetIQ
Let’s talk about each of above service one-by-one,
highlighting the important points which are hard to catch in
vast documentation of AWS.
AWS GameLift Custom Server
It’s a fully managed service for deploying, operating, and
scaling session-based, multiplayer game servers. GameLift
Hosting replaces the work required to host your own custom
game servers, including buying and setting up hardware and
managing ongoing activity, security, storage, and performance
tracking.
The two main key components of GameLift Hosting-based
solutions include:
-
Game Backend Service
In addition to GameLift, you always need to host a
backend service for your game. The backend will use
GameLift APIs to initiate matchmaking and request game
session placement. Popular options for game backend
hosting include serverless backends with Amazon API
Gateway and AWS Lambda, or container-based backends with
Elastic Load Balancing and Amazon ECS. Backend service
can also be called as API Service which will call
GameLift API’s. This can be integrated with backend
server of game.
-
GameLift Fleets
This is the actual fleet of EC2 instances hosted by
GameLift, which is running your game server build with
your defined configuration and scaling logic. GameLift
fleet will be the actual game servers which will relay
the data from one user to another. When created the Game
Build, the build is deployed on these servers which are
scaled and managed by GameLift Service.
Points to be noted
-
Many of us get confused while reading the documentation
around the terms Client, Backend Server and Game Server.
Let’s clear the confusion, below:
- Client is the actual game on Mobile device.
-
Backend Server calls the GameLift API’s, and it has
nothing to do with the actual gameplay. It just helps
to set the game including matchmaking, requesting game
sessions, etc.
-
Game Server is actual game server which will relay the
actual game data. It has all the gaming logic.
-
It is best practice to not call AWS GameLift API’s
directly from Mobile Device since there is no
authentication mechanism provided by AWS GameLift.
Instead, integrate GameLift API’s in backend server by
which the request will only come from authenticated users.
-
Game Server creation and termination are decided by AWS
GameLift FleetIQ ViabilityAlgorithm
-
Following are the parameters provided once the game
session is created:
-
IP Address and Port (It’s IP of Game server on which
the session is placed. The client will be connected to
this IP and Port for gameplay.)
-
AWS GameLift Custom game servers supports following
languages:
- C++
- C++ for Unreal Engines
- C#
-
Game engines – Amazon Lumberyard, Unreal Engine, Unity,
engines that support C++ or C# libraries
AWS GameLift Realtime Server
Realtime Servers are lightweight, ready-to-go game servers
that are provided by GameLift for you to use with your
multiplayer games. While many games need a custom game server
to handle complex physics and computations, this is overkill
for many other games. Since Realtime Servers eliminate the
need to develop, test, and deploy a custom game server,
choosing this solution can help minimize the time and effort
required to complete your game.
-
AWS GameLift Realtime servers use TCP and UDP for
messaging.
-
A Realtime server is set up to communicate with the
GameLift service, which triggers the Realtime server to
start game sessions, validate players when they connect,
and collects player connection status and game health
state from the game server. In contrast, this
functionality must be implemented in a custom game server.
-
A
Realtime script
provides configuration settings and optional custom game
logic for your game. The script may contain minimal
configuration settings or have more complex game logic.
The Realtime script is deployed along with the Realtime
server when starting up new hosting resources. Scripts are
written in Node.js-based JavaScript.
-
In Realtime Servers,
Game server is already built-in inside the fleet
, so there is no need to worry about developing the game
server as in Custom Game Servers. In most of the cases,
Fleet (EC2 Servers) will only act as message relay servers
without doing any processing.
In which scenarios one should think of using Realtime
Servers?
- Where there is no server processing included.
-
Where most of complex processing is happening on Mobile
Devices.
-
Where servers are only needed to relay data from one
device to another device.
Points to be noted:
-
There is no special realtime capability in Realtime
servers. There is no latency advantage when used Realtime
server compared with GameLift Custom Server.
-
Realtime Server Client SDK is used to communicate with
Realtime Server on Client Device
-
Realtime Script can only be written in Node.js language.
-
AWS GameLift Realtime Script can be deployed on Spot
Instances as well as On-Demand instances
-
Realtime Server Client SDK is only in C#. So game builds
which are developed other than C# cannot user Realtime
Server capability and will have to use GameLift Custom
Server.
-
Realtime Server works only for Unity and engines that
support C# libraries.
AWS Gamelift FleetIQ
GameLift FleetIQ optimizes the use of low-cost Spot Instances
for cloud-based game hosting with Amazon EC2. With GameLift
FleetIQ, you can work directly with your hosting resources in
Amazon EC2 and Auto Scaling while taking advantage of GameLift
optimizations to deliver inexpensive, resilient game hosting
for your players.
When to use:
-
Have existing AWS deployments or want to use Amazon EC2
directly rather than through the fully managed GameLift
service. GameLift FleetIQ works with Auto Scaling groups
that you manage in your AWS account, giving you full
access to your Amazon EC2 instances and groups. You can
also integrate with other AWS services, including Amazon
Elastic Container Service, Amazon Elastic Kubernetes
Service, and AWS Shield Advanced.
-
Have existing on-premises game hosting and want to extend
capacity to the cloud. With GameLift FleetIQ, you can
build a hybrid deployment system that uses your
on-premises capacity and incrementally adds AWS cloud
capacity as needed.
Points to be noted:
-
When using GameLift FleetIQ, you prepare to launch Amazon
EC2 instances as usual: make an Amazon Machine Image (AMI)
with your game server software, create an Amazon EC2
launch template, and define configuration settings for an
Auto Scaling group. However, instead of creating an Auto
Scaling group directly, you create a GameLift FleetIQ game
server group with your Amazon EC2 and Auto Scaling
resources and configuration.
-
By using FleetIQ, we get complete control to our EC2
instances. It can be seen in EC2 console, which is not in
the case of Custom Servers and Realtime Servers. Both the
above servers are managed by GameLift and are not
accessible.
-
When new server is created by auto scaling group, it first
needs to register itself to GameLift Service.
-
When the instance spawn up, it calls AWS SDK function
RegisterGameServer(), which informs GameLift Service about
the new instance. FleetIQ Viability Algorithm then keeps
note of it and mark it as available. New game sessions can
now be hosted on that Game Server.
-
Same goes while terminating the Instance. In order to
gracefully terminate the instance, it needs to inform to
GameLift Service that the instance will no longer be
available to host new game sessions. For this, it calls
DeregisterGameServer() function which deregisters it and
make it unavailable to host new game sessions.
-
GameLift FleetIQ works best when it is constantly
directing players onto instances that are least likely to
have game session interruptions. Maintaining long-lived
sessions interferes with the GameLift FleetIQ balancing
process, which increases the likelihood that games
sessions might be interrupted
Conclusion
As you may have got a brief idea on all the AWS GameLift
offered services, and if you are looking to know more about
how we can help you with GameTech solution on AWS for your
game, reach out to us at
sales@flentas.com
Reference Links