Sgt. Conker We are "absolutely fine"

5Nov/100

News from the XNA team

Steps to install XNA Game Studio 4.0 without using the setup bootstrapper, by Aaron Stebner

PDC talks available for download, by Shawn Hargreaves

XNA Content Pipeline Debugging (4.0), by Stephen Styrchak

XBLIG: 4.0 Submission Opens on App Hub This Friday, by Team XNA

'nuff said...

14Aug/105

Article: Derived Effect Classes in XNA 4

by Dave Carlile

One of the nice API changes in XNA 4.0 is the simplified syntax used when drawing with an Effect. In previous versions you would draw things like this:

effect.Begin();
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
        pass.Begin();
        // draw your stuff
        pass.End();
}
effect.End();

Now you can draw things like this, with EffectPass.Apply handling all the magic:

foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
        pass.Apply();
        // draw your stuff
}

Related to this is the new Effect.OnApply virtual method which gets called by EffectPass.Apply. By overriding this method in a derived class you can do things like perform pre-shader calculations and set shader parameters from properties. This is how BasicEffect and the other new standard shaders work, and it would be nice to be able to duplicate that functionality in our own derived effects.
Ideally we would like to be able to do something like this:

        MyEffect effect = Content.Load<MyEffect>(“myeffect”);
        effect.World = Matrix.Identity;
        effect.Color = Color.Blue;
        ...
        effect.Apply();
        ...

The first line is where we begin running into issues. In order to load a derived class using the content pipeline you have to write your own content processor, reader, and writer, for every single class. You might think that you could load an Effect instance using the content manager, then create an instance of your derived Effect class and pass in the code. Unfortunately, there is no way to get at the code in the Effect instance (okay, that is not entirely true, but this solution requires the full Game Studio install).
If you want to store the class properties (e.g. MyEffect.World, MyEffect.Color) as content then extending the content pipeline for each class is your best option. But what if you don't need to store the properties? What if you just want a cleaner interface to your shaders? Extending the pipeline each time for these cases seems like a lot of unnecessary work.

A Solution

This remainder of this tutorial will show you how to load any derived Effect class from the content pipeline without having to extend the pipeline for each class. To accomplish this we're going to create a content pipeline extension library that will compile the effect into an intermediate object that will let us get at the compiled code. We will also create a game library that will define the intermediate class so we can get to it at run time. And finally we’ll add an extension method that will do the work of loading our derived Effect class.

10Aug/100

Links, links, links!

We'll start with NemoKrad's BoundingBoxes in XNA 4.0

Next, Stephen Styrchak talks about Debugging the XNA Content Pipeline with C# Express Edition and a bug-fix for Debugging Xbox 360 Content

Bob Taco Industries has two blog posts, one about Turning a Solution into a Template for XNA 4.0 and one about Sizing Apps and Games Properly Using the WP7 Emulator

Xna Creator's Club Online released some new samples for Windows Phone and XNA Game Studio 4.0

And Shawn explains the new Dual Texture Effect

1Mar/100

Debugging the Content Pipeline : the real deal

Well that was quick: the Visual Studio extensions for debugging the content pipeline have been released!

20Feb/100

Article: Using XNA Content pipeline extensions for localization. (Part 2)

by Roy Triesscheijn

Recap

So… last time we made our strings localizable and added-in a new content manager. Today we are going to make all our content localizable, but first we should revisit and refactor “yesterday’s code”.

After publishing part one and having a good week to think about part two, I found that some of my design choices, which seemed nice, where actually at bit cumbersome.
Also the xml parsing (in BABProcessor) wasn’t as robust as I wanted it to be because I forgot about localized formats for dates and numbers.
Fixing our xml loading is easy, so let’s first fix that!

30Jan/103

Article: Using XNA Content pipeline extensions for localization.

by Roy Triesscheijn

Introduction

In this tutorial series I will show how to setup a simple Content Pipeline extension. At first it will be used to parse XML files containing text and their translations, in a part 2 we are going to extend our processor to also parse other xml files which contain data about localized textures and sounds. We extend XNA’s content manager to make use of all this extra data.