Epic Online Services achievements sample

Reference page for the Epic Online Services achievements Sample

3 mins to read
Achievements Sample Main

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.

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.

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:

Epic Online Services achievement Definitions

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:

Definition Info

Player Achievement Data

After a user has logged in, the buttons Unlock and Update buttons at the top of the window will be activated.

Player Achievement Data

The functions they provide are as follows:

Button NameDescription
UnlockUnlocks the selected Epic Online Services achievement by setting its progress to 1.0.
UpdateRequests the retrieval of player achievement data, providing the most recent information on the player's current progress and status.

Notifications

When Epic Online Services achievements are unlocked a notification will appear in the top right corner, for example:

Achievement Notifications

Stats

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:

Ingest Stats

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.

Console Commands

In addition to the common console commands, this sample supports the following additional console commands, which you can enter in-game:

Console CommandUsageDescription
GETDEFSGETDEFSMakes 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.
GETPLAYERGETPLAYERMakes a request to retrieve the current user's Epic Online Services achievement data.
UNLOCKUNLOCK <ACHIEVEMENT_NAME>Unlocks an Epic Online Services achievement with the name supplied in place of <ACHIEVEMENT_NAME>.
INGESTINGEST <STAT_NAME> <INGEST_AMOUNT>Ingests a stat with the name supplied in <STAT_NAME>, with an ingest value of <INGEST_AMOUNT>.
QUERYSTATSQUERYSTATSQuery stats for the current player.