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

プレイテスト - クラウドセーブ - (Unreal Engine モジュール)

Last updated on June 12, 2024

Test cloud saving game options

  1. Compile the project and open it in the Unreal Editor. Play the game by following the scenario presented in the image below.

    Play test preview Unreal Byte Wars cloud save

  2. In the Output Log, you will see following logs if successful:

    • Log when loading game options from Cloud Save:

      LogCloudSaveEssentials: Success to get player record.
    • Log when saving game options to Cloud Save:

      LogCloudSaveEssentials: Success to set player record.
  3. Get the Player ID (AKA User ID) by playing the game and logging in. The ID will be in the following log:

    LogAccelByteOSS: Verbose: >>> GetUserAccount (DefaultInstance) was called. Args: UserId: {"id":"<You should see your Player Id here>","platformType":"","platformId":""}
  4. To confirm the cloud save was successful, log in to the AccelByte Gaming Services (AGS) Admin Portal and go to your game namespace dashboard. Go to Progression & Inventory > Cloud Save > Player Records. Click on the dropdown next to the search box and select by User ID. Paste the Player ID/User ID from the log in the previous step into the search box and then press Enter. Then, you can press the View button to view the record details.

Test deleting cloud game options

While the Byte Wars options menu doesn't have a button for deleting, for testing purposes, this section will walk you through deleting game options with code and in the AGS Admin Portal.

  1. You can call the DeletePlayerRecord() function that you have made in the CloudSaveSubsystem_Starter subsystem. You simply need to pass the record key to delete and a callback function to listen when the record is successfully deleted. Take a look at the example code below. The code will let the player delete the game options Player Record. Keep in mind that to delete a Player Record, the player needs to log in to the game first.

    // Include the header file.
    #include "TutorialModules/Storage/CloudSaveEssentials/CloudSaveSubsystem_Starter.h"

    ...

    // Get the CloudSaveSubsystem_Starter subsystem.
    UCloudSaveSubsystem_Starter* CloudSaveSubsystem_Starter = GameInstance->GetSubsystem<UCloudSaveSubsystem_Starter>();
    ensure(CloudSaveSubsystem_Starter);

    // Send the Player Record deletion request.
    const APlayerController* PC = /* Set Player Controller here */;
    const FString RecordKeyToDelete = FString::Printf(TEXT("%s-%s"), *GAME_OPTIONS_KEY, *SOUND_OPTIONS_KEY);
    CloudSaveSubsystem_Starter->DeletePlayerRecord(PC, RecordKeyToDelete, FOnDeleteCloudSaveRecordComplete::CreateWeakLambda(this, [](bool bWasSuccessful)
    {
    UE_LOG(LogTemp, Warning, TEXT("Is Player Record Deleted: %s"), bWasSuccessful ? TEXT("True") : TEXT("False"));
    }));
  2. As the game admin, you can delete the Player Record via AGS Admin Portal. Log in to the AGS Admin Portal and go to your game namespace dashboard. Go to Progression & Inventory > Cloud Save > Player Records. Click the dropdown next to the search box and select by User ID. Paste the Player ID/User ID you acquired from the previous section in the search box and press Enter. Then, you can press the View button to view the record details.

  3. On the record details menu, locate the record you want to delete and click the Delete button to delete it.