Save System

Aerisetta

Active member
A question that I get asked often by players is how saving works, they find it quite confusing and are not used to the style openBOR handles saves. I myself am often worried about overwriting and not being able to control it.

I am wondering if anyone has ever tried to implement a save system similar to that of RPG save slots like in RPGmaker (see below) or even save state's similar to emulators. The key is having multiple save slots the player can manually save to or overwrite

I think this will be very helpful in making larger/longer games like an RPG beat em up or just letting players play different characters without worry about losing all progress because because there is only 1 save file.

Also a side note is the save file presentation is quite confusing as well. Information is presented poorly and some of that information is presented in a way that confuses normal players

Screenshot_20230425_154605_Brave.jpg

I recently added a world map to my game as well as difficulty select that unlocks per stage in my game, so the path forward isn't so linear for the player anymore and I would like to give them better control in saving so they (and me) can be confident their game's progression is recorded long term

Screenshot_20230425_155820_FEMTALITY.jpg
Screenshot_20230425-160119.jpg
 

My personal rule for relying on OpenBOR's native save state: Don't. Never. No, not even then. That thing was a tacked on BS feature I wish never existed, and has been nothing but confusion and trouble ever since. The only mistake uTunnels really made during his distinguished tenure as a developer.

If you want to set up a true save game feature, you best buckle up, it's going to be a ride. Not because of saving data - that's actually pretty easy. The hard part is building a menu to control it. If you can't work up custom menus yet, then you can't build a save system. Study some of @Bloodbane's demo projects, as he has a lot of custom interfaces that should make good examples. That's step 1.

Step 2: Saving/Reading the data.

OpenBOR has a functionality called Filestream. This is a set of native script functions that let you create, write to, and read from files. It's fairly straight forward. The catch is you'll need to decide beforehand how you will store that data. The files are plain text, so you'll probably want to come up with some sort of table layout. What exactly do you want to keep. Level? Hitpoints? Location? Etc.?

Layout your full plan and we can start walking through implementation.

DC
 
Hmmmm

So what is currently being saved is actually fine for me, which I think is
what mode you are on
what level you're were on
score - which translates to character level for me
credits - i don't use
lives - i don't use

That's all I'm aware is being saved atm, and these things are fine with me
it would be nice to see the date/time the save was made

What I would like is
1. the player can initiate the save from the ingame pause menu, it's okay if they save in the middle of a stage and when they reload it's at the beginning of the stage
2. the player can make multiple saves
3. the player can choose what save to load
4. there is still an auto save function, and preferably there are 5 auto save slots that cycle and overwrite when full
5. there is a loading menu players can access from the title screen (and get rid of the existing one)
 
Actually there is one more thing, although im not very sure how it even works atm

I am currently locking access to stages behind a setglobalvar. i'm not 100% sure but it seems this is saved globally? like if i started a new game and went to this menu, it would be unlocked already if it has been unlocked once.

I guess the unlock trigger should be saved in the file, although I wouldnt bother if it makes it harder to implement (but it doesnt sound like this is the hard part)

When the pre-requisite is met
Code:
spawn TextPop_C01-01 (this is an announcement of stage end)
@script
void main()
{
    void self = getlocalvar("self");
    changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW15"));
    setglobalvar("C01H-Unlock", 1);
}
@end_script
at 0

And this unlocks the mode in the stage select
Code:
spawn    Exit
@script
  void main()
  {
    void self = getlocalvar("self"); //Get calling entity
    int Status = getglobalvar("C01H-Unlock");


    if(Status == 1){
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW3"));
    }
      
      
        else {
        killentity(self);
    }
  }
@end_script
alias    C01H
coords    625 550
at    0
 
it would be nice to see the date/time the save was made

I'll try to answer other stuff in detail quick as I can (this is finals week for me). I can tell you right away there's no way to include date and time because OpenBOR doesn't have access to the system clock. The engine was written with its timing fully internalized, and a lot of the old platforms didn't even have a system clock. That might be something I can fix later since all the current official ports do have a system clock, but I can't guarantee anything - chiefly because I've just never written clock support before.

DC
 
I'll try to answer other stuff in detail quick as I can (this is finals week for me). I can tell you right away there's no way to include date and time because OpenBOR doesn't have access to the system clock. The engine was written with its timing fully internalized, and a lot of the old platforms didn't even have a system clock. That might be something I can fix later since all the current official ports do have a system clock, but I can't guarantee anything - chiefly because I've just never written clock support before.

DC
clock thing isnt that important, just a nice to have
 
Back
Top Bottom