A common thing that people want to do in their XNA games is to store data like high scores, game options, or even game states. There are a number of ways of accomplishing this. I have used many myself but my favorite is now to use XML serialization and XNA's Storage. The problem with straight XML serialization though is that it isn't secure. It is easy for the player to edit an XML file. There are ways to encrypt/decrypt the data to make it more secure. The discussion I want to start is how do my fellow XNAer's save data related to games?
Discussion: Saving Data
Page 1 of 15 Replies - 3604 Views - Last Post: 21 November 2011 - 02:15 PM
Replies To: Discussion: Saving Data
#2
Re: Discussion: Saving Data
Posted 19 November 2011 - 04:20 PM
I've used XNA storage with a serialized structure in my first Blockable game attempt and that is mostly for setting up the level data, but the only problem I've found is the lack of changing the storage location as it wants to use the default system for a Windows Storage Container which is in the Game Saves in My Games.
So being able to store serialized data in the content project would be my preference.
So being able to store serialized data in the content project would be my preference.
#3
Re: Discussion: Saving Data
Posted 20 November 2011 - 06:26 AM
If you want it to look more secure you can change the extension of the xml files after they are written, just change them to any extension. They will still open as xml files without trouble. The only trouble is someone with a bit of knowledge could just think to change it to xml, edit it and change the extension back.
#4
Re: Discussion: Saving Data
Posted 20 November 2011 - 04:02 PM
That is an idea but like you said it is easy to get around. Anybody serious about cracking your game would be using hex editors and such and would see the XML file for what it is right away. I've considered encoding/decoding strings using simple Boolean logic like XORing with a specific mask. It is very simple to implement but also easy to crack. Securing game data, in XNA or any platform, can be a challenge to overcome.
#5
Re: Discussion: Saving Data
Posted 21 November 2011 - 12:29 PM
I prefer to serialize my save data as well. However, rather than serialize the data to an xml file, I like to use a binary file, using the BinaryFormatter class found in the System.Runtime.Serialization.Formatters.Binary namespace.
The process is very similar to xml serialization, but since the file isn't human readable, it's a bit more difficult to edit (not impossible, though).
The process is very similar to xml serialization, but since the file isn't human readable, it's a bit more difficult to edit (not impossible, though).
#6
Re: Discussion: Saving Data
Posted 21 November 2011 - 02:15 PM
That is also a good alternative when it comes to saving data. Combined with some sort of encryption scheme it would definitely make things more secure. Thanks for adding that to this conversation.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|