The Achievements Sample demonstrates the operations related to Epic Online Services achievements in the EOS SDK, including:
- Querying Epic Online Services achievement definitions
- Querying player Epic Online Services achievements progress
- Ingesting stats to update the progress of Epic Online Services achievements
- Manually unlocking Epic Online Services achievements
The sample demonstrates these features by providing a user interface that can control these operations and display data directly to the user.
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.
Epic Online Services achievement definitions
When the sample starts, it will retrieve the Epic Online Services 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 Epic Online Services 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 Epic Online Services achievements
Left-click an Epic Online Services achievement definition to select it. The Selected Definition Info section will display more information about that Epic Online Services 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:
|Unlock||Unlocks the selected Epic Online Services 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.|
When Epic Online Services achievements are unlocked a notification will appear in the top right corner, for example:
Stats can be created on the Developer Portal and associated with Epic Online Services achievements, enabling them to automatically update Epic Online Services 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 Epic Online Services achievements associated with that stat.
In addition to the common console commands, this sample supports the following additional console commands, which you can enter in-game:
|GETDEFS||Makes a request to retrieve the Epic Online Services 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 Epic Online Services achievement data.|
|UNLOCK||Unlocks an Epic Online Services achievement with the name supplied in place of |
|INGEST||Ingests a stat with the name supplied in |
|QUERYSTATS||Query stats for the current player.|