PDA

View Full Version : Using XML to store character data


boaty
08-11-2008, 11:21 PM
Hi, I'm new to game design and I was looking for opinions on this matter.

Is it a wise idea to use XML to store character data? I was planning on implementing it as such: Use a simple GUI with which a player would select the desired features for his or her character. With C++, I would create an XML File which could then be used later to load the attributes of the character.

The only hookup I have right now is username and passwords. Could I name the XML file the same as the username and have the passward stored in the file.

Does that seem like a wise approach or should I research an alternative method?

Reedbeta
08-11-2008, 11:28 PM
XML sounds like overkill for this. You probably only need something simple like an INI file or even just a text file with one piece of data per line (in a predetermined order).

Storing passwords in plaintext is a very bad security practice. It's not imporant as long as you're just developing it by yourself, but if you want to have people use this, you ought to store only a cryptographic hash of the password. MD5 (http://en.wikipedia.org/wiki/MD5) is a popular cryptographic hash, and you can find numerous examples online of C++ code to compute it.

boaty
08-12-2008, 09:33 AM
Ahh, Ok, an INI file makes sense, I'll look at those a bit. Also, thanks for the MD5 link.