Updating JSON game progress data after AssetBundle download

Hi,

I have a question regarding to a more client-server based game architecture.

I have a download manager that checkes the FTP if there are new versions, if so downloads the new assets in AssetBundle form and loads them.

Also, I have a game progress I keep them both in client and a DB server. I save the progress in JSON form at the client. I approach the solution by creating a Default Game Data JSON file at the first run that is generated from a ScriptableObject that holds all the default game data, say Level Names, Lock-Unlock info.

When the player first loads the game, the default JSON file is read and generated a new one to set progress data like lock-unlock by player’s progress. However, I have a situation that, when I want to make a new update from FTP, I would be necessarily update the GameDefaults JSON and update the player’s progress JSON to follow the game. But how would I do without violating the player’s progress history and only add new fields in a proper way?

I’m a bit confused. AssetBundles can’t contain scripts or new code (well it’s possible to ship assemblies and load them manually). How exactly does an “update” look like? Do you have code in your main application that allows dynamically adding features without new code? Like new items with the same functionality but different look or stats? If that’s the case you might just want to ship a “patch” JSON file which just contains the default values for the newly added item which simply get merged into the existing file.

How do you read / write your JSON file? Of course you can’t use class mapping without actually changing the code as well.

So to properly answer this question we need to know more about:

  • How such an “update” might look like and what it can contain
  • How you read / write / manage your JSON data from code.