Page 1 of 1

Save System: Concept for "saves per level"

Posted: Mon May 30, 2022 1:00 am
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?

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

Posted: Mon May 30, 2022 7:43 am
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"?

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

Posted: Mon May 30, 2022 10:13 am
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.

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

Posted: Mon May 30, 2022 10:47 am
by Tony Li
Is it too big?