The Achievements Sample demonstrates the operations related to achievements in the EOS SDK, including:
Querying achievement definitions
Querying player achievements progress
Ingesting stats to update the progress of achievements
Manually unlocking achievements
The sample demonstrates these features by providing a user interface that can control these operations and display data directly to the user.
See the Achievements Interface and Stats Interface documentation for more information about achievements and stats).
Before You Begin
The sample application uses Epic Account Services to authenticate the local user for demonstration purposes. This requires that the Client Credentials used to initialize the SDK have been assigned to an Application used for Epic Account Services.
The demonstrated SDK functionality can be used with any of the supported identity providers for user authentication.
Achievement Definitions
When the sample starts, it will retrieve the achievement definitions created via the Developer Portal and display them in a list. The definition names will appear in a column on the left, under the header Definitions, as shown below:
If a user is logged in, the localized text returned in the achievement definitions will match the user's locale. If the user has a locale override set, it will match that instead. If a user is not logged in, it will retrieve the default text instead.
Selecting Achievements
Left-click an achievement definition to select it. The Selected Definition Info section will display more information about that achievement, as shown below:
Player Achievement Data
After a user has logged in, the buttons Unlock and Update buttons at the top of the window will be activated.
The functions they provide are as follows:
Button Name |
Description |
---|---|
Unlock |
Unlocks the selected achievement by setting its progress to 1.0. |
Update |
Requests the retrieval of player achievement data, providing the most recent information on the player's current progress and status. |
Notifications
When achievements are unlocked a notification will appear in the top right corner, for example:
Stats
Stats can be created on the Developer Portal and associated with achievements, enabling them to automatically update achievement progress. To ingest a stat, set the name of the stat and the amount you want to ingest that stat by, then click the Ingest Stat button, as shown below:
After ingesting a stat, you will need to click on the Update button to query stats for the current player. You will then see the Progress change for achievements associated with that stat.
Console Commands
In addition to the common console commands, this sample supports the following additional console commands, which you can enter in-game:
Console Command |
Usage |
Description |
---|---|---|
GETDEFS |
|
Makes a request to retrieve the achievement definitions for this application. If the user is logged in, the localized text will match their specified locale or locale override. |
GETPLAYER |
|
Makes a request to retrieve the current user's achievement data. |
UNLOCK |
|
Unlocks an achievement with the name supplied in place of |
INGEST |
|
Ingests a stat with the name supplied in |
QUERYSTATS |
|
Query stats for the current player. |