Need some advice about storing data

I’m creating a rather basic role-playing game with a friend of mine that requires a bit of data storage and looking at some of the options (PlayerRefs, XML, Database, Text Files) I’m not entirely sure which will fill my needs and I don’t want to spend a lot of time doing trial and error here. Hoping for some advice and suggestions.

Basically we are going to be storing role-playing characters, forming a party of 6 characters each with their own statistics (Str, IQ, Agility etc…) various skills and various equipment (pretty basic inventory).

The hiearachy is.

Party : There can be multiple characters in any given party
Characters: There are multiple statistics, skills and equipment for each character.

PlayerRef was the first one I looked at but that seems to be more of a pretty direct system, I think given that there will be multiple parties of multiple characters with multiple additional attributes this doesn’t seem capable of handling that diversity. In particular since I will need to query this information on a pretty regular basis and updated it everytime their is a change.

XML seems like it might be a good choice but Im kind of a SQL guy and I find XML to be … harder to grasp.

Databases was my first choice and its the first thing I tried but their doesn’t seem to be any compatibility with SQL at all. Some people have had some success but so far I’m finding getting any of the reference libraries to place nicely with Unity scripts hard to acomplish. Im getting a lot of internal compiler errors after adding reference libraries, even when adding .dll’s directly to asset folders and various other advice I got on the topic. Has anyone had any success for example just getting straight SQLcompact to play with Unity? SQL is my bread and butter, if I could get that to work it would be extremly simple for me to use it in games.

Text files, again, seems like a lot of people have had a lot of trouble in this areas (system.IO) seems to have the same types of problems as SQL oriented libraries.

Anywho, any advice, suggestions, tutorials or links would be greatly appriciated.

I’m working on an RPG as well, and have to make a similar choice. In my case, if I save the player data locally, I plan to save it as XML data. If I save the data on a server somewhere, it’ll be on a mySQL server. I’ve done both (not together yet), and I don’t think I’ll be having much trouble with the data.

The nice thing about XML data is that it keeps things together in one location (rather than saving it all in playerprefs), and you will end up with a file (at least locally) that can be copied, edited or transferred to other locations (if you want the player to share the save data). The data is fairly nicely formatted with <> tags also.

I’m not sure about how you could get SQL to work locally or directly (if at all) I had to use a PHP interpreter for the SQL code.

here’s a link to the server side high score code that I used as a basis for my original SQL save game data:

I lost the thread link, but if you google Unity save game, one of the first unity answers will point you to how serializing data works. You’ll find ready to go scripts made by awesome people that can store any kind of data into safe, custom files that can be read later on.