Hi everyone! I'm currently making a Football Agent simulation game.
My problem is how do I represent enormous data that the game world has so I can read from it when I load the game and write it out when I'm saving the game.
Naturally (is it natural?), I've decided to represent data with JSON. So, my objects, simplified are represented like this:
"name": "Liga prima",
"name": "club 1",
This seemed nice to me but when I realised I'll need to provide a reference to a player of what club he plays in, or provide a reference to an agent what players he currently has and vice versa, I've realised this design isn't the best.
My next conclusion was that is probably better that I make a giant list of all players, do that in JSON too, and add a unique ID to every player. Then I do the same for clubs, nations, coaches, agents and every other object I have in the game. Inside these objects instead of references I slip the IDs of the objects when representing my data in JSON and then when I want to load the data I match every ID with their owner and supply the ID's. This somehow works like tables inside a database and it seems natural.
Is this the right way? What could I do better/differently? It also seems slow, so I was wondering what were the best practices with these type of problems.