Hi
Im wondering how people handle a “save game” feature in their game.
To save level status, play and enemy attributes, inventory etc etc.
Do you do use an overridden save() , load() one each gameObject and write info to a file?
How would you make it info that cant be tampered with easily ( I guess some binary encoded files?)
Just curious…examples would be great.
Thanks
-LW
If it was me I’d create a GetSaveData/LoadData methods for each class that needs to save something.
Then create another Save class, which would hold references to all the objects that need their data saved. When you need to save something, just call Save.Save() and it would iterate through all the objects calling their GetSaveData(), then merging it into one file, and finally saving.
For encryption you can use System.Security.Cryptography namespace. If you google that I’m sure you can find plenty of examples and tutorials how to do it. It’s pretty straightforward.
Although since you have to keep the encryption key somewhere with the game, someone who’s bit more skilled can easily extract the key.