You are currently viewing content for use with Unreal Engine software. See all AWS GameKit documentation
Add achievements to your project
Summary
Learn how to build a complete cloud-based achievements system and integrate it into a Unreal Engine project. This topic guides developers through building backend services and then using the AWS GameKit API to connect frontend code to the backend on AWS.
When you're ready to build the achievements feature for your game, follow these basic steps. If you don't yet have AWS GameKit installed for your project, see Install the AWS GameKit plugin with Unreal Engine and Set up the AWS GameKit plugin for your game.
Step 1. Configure the achievements game feature for your game project.
-
In the Unreal Editor toolbar, open Edit, Project Settings and go to the AwsGameKit plugin section. Select the environment you want to work in and enter valid AWS credentials as needed. For more details, see Set up the AWS GameKit plugin for your game.
-
Expand the Achievements section. For this game feature you must define the achievements you want to include in your game. Choose the Configure button add or update achievement definitions. All achievement data is cached locally until you choose to sync it with AWS, and you can choose to save updates locally to use in later sessions.
You have several options for maintaining achievement definitions in the AWS GameKit plugin:
-
Use the plugin UI to add achievement definitions. Entries are automatically cached locally.
-
Download an achievements JSON template by choosing Get Template. You can edit it directly and then upload to the plugin by choosing Import from Local File.
-
Retrieve the cloud-saved achievement definitions by choosing Get Data from Cloud.
In each method, you are updating achievement definitions and saving them locally. When you're ready to make an achievement accessible to your game, either deploy new AWS resources for this feature or, if an Achievements backend has already been deployed, choose Save Data to Cloud to sync your local updates with the cloud-based versions.
-
Step 2. Deploy AWS resources for your achievements backend.
-
While still in the AWS GameKit settings for Achievements, scroll down to the deployment controls. Choose the AWS resource action Create. This action prompts AWS GameKit to deploy the complete AWS solution for this feature's backend services. When deploying, AWS GameKit connects to AWS to create all the AWS resources for the solution, using the configuration template for the active environment.
-
Deploying resources for identity and authentication typically takes 30 minutes to complete. During this time, the feature's deployment status reads Deploying resources. You can track the progress of your deployment status:
-
In the Unreal Editor, open the output log window to monitor status messages, events, and errors throughout the deployment.
-
In the AWS Management Console, open the AWS CloudFormation service. In the Stacks view you can watch as the Identity stack for your game project is deployed.
When deployment is complete, the feature's deployment status reads Deployed. Your game backend for achievements is in place. You can make calls to it using the AWS GameKit API.
Note
NOTE: From this point on, you might begin incurring costs for this game feature. If you're still in the AWS Free Tier window, you will only incur costs if you exceed free tier limits.
-
-
When you've deployed the cloud backend for this feature, sync your achievements definitions with the backend services on AWS. To upload new achievement data to the cloud, choose Save Data. To download saved achievement data from the cloud to your local machine, choose Get Latest.
Permisisons and version control for achievements definitions
By default, AWS GameKit users are given access permissions to save achievement definitions to the cloud in the Development environment only. For instructions on how to modify these user permissions, see Manage permissions for achievements.
AWS GameKit does not provide version control for achievement definition updates. For teams development, we recommend that you manage definition updates through your own version control system and restrict user permissions for uploading achievement definitions to your cloud backend.
Step 3. Add achievements functionality to your game.
Create UI elements and add code for the achievement-related workflows as needed for your game. See the plugin's achievements examples for illustration. Workflows might include:
-
Get all achievement information and player status
GetAchievements()
-
Get information and player status for a single achievement
-
GetAchievement()
-
-
Add a trigger to a game event that prompts an update for a player's achievement status
UpdateAchievement()