Open miskatonicstudio opened 4 years ago
It would be nice if Goat get save game checkpoints functionality.
@sergicollado thank you for the suggestion. GOAT is primarily aimed at adventure games, where checkpoints are usually not used, but maybe this could work for some more experimental storytelling, so I've created a new task for that ;)
This is a bit more difficult than expected. Saving data manually doesn't seem to be an option, loading the entire scene doesn't seem to work. More details are described here:
https://godotengine.org/qa/69338/how-to-properly-load-a-saved-scene-skipping-_ready-method
Some solutions (if the question above will not receive an answer):
EDIT: if the game switches between scenes, then saving the state manually will have to be implemented anyway. However, a simple game doesn't have to switch between scenes (can hide/show them when necessary).
I think the simple it's the better, I usually save a json with some parameters:
That's the thing: the simple solution is to save the state of the scene ;) Saving a json or a config file with all the data picked manually from the whole game state seems very difficult, e.g. if an item was picked up, it has to be removed during initialization, if a door is closing slowly (this can be a part of a challenge/puzzle) then the state of the door also needs to be saved. If activating a generator lights up the generator screen, the computer screen, and portal lights, all of those scenes will have to react to the state of the generator included in the saved game. These are just the examples I can think of, I'm sure there are many more ;) It seems much easier to just "freeze" the entire scene and then bring it back ;)
Has to store:
If a list is loaded from a save file into the game, the signals have to be blocked (in case e.g. "add_book_to_inventory" has a corresponding audio, it cannot be played).
EDIT: In general, there seem to be 2 approaches:
The first approach would probably work best if all the important information is stored globally (in singletons). That includes all Player info (there is no singleton for that yet), as well as e.g. info about activation of interactive objects/screens etc. (to remove already activated interactive objects). The existing API of singletons can probably be kept, with saves extracting and storing the information from them.
Depending on the chosen solution, 3 options could be required: save, load, and reset (for creating a new game).