LZMA Compression (Xbox360)

Mar 18, 2011 at 2:34 AM

Hey there,

 

My team has succesfully loaded LZMA content through the provided manager under Windows, but when using it under Xbox the following exception is thrown:

An unhandled exception of type 'Microsoft.Xna.Framework.Content.ContentLoadException' occurred in Microsoft.Xna.Framework.dll
Additional information: Error loading "plane". This file was compiled for the wrong target platform.


Any help is appreciate. Thanks for your time! :) 

Coordinator
Mar 18, 2011 at 8:31 AM

Did you check whether the exception is actually right?

If you LZMA-compress the content of an x86 build and attempt to load the same content on the Xbox 360, it will trigger this exception. I've never seen that particular exception raised in error, it was always my own build script that was in error :)

In case you have integrated content compression into your normal builds (eg. via the 'AfterBuild' target is msbuild), I'd suggest using two differently named .lzma packages (like, content-x86.lzma and content-xbox360.lzma) - one compressed from bin\x86\${Configuration} and the other, logically, from bin\Xbox 360\${Configuration}. That will ensure that .xnbs from different platforms will never get mixed.

My own workflow is to not compress content during development because deploying the .xnbs directly is faster than waiting for the compression to finish first. I only run the Nuclex.Game.ContentCompressor tool when I want to ship my game (using a working, tested development build, I compress everything in its bin\Xbox 360\Release directory, temporarily remove the project's content reference and add the .lzma package with "Copy to Ouput Directory" set to "Copy if Newer"). I added the allowReplacement option to LzmaContentCompressor to simplify that process.

Mar 20, 2011 at 1:05 AM

Everything has been sorted, our build script was indeed the errors.

 

Thanks for your time. :)