XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

What methods are there to compress .xml data inside the program?

Last post 6/6/2008 5:34 PM by Narf the Mouse. 2 replies.
  • 6/6/2008 3:34 PM

    What methods are there to compress .xml data inside the program?

    I'm writing a TBS; the problem is that the save files are about 3.3 MB - And that's with turning the map data into string arrays. This is only practical because the data is very simple - I havn't done the same with units because I don't want to spend my time making a serialization for my objects, that's what the built-in serializer is for.

    I'm wondering if it is possible to somehow program it to auto-not serialize data that meets a certain prerequisite, such as being equal to the default?

    Thanks. :)

  • 6/6/2008 4:50 PM In reply to

    Re: What methods are there to compress .xml data inside the program?

    Have you thought about using the .NET binary serialization instead? It works almost the same as the XML, but saves out the data as just a binary file which can potentially give you a decent savings. I'd give it a shot and see.

    As for the XML issues, there is no way that I'm aware to have it not serialize out all the data if using the default. If you want that finely tuned you'll have to either create your own serializer or manually write out your XML data.

  • 6/6/2008 5:34 PM In reply to

    Re: What methods are there to compress .xml data inside the program?

    Thanks, that sounds useful. :) However, someone already pointed me at GZipStream, which gave me a compression ratio of at least 95% (3.0-3.5MB to 130-140kb for a 100x100 map), so I don't think I need more compression right now. :)
Page 1 of 1 (3 items) Previous Next