Download

Loading saves from 4.5 in 4.8

So we have recently decided to upgrade the current release of the game to the 4.8 Engine version from 4.5 and found that when we try to load our previous saves from 4.5 it crashes. There is a comment in the LoadGameFromSlot(…) function which mentions that there may be crashes;
“if you get a crash loading a pre-4.8 version of your savegame file and
you don’t want to delete it, try uncommenting these lines and changing them to use the version
information from your previous build. Then load and resave your savegame file.”

We have changed the memory reader information to the version we were using by changing the variables to:

MemoryReader.SetUE4Ver(451); // @see GPackageFileUE4Version
const FString brachName = “++depot+UE4-Releases+4.5”
MemoryReader.SetEngineVer(FEngineVersion(4, 5, 1, 0, brachName); // @see GEngineVersion

but this doesn’t seem to help. After looking further into the code, it seems that because whenever the serialization code tries to load a custom struct from my save, the position it was looking at in the memory archive bytes was off by what seems like 16.

Am I missing something with setting the UE4/EngineVer incorrectly that means that it doesn’t serialize my save correctly?

So after quite a bit of looking around I found that VER_UE4_STRUCT_GUID_IN_PROPERTY_TAG is set to 441, and there is a check when serializing that uses the version and this define:

if (InAr.UE4Ver() < VER_UE4_STRUCT_GUID_IN_PROPERTY_TAG)

so, instead of using 4.5 we had to go to a version number before 441 to get this to work:

MemoryReader.SetUE4Ver(440);
const FString brachName = “++depot+UE4-Releases+4.4”
MemoryReader.SetEngineVer(FEngineVersion(4, 4, 0, 0, brachName);