Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

amazing game, gj! The update was really awesome, thanks for adding new stuff and fixing bugs. how do you save progress so smoothly? is that browser localStorage + Godot resources?

Hey!

Sorry for taking so long to answer. Thanks for the feedback :)

For the game state I'm basically using a big Dictionary that stores every info the game needs to have (e.g. "how many segments does the player have", "what upgrades have they unlocked", "what entry in the bestiary have they read", etc.).

I wrote an Autload script that that allows me to easily modify that state (Storage.set_int(name, value) / Storage.get_int(name, default_value)).  In the set_* functions I then trigger a save via a Godot Timer that simply writes this state as JSON after 3 seconds to a file (if a Timer is already running I skip this). When the game is first loaded, this file is loaded into the state.

Then, to react to changes in the state I have a signal in the Autoload that notifies anyone interested if a key has changed (changed(key: String)).

Things like foods, food effects, shop upgrades and bestiary entries are managed using plain-old Godot resources. I quite liked this plugin to keep an overview while editing them.

Here's the source code for my Storage class if you want to take a look at it (note: the code is pretty ugly at places and could definetely use a refactor; there's also some last-minute hacks in there):

https://gist.github.com/Joex3/8864c5752645918452a93cfd4678e19f

thanks!