How would I go about saving my game?
I´d like to point out I´m pretty new to Unity and coding in general, so I may not be familiar with all the terms. I´m not looking for you to code my game, but rather point me to the right direction.
I´m making a game where the player is a shopkeeper. The game is going to be an idle game, where you naturally need to save your progress. There is 75 different items and 200 different customers. All the items and customers are created in the inspector. There is an item-script, which I attach to all the items (hammer, axe, sword etc). In the script there is a class that contains values like quantity of said item in the shop and current price of the item. Those values are modified by the player via UI buttons in-game. The items differ from each other by the values I assign to them via the inspector. Those values are the likes of damage of the item and the base value of “need” the item puts out.
The customers don´t need to be created in the inspector, since they all are alike. They just have random values (personalities) and needs for the items. The personalities are created randomly at the start of the game. But when you start the game the second time, the personalities are loaded from a file (the personalities may change a little based on your actions). Same goes for the needs. I know it´s going to be a lot of work, but I´m planning to make the need system values like needHammer, needAxe, needSword etc. This also makes it so that I don´t have to refer to other classes, since I understand that makes saving a wee bit harder. So every customer has a customer-script with a class that holds the personality values and the need values. Nothing needs to be assigned in the inspector.
The game is going to be saved locally on the phone/pc. I don´t want to use playerprefs, even I know not to use that. I have looked into binary serialization, XML serialization and some different saving assets, but I´m not sure which way to go. I´ve read something about XML being able to support lists of classes, which might be good for this situation?
I have also gone through a lot of questions here related to this question but most of the answers just go “Look into Binary formatting”, totally overlooking the fact that this would make potentially hundreds of save files. So one more thing is that I would prefer that saving the game could make as little files as possible. I think I would know how to do this using binary serialization, but to my understanding my method would create 75 save files for items and another 200 files for the customers. That is less than ideal.
As I said, I´m pretty new to making games, but trust me, this game is not going to be as complicated as it might seem.
Thanks a lot in advance.