Jump to content

  • Log In with Google      Sign In   
  • Create Account

unity3d Storage/data files type?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Durakken   Members   -  Reputation: 532

Like
1Likes
Like

Posted 09 March 2014 - 07:09 PM

Is there a reason why I should go and mess with these other formats to save store data?

 

I basically need to make a monster list, their stats. how they level, when they get their abilities, and what those abilities are.

It seems to me that using a regular text file would work and from what I know would be the smallest file size...

 

So is there a reason to use mysql, xml, or whatever other format other than preference?



Sponsor:

#2 shadowisadog   Crossbones+   -  Reputation: 2522

Like
3Likes
Like

Posted 09 March 2014 - 08:20 PM

Each format and method of storing information has advantages and disadvantages.

 

Plain text files are simple but your generally looking at custom parsing code that is developed for your particular application. Using the format in other tools would mean developing a similar parsing routine in the other applications. XML provides a means to exchange data between tools without having to write the parsing routines yourself. XML is also less brittle then a plain text file (you can add data to an element without making large changes to the parsing code). However XML does make for larger files then a plain text file. There are some other alternatives such as JSON or YAML.

 

A plain text file or an XML file can be stored internally to your application as a database (you can convert the records). Databases allow you to perform a query to return information about your dataset. One example might be if you needed a way to return all shields that had a strength less than 50. In general relational databases are not often used in game development, except in some limited contexts. The general opinion seems to be that relational databases (such as SQL) are too slow for real time games. However some web games and multi-player games do use relational databases for persistent data.

 

How you organize and store your information matters when it comes to maintainability, interoperability, data processing/look up time, and persistence.


Edited by shadowisadog, 09 March 2014 - 08:34 PM.


#3 pkMinhas   Members   -  Reputation: 320

Like
1Likes
Like

Posted 10 March 2014 - 12:56 AM

Using XML with Unity is pretty easy. Refer: http://wiki.unity3d.com/index.php?title=Saving_and_Loading_Data:_XmlSerializer

In addition to the easy loading & saving, the stored data will closely resemble your class structure.



#4 Durakken   Members   -  Reputation: 532

Like
0Likes
Like

Posted 11 March 2014 - 02:47 AM

Thanks for the info

 

New Question - I am making a pokeclone game... so I need to make a file to list all the monsters, moves, and the leveling rates... Should I separate these into 3 files? 2? or 1?






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS