首页 > 技术文章 > Sonys TRC save data plolicy

AnKen 2017-06-07 23:27 原文

帖子地址:https://forums.unrealengine.com/showthread.php?130820-Sonys-TRC-save-data-plolicy

we had several problems with the standard Ps4 save game implementation, so I wanted to tell you what changes we had to make to get through the submission.

In the first must fix bug reported from Sony was:
"Placeholder icon is used for save data icon."

To fix that I had to copy an image file named "save_data.png" (228x128/24) into the sce_sys folder.
In the "PS4SaveGameSystem.cpp" I had to change the line 611 from
FillOutSceSaveDataMount(SCE_SAVE_DATA_MOUNT_MODE_RDWR | SCE_SAVE_DATA_MOUNT_MODE_CREATE, &MountData);
to
FillOutSceSaveDataMount(SCE_SAVE_DATA_MOUNT_MODE_RDWR | SCE_SAVE_DATA_MOUNT_MODE_CREATE | SCE_SAVE_DATA_MOUNT_MODE_COPY_ICON, &MountData);

And line 652 from
MountData.mountMode = SCE_SAVE_DATA_MOUNT_MODE_RDWR | SCE_SAVE_DATA_MOUNT_MODE_CREATE;
to
MountData.mountMode = SCE_SAVE_DATA_MOUNT_MODE_RDWR | SCE_SAVE_DATA_MOUNT_MODE_CREATE | SCE_SAVE_DATA_MOUNT_MODE_COPY_ICON;

The other must fix sony complained about is:
"The application deletes save data without informing the user a deletion will occur.

PREREQUISITE
No save data present for the application.

STEPS TO REPRODUCE
1. Let your app create a save game
2. Set 'Fake Save Data Broken Status' – ‘On’ for all save files.
3. Set 'Fake Free Space(FS)' – ‘On’.
4. Let your app load save data
5. Select OK to the ‘not enough free space’ message.
6. Select OK to the second ‘not enough free space’ message.
7. Select OK to the ‘Corrupted Data’ message.
8. Press the PS button and access save data from the system settings.

BUG DESCRIPTION
Observe that the application deletes the users save data without informing the user deletion will occur."

To fix that one I used DisplayDeleteConfirm() in "PS4SaveGameSystem.cpp" line 648 instead of DeleteSavedGame().

The whole process was made with engine version 4.12.5. but I compared my file to the one of the 4.14 source and there were no changes. So it’s still up to date I guess.
I hope that helps.

 

 

To set the save title and details, there's a game delegate which you can assign a function in your code to return that information:

static void ExtendedSaveGameInfoDelegate(const TCHAR* SaveName, const EGameDelegates_SaveGame Key, FString& Value)
{
	static const int32 MAX_SAVEGAME_SIZE = 100 * 1024;
	switch (Key)
	{
	case EGameDelegates_SaveGame::MaxSize:
		Value = FString::Printf(TEXT("%i"), MAX_SAVEGAME_SIZE);
		break;
	case EGameDelegates_SaveGame::Title:
		Value = TEXT("ShooterGame");
		break;
	case EGameDelegates_SaveGame::SubTitle:
		Value = TEXT("The Shootening");
		break;
	case EGameDelegates_SaveGame::Detail:
		Value = TEXT("ShooterGame User Settings");
		break;
	default:
		break;
	}
}

class FMyGameModule : public FDefaultGameModuleImpl
{
	virtual void StartupModule() override
	{
		FGameDelegates::Get().GetExtendedSaveGameInfoDelegate() = FExtendedSaveGameInfoDelegate::CreateStatic(ExtendedSaveGameInfoDelegate);
	}

	virtual void ShutdownModule() override
	{
		
	}
};

  

推荐阅读