Methods for discriminating save data?

When I save my game, I want to discriminate between certain types of values.

We have game values (player position, rotation, etc) and then we have settings (audio volume, graphics settings, etc).

I can’t save everything at anytime because - for instance - if I saved the game values whenever I save options settings, I’d initialize some values.

So question is, I can imagine several ways to discriminate the saved values, but which might cause problems?

Here is ways I can imagine:

  1. Write to multiple save game objects
  2. Use different save slot names (one for game values, one for options values)
  3. a series of branches and/or switches to control flow within one save game object

Advice is appreciated. Not too hard to test each way but sometimes a system seems good and you dont find problems until later.

You just load the save game object before each save, like this:


So I was basically doing like you said, but one big mistake was causing bad results. Here is why:



Looks like the way I was doing it caused some bad data to get into the mix. Seems simple now but I was pulling my hair out about this for awhile.

Thank you!

1 Like

Yes, there’s two ways basically:

  1. This was, always load before you save

  2. Load the save game on begin play and copy it to a variable which gets saved every few seconds. Then you can just update bits of this variable in the game. Put it somewhere global like the game instance.

1 Like