Load or LoadLastScene?

Hey!
I was thinking…
It wouldn’t be better if we always call LoadLastScene, also when we press “L” instead of only when the game starts?
Because if I saved the game, I want to go back to that state I saved before, even if I had saved in the last scene…
Oops… writing this I realized that we saved again when we entered the scene… so… how could we have a slot-based save system, that we load a state based on a specified moment and not every time we enter in a new scene?
This system definitely is a saving system, but is more like a checkpoint system, right?

I’ll try to answer myself and you can correct me if I made a mistake…

  • It wouldn’t be the case of having two saving systems? One for the checkpoints and another for saving and loading the progress when we want?
  • Or two wrappers, that care about two files, one for checkpoints and another for progress

Yes, it is a bit of saving and a bit of state management/checkpoint.

I have spent hours making a save structure that has slots; an ‘autosave’ slot for the state management bits (when we change scenes) and slots for manual saves (by pressing ‘S’). What I did was a little complex and I was saving screenshots and a timer of how long the player has been playing, etc. I changed the saving from binary to json, so I made a json container that would hold a list of slots, as well as the index of the last slot that was saved. When the game starts it can load the last save, or the player can choose which save to load.

The structure is basic

{
  "SlotCount": 4,
  "Slots": [
    {
      "ScreenshotWidth": 205,
      "ScreenshotHeight": 128,
      "Screenshot": [base64 screenshot here],
      "SavedDate": "2022-10-26T11:04:58.9600932+02:00",
      "LastSceneBuildIndex": 2,
      "TotalPlayTime": 39.35405,
      "Data": { [all the save data goes here] }
    },
    null,
    null,
    null
  ],
  "LastSlotIndex": 0
}

Those null entries just mean there are no manual saves. Slot 0 is always the autosave. And the ‘SavedDate’ should tell you when last I did anything with this. Managing the save state, etc, got a little complicated. In my case, the player was restricted to having 3 slots to save in, per game. I edited the json slightly because I also have game slots so the player could have multiple games as well and everything was getting saved in the same save file. These games are also restricted to 4

1 Like

this makes a huuuuge sense.
thanks!!!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms