Skip to main content

Group and filter achievements

Last updated on July 16, 2024

Overview

The AccelByte Gaming Services (AGS) Achievements services allows you to add tags to your achievement configurations. Tags will be used to group the achievements, and you can use that to filter the achievements you want to display within your game. By presenting the achievement in a structured and organized grouping, it can give your players the best experience, as they'll easily see the relevant information.

In this guide, you will learn how to utilize achievement tags for grouping and filtering.

Goals

  • Provide an understanding and overview about achievement configurations.
  • Explain how to utilize achievement using AccelByte SDK.

Prerequisites

  • Access to the AGS Admin Portal.
  • AccelByte Unreal, Unity or Extend SDK, including the permissions:
    • Client ID
    • Client Secret
  • Access to AccelByte Achievement API documentation.
  • Access to the AccelByte Statistics API to configure the required information (optional).

Group achievements by tags

You can utilize tags in achievement configurations to group your achievements. You can add tags in your achievement configurations by following the steps below:

  1. On the Admin Portal sidebar, go to Engagement > Achievements > Configuration.

    Achievements page

  2. On the Achievements page, click on the Add Achievement button.

  3. On the Add New Achievements form, fill in the required information such as Code, Name, Description, and Icons.

  4. For grouping, you can add the contextual information related to the achievement in the Tag field. These tags will be used to query your achievement configuration.

    Achievement tags

    info

    You can add up to five tags.

  5. Click Add. The new achievement is added to the achievements list.

Filter achievements by tags

To retrieve a list of all achievements in the related namespace with a specific tags that you already set, you can use the following function:

FString Language = FString("en");
EAccelByteAchievementListSortBy SortBy = EAccelByteAchievementListSortBy::LISTORDER;
int32 Offset = 0;
int32 Limit = 50;
FString TagQuery = TEXT("kill,totalwin")
bool bIsGlobal = false;

FRegistry::Achievement.QueryAchievements(Language, SortBy, THandler<FAccelByteModelsPaginatedPublicAchievement>::CreateLambda([](const FAccelByteModelsPaginatedPublicAchievement& Result)
{
// Do something if QueryAchievements is successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if QueryAchievements has an error
}), Offset, Limit, TagQuery, bIsGlobal);