From: <ia...@co...> - 2005-03-02 20:37:53
|
>> Binary saves are a very, very bad idea: do I really need to explain why? >> Creating and reading XML for the saves is not difficult. >Please explain. It seems to me that the only thing you accomplish by >saving in XML is to enable players to cheat in multiplayer games by >editing the save file. Players can always cheat and edit a save file, making it a little less easy doesn't stop them doing (search for 'security through (or by) obscurity' for more information). You need a human readable format because it makes testing much easier, and bug hunting later much easier. It is also much, much easier to provide backward compatibility. Look at the problems Peter Nowak is reporting getting the new version of the Vassal/18xx to read his old saves. Java serialisation is great for live system-system communications, it is very fragile as a persistence mechanism because when you change the class signature, you find that you cannot load old saves. If your upgrade adds a new attribute, either your new XML reading code can cope with the absence from an old save, or you can easily provide a migration script for old saves. Let's not even get into byte-ordering issues different hardware classes. Basically, 'It's too much like hard work to do human readable saves' is lazy, and will land in a deep hole later, it's also just not true with XML as good libraries are freely available to do the hard work. It also means that someone else can much more easily write a tool that will work with your save files: e.g. someone might want to take a game log, and produce an animation of the map development. If your log is in a well-known, easy to read format, they'll just get on with it, and suddenly your project has more features. Keep it friendly for other people to work with you, and you'll get more friends working with you. Iain. |