C# Database assistance

Hello unity members,

I’ve been looking over the forums, google and youtube to find somewhere solid to learn how to construct database’s for unity, subsequently I can’t find anything solid. Can anyone point me in the right direction?. I basically want a database where I can store game data, like players level, abilities, items, all game items (used for quests) all game info. Just a general database for a hack and slash game, and hopefully something that will show me how to make a save/load game from a database.

Many thanks in advance.

PlayerPrefs is the simplest portable way to do this.

Like Waz said, PlayerPrefs is the easiest way to store data on the clients PC. Next thing is what kind of data you want to store. Is it a multiplayer game or a singleplayer game?

For a multiplayer game you would need a server. The easiest solution is a webserver with SQL database and PHP support.

It is also depending on the used platform. You could use an SQLite database except for web- and flashbuilds since file access isn’t possible there. On all other platforms it’s possible.

In our upcoming racing game for tablets i use my SimpleJSON parser to save and load any data on the client side. It has builtin support for compressing the generated JSON string and optionally encode it as base64 for easy server communication. The current version won’t compile for webbuilds since it contains file-access routines. I will wrap those in preprocessor tags in a future version. However you can simply delete them or comment them out.

It’s also possible to save and store data as XML since .NET has XML support. There’s also a lightweight XML variant on the wiki.

When it comes to loading and saving whole scenes the great UnitySerializer might be a good choice.

In the end it depends on your exact needs for your special case.

Check Valentina Database. It has local royalty free engine, and Valentina Server. You can use any or both of these via “Valentina NET” ADK.
I should say this is fastest database I have see ever (it is columar). This is SQL and in the same time NON-SQL DB. Can be disk-only or RAM-only or mixed. Besides it works on mac and linux, can be used with other languages easy and can be used FREE in many cases

As Waz Said PlayerPref is best option for save player data in clint system / device. alternately we are used XML file (as like Bunny83 said) we used Serializable class to store and read data in / from users system or device and you can serialized in XML or binary format as you want. and using serialzing you not any extra plugin or package. you can achive it using directly from mono by using this namespace.

using System.Xml.Serialization;

or

using System.Runtime.Serialization.Formatters.Binary;

it’s very easy process.