Player Information File

Started by
4 comments, last by KulSeran 15 years, 7 months ago
What would be best used for player information such as ---------- -Username- -Password- ---------- ################# ##Player Slot 1## ################# Player Name: Player Level: Player Class: Player Inventory: ################# ##Player Slot 2## ################# And so on. I was going to use like a .dat file but I just like to get some information on what would be best.
Advertisement
JSON is really easy to parse and to generate.
{  players:[    {name:"BillyBob", level:13, experience:44123, class:"Ranger", skills:[]},    {name:"Cletus", level:9, experience:3785, class:"Ranger", skills:[]},  ],  graphics:{    screenMode: "1280x1024",    details: 3  }}

And there's no such thing as "best", FYI.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
The term "best" is relative.

On the PC, XML works nice. It is easy to use, there are lots of tools for it, and it is easy for programmers, designers, testers, and anybody else.

It is easily modified by end users, so be prepared for attacks. It is also fairly verbose and has a low bit-to-information ratio. If you want to obfuscate it a little bit, you can compress the XML and store it amongst other assets, but you should still expect it to get hacked.

On consoles, you'll have to serialize your data in a much more compact form.
When I say best, I mean the safest, Less Memory, easiest to use and reuse.

I understand there is tons of ways to do Player Information I just want some opinions on what to use.

I probably wont use XML for many reasons. One is security XML is too easy to get ahold of.
Quote:Original post by ARC inc
I probably wont use XML for many reasons. One is security XML is too easy to get ahold of.
Trust me when I say that this is not a valid reason to discard XML as an option. There are people out there who read hex dumps easier than we read natural-language sentences, and people with all the free time you could possibly be scared of.

The only way to keep something private is to keep it a secret. If you don't want it known, never let it out of your hands. Encrypting data just prevents transport-level middlemen from intercepting your data; the receiving computer still gets to do whatever they want with what you send them, no matter what you think you can do to prevent it.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
Also, WHY WHY WHY WHY WHY do you want to keep people from reading your data files? People play games that are fun, the MOD them afterwords. And games that can easily be MODed tend to be very popular. So what if people pull a "infinite money!" "god mode" "all items" or whatever type of "hack" to your game?

People mod games becauze:
A) just don't care about playing a game
B) find a good game mechanic and design decision frustrating because they don't see the merit of it (duct tape mod, I'm looking at you)
C) find a part of the game truely poor in design or balance, and want to mod it to something more in line with the rest of the game.
D) they see potential for a new game, and want to mod to their favorite story (starwars, WWII, zombies, future, fantasy, etc)

There are thousands of people who play a good game, and of them there are bound to be people who play for different reasons.
A) to get to the end
B) to enjoy a story
C) bought a "FPS" expected a FPS, or a "RPG" wanting an RPG, or whatever, and will insist on playing the game as such even if that isn't what it is.
D) with the express purpose of modding it
E) to enjoy the gameplay
F) .....

See my point? making it hard to get at said files (ie put them in an archive) is enough to deter most people from even bothering with it anyway. and for the people who do want to bother, everything is in a nice understandable format. Besides, why waste your own development time on something that makes it hard to edit files you are going to edit all the time? why waste time on a converter to some obscure format if you have to update the game, the source file, and the converter all the time when you make changes to your format?

You want people to not steal your files? register your copyright. Then people can't sell things with any of your files. (and thanks to abusive corporations, copyright is no longer protection of a profit market from others trying to sell the same thing, but "guarantee of profit" used to keep ideas safe from those who would freely trade them)
Quote:Original post by ARC inc
----------
-Username-
-Password-
----------
This suggests that you make an online game. If it's a solo game, then what do you need a password for :-)

So... security (in terms of "human readable") should not be a concern, because that data will be kept on your server. The user never gets to see it.
Your concerns should be security in terms of "data loss" and possibly "transaction safety". If you plan for 10-100 players, and you don't need 100% transaction safety, then XML or any simple flat textfile will do just fine.
If you plan for 50,000-100,000 players, use a relational database such as MySQL or Postgres. All those relational databases have the nice property that they scale a lot better and are much more error resistant than anything you could possibly program in finite time.

This topic is closed to new replies.

Advertisement