Original Post
I'm making a game taking place in a procedurally generated world. When the player starts a new game, they could create a new world, which currently creates a bunch of files in a worlds/[ID]/ folder. When the player saves their game, their stats are saved in a separate save game folder. The world is created area by area as the player advances through the game, not all at once.
The reason I want to do it like this is that I want the player to be able to start a new game in an existing world and play through it again, or share fun worlds with other players without changes made in their old save file affecting the experience.
I realize this is similar to what a lot of other games do with their saves. My world is just the levels that are usually man-made. But whenever I've made save systems before, it's been in simple games where the player could only save between levels and never return to previous ones. So I'm not quite sure how to accomplish this.
I can think of two ways right now:
1) Save all dynamic data in the save file, even if no changes have been made. This would be simple to implement, but feels sort of brute force-ish and like I'm just duplicating data. I can't imagine an open world game like Morrowind has an entry in their save file for every single movable object unless the player has actually done something with it. (I remember that the Xbox Morrowind used to crash for people who had played for too long and had huge save files)
2) Save the differences only. Loading this way could probably be done two ways, either by always first checking the save file for a version of the data being loaded, or by loading all the base data and then going through the save files applying the changes. Not sure which would be best. Maybe there's no definite answer.
Anyway, the biggest problem I have with saving only changes is detecting a change. How can I make it so when the game saves, it sees that Object A is the same as when it was created, while Object B has been destroyed?
Any input is appreciated.
The reason I want to do it like this is that I want the player to be able to start a new game in an existing world and play through it again, or share fun worlds with other players without changes made in their old save file affecting the experience.
I realize this is similar to what a lot of other games do with their saves. My world is just the levels that are usually man-made. But whenever I've made save systems before, it's been in simple games where the player could only save between levels and never return to previous ones. So I'm not quite sure how to accomplish this.
I can think of two ways right now:
1) Save all dynamic data in the save file, even if no changes have been made. This would be simple to implement, but feels sort of brute force-ish and like I'm just duplicating data. I can't imagine an open world game like Morrowind has an entry in their save file for every single movable object unless the player has actually done something with it. (I remember that the Xbox Morrowind used to crash for people who had played for too long and had huge save files)
2) Save the differences only. Loading this way could probably be done two ways, either by always first checking the save file for a version of the data being loaded, or by loading all the base data and then going through the save files applying the changes. Not sure which would be best. Maybe there's no definite answer.
Anyway, the biggest problem I have with saving only changes is detecting a change. How can I make it so when the game saves, it sees that Object A is the same as when it was created, while Object B has been destroyed?
Any input is appreciated.