Game
Clever Cogs
8 years ago

Save/ Load system


The save system that was created is quite rudimentary but it does the job. Before making the save/ load system I had to figure out how exactly to do it. From my previous experience I imagined it being done through the use of files and sure enough after a bit of research I found a simple way to save data into a file and load the data from the file.

The process was simple enough, all I needed to do is create a static class with variables I wanted to save and make sure that the object the save/load script is attached to is persistent through different levels, which I did by running “DontDestroyOnLoad” function in the “Awake part of the script. This makes it so the object is not destroyed when an object is loaded.

Save system is quite simple, due to level based nature of the game. Since There are no collectibles right now, the only thing that will differ between saves is the level player is on. Since level the player is on can be represented by a single number, that’s the only thing I save. Originally I was going to save two variables like level and save slot number, but since save slot doesn’t change during the game, I decided not to save unnecessary data, instead I have split each of the save slots into it’s own file. This way a file can correspond to a save slot and I only need to save a level number for that slot. Having a separate file for each slot also allows me to easily expand save system in future by simply adding variables. This wouldn’t be possible before, since each variable would have to be linked to a save slot in some manner so I would have to think about how to make it so that variables with the same names are differentiated in a single file. It’s not impossible, since I could separate file into sections representing save slots or adding a prefix to each variable when it is written into a file. However I decided that having separate files is a better solution.

In the end what I ended up with is a system that consists of 3 save slots each dedicated to a separate file. If there is no file. game can’t be loaded from that save slot and instead a “No save data found” is displayed.



0 comments

Loading...

Next up

Menu Changes and Death mechanic Just a quick update on the menu changes. I have added a restart option to the pause menu The same function will be used to restart the level when a player hits “Death spikes”.

First character is finished (well, modelling is) Texturing will be done when other characters are ready. The model is far from perfect, but it will do for now.

Base for 3rd character The last of three characters is complete… well the base model is.

Base for 2 characters (need to be finished) The base models for small and medium characters are done (see below) I had to remake the legs for the character since they looked way too small. The new ones look better:

Fan art for Foolish I'm feeling kinda better so I drew this

We made a lot of improvements on the Freezing Plains visual. Things like pine trees, tiny bushes, some rocks, and others game props!

#IndieGame | #IndieDev | #GameDev | #PixelArt | #WaifuQuest | #WifeQuest | #screenshotsaturday

Have a good Boi

Today I was setting up the location of the first boss. His name is "Father" and he is the first of the Patagonians. His task is to guard the road to the House.🛡🗡 Bookmark pre-launch page🔖🔖🔖

https://www.kickstarter.com/projects/rdvindiegame/the-patagonian…

Protege el conocimiento, salva la historia. Guardian of Lore es un platformer 2D en el que debes luchar para mantener viva la memoria de la mitología latinoamericana. El juego llegará a Steam el 18 de mayo: https://steam.pm/app/1211740 #ScreenshotSaturday