How achievements work - AWS GameKit

You are currently viewing content for use with Unreal Engine software. See all AWS GameKit documentation

How achievements work

When deployed, your AWS GameKit achievements backend has three primary functions:

  • It stores the definitions for all the achievements in your game. Definitions include information such as the achievement name, how it's earned, an optional reward, and player-facing details such as icons or messaging. You use the AWS GameKit tool to create achievement definitions and sync them to your achievements backend. With achievements saved to the backend, players can start to earn them. You can add or update achievement definitions at any time. Game clients can use the AWS GameKit API to request a list of achievement definitions.

  • It stores each player's achievements status. When a player does something in your game that earns them progress toward an achievement, your game client sends an AWS GameKit API request to the backend to update the player's status. The game client can also request player achievement status, including earned awards and progress toward multi-step awards.

  • It runs logic to evaluate if a player has earned achievements. Using the achievement definitions and player status, the backend uses a Lambda function to determine if a player has completed the achievement requirements. In addition to tracking player status, earned status can affect how the backend responds to game client requests for achievement information.

Achievement types

The AWS GameKit achievements game feature supports the following achievement types:

Single-step achievement

Also called a stateless achievement, a player earns this type in response to a single specific event in gameplay, such as when they find a certain treasure item or unlocks a puzzle. Your game client responds to the event by sending an update request to your achievements backend Player status for stateless achievements is either locked (not earned) or unlocked (earned).

Multi-step achievement

Also called a stateful achievement, a player earns this type in response to a series of events in gameplay. A stateful achievement definition specifies the number of steps that are required to earn the achievement. When an event occurs, the game client sends an update request, with a number, to the achievements backend, and the backend service responds by adding that number to the player's current progress until the step requirement is reached and the player earns the achievement. For example, the achievement "eat 1000 bananas" has a step value of 1000. Each time a player eats a banana, the game client notifies the backend with a value of "1", and the backend increments the player's status by 1 until it reaches 1000. With this achievement type, you have the flexibility to design how you want to increment player progress. You might add banana bunches that increment by 10 or mega-bunches that increment by 100. Player status for a stateful achievement is locked and not started, locked and in progress, or unlocked.

Secret achievement

This type is useful when you want to define achievements but not reveal them to players until after they've earned them. For example, with a secret achievement such as "Expose the Nazi mole before they defect", you can reward players without giving the end game away. The achievements backend does not include secret achievements when responding to a game client's request for achievement information until the player has earned them. You can add or remove an achievement’s "secret" flag at any time. Secret achievements can be stateless or stateful.

Hidden achievement

This type allows you to hide a defined achievement from your game. This is useful when you want to stage an achievement for future release, such as for a special event. When responding to requests from a game client, the achievements backend does not return information on hidden achievements and does not track player status for them. You can add or remove an achievement’s "hidden" flag at any time. Hidden achievements can be stateless or stateful.

Achievements workflow

Here's a high level description of how the achievement system works from the player/game client perspective.

  1. In your game, a player does something that fires an event. In response to the event, your game client calls an AWS GameKit API operation to report player progress toward the achievement. This call contains the following information: player ID, name of the achievement, and a number value that represents what the player has done, such as eat ten bananas or slay a dragon.

  2. When the achievements backend receives the request, it updates the player's status for the specified achievement. It then runs some built-in logic to determine if the player has earned the achievement. This involves comparing the goal (as specified in the achievement definition) to the player's current progress. If the player has reached the goal, the achievement is unlocked.

  3. The game client can call AWS GameKit API operations to get a player's status for a single achievement or all achievements, and displays updated information to the player.