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 Althaen · Nov 20, 2012 at 03:25 AM · databaseitemsmanagementstatistics

Storing item information in a game

Probably a noob question to ask but anyway:

If I wanted to store the information of every item in my game how would I do this? Some sort of database with all the information of each item and then reference it whenever it needs to be accessed? (when the player picks up/crafts something)

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by kromenak · Nov 20, 2012 at 04:01 AM

It depends a bit on how you plan on structuring your game, and what kind of game it is.

If you have graphical representations of each item in your game (and this isn't a network-heavy game), you might as well store this data with the graphics in a prefab. This way, your game objects and all values that represent them are encapsulated in a single location. If someone selects the "Cherry" prefab, they can place it, modify the graphics, or adjust the properties in one place.

If there is not a representation in-game (abstract representation of items or something), then it might be better to store this data externally in some sort of database. I'd use the term "database" lightly, since you could simply use text files with some type of formatting, whether that is key/value pairs, XML, JSON, YAML, whatever. There are a lot of benefits to plain text files: they are simple, light-weight, and anyone can edit them.

However, it would be possible to do some SQLite bindings and actually store this data in a database...might be overkill for your needs though. If you are storing all the item data on a server and want people to access the server to get properties, then using MySQL for item data would be totally appropriate.

So...depends a lot on how you want to structure your game. If you are new to Unity and plan on making a single player game of some sort, option 1 is the best way to get started.

Comment
Add comment · Show 1 · 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 Althaen · Nov 20, 2012 at 07:10 AM 0
Share

Hmm I'm thinking about at least attempting networking just as a learning exercise. People would need the properties of certain items and I plan on having lots of items with physical representations for crafting, trading and whatnot.

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

10 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

Related Questions

ScriptableObject List doesn't save 1 Answer

Keeping item database 1 Answer

Working with Items and Class Inheritance for an RPG Item Database 1 Answer

How to make a copy of the data 0 Answers

How would i make an item database? 1 Answer


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