I am currently making a car game. In this car game, the user can choose between a variety of cars BUT ONLY IF HE’S PURCHASED THIS. Assuming I already have an ingame-currency system setup, how would I store data about what cars a player has purchased or not?
In the past, I made a SaveGame blueprint. In this blueprint, I had a Map variable (dictionary) called VehicleLog. In this data structure, I have a string-key which represents the vehicles named, followed by a struct-value. This struct stores a boolean called “isPurchased?” and a CLASS reference to it’s respective blueprint for spawning in.
Then, everytime I load the game, I have my gameinstance store whatever is in the SaveGame file.
Currently, this approach is tedious. What if I want to add more vehicles later on? I would have to go to the SaveGame and add to it’s dictionary.
What I tried to do before is create a DataTable to model this. Unfortunately, UE4’s DataTables are read-only, so that’s unfortunate.
What’s another way I can represent this data, such that this proposed method could easily be updated and modified. I’m thinking about using SQL, but doesn’t that require an internet connection to a Web Service? This game should be offline available too.
This would imply that I’m trying to add more cars in runtime which was not was I was asking sorry haha. I’m basically just trying to make a database of vehicles that a player can purchase. I don’t think I have been doing it correctly though. My SaveGame class served to be my container for all this data, and I did this by using a dictionary. Unfortunately, if I wanted to add more cars, I would have to recompile the class. I feel like this isn’t the correct approach.