- Home /
Storing data for 30+ characters. (Database, textfile, etc)
Hey geeks! I need help to find some solution to store a not verry big amout of data, for about 35 character. I have to be able to save information such as: a picture of the character, character name, how much the character has evolved at the level (Characters evolve when they complete tasks), and some short information about the character. Im not sure about PlayerPrefs
but iv'e heard that it only keeps that for one (1) game session. Corret me if im wrong! I need some ideas on how i can store this data locally. Brainstorm me!
Texfile, XML, SQL database, MS SQL, Access database are some options that im not sure if they work.
Cheers! //Tommy
Initial read though makes it seem like you want to store 30ish characters ( as in single character strings ). At least thats what I thought initially. $$anonymous$$ake sure to keep that in $$anonymous$$d when posting about characters and data =D
Answer by duck · Oct 23, 2010 at 12:55 PM
Yes, you heard wrong. PlayerPrefs preserves data locally between sessions, so its ideal for local save-game data, local highscores, etc.
If you need the data to be available and shared between users on different computers (i.e. a shared internet-based scoreboard or profile system), you'll need to look into a server-scripting and database based solution.
Okay, thanks for the answer! Is it possible to change the PlayerPrefs as you want it as the game goes? So i can select number of players, player name, how far the player has evolved etc. Possible?
Answer by StephanK · Oct 23, 2010 at 12:59 PM
You could use PlayerPrefs for it using a lot of values that are named like char35Name and so on. A better approach would be to use an external method like a database.
Basically you can use anything .NET, so you could write your own class for all the data handling.
Answer by diabloroxx · Nov 12, 2010 at 10:18 PM
Depends entirely on whether you wish to deploy it for Web or whether it is a Stand Alone game.
If it is for web, you could store the data in some Database (MySql) and send the data to Unity using the WWW class - Eg: http://www.unifycommunity.com/wiki/index.php?title=Server_Side_Highscores
If you want to send the data as an XML file, then you can use this forum post: http://forum.unity3d.com/threads/38789-Unity-gt-Php-gt-MySQL-gt-Xml-gt-Unity
For Stand Alone Games, you can write a Save file and use the File reader to access the file.
Answer by cristoph1 · Jul 19, 2011 at 02:06 PM
you can use Siaqodb http://siaqodb.com/?p=482, has very simple API, fast, small footprint, etc
Your answer
Follow this Question
Related Questions
Best way to display long texts 0 Answers
How to read data from a constantly updating xml server? 1 Answer
Information Panel // File Types // Remote URL Loading 0 Answers
store a gameobject ? 2 Answers
Do I need a database ? 1 Answer