After making a quest and dialogue system, I find myself in a position where I need a save game system. The best suited one for my game would be one that autosaves and can't be controlled by the one in front of the screen (reverting decisions should not be possible).
I need to save basic things like player health, mana, equipment, inventory state, chests, etc. and... the players position.
My (maybe naive) strategy would be to create a file which saves these things as dictionaries and update it whenever the player changes equipment, opens a chest, etc.
But this requires to always open the file, write to it and close it again for EVERY move, for every injury in battle, etc. And I intend to save the enemies position and health status as well, so it is not possible to quit out and every foe is at its spawn location (like it is possible in dark souls).
For the movement I could maybe use a timer of 5 to 10 seconds to reduce the rate of saves, but I would still like to know if there is a better (and maybe less resource consuming) way to go about this.
And of course to update the file content I always need to go through the entries until I find whatsoever needs to be updated. So maybe it would be better to have multiple files (one for the player, one for chests, etc.) and load them one by one on startup?
Does anyone have some clues on the matter? Or even written a similar system himself? I'd really appreciate any help I can get.