Archive for category Code

Curing the Clicks – Release Curves in XACT

Once I’d worked out that the clicking noises I was getting in Retrofit:Overload were not clipping but were caused by stopping the sounds, I expected it to be easy to fix in XACT. It was, really, but only after some puzzling over the MSDN docs and a false start or two.

To save others similar confusion, here’s a step by step guide to adding a release curve to a sound in XACT…
Read the rest of this entry »

Tags: , ,

SVG in XNA

Authoring enemy flight paths with SVG Beziers.

Scalable Vector Graphics (SVG) seemed an ideal format for authoring the enemy paths in Retrofit: Overload but it turned out to be much harder to parse than it appeared at first sight. Fortunately the open-source SVG Rendering Engine works very nicely for reading SVG files in our content pipeline. Here’s how we use it:

Read the rest of this entry »

Tags: , , , , ,

Easy loading bar for XNA

Here’s the loading-bar system that I wrote for Pegzo (also used now in Retrofit:Overload, although that loads so fast it doesn’t really need it).

Loading bars seem to be rare in community games and I think the approach I took is simpler than is often advised. This system is single-threaded and revolves around an enumerator function that looks something like this:

    thing = content.Load<Thing>("thing");
    yield return progress();  

    levelNames = content.Load<LevelNames>("level-names");
    yield return progress();  

    foreach (string name in levelNames) {
        levels.Add(content.Load<Level>(levelName));
        yield return progress();
    }  

    // etc.

You can download the source from here: Download EasyLoadingBar.