Targetting Xbox platform

Topics: User Forum
Dec 16, 2006 at 4:32 PM

I'm interested in trying out the XNA animation component library on my Xbox 360. I've already written and deployed programs on my Xbox that display unskinned meshes using the default rendering stuff in XNA. I've also had no problem running the SimpleDemo (that displays the animated bear) on my windows machine.

The main impediment to running SimpleDemo on the Xbox seems to be the assembly for the content pipeline. Specifically, the Xbox platform doesn't have content pipeline assemblies :( I've strated to make a non-content version of the library for use on Xbox by ripping out all the content pipeline references, but I'm not sure if I'm going about this in the right way.

Anyone have guidance for this? Maybe some simple changes or property settings I can use? I'm afraid I'll probably end up putting in a bunch of #ifdef XBOX wrappers all over the place.
Dec 16, 2006 at 4:47 PM
Support for running it on the xbox will happen over the next couple of days. Basically it is a matter of making classes outside the content pipeline similar to the AnimationContentDictionary/AnimationContent/etc. This removes the dependency on the content pipeline dll.

Also, I'll be adding support for precomputing the animation interpolations to 60 fps in the pipeline rather than when the game starts within the next few days.

I'd do it today if I wasn't busy :)
Dec 16, 2006 at 5:32 PM

Excellent, thanks for the info. I'll try generating some models till then :)
Dec 17, 2006 at 3:53 AM
I split up the project into two parts: files in the content folder and files not in the content folder.

It should work on xbox now.
Dec 17, 2006 at 1:07 PM
Hmm... well, it still will probably not work on xbox because of how basicpalette effect is compiled. I'll have to think about how to make that compile correctly for xbox and windows.
Dec 17, 2006 at 7:50 PM

Yeah, I tried to remove all the content-pipeline specific stuff and got stuck at BasicPalletteEffect, which is when I decided to post here :P

Does it look like a problem that I can solve just by #ifdef'ing out certain chunks of code? I thought about doing that but I haven't figured out the overall architecture yet.
Dec 17, 2006 at 8:44 PM
No, #ifdef won't help because the basicpaletteeffect is compiled in the processor, and then the byte code is written. The problem is that you can't compile it to xbox 360 byte code; you have to use the content pipeline effect loader.

I guess the solution is to write an external reference in the paletteffect writer, and read an external reference in the reader.
Dec 18, 2006 at 4:27 AM

Thanks for the quick fixin' there. I got the modelviewer to build successfully in an Xbox Game project, but I haven't quite gotten it to deploy and run on the xbox yet. Some problems:

-The shaders built in BasicPaletteEffect choke when I try to compile them using Xbox360 as the target platform. Specifically, the value of output.w in TransformPixel is sometimes unitialized, and it runs out of constant registers. I fixed these problems by

1. adding "output.color.w = input.color.w;" at the end of TransformPixel, and removing the identical statement right above it, inside the else block.
2. reduced the PALETTE_SIZE to 32 (from 56). I dunno how big I can make this and still have the compile work, but 32 bones seemed like a good number for now.

-The Xbox System assembly has no SortedDictionary (!!!) I switched to SortedList but have not verified that it produces the same behavior (it should)

-Removed MouseState from the modelviewer. At some point I'll try to write up code to use the Xbox360 controller.
Dec 18, 2006 at 7:53 PM
Thanks, this is very useful information.

As it turns out, for political reasons, I won't have creator's club till a week from now, so I won't be able to test anything directly on the xbox till then.
Dec 18, 2006 at 8:24 PM
And 32 bones? :(

People have been sending models with 100+ bones and asking to animate them

Looks like I'll have to go back to the shader 1.1 days and split up the mesh into parts based on bones.
Dec 19, 2006 at 9:03 PM
Hey ghaussman, those changes you listed seem to me like they should make it work on the xbox. Any idea why it still won't run on the 360?