• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Ricewind1 · Jun 09, 2015 at 10:42 PM · c#importdatabasedatapolymorphism

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!

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Elisvaldo · Jun 10, 2015 at 08:14 AM 0
Share

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.

avatar image Ricewind1 · Jun 10, 2015 at 08:24 AM 0
Share

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

avatar image Ricewind1 · Jun 11, 2015 at 05:05 AM 0
Share

Bump. Still hoping for an answer!

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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

Burgzergarcade Why am i getting an error after re-importing? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges