Enable player interaction with UGC
注釈:本資料はAI技術を用いて翻訳されています。
概要
AccelByte Gaming Services(AGS)はユーザー生成コンテンツ(UGC)に対応しています。UGCは、プレイヤーが作成した新鮮で多様なコンテンツでゲームを充実させる強力な方法です。UGCは、シンプルな装飾アイテムから複雑なレベルやシナリオまで多岐にわたります。UGCはゲーム開発者にとって有益であるだけでなく、プレイヤーの体験とエンゲージメントを高めることもできます。
UGCを魅力的にする重要な要素の一つは、その社会的側面です。プレイヤーは、いいね、ダウンロード、フォローなど、さまざまな方法でUGCを通じて互いに交流できます。これらの交流は、プレイヤー間のコミュニティ意識、評価、フィードバックを育み、より多くのUGCを作成・共有する意欲を高めます。
目標
このセクションでは、以下のようなゲーム内UGCへのプレイヤーの交流を可能にする機能のいくつかを説明します。
- コンテンツにいいねする
- コンテンツにいいねしたユーザーの一覧を表示する
- コンテンツにダウンロード数を追加する
- コンテンツをダウンロードしたユーザーの一覧を表示する
- UGCクリエイターをフォローする
- UGCクリエイターの統計情報を取得する
- フォローしているクリエイターのUGCの一覧を表示する
- フォロワーの一覧を表示する
- フォローしているクリエイターの一覧を表示する
前提条件
以下へのアクセスが必要です。
- AGS Admin Portal
- AccelByte Unreal SDKまたはUnity SDK
- 詳細についてはAccelByte UGC APIドキュメントを参照してください。
いいね
コンテンツにいいねする
これは、プレイヤーがUGCへの評価を表現するためのシンプルかつ効果的な方法です。コンテンツにいいねすることで、プレイヤーはクリエイターへの支持や感謝を示すことができ、また他のプレイヤーが人気の高いUGCや高品質なUGCを見つける手助けにもなります。コンテンツにいいねすることは、ゲームのUGCブラウザやマーケットプレイスでのコンテンツの可視性やランキングを高めることにもつながります。
コンテンツにいいねするには、この関数を使用します。
- Unreal Engine
- Unity
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FString ContentId = "YourUGCContentId";
bool bLikeStatus = true; // True = like and False = Dislike
ApiClient->UGC.UpdateV2LikeStatusToContent(ContentId, bLikeStatus, THandler<FAccelByteModelsUGCUpdateLikeStatusToContentResponse>::CreateLambda([](const FAccelByteModelsUGCUpdateLikeStatusToContentResponse& Result)
{
// Do something if UpdateV2LikeStatusToContent is successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if UpdateV2LikeStatusToContent has an error
}));
string contentId = "YourUGCContentId";
bool likeStatus = true; // True = like and False = Dislike
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.UpdateLikeStatusToContentV2(contentId, likeStatus, result =>
{
if (result.IsError)
{
// Do something if UpdateLikeStatusToContentV2 has an error
Debug.Log($"Error UpdateLikeStatusToContentV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if UpdateLikeStatusToContentV2 is successful
});
コンテンツにいいねしたユーザーの一覧を表示する
この機能は、プレイヤーが自分と興味や好みが共通する他のプレイヤーを見つけ、その相手との社会的なつながりを持つ手助けとなります。また、他のプレイヤーがいいねした新しいUGCを見つける手助けにもなります。コンテンツにいいねしたユーザーの一覧を表示することは、多くの人に評価されていることを示すため、そのUGCの可視性や人気を高めることにもつながります。
コンテンツにいいねしたユーザーの一覧を表示するには、この関数を使用します。
- Unreal Engine
- Unity
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FString ContentId = "YourUGCContentId";
ApiClient->UGC.GetV2ListContentLiker(ContentId,
THandler<FAccelByteModelsUGCGetPaginatedContentLikerResponse>::CreateLambda([](const FAccelByteModelsUGCGetPaginatedContentLikerResponse& Result)
{
// Do something if GetV2ListContentLiker is successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetV2ListContentLiker has an error
}));
string contentId = "YourUGCContentId";
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.GetListContentLikerV2(contentId, result =>
{
if (result.IsError)
{
// Do something if GetListContentLikerV2 has an error
Debug.Log($"Error GetListContentLikerV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetListContentLikerV2 is successful
});
ダウンロード
コンテンツにダウンロード数を追加する
この機能は、あるUGCが他のプレイヤーによって何回ダウンロードされたかを表示します。ダウンロード数は、コンテンツの人気や品質を測る指標となるだけでなく、クリエイターへのフィードバックとしても役立ちます。また、多くのプレイヤーが気に入っていることが分かることで、他のプレイヤーがより多くのUGCをダウンロードして試してみる動機にもなります。
コンテンツにダウンロード数を追加するには、この関数を使用します。
- Unreal Engine
- Unity
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FString ContentId = "YourUGCContentId";
ApiClient->UGC.AddV2DownloadContentCount(ContentId,
THandler<FAccelByteModelsUGCAddDownloadContentCountResponse>::CreateLambda([](const FAccelByteModelsUGCAddDownloadContentCountResponse& Result)
{
// Do something if AddV2DownloadContentCount is successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if AddV2DownloadContentCount has an error
}));
string contentId = "YourUGCContentId";
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.AddDownloadContentCountV2(contentId, result =>
{
if (result.IsError)
{
// Do something if AddDownloadContentCountV2 has an error
Debug.Log($"Error AddDownloadContentCountV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if AddDownloadContentCountV2 is successful
});
コンテンツをダウンロードしたユーザーの一覧を表示する
この機能により、クリエイターはゲーム内で自分のコンテンツを誰がダウンロードしたかを確認できます。クリエイターはこの情報を利用して、自分のオーディエンスやリーチを把握し、ファンや潜在的なコラボレーターとつながることができます。
コンテンツをダウンロードしたユーザーの一覧を表示するには、この関数を使用します。
- Unreal Engine
- Unity
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FString ContentId = "YourUGCContentId";
ApiClient->UGC.GetV2ListContentDownloader(ContentId,
THandler<FAccelByteModelsUGCGetPaginatedContentDownloaderResponse>::CreateLambda([](const FAccelByteModelsUGCGetPaginatedContentDownloaderResponse& Result)
{
// Do something if GetV2ListContentDownloader is successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetV2ListContentDownloader has an error
}));
string contentId = "YourUGCContentId";
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.GetListContentDownloaderV2(contentId, result =>
{
if (result.IsError)
{
// Do something if GetListContentDownloaderV2 has an error
Debug.Log($"Error GetListContentDownloaderV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetListContentDownloaderV2 is successful
});
フォロー
UGCクリエイターをフォローする
この機能により、プレイヤーはゲーム内でお気に入りのUGCクリエイターをフォローできます。クリエイターをフォローすることで、プレイヤーは最新の作品について常に把握でき、過去の作品にもアクセスできます。クリエイターをフォローすることは、その技術やスタイルへの敬意や称賛を示すことにもなり、忠誠心やつながりの意識を育みます。
UGCクリエイターをフォローするには、この関数を使用します。
- Unreal Engine
- Unity
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FString UserId = "UserId";
bool bFollowStatus = true;
ApiClient->UGC.UpdateFollowStatusToUser(UserId, bFollowStatus,
THandler<FAccelByteModelsUGCUpdateFollowStatusToUserResponse>::CreateLambda([](const FAccelByteModelsUGCUpdateFollowStatusToUserResponse& Result)
{
// Do something if UpdateFollowStatusToUser is successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if UpdateFollowStatusToUser has an error
}));
bool followStatus = true;
string userId = "UserIdToFollow";
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.UpdateFollowStatus(followStatus, userId, result =>
{
if (result.IsError)
{
// Do something if UpdateFollowStatus has an error
Debug.Log($"Error UpdateFollowStatus, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if UpdateFollowStatus is successful
});
UGCクリエイターの統計情報を取得する
この機能により、プレイヤーはゲーム内のUGCクリエイターに関するさまざまな統計情報(フォロワー数、フォロー数、いいねされたコンテンツの総数など)を確認できます。これらの統計情報は、ゲームのUGCコミュニティにおけるクリエイターの人気、影響力、評判、さらには個人的な好みや興味についての洞察を提供します。UGCクリエイターの統計情報を取得することは、プレイヤーが異なるクリエイターを比較検討し、新たにフォローやコラボレーションをしたいクリエイターを見つける手助けにもなります。
UGCクリエイターの統計情報を取得するには、この関数を使用します。
- Unreal Engine
- Unity
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FString UserId = "UserId";
ApiClient->UGC.GetCreator(UserId,
THandler<FAccelByteModelsUGCGetListFollowersResponse>::CreateLambda([](const FAccelByteModelsUGCGetListFollowersResponse& Result)
{
// Do something if GetCreator is successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetCreator has an error
}));
string userId = "UserId";
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.GetCreatorStats(userId, result =>
{
if (result.IsError)
{
// Do something if GetCreatorStats has an error
Debug.Log($"Error GetCreatorStats, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetCreatorStats is successful
});
フォローしているクリエイターのUGCの一覧を表示する
この機能により、プレイヤーはゲーム内でフォローしているクリエイターのUGCを閲覧し、プレイできます。プレイヤーは自分の好みや興味に合った新しく関連性の高いコンテンツを簡単に見つけることができ、新しいジャンルやチャレンジを発見できます。フォローしているクリエイターのUGCの一覧を表示することは、プレイヤーがゲーム体験を多様化・拡大し、優れたクリエイターから学ぶ手助けにもなります。
フォローしているクリエイターのUGCの一覧を表示するには、この関数を使用します。
- Unreal Engine
- Unity
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
ApiClient->UGC.GetFollowedContent(
THandler<FAccelByteModelsUGCContentPageResponse>::CreateLambda([](const FAccelByteModelsUGCContentPageResponse& Result)
{
// Do something if GetFollowedContent is successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetFollowedContent has an error
}));
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.GetContentFollowed(result =>
{
if (result.IsError)
{
// Do something if GetContentFollowed has an error
Debug.Log($"Error GetContentFollowed, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetContentFollowed is successful
});
フォロワーの一覧を表示する
この機能により、クリエイターはゲーム内で誰が自分をフォローしているかを確認できます。クリエイターはこの情報を利用して、ファンに感謝や評価を伝え、メッセージやコメントを通じて交流できます。クリエイターのフォロワーの一覧を表示することは、自分の作品を紹介することでファンベースを構築・拡大し、新たなフォロワーを引き込む手助けにもなります。
フォロワーの一覧を表示するには、この関数を使用します。
- Unreal Engine
- Unity
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FString UserId = "UserId";
ApiClient->UGC.GetListFollowers(UserId,
THandler<FAccelByteModelsUGCGetListFollowersPagingResponse>::CreateLambda([](const FAccelByteModelsUGCGetListFollowersPagingResponse& Result)
{
// Do something if GetListFollowers is successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetListFollowers has an error
}));
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.GetListFollowers(result =>
{
if (result.IsError)
{
// Do something if GetListFollowers has an error
Debug.Log($"Error GetListFollowers, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetListFollowers is successful
});
フォローしているクリエイターの一覧を表示する
この機能は、プレイヤーがお気に入りのクリエイターを把握し、その作品に簡単にアクセスする手助けとなります。コンテンツクリエイターにとっては、この情報を利用して仲間や尊敬するクリエイターの動向を追い、その手法やアイデアから学ぶことができます。
フォローしているクリエイターの一覧を表示するには、この関数を使用します。
- Unreal Engine
- Unity
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
ApiClient->UGC.GetFollowedUsers(THandler<FAccelByteModelsUGCFollowedUsersResponse>::CreateLambda([](const FAccelByteModelsUGCFollowedUsersResponse& Result)
{
// Do something if GetFollowedUsers is successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetFollowedUsers has an error
}));
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.GetFollowedCreators(result =>
{
if (result.IsError)
{
// Do something if GetFollowedCreators has an error
Debug.Log($"Error GetFollowedCreators, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if GetFollowedCreators is successful
});