UObject class IDs for saving and loading?

Hey guys,

The saving and loading system that we implemented is explained here.

One of the issues that we are having with this system is that to know what class of actor to spawn when we load back in, we look at the actual class path that gets saved. But if we decide to rename one of our actor classes or change its path, then we would break the entire system for old save files when the new version of the game with the changed class path tries to load the old file.

Does anyone have a good solution to combat this issue?

I don’t know if this would help for your specific case but doing an SaveLoad system for a RPG I’ve thought at the following:

  1. All objects placed in levels have a GUID. At the moment I can’t store it in C++ since of the bug described here: Unreal Engine Issues and Bug Tracker (UE-52220) When I compile all the GUID’s are lost. But I use those so that I can place in the level items/creatures that I know that might be killed or anything else like that, so that I can delete them on the load, based on that GUID
  2. All objects placed in a level have stored a ID/GUID mapped to a DB entity or a class that I know at compile time. In that way I only serialize the ID that I’m sure that it maps to ‘Monster’ or ‘Character’ or whatever, independently of the fact that I might change the class path
  3. The save is organized like a map of maps (TMap), that has a list of GUID’s and each entity with a GUID knows what data is required and knows how to extract it from the save
  4. Don’t worry about loosing the game progress while developing, you should be sure on the save/load only when releasing the game or when patching it

I’m not entirely sure that my system is good for the average game, or your specific game, since you can’t leverage the ‘<<’ operator or the ‘SaveGame’ property, but it is what I need for my specific game. I don’t know if it can help your case, but who knows, someone might get an idea :slight_smile:

Also it doesn’t support serialization of the animation state. If you have a character in the middle of a weapon swing, it’s though luck, doesn’t work. Still browsing around for a solution to that problem, I can’t seem to find one.

Regards!