I am new to Godot and wanted to try making a game somewhat similar to a sports team management game. I am just trying to figure out the overall structure for now. The basic idea would be that there are players with their own stats like speed, accuracy, etc. and teams composed of players. Players could be traded from one team to another.
My first thought was to just make a dictionary of players and each player would have their own dictionary with their stats. I could then either put the player dictionaries inside of a team dictionary or keep them separate and just have the team dictionary reference the dictionaries of the players on the team.
But I am having trouble figuring out the best way to make the data accessible and able to be saved.
Would I just have a singleton holding the dictionaries and then I could access the data from anywhere in the game and then when the game is saved/quit, I could save the data in the singleton to a resource? Do I even need to use a singleton at all? Could I just put the dictionaries directly into a resource and be able to access and modify the data? Or is it not possible/less convenient to work with data in a resource vs a singleton?
And would I want to make a custom class for players and teams or is it not needed since the structure would come from the dictionary? Or could I just have all the players be an instance of a player class with their stats in the class and then put all the player instances in a dictionary or something? Or is that not how classes are meant to be used?
I’ve tried reading up and watching tutorials on these things but just can’t wrap my head around it all and I would appreciate any advice on when to use what or how to structure it all.