Save System: Concept for "saves per level"

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
NotVeryProfessional
Posts: 145
Joined: Mon Nov 23, 2020 6:35 am

Save System: Concept for "saves per level"

Post by NotVeryProfessional »

This is something I have a solution for but I'm bouncing this off the forum to check if someone has a better solution.

My game has not a sidescroller- or FPS-like level progression where the player starts somewhere and then moves from level 1 to 2 to 3, etc. - but instead I have a bunch of levels that a player can play independently. Something like RTS games where you pick a map to play.

So I need not a list of save games by date, but by level. In fact, I only want one save game per level - players should be able to continue a game, but I don't allow saving, trying, reloading, etc.

So what I did was keep a list, give each level an ID and hardcode the save system slot to the level ID. This works. If I know the level ID, I an check if there is a save game and I can load it.

It also can fail if I don't get the ID correct, so obviously the system isn't perfect. And it leaves empty slots scattered around, which is only a problem in the meta file, but it prevents me from using numbering like "all easy levels are in the 100 - 199 range, all difficult levels in the 200 - 299 range".

So maybe there's a better way and I've missed it?
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save System: Concept for "saves per level"

Post by Tony Li »

Hi,

That sounds like a good approach to me.

What's preventing you from using numbering like "all easy levels are in the 100 - 199 range, all difficult levels in the 200 - 299 range"?
NotVeryProfessional
Posts: 145
Joined: Mon Nov 23, 2020 6:35 am

Re: Save System: Concept for "saves per level"

Post by NotVeryProfessional »

Tony Li wrote: Mon May 30, 2022 7:43 am What's preventing you from using numbering like "all easy levels are in the 100 - 199 range, all difficult levels in the 200 - 299 range"?
There's the meta-file (savedata.dat ? I forgot the name) which stores information about all the saves, and that blows up with hundreds of empty lines.
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save System: Concept for "saves per level"

Post by Tony Li »

Is it too big?
Post Reply