I am making a platformer that is made up of several levels. All of the levels are loaded into a persistent world. When the player finishes a level, they are given the opportunity to save their progress. If the player wants to play a level they have previously beaten, they are given the opportunity to select a level in the load game screen.
The game saves and loads progress correctly if the player plays each level sequentially. However, if the player loads a level they had previously beaten, and then reaches another level they had previously beaten, the save game file will load in the wrong level the next time the player loads a game.
For example:
- The player beats and saves levels 1, 2, and 3. The player quits the game.
- The player loads their save game, but decides to play from level 2 again.
- The player reaches level 3 and saves the game. The player quits the game.
- The player loads their save game. The order of the saves is now incorrect, so any attempt to load a level will result in the wrong level and data being loaded.
When the system is working correctly (i.e., the player is saving levels sequentially and not returning to previous levels), print stings return something like this:
However, when loading a level that is out of order and saving again, the print strings return this:
I would expect a correctly saved game to look like the second image, while an incorrectly saved one might look like the first, but the opposite is true. The save game system is large and a little complex, so I’m not even sure what part of the blueprint I should attach.