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

ゲームクライアントでチャレンジを表示する

Last updated on February 4, 2026

注釈:本資料はAI技術を用いて翻訳されています。

概要

AccelByte Gaming Services (AGS) Challengeを使用すると、プレイヤーが取り組むアクティブなチャレンジと、それらのチャレンジを完了するための進捗状況を表示できます。この記事では、AGS Gaming SDKを使用してAGS Challengeと統合したチャレンジとその進捗状況、ゴール、報酬を表示する方法について説明します。

前提条件

  • AGS Game SDKがUnrealまたはUnityプロジェクトにインストールおよび設定されていること。
  • ゲーム用にIAMクライアントが設定されており、そのIAMクライアントのIDとシークレットへのアクセス権があること。
  • AGS Challengeを使用してプロジェクトにチャレンジが統合されていること。

ゲームクライアントでチャレンジを表示する

チャレンジ設定が完了したら、それらを取得してゲームクライアントに表示するか、そのコードにアクセスできます。

利用可能なすべてのチャレンジを取得して表示する

利用可能なすべてのチャレンジ設定を取得し、次のコードを使用してゲームクライアントに表示できます:

AccelByteOnlineSubsystemPtr->GetApiClient()->Challenge.GetChall6enges(THandler<FAccelByteModelsGetChallengesResponse>::CreateLambda([]
(const FAccelByteModelsGetChallengesResponse& Response)
{
for (auto ChallengeData : Response.Data)
{
UE_LOG(LogTemp, Warning, TEXT("Challenge Name: %s Status: %s"),
*ChallengeData.Name, *FAccelByteUtilities::GetUEnumValueAsString(ChallengeData.Status));
// more various things to do with the challenge data
}
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogTemp, Warning, TEXT("[%d]: %s"),
ErrorCode, *ErrorMessage);
}));

特定のチャレンジを取得して表示する

デイリーミッションUI実装の例

特定のチャレンジ設定を取得し、次のコードを使用してゲームクライアントに表示できます:

const FString& ChallengeCode = TEXT("specific-challenge-code");
AccelByteOnlineSubsystemPtr->GetApiClient()->Challenge.GetScheduledChallengeGoals(
ChallengeCode, THandler<FAccelByteModelsGetScheduledChallengeGoalsResponse>::CreateLambda([]
(const FAccelByteModelsGetScheduledChallengeGoalsResponse& Response)
{
for (auto ChallengeGoalData : Response.Data)
{
UE_LOG(LogTemp, Warning, TEXT("Goal Name: %s Description: %s IsActive: %hhd"),
*ChallengeGoalData.Name, *ChallengeGoalData.Description, ChallengeGoalData.IsActive)
}
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogTemp, Warning, TEXT("[%d]: %s"),
ErrorCode, *ErrorMessage);
}));

プレイヤーの進捗状況を表示する

チャレンジ進捗状況UI実装の例

プレイヤーのチャレンジ完了に向けた進捗状況を取得し、次のコードを使用してゲームクライアントに表示できます:

const FString& ChallengeCode = TEXT("specific-challenge-code");
const FString& GoalCode = TEXT("specific-goal-code");
AccelByteOnlineSubsystemPtr->GetApiClient()->Challenge.GetChallengeProgress(
ChallengeCode, GoalCode, THandler<FAccelByteModelsChallengeProgressResponse>::CreateLambda([]
(const FAccelByteModelsChallengeProgressResponse& Response)
{
for (auto ChallengeGoalProgressData : Response.Data)
{
UE_LOG(LogTemp, Warning, TEXT("Goal Code: %s Status: %s"),
*ChallengeGoalProgressData.GoalCode, *FAccelByteUtilities::GetUEnumValueAsString(ChallengeGoalProgressData.Status));
}
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogTemp, Warning, TEXT("[%d]: %s"),
ErrorCode, *ErrorMessage);
}));