Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by Richard 16 · May 05, 2011 at 09:12 PM · databasexmlstatestorage

Best approach for storing complex data structures and tables (iOS and WebPlayer)

Hello All,

More of an advice request than a straight question. I'm working on a branching narrative implementation for an adventure style game and have started looking for the best way to store the data.

I have:

NPC Dialog, Items, Collectables, Scenes and so forth all of which interlink. This would seem to lend itself to a traditional normalised database design, however I'm not sure how best to proceed..?

So far I've considered:

1) Have a web connection to a SQLServer database. Not too keen on this as it forces a web connection.

2) Use an embedded database such as SQLLite. Not too keen on this as it wont work on iOS (without a whole lot of work) and the web player wont read static files or allow me to ship additional plugin DLLs.

3) Use XML to store the data and (possibly) some kind of Linq -> XML to query.

Does anyone have any thoughts on this? Has any one implemented something similar?

Thanks in advance as always for any help.

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by loramaru · May 06, 2011 at 03:05 AM

Let me preface by saying, I've not done WebPlayer or iOS Unity work.

Have you considered using ScriptableObjects? You could make classes for each type of data you want to store and then just make assets for each instance you need. This way you don't have to deal with parsing the data into a format that can be used by your code since it already is. You also have you data in first-class assets and gain all the built-in Unity support for assets, including only including the ones that your scene actually references. You can also interlink directly from asset to asset (no need for name or id references).

Comment
Add comment · Share
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
0

Answer by 1337GameDev · Feb 13, 2013 at 05:14 AM

I think the XML would work, and is easily expandable. You could also implement some kind of hash table (to retrieve objects quickly) once the file is local.

If the data is on an external server, can't you just download it to the local client and then access the file? You could the have unity read in the file into a hash table.

The only downside to hash tables is when you get over half full of elements (as more collisions and iterations occur), and when the hash table needs to be resized. Otherwise a hash table is super efficient on retrieving data. So in this case, just store the data into a hash table (which is most cpu intensive part of the procedure) and then retrieve the information during runtime.

Comment
Add comment · Share
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

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.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

Where to store data about location 0 Answers

How to store profile data in unity with firebase 0 Answers

Store item images in database or on device? 0 Answers

Custom Editor Window to Create and Store Item Data 1 Answer

Data Storage 5 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges