Saturday 23 January 2010

Compression & Encryption

Over the last few days I've cleared a couple of crucial items from the roadmap that I've been putting off for months.

For reasons that escape me now, XAGE Editor was using a different zipping library than the engine itself. Now everything uses the excellent SharpZipLib library, which has provided some decent space savings when it comes to publishing XAGE games to different platforms. This is how all versions compare in their distributable packages, in order of size:
  1. XAGE Awakener - Silverlight (.xap): 5.28mb
  2. AGS Awakener - Native Windows (.zip): 5.71mb
  3. XAGE Awakener - Xbox 360 (.ccgame): 6.44mb
  4. XAGE Awakener - Native Windows (.zip): 7.67mb
So as it currently stands, the Silverlight version is the smallest, and comes in at a paltry 1.8mb with the music removed. Whether these relative sizes will scale this way for larger games remains to be seen, but considering XBLIG's can be up to 200mb in size, the compression is more than satisfactory.

In addition, save game files are now also compressed, with a typical save for Awakener coming in at about 60k. Loading and saving isn't as snappy as I'd like it to be (particularly on Silverlight) as there's a lot going on in the background but it's never more than a few seconds.

In the past I've touched upon encryption. It's important to ensure all of a game's raw assets are protected from both casual inspection and more determined snooping. As the heavy-duty AES encryption wasn't supported on the Xbox & Silverlight, I've had to look elsewhere. I've now implemented a system I'm reasonably happy with, as everything is now locked away from prying eyes. This also includes save files, to prevent tampering.

Finally, Awakener now has only 49 script errors remaining. I said I'd be happy if I got it under 100. Consider me ecstatic if I get it down to under 10.

No comments: