Maaack / Godot-Game-Template

Godot template with a main menu, options menus, pause menu, credits, scene loader, extra tools, and an example game scene.
MIT License
283 stars 17 forks source link

Suggestion: Generic GameState that saves into JSON (or similar) #80

Open Maaack opened 1 month ago

Maaack commented 1 month ago

Currently, the GameLevelLog tracks progress in the config file. This does not follow convention on where that data would typically be stored, as it mixes application configuration settings with game state.

Instead, we could try creating a generic GameState (or even more generic AppState) that stores a dictionary of data and manages the saving/loading behind the scenes. There's a lot of documentation available on how to save and load game state to and from files.

https://docs.godotengine.org/en/stable/tutorials/io/saving_games.html

Eventually, it could have multiple levels, like UserGameState, PCGameState, WorldGameState depending on the level of persistence desired.

GameLevelLog, GameLog, AppLog could then be updated to read from the GameState instead of Config.

Maaack commented 2 weeks ago

I think adding this could really help avoid devs (specifically, me) from getting into a bad practice of saving game state data in the config file instead, just because it is available.