UGC へのプレイヤーインタラクションを有効にする
Overview
AccelByte Gaming Services (AGS) allows for user-generated content (UGC). UGC is a powerful way to enrich your game with fresh and diverse content created by your players. UGC can range from simple cosmetic items to complex levels and scenarios. UGC is not only beneficial for the game developers, it can also enhance the player experience and engagement.
One of the key factors that makes UGC engaging is the social aspect of it. Players can interact with each other through UGC in various ways, such as liking, downloading, and following. These interactions can foster a sense of community, recognition, and feedback among the players, and motivate them to create and share more UGC.
Goals
The goals of this section are to explain some of the features that enable player interaction with in-game UGC, such as:
- Like content
- List content likers
- Add download count to content
- List content downloaders
- Follow UGC creator
- Get UGC creator stats
- List UGC from followed creators
- List follower
- List followed Creator
Prerequisites
You will need access to:
- The AGS Admin Portal.
- The AccelByte Unreal or Unity SDK.
- The AccelByte UGC API documentation for further reference.
Likes
Like content
This is a simple but effective way to let players express their appreciation for a piece of UGC. By liking content, players can show their support and gratitude to the creator, as well as help other players discover popular and high-quality UGC. Liking content can also increase the visibility and ranking of the content in the game's UGC browser or marketplace.
You can use this function to like content:
- Unreal Engine
- Unity
FApiClientPtr ApiClient = FMultiRegistry::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 has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if UpdateV2LikeStatusToContent has an error
UE_LOG(LogTemp, Log, TEXT("Error UpdateV2LikeStatusToContent, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
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 has been successful
});
List content likers
This feature can help players find other players who share their interests and preferences, and potentially form social connections with them. It can also help players discover new UGC that is liked by other players. Listing content likers can also increase the visibility and popularity of a piece of UGC, as it shows how many people have enjoyed it.
You can use this function to list content likers:
- Unreal Engine
- Unity
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString ContentId = "YourUGCContentId";
ApiClient->UGC.GetV2ListContentLiker(ContentId,
THandler<FAccelByteModelsUGCGetPaginatedContentLikerResponse>::CreateLambda([](const FAccelByteModelsUGCGetPaginatedContentLikerResponse& Result)
{
// Do something if GetV2ListContentLiker has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetV2ListContentLiker has an error
UE_LOG(LogTemp, Log, TEXT("Error GetV2ListContentLiker, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
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 has been successful
});
Downloads
Add download count to content
This feature shows how many times a piece of UGC has been downloaded by other players. Download counts can serve as a measure of popularity and quality of content, as well as feedback for the creator. Download counts can also encourage players to download and try more UGC, especially if they see that many players have enjoyed it.
You can use this function to add a download count to content:
- Unreal Engine
- Unity
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString ContentId = "YourUGCContentId";
ApiClient->UGC.AddV2DownloadContentCount(ContentId,
THandler<FAccelByteModelsUGCAddDownloadContentCountResponse>::CreateLambda([](const FAccelByteModelsUGCAddDownloadContentCountResponse& Result)
{
// Do something if AddV2DownloadContentCount has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if AddV2DownloadContentCount has an error
UE_LOG(LogTemp, Log, TEXT("Error AddV2DownloadContentCount, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
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 has been successful
});
List content downloaders
This feature allows creators to see who has downloaded their content in the game. Creators can use this information to gauge their audience and reach, as well as to connect with their fans and potential collaborators.
You can use this function to list content downloaders:
- Unreal Engine
- Unity
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString ContentId = "YourUGCContentId";
ApiClient->UGC.GetV2ListContentDownloader(ContentId,
THandler<FAccelByteModelsUGCGetPaginatedContentDownloaderResponse>::CreateLambda([](const FAccelByteModelsUGCGetPaginatedContentDownloaderResponse& Result)
{
// Do something if GetV2ListContentDownloader has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetV2ListContentDownloader has an error
UE_LOG(LogTemp, Log, TEXT("Error GetV2ListContentDownloader, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
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 has been successful
});
Follows
Follow UGC creators
This feature allows players to follow their favorite UGC creators in the game. By following a creator, players can stay updated on their latest creations and access their previous work. Following a creator can also show respect and admiration for their skills and style and foster a sense of loyalty and connection.
You can use this function to follow a UGC creator:
- Unreal Engine
- Unity
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "UserId";
bool bFollowStatus = true;
ApiClient->UGC.UpdateFollowStatusToUser(UserId, bFollowStatus,
THandler<FAccelByteModelsUGCUpdateFollowStatusToUserResponse>::CreateLambda([](const FAccelByteModelsUGCUpdateFollowStatusToUserResponse& Result)
{
// Do something if UpdateFollowStatusToUser has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if UpdateFollowStatusToUser has an error
UE_LOG(LogTemp, Log, TEXT("Error UpdateFollowStatusToUser, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
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 has been successful
});
Get UGC creator stats
This feature allows players to view various statistics about a UGC creator in the game such as follow count, following count, total liked content, etc. These statistics can provide insight into the creator's popularity, influence, and reputation in the game's UGC community, as well as their personal preferences and interests. Getting UGC creator stat can also help players compare and contrast different creators and find new ones to follow or collaborate with.
You can use this function to get UGC creator stats:
- Unreal Engine
- Unity
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "UserId";
ApiClient->UGC.GetCreator(UserId,
THandler<FAccelByteModelsUGCGetListFollowersResponse>::CreateLambda([](const FAccelByteModelsUGCGetListFollowersResponse& Result)
{
// Do something if GetCreator has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetCreator has an error
UE_LOG(LogTemp, Log, TEXT("Error GetCreator, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
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 has been successful
});
List UGC from followed creators
This feature allows players to browse and play the UGC from the creators they follow in the game. Players can easily find new and relevant content that matches their taste and preferences and discover new genres and challenges. Listing UGC from followed creators can also help players diversify and expand their gaming experience and learn from the best.
You can use this function to list UGC from followed creators:
- Unreal Engine
- Unity
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
ApiClient->UGC.GetFollowedContent(
THandler<FAccelByteModelsUGCContentPageResponse>::CreateLambda([](const FAccelByteModelsUGCContentPageResponse& Result)
{
// Do something if GetFollowedContent has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetFollowedContent has an error
UE_LOG(LogTemp, Log, TEXT("Error GetFollowedContent, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
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 has been successful
});
List followers
This feature allows creators to see who is following them in the game. Creators can use this information to appreciate and acknowledge their fans and interact with them through messages or comments. Listing followers from a creator can also help creators build and grow their fan base and attract new followers by showcasing their work.
You can use this function to list follower:
- Unreal Engine
- Unity
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
FString UserId = "UserId";
ApiClient->UGC.GetListFollowers(UserId,
THandler<FAccelByteModelsUGCGetListFollowersPagingResponse>::CreateLambda([](const FAccelByteModelsUGCGetListFollowersPagingResponse& Result)
{
// Do something if GetListFollowers has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetListFollowers has an error
UE_LOG(LogTemp, Log, TEXT("Error GetListFollowers, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
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 has been successful
});
List followed creators
This feature can help players keep track of their favorite creators and easily access their content. For the content creators, creators can use this information to keep up with their peers and idols and learn from their techniques and ideas.
You can use this function to list followed creators:
- Unreal Engine
- Unity
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
ApiClient->UGC.GetFollowedUsers(THandler<FAccelByteModelsUGCFollowedUsersResponse>::CreateLambda([](const FAccelByteModelsUGCFollowedUsersResponse& Result)
{
// Do something if GetFollowedUsers has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetFollowedUsers has an error
UE_LOG(LogTemp, Log, TEXT("Error GetFollowedUsers, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
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 has been successful
});