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 Tobias · May 24, 2010 at 09:25 PM · savedatabase

Best method to store files ?

Hello Im making a trading card game.

What would be the best way to store the decks my user created?

  • Database (mysql) but needs sql server
  • Txt file, hard to read/write.
  • XML (Couldnt get it work)
  • Other ways? ...

Thanks

Comment
Add comment · Show 1
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 straydogstrut · May 24, 2010 at 09:34 PM 0
Share

I don't know about the best way, but another way to store data (and the built in way in Unity), is to use PlayerPrefs, though that might not be best if you want to share decks, and there's a 1$$anonymous$$b memory limit in web apps: http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by qJake · May 24, 2010 at 09:33 PM

Without knowing what type of data it is (exactly), it's hard to say.

You'd probably be best off using a file or series of files, and using the Application.dataPath property to know where to read and write your files to (excluding the web player).

And I'm not sure how you think a text file is "hard to read and write"...? Just use the File.ReadAllText method to read the file into a string, and then use its corresponding method, File.WriteAllText(), to write the text back to the file.

Comment
Add comment · Show 2 · 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 Tobias · May 24, 2010 at 09:38 PM 0
Share

Thanks for the reference.

I mean hard to read and write because when I read a text file I have a large string.. and then? How can I read informations from that? (Like splitting the string in thousand parts)

avatar image qJake · May 24, 2010 at 10:01 PM 0
Share

That's called string parsing, and everyone has their own way of doing it. You need to devise a protocol or something that you can use to read and write the data to/from your text file. There isn't a "right" way to do it, you just have to do it your own way.

avatar image
1

Answer by Adrian Love · May 25, 2010 at 02:20 AM

What is a trading card game without opponents? Where do opponents come from if not the internet, Do yourself a favor and learn / setup the MySQL database now. You don't have to buy one from the internet or anything, just run one locally using an easy web host kit like XAMPP or WAMP.

MySQL isn't as complex as it seems.

Comment
Add comment · Show 3 · 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 Tobias · May 25, 2010 at 06:23 AM 0
Share

First I was thinking about LAN/Single Player.

I dont have problems with $$anonymous$$ySQL I know how to set it up, creating database and tables and optimize them.

But I have problems with connecting Unity to the $$anonymous$$ySQL Database.

Anyway thanks for you reply

avatar image Adrian Love · May 25, 2010 at 06:47 AM 0
Share

Hey man, that's cool. It sounds like it could be done really well with some love, be sure to advertise if you get something together.

avatar image Tobias · May 25, 2010 at 07:13 AM 0
Share

Hehe I hope so Adrian. Ive just got mysql connection working :D I forgot to add the mysql dll to unity.

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

No one has followed this question yet.

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Setting a mesh's triangles and vertices from file causes distortion. 2 Answers

Playerprefs behaviour in unity3.5 0 Answers

Can someone help me fix my Javascript for Flickering Light? 6 Answers

Setting Scroll View Width GUILayout 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