- Home /
Importing large amounts of data
A little backstory to this question: I'm working on an (mmo)rpg which has a decent amount of items and skills and other stuff. I have separated the data classes from the gameobjects (meaning that monobehaviour is only on the weapon model and item model etc.)
All the data classes use polymorphism and have a lot of subtypes. Below is an ERD showing how I envisioned the database. https://www.dropbox.com/s/hytej98aih2j927/erd.jpg?dl=0 (Subtypes I am referring to are Entities derived from "Item", "Skill", and "StatusEffect". Everything else is data that can change at runtime (player save data)).
I have minimized the amount of classes needed to get these entities. (mind you this is not 100% correct and doesn't have all the data just yet). It does give an impression of what I'm trying to achieve though.
For the localized version, I'm using a few databases. This is essentially a class with a static getter and a dictionary for the items in the database. I'm also using scriptableobjects to manage gameobjects (such as weapon models).
Based on this imformation I have 2 questions: How do I enter every weapon model and other models into these databases without too much tedious work (and still have a decent overview of what model matches with what ID).
How do I enter all my other data into the respective databases? Some items have information across multiple databases (referenced by an (int)ID). Again, without too much tedious work and still keeping a nice overview of the data.
I could enter the data via a custom editor although I am unfamiliar with this. I would need so adjust the editor for every subtype as well, plus this wouldn't give me feedback of what is in the list already.
I could also use regular C# in Visual Studio or Unity to convert the subtypes to a JSON-like string and convert add them to the database in Unity.
Another option is to already make a database and extract + serialize the data from there.
What would you suggest?
A big thanks for the long read and help in this matter!
I would use various .JSON to store all the data. But depending which platform the game is supposed to run, maybe consider building a database and querying the data that you need.
So in the end, it all boils down in which platform the game will be played, since database might not even be an option.
Win/Pc. I wouldn't make an ERD if I couldn't use a database now would I? And a database can even be used on mobile devices.
Although JSON is (somewhat) readable, the performance is terrible and it uses up a lot of space. On top of that it can't deserialize a dictionary with polymorphic data.
I'm not concerned about storage but more about how I'm getting the data into the game's files
Your answer
![](https://koobas.hobune.stream/wayback/20220613200825im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
An OS design issue: File types associated with their appropriate programs 1 Answer
Use a simple Database... 2 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Callback function cannot change game object status,callback function cannot change gameobject status 0 Answers