Creating large amount of character data and storing it
I have a hard time figuring out how to implement a set of data to a sports game ( single player game ). I've been trying to find answers for this from the hub but none of them quite touches my problem.
In the game you are a manager and also can play matches. What I'm trying to achieve is a data set that has all of the players statistics/attributes/characteristics (playerID, how they look, strength, items they hold, which team they belong to etc.) , to which you can add more players, remove players and update players if needed. I've been trying to do that using data table but it seems, if I understand it correctly, that data tables aren't used that way. I've been trying things in the editor, no coding yet because I think I first need to understand the correct way of thinking.
My thinking is that the player data should be in an external file where from you can load player data when the game starts and while playing, it updates the data respectively. Thinking behind this is that players retire and we need to add more new players (rookies) after every season. That is why we need a system that supports adding and removing players. But the question is that which file format should the data be? JSON, csv, excel,txt or... What is the best way keeping things tidy and easy to read/use when we have let's say at start we have 1000 players and their stats. Is it the same case with team information which should have the info about the players playing in the team, overall money of the team, monthly expenses etc.
How would you guys go forward with this?
Thank you in advance -Mike
I'm pretty sure you can use Data Tables to manage this data. It is afterall just a collection of structured information. However, there might be some reason for it not to be the best solution depending on the data you actually want to store.
I've made sports games in the past and at the time we always used XML to store the data. That decision was made because we were using a custom engine that already had robust XML support and it was used farily extensively. Personally I'd use JSON now but the best answer depends on your work flow. You're going to need to create and edit all this data, so choose a format that works well for you.
For save data, you could initially read in all the 'base' stats (from your datatable / xml / json or whatever) and keep them in structures. As tou play the game these are then updated and serialised out in whatever format you think is suitable. When the game next loads, just read in this new data instead (or read in the core data then apply the saved changes to that data, depending on what is best for your game)
answered Apr 23 '19 at 10:28 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here