0
\$\begingroup\$

I have a broad question, hopefully I'll synthesize it well. I've been looking for the best way to store the standard data of my project. So far, I've found 4 possible answers to my problem: Binary files, Json files, XML files and local DB(using SQLite). While the first 2 seems to be common sense for store data, I would still need some opinions about it, instead of create a bunch of content and code in vain. The chosen option must generate files that can be editable at runtime. Already used some XML files for basic saving and watched tutorials on Json and Binary files but I'm still uncertain about what road to take. I believe DB's are a different animal, but maybe it would worth for my case.

To contextualize, my project is a sports game, so I must start to generate and store virtual players and teams. After that I need to link those virtual players at their respective teams. It happens that I would like to enable human players to edit those generated virtual players and teams attributes at runtime through some kind of editor. Furthermore, I want to enable human players to create their own virtual players and teams, so the chosen method must have scalability, so it's expected to have hundreds of teams and thousands of virtual players at some point. My target platform is PC, so file sizes and general performance isn't so critical as it could be on mobile for example.

Anyway, hopefully my doubts are clear enough. It would be cool if someone have something to say, I would like to know the best choice for my case.

PS: Already take a look at these 2 questions:

How to choose how to store data?

Would it be better to use XML/JSON/Text or a database to store game content?

But most of it's answers have some years now and I still have doubts on this matter.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ There is a difference in for how to enable the user to edit the data and how to store the data. The user should always edit it via some kind of editor that you provide him and not directly on the file. The user won't even know in what kind of format you save the data. The actual need of what you want to do with the data decides how to store the data. (in your case a database sounds good) \$\endgroup\$
    – Zibelas
    Dec 14, 2020 at 19:32
  • \$\begingroup\$ Ok, fair point. I probably mixed my doubts here. My long term goal also involves data sharing by the users. Not sure if this favors one choice over the other. Thanks for the comment by the way. \$\endgroup\$ Dec 15, 2020 at 14:06
  • \$\begingroup\$ Even if you want the user to share his data, it will probably always a small subset and not your whole data. And even than it is something you would handle differently since importing and exporting can be handled in a format that the user does not need to understand. He would again select just in your game/ editor what he want to export, he should neither care about the file type/ format nor how the data goes back into the game besides clicking (in the worst case) on some import button (best case is you send it backend to the second user) \$\endgroup\$
    – Zibelas
    Dec 15, 2020 at 16:15
  • \$\begingroup\$ Both of the links in your question are still valid. They describe the concept of what you want and they are probably still valid in 10 years. \$\endgroup\$
    – Zibelas
    Dec 15, 2020 at 16:37
  • \$\begingroup\$ Yeah, I got your point. I'll re read the previous answers to decide which way I gonna follow. \$\endgroup\$ Dec 15, 2020 at 16:46

0

You must log in to answer this question.

Browse other questions tagged .