Some context about what I’m trying to do first: I am trying to do the migration of the whole game state (game instance, player, worlds, etc.) from one running game process to another. These game processes will be running in different virtual machines.
The first thing I am trying to do is to serialize the UGameInstance object that is created and called in GameEngine.cpp. I have been trying many methods, but all of them had some sort of error or problem with it.
So far, I have tried this:
- https://wiki.unrealengine.com/Save_System,Read%26_Write_Any_Data_to_Compressed_Binary_Files
This one Crashes when serializing using “<<”. The callstack brings me this inside MemoryArchive.h
virtual FArchive& operator<<( class UObject*& Res ) override
{
// Not supported through this archive
check(0);
return *this;
}
Does this mean that it’s impossible to serialize a UGameInstance via Unreal’s “<<” operator?
Next one I tried:
This one seems to be the best one so far. Everything works until the point where I call GameInstance->StartGameInstance()
. I am told that there is a read access exception. My guess is that *FileReader << GameInstance
does not seem to be loading properly. Why though?
Next one I tried:
This one fails at FMemoryReader MemoryReader(GameInstance, true);
. During compilation, cannot convert argument 1 from 'UGameInstance *' to 'const TArray &'
is shown. Is this another sign that UGameInstance cannot be serialized?
So is it really not possible to serialize UGameInstance? If it really is not possible, considering the context of what I was doing, are there any ideas of how else I can achieve this?