I need to keep track of a lot of data for my game but I don’t know how to keep track of them.
There are 6 shop upgrades and each upgrade affects the player. And each upgrade has 3 levels and each of those has a requirement set of coins and gems to unlock.
6 other shop upgrades that focus on cosmetics.
There are 6 chapters in the game and each chapter has 50 levels and I need to store how many of them are unlocked and how many stars player has got for each of them.
I do know that I need to serialize them at some point so that is not the question, please do not point me towards it.
There are more than one way of doing this and it’s difficult to tell which si the right one for your purpose without knowing the ins-and-outs of the project.
We made a game with savegame functionaliy save it to a JSON based format:
In the end we ended up refactoring that by writing classes for the things we wanted to save and just dump that to a binary format ( the c# standard binary serialization )
I recommend reading this article about the subject.
Serialize with unity.
I would recommend making arrays
example
int levels[] = new int [50];
//then when you pass level 2
levels[1] = 1; //1 indicates you passed level
//same with upgrades
int upgrades[] = new int[6];
upgrades[2] = 2; //third upgrade is at level 2
//and so on