Why all the XACT hate?

XNA has been out for a few years now, and I still don’t understand why people seem to dislike XACT so much.  After I started working on some of the audio for an upcoming presentation, I was reminded just how powerful of a tool it is.  I mean, I guess I understand the allure of the super simple audio model offered in XNA 3.0.  For simple projects it’s definitely a lower barrier to entry. 

But here’s one problem I see with it … I can almost guarantee that very few people will use XACT once 3.0 is released.  Considering that I do not see very much community involvement from the XACT team, or any individuals (where are the xact tutorials, where is the xact team blog?), I fear that an atrophying user-base will kill the project for future releases.

Much of the feedback I see about XACT seem to mimic a lot of the negative feedback of the content pipeline.  Thankfully, the XNA team hasn’t given in and allowed runtime loading of content files.  The second they enable that is the second that 99% of people move their projects to import/loading everything at runtime (and thus, introducing longer load times into their games).  By limiting that choice, I believe they’ve done the community a favor because at this point, lots of people are very familiar with building custom content pipeline extensions.

so I guess what I’m trying to say is, if you’re an XNA developer … fire up XACT, and give it some love :-)

ps. I suppose this would be an ironic time to announce that once I upgrade Scurvy.Media to 3.0, I’m going to experiment with automatically importing the video’s audio stream using the new SoundEffect/Song APIs :-P

Comments off

XNA Presentation

I’ve mentioned this already to a few close friends, but figured I’d post it here for posterity. I will be giving the presentation at the August ONETUG meeting. The topic?

Software development is about constantly learning, and developing your skills. Each new technique, or novel solution to a problem improves your overall effectiveness and value as a software developer/engineer.

XNA Game Studio can help you experience those new techniques and solutions by exposing you to a different world of software engineering problems. If you embrace game development as a hobby, you *will* become a better programmer, and this session will show you how.

I’ve already got the presentation in development … pretty excited to finally be talking to the locals about some of the stuff that has had so much of my focus for the past year or two :-)

Comments off

XBox and the Case of the Mysterious Color order

I’ve been meaning to blog about how I finally got the lastest build of Scurvy.Media out the door. Those of you keeping track at home will remember that, though the previous build shipped with XBox platform support, the colors of the videos were unfortunately very “off”.

After a large amount of experimentation, and tons of help from the guys over on the #Xna IRC channel, we were finally able to figure out the problem. To explain the solution, I must first explain a tiny bit about the architecture of the Scurvy.Media content pipeline.

  1. Decode each frame of the video as individual textures. The pipeline currently only supports AVI video using the AVIFile library from CodeProject.
  2. Write the contents of each frame sequentially into one large .XNB file through the content writer.
  3. At runtime, open a stream (and keep it open), and read each texture one at a time in a separate thread.
  4. use .SetData to set the contents of a texture based on whatever the current Frame is.� Technically speaking, there are two textures at play for the purpose of double buffering … but that’s largely irrelevant to the topic at hand :-)

So the confusing part was that the code ran perfectly on windows, but on XBox the colors were all messed up.

Now that I’ve explained the architecture, I’ll explain the solution to one of the issues.� Mainly, it’s the fact that the color order on the xbox platform is *different* than it is on windows.� Why that is I don’t know, I wasn’t able to find very many sources of information on this, but c’est la vie :-)

XBox:

  • RGBA

Windows:

  • BGRA

To get around this problem, I simply had to transpose the color channels as I imported the video when compiling for the xbox platform.

byte[] xpix = new byte[pix.Length];
for (int i = 0; i < pix.Length; i += 4)
{

��� int first = i, second = i + 1, third = i + 2, fourth = i + 3;
��� xpix[first] = pix[third]; //x=red
��� xpix[second] = pix[second]; //x=green
��� xpix[third] = pix[first];//x=blue
��� xpix[fourth] = pix[fourth];//x=alpha�
}

b.SetPixelData(xpix);

the code snippet above takes a byte array that uses four bytes per channel.� And it just puts it into a copy of the byte array.� Technically, I could have used the same array and just rearranged the byte values as I go … but perhaps that’s an improvement for another day.

But Avast! There still be problems on the high waters!

After making that change, the colors were still not right.� What we eventually realized is that I was writing byte data directly from windows (who’s x86 architecture is little-endian), to be read from the xbox (who’s powerpc architecture is big-endian).

Sooooo … the answer was this:

byte[] xpix = new byte[pix.Length];
for (int i = 0; i < pix.Length; i += 2)
{

��� int first = i, second = i + 1;
��� xpix[first] = pix[second];
��� xpix[second] = pix[first];
}

output.Write(xpix.Length);
output.Write(xpix);

Right before writing the byte array to disk … I flip every other byte.� Once I did that, the video was alight with correct coloration :-)

Again, a huge thanks to the guys on the #xna IRC channel.� This wouldn’t have been possible without them.

Comments off

I’m @ ]InBetween[, where are you?

Writing this from the Orange County Convention Center’s “OpenSpace”.  hanging out with the rest of the central florida .NET Geeks:

http://www.devfish.net/articles/inbetween/

You should at least try to make it before the end of the day so you can get a badge and make it into the after-party at Destiny Nightclub :-)

Comments off

Scurvy.Media v0.7.2008.0525

  • Fixed the XBox support so that videos that play with the right colors.
  • There are now two different versions of the pipeline assembly (Scurvy.Media.Pipeline.dll). One for each platform. This is because the color information must be manipulated differently when compiling a video for the xbox.

known issue: compiling a video with compression will produce a distorted video. This issue is under investigation, and will ideally be fixed for the next release.

Comments off

New XNA Site Online

http://creators.xna.com

Now you can submit games (assuming you have a subscription) for the community to play.  Can’t wait to see what awesome games come of this.

Comments off

XNA Development on an iMac?

A bit of a misleading title to be sure :-P but I have a penchant for appreciating weird distributed setups.  I installed the windows RDP client on my wife’s new iMac, and am using it to connect to my laptop, which is then used to deploy XNA code to my xbox.

Hurray TCP/IP!

Comments off

Game State Management Designer

Ahh the power of tooling.  Could this be the beginnings of “Microsoft Visual Game Studio 2010: RAD Edition“? :-P

But seriously … I think there’s a lot that can be done on the tooling side.  For example, it wouldn’t be too far-fetched to imagine creating a custom UITypeEditor for your content pipeline processors that spin up an XNA Graphics Device and let you edit in real time resources like heightmaps, shaders, or maybe even let you preview model material changes in real-time.

Cool Stuff :-)

Comments off

Minor update checked in

checked in a few relatively minor items to the Scurvy.Media library:

  • Importer now throws an exception if the .avi file is readonly to avoid any confusion over why the import won’t work.
  • Video now has an “End” event that is raised when the video reaches the final frame.  This can be used in cases where you need to know when the video has come to an end (like an Intro video).
  • Improved the video streaming code to read fully into the byte array buffer.  Before, I was just calling .Read on the stream, which is not guaranteed to read the full amount requested.

Comments off

Scurvy Media Logo Contest

So I’m really interested in finding a really good logo for the Scurvy.Media library.  Ideally, it would work in, or at least be related to the Scurvy Bones logo:

scurvy_logo_big

But that’s not a requirement.  I won’t go into the properties and virtues of a good logo, since if you’re the kind of person that could come up with a great logo, you’d know them better than I.  Though if I had to give any direction (aside from the scurvy bones logo above), I’d say that I really love farseer’s logo:

FarseerPhysicsNoBorder430X260

It’s so simple, and iconic … and explains exactly what the farseer physics library is all about.

What will you win?  aside from my undying gratitude … the winner will be forever recognized (with a link and info on any scurvy media distribution site) as the logo’s designer.

:-)

Comments off