I’m trying to figure out what the best way to store consumable data for a Unity game being sold on say iTunes or Google Play. I want to ensure that between version updates of the application, the data persists as to not aggravate the user and discourage them from wanting to make future consumable purchases.
From what I understand, upon doing some light reading, these seem to be the common (?) ways to store consumable data:
Standard [File] I/O
Pros - Because the information is likely stored in a Persistant Data path, the data should be retrievable even after updating the application (as long as the new application recognizes the file format, which it should).
Cons - Easily (?) modifiable if someone has the ability to access the file. Would require encoding the data somehow as well as validations checks within the game to reduce the chance of the user being able to directly modify consumable data.
[Player Preferences]
Pros - Although external, I believe these values are loaded with the game, so retrieval of the data is likely faster (correct me if I’m wrong).
Cons - The values are stored in variables that can be modified at runtime by hacking tools. Would require some kind of safer version of Player Preferences. I also have no idea if these values will be valid for an updated version of the application.
Online profile / database
Pros - Like Standard File I/O, this would make it such that the user can retrieve their consumable information from say a database. Also, since the data is stored online, the user can only retrieve the amount of each consumable that is logged into the database.
Cons - May require an additional log in to check their consumable status when the player may not have a WiFi connection (this would be okay if the game is an online game, but that isn’t always the case). Requires additional maintenance of player information through a database, which can open a new can of worms in terms of project maintenance for the developer.
Other methods I haven’t thought of or seen used**
Which method would you recommend? Am I missing anything? I’m thinking its going to be Standard File I/O with some protection/validation involved but I’d like to know of any better options if possible, or any other issues I’ll have if I go the Standard File I/O route.