メインコンテンツまでスキップ

Tag goals for organization

Last updated on September 17, 2024

Overview

AccelByte Gaming Services (AGS) Challenge allows you to add tags to the goals of the challenges you create so players can group and filter them. This article provides information on how to use goal tagging, grouping, and filtering using AGS Challenge with the AGS Game SDK.

This article will use the example of implementing an all-time fixed challenge with 20 goals for the player to complete. Goals will be grouped based on the category so that players can easily find the relevant information about the goals.

Example of goals grouping UI implementation

Prerequisites

  • The AGS Game SDK installed and configured into your Unreal or Unity project.
  • Challenges integrated into your project with AGS Challenge.

Add tags to a goal

You can use tags in the goals configurations in the AGS Admin Portal to group your goals by following the steps below:

  1. In the AGS Admin Portal under your game namespace, go to Engagement > Challenge > Configuration.
  2. Find your desired challenge you'd like to organize the goals for (or create a new one) and click its name to enter its configuration settings.
  3. Click on the Goals and Rewards tab.
  4. Edit your desired goal by clicking its name, or create a new one, and enter the name of a tag in the Tags field as desired.
  5. Press Enter on your keyboard for each tag you want to add.

Group or filter goals by tags in the game client

To retrieve a list of all goals for the a challenge with the tags you set, you can use the following code:

const FString& ChallengeCode = TEXT("specific-challenge-code");
const TArray<FString> Tags = { "Hard", "Medium" };
AccelByte::FMultiRegistry::GetApiClient()->Challenge.GetScheduledChallengeGoals(
ChallengeCode, THandler<FAccelByteModelsGetScheduledChallengeGoalsResponse>::CreateLambda([]
(const FAccelByteModelsGetScheduledChallengeGoalsResponse& Response)
{
for (auto ChallengeGoalData : Response.Data)
{
FString TagList{};
for (auto Tag : ChallengeGoalData.Tags)
{
if (!TagList.IsEmpty()) TagList.Append(TEXT(":"));
TagList.Append(Tag);
}

UE_LOG(LogTemp, Warning, TEXT("Goal Name: %s Description: %s IsActive: %hhd Tags: %s"),
*ChallengeGoalData.Name, *ChallengeGoalData.Description, ChallengeGoalData.IsActive, *TagList)
}
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogTemp, Warning, TEXT("[%d]: %s"),
ErrorCode, *ErrorMessage);
}), Tags);