[Q]Best way to store player data?

Hi, i’m kind of new to the whole programming and game developing and I need some help/advise.

I want to make a game for kongregate.
I made a little game to try them out and that sort of worked oké.
So, I want to go further with my next project. My idea requiers me to store player date like level, exp, gold, etc.
My idea was just to put it in a database. But many people say that it’s not a really save thing to do.

So my question is:
How else can I store that kind of player data that is easy to access and adjust, and which is the best solution for it?
And does anyone have experiance with the Kong API? Is the Kong API to handle such thing?

  • SEG

Have you already checked out PlayerPrefs?

EDIT: Or you want to store the data centrally/globally for multiple players?

I want to store it online.

I forgot to add that it should be for a webplayer.

databases are awesome! use them :wink:

But people are talking about hacker problems if you use it with a webplayer.
But I could not think up any other way :frowning:

I think there are ways to safely (more or less) connect your Unity3D game to a database. if you know PHP and you use that to save everything (by using WWW to load up the PHP page and having that page’s PHP code take care of all the saving and loading and stuff), then you have all the security available from C# (if you’re using that) and PHP.

Edit: and nothing in the world is “unhackable” as far as I know, anyways. All you can really do is secure your stuff as much as you can and keep an eye on anything suspicious.

also keep backups in case you need to roll back and encrypt your user details

I was referring to the thing Akinon93 said, using PHP files (it’s as safe as it gets, i guess), which will communicate with your database, and WWW’s to use them in unity.

I’m using Drupal so I don’t really have to think about safety when connecting to MySQL and storing my values because Drupal handles it for me, but there’s surely a ton of info on the subject on the world wide web. :slight_smile:

I’m making a Diablo clone game which eventually will store its player data in a MySQL table. I will do it as it is explained in the link above. Will probably need to serialize the data before you send it as well. The cool thing then is that you can have a singleplayer game that feels like it’s multiplayer because I will make a frontend in Drupal where you can compare your character and gear with other people also playing. Comparing gear is what Diablo is about anyway so I think it will be fun. :stuck_out_tongue:

I’m stadyng C# and I need to know about camera
Movement using directX

Thanks for all your advises, I’m currently using the PHP method (I’ve read a book about PHP a while back so I know some stuff about that)and it actually works pretty fine. I’m not that good with securing it, but that will be just another thing to learn right?

I hope I get this done and make you people addicted to my game!

If you have a lot of data to save then save into a text file and save only the path to the text file into the database and load the text with www class then start splitting all the data .

Well, I wanna save player accounts. So they only really have to load once, and do not really have to contain a lot of data.
And only at some points in the game I have to find a little bit of data and change it, so I think finding that in a database should be easiest.

I dont see how things in database could be hacked. By default MySQL doesnt open itself to the world, is just listening to 127.0.0.1 or localhost.
Also the php script you use to manage data in database can be made to check for the referrer and drop any other requests outside unity webplayer. Since the only way to communicate with that php is through your webplayer, there is no need also to use any check on the user submission, because the data you are going to send are generated by the game.

But if you are going to allow the player to submit data (like username or password, generally speaking text boxes) in which they can write malicious code, then you should learn about sanitizing user input in php and sql injection.