Skip to main content

Enable player interaction with UGC

Last updated on September 19, 2023

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 liked content
  • List content liker (V2)
  • Add download count to content
  • List content downloader (V2)
  • Follow UGC creator
  • Get UGC creator stat
  • List UGC from followed creator
  • List follower
  • List following

Prerequisites

You will need access to:

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.

If you're using Version 1, you can use this function to like content:

FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();

FString ContentId = "YourUGCContentId";
bool bLikeStatus = true; // True = like and False = Dislike

ApiClient->UGC.UpdateLikeStatusToContent(ContentId, bLikeStatus, THandler<FAccelByteModelsUGCUpdateLikeStatusToContentResponse>::CreateLambda([](const FAccelByteModelsUGCUpdateLikeStatusToContentResponse& Result)
{
// Do something if UpdateLikeStatusToContent has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if UpdateLikeStatusToContent has an error
UE_LOG(LogTemp, Log, TEXT("Error SearchV2ContentsSpecificToChannel, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

If you're using Version 2, you can use this function to like content:

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);
}));

List liked content

This feature allows players to access and manage the content they have liked in the game. Players can easily revisit their favorite UGC, play it again, or share it with others. Listing liked content can also help players keep track of their preferences and interests, and inspire them to create their own UGC based on what they like.

If you're using Version 1, you can use this function to list liked content:

FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();

TArray<FString> Tags = { "UGC Tag1", "UGC Tag2" };
FString Name = "UGC Integration UE4";
FString Type = "UGC Type";
FString SubType = "UGC SubType";
bool bIsOfficial = true;

ApiClient->UGC.GetLikedContent(Tags, Name, Type, SubType, bIsOfficial,
THandler<FAccelByteModelsUGCContentPageResponse>::CreateLambda([](const FAccelByteModelsUGCContentPageResponse& Result)
{
// Do something if GetLikedContent has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetLikedContent has an error
UE_LOG(LogTemp, Log, TEXT("Error GetLikedContent, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

If you're using Version 2, you can use this function to list liked content:

FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();

ApiClient->UGC.GetV2LikedContent(
THandler<FAccelByteModelsUGCContentPageResponseV2>::CreateLambda([](const FAccelByteModelsUGCContentPageResponseV2& Result)
{
// Do something if GetV2LikedContent has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetV2LikedContent has an error
UE_LOG(LogTemp, Log, TEXT("Error GetV2LikedContent, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

List content likers (V2)

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:

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);
}));

Downloads

Add download count to content (V2)

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:

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);
}));

List content downloaders (V2)

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:

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);
}));

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:

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);
}));

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:

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);
}));

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:

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);
}));

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:

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);
}));

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:

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);
}));