Solution to apply savegame state when a savegame doesn't belong to current level

Hi,

I’m working on save system and I’m wondering what is a good method to apply savegame state when savegame doesn’t belong to current level - you have change level before applying savegame.

For now I’ve implemented something like this:

  1. Get a level name from savegame
  2. Deserialize a savegame state, TArray with actor records
  3. Create a URL with saved level name and option for example: “?LoadedFromCheckpoint”
  4. Call ClientTravel with created URL
  5. Then in GameEngine class wait for PostLoadMap() function call
  6. Check in PostLoadMap if URL contain “?LoadedFromCheckpoint” option then load a savestate

Sometimes I can’t match serialized data with actors in the world because there are leftovers from the previous map.

Can sameone describe how to load a savegame correctly? Maybe I should enforce GC somewhere in the code or load a savegame from different event/function?

Regards

Pierdek