This Guidance helps developers test, visualize, and optimize their multiplayer games using the Amazon GameLift Testing Toolkit. With the toolkit, developers can troubleshoot, debug, and tune their Amazon GameLift infrastructure. This Guidance offers an optional capability to use virtual players that run the same code as real players so developers can test the success of their game before launching it into production.
Architecture Diagram
[Architecture diagram description]
Step 1
Amazon CloudFront provides access to the toolkit web console, which is stored on Amazon Simple Storage Service (Amazon S3). Toolkit console users authenticate with Amazon Cognito user pools.
Step 2
The web console connects with an Amazon API Gateway WebSocket API, which calls an AWS Lambda function to process requests and store data in Amazon DynamoDB.
Step 3
The Lambda function can query and update Amazon GameLift infrastructure directly.
Step 4
The game listener receives GameLift events through Amazon EventBridge and uses AWS Step Functions to poll and receive infrastructure updates from GameLift and Amazon CloudWatch.
Step 5
The game listener dispatches aggregated event data over a custom EventBridge event bus. The events are received by a Lambda function which stores data in DynamoDB and calls API Gateway to send data to connected web console users for display.
Step 6
The web console user can also launch virtual player tasks on AWS Fargate to simulate real game clients.
Step 7
Each virtual player task requests a Cognito guest identity and connects into the game client services API Gateway to request matchmaking.
Step 8
The Lambda functions call GameLift FlexMatch to start the matchmaking process and place successful matches onto a fleet using game session queues.
Step 9
The virtual player tasks connect with GameLift fleet instances to start their game sessions.
Well-Architected Pillars
The AWS Well-Architected Framework helps you understand the pros and cons of the decisions you make when building systems in the cloud. The six pillars of the Framework allow you to learn architectural best practices for designing and operating reliable, secure, efficient, cost-effective, and sustainable systems. Using the AWS Well-Architected Tool, available at no charge in the AWS Management Console, you can review your workloads against these best practices by answering a set of questions for each pillar.
The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.
-
Operational Excellence
Both the toolkit and the sample game are fully deployed with infrastructure as code, which reduces errors caused by manual processes and reduces the effort to deploy changes.
-
Security
The serverless web console API on API Gateway is protected with AWS Identity and Access Management (IAM) based authentication against a Cognito User Pool.
The serverless sample game backend on API Gateway is protected with IAM-based authentication for secure validation of the player's guest identity.
Game servers on GameLift only allow access to the ports used for client-server communication. The backend Lambda functions only have access to the services they need.
-
Reliability
Data is stored in DynamoDB tables, utilizing on-demand capacity allocation to automatically scale based on changes in demand.
The solution backend services use Lambda, which scales instances automatically.
The sample game backend supports GameLift Target-based auto-scaling to handle changes in demand.
-
Performance Efficiency
By utilizing managed, serverless technologies such as API Gateway, Lambda, DynamoDB, and Fargate, you only pay for the resources you use and reduce the operational effort required to maintain the solution.
The solution can be deployed into a region of your choice, and utilizes CloudFront to reduce latency for the web console end user.
-
Cost Optimization
Virtual Player Tasks can be launched with Fargate Spot to reduce the cost of testing.
The web console and sample game backends utilize serverless technologies so that you only pay for the resources you use.
The web console backend utilizes the native scaling features of Lambda and API Gateway, with DynamoDB tables using on-demand capacity allocation to ensure the resources match the demand.
The sample game backend supports GameLift Target-based auto-scaling to minimize the resources required.
-
Sustainability
This Guidance extensively uses managed services, which shifts responsibility for maintaining high-average utilization to AWS.
The sample game backend supports GameLift Target-based auto-scaling to minimize the resources required. By packing game sessions onto the minimum number of server instances, resource utilization is kept consistently high.
By widely utilizing managed services, this Guidance reduces your individual impact on the environment.
You can further reduce the sustainability impact of unused resources by launching game servers onto Spot fleets, and launching Virtual Player tasks onto Fargate Spot.
Implementation Resources
The sample code is a starting point. It is industry validated, prescriptive but not definitive, and a peek under the hood to help you begin.
Related Content
[Title]
Disclaimer
The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.
References to third-party services or organizations in this Guidance do not imply an endorsement, sponsorship, or affiliation between Amazon or AWS and the third party. Guidance from AWS is a technical starting point, and you can customize your integration with third-party services when you deploy the architecture.