This Guidance helps developers build an achievement system for their games using Amazon GameSparks and Amazon DynamoDB. Using this Guidance, developers can define achievements and the metrics required to unlock them. They can also design their game clients to send metric updates when players complete in-game tasks. Achievement progress is validated server-side and automatically unlocked for players once completed. Achievements motivate players by adding challenges to games, which can drive player engagement.

Architecture Diagram

Download the architecture diagram PDF 

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.

  • This Guidance is delivered as an AWS Cloud Development Kit (AWS CDK) app where you can make changes to the configurations as small, incremental iterations. We recommend capturing the following Amazon CloudWatch metrics to create feedback loops that will help you measure performance and error rate of GameSparks in this Guidance:

    • MessageReceived
    • MessageProcessingDuration
    • MessageProcessingError

    The DynamoDB capacity mode in this Guidance is set to “On-demand,” which is ideal for unpredictable workloads. For predictable workloads, you can optimize costs by changing to “Provisioned” capacity mode. You can also use the following CloudWatch metrics to monitor DynamoDB workloads: 

    • ConsumedWriteCapacityUnits
    • ConsuedReadCapacityUnits
    Read the Operational Excellence whitepaper 
  • The resources deployed by this Guidance are not exposed to the internet, and the public can only access them using the GameSparks game backend. Users can only access the administrative services through AWS Command Line Interface (CLI) or software development kits (SDKs), using Identity and Access Management (IAM) users or roles with the appropriate permissions. All stored data resides in DynamoDB and is encrypted using AWS-managed keys.

    Read the Security whitepaper 
  • We recommend checking and adjusting the Lambda (reserved) concurrency for the Lambda functions deployed in your AWS account prior to your game receiving production traffic. When there are changes in demand, GameSparks, Lambda, and DynamoDB will automatically scale to meet the new demand. DynamoDB has point-in-time recovery enabled by default in this Guidance, which allows for backup with per-second granularity so that you can restore to any given second from the preceding 35 days.

    Read the Reliability whitepaper 
  • For achievements, latency from the game client to the game backend is not a large concern. GameSparks game backends can be deployed to several AWS Regions. You should choose where to deploy your game backend based on where most of your players reside—by deploying closer to your players, you can reduce lag in gameplay.

    Read the Performance Efficiency whitepaper 
  • Within this Guidance, data transfer out only occurs through GameSparks, which does not include a cost for data transfer. We avoid data transfer across AWS Regions by centralizing all resources in a single AWS Region. DynamoDB is used as the primary data storage for the Guidance. DynamoDB offers on-demand capacity, so you pay only for what you use. Serverless services in the Guidance, such as Lambda and DynamoDB, automatically scale from zero to peak demands.

    GameSparks includes pricing based on Client API calls and Cloud Code API calls, both of which are kept to a minimum. To keep cost of client API calls to a minimum, you should poll for achievement status updates from the game client as infrequently as possible and only whenever player activity may cause an achievement to get unlocked. 

    Read the Cost Optimization whitepaper 
  • The architecture scales based on user demand, helping to ensure that there are no idle resources. You can change memory and storage allocation on Lambda functions based on usage to ensure maximum utilization.

    Read the Sustainability whitepaper 

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. 

AWS Architecture
Blog

Title

Subtitle
Text.
 
This post demonstrates how...

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.