Skip to main content

Unreal Engine Module - Store game settings in the cloud - Play test

Last updated on January 13, 2024

Test Load and Save Game Options to Cloud Save

  1. Compile the project and open it in the Unreal Editor. Then, play the game by following the scenario below.

    Play test preview

  2. In the Output Log, you should be able to see the following logs.

    • 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. You can also check the Player Record on Admin Portal. But, you need to know the Player ID (also called User ID) first. When you play the game and logged in, you should be able to get the Player ID by searching the following log.

    LogAccelByteOSS: Verbose: >>> GetUserAccount (DefaultInstance) was called. Args: UserId: {"id":"<You should see your Player Id here>","platformType":"","platformId":""}
  4. Now, open your Admin Portal. From the dashboard, go to Game Management > Cloud Save > Player Records. Click the box on the left of the search box and click by User ID from the dropdown. Paste the Player ID in the search box and then press enter. Then, you will find the game options record successfully saved in the Cloud Save. You can press the View button to view the details.

    Player&#39;s record list

  5. After that, you should see the Player Record details like the following.

    Player&#39;s record detail

Test Delete Game Options from Cloud Save

In the previous sections, you connected the Options menu widget to set and get the game options. But, as you may notice, the Options menu widget doesn't have a button or other user interface to delete the record since it is not necessary by the Byte Wars game design. Therefore, in this section, we will guide you on how to delete Player Record just for testing.

  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 below 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. Alternatively, as the game admin, you can delete the Player Record via Admin Portal. From the Admin Portal dashboard, go to Game Management > Cloud Save > Player Records. Click the box on the left of the search box and click by User ID from the dropdown. Paste the Player ID in the search box and then press enter. Then, you will find all the Player Record of that Player. Next, press the Delete button on the record you would like to remove to delete the record.

    Delete player&#39;s record

  3. Next, you simply need to confirm the deletion. Once you hit the Delete button, the record for that particular player will be deleted.