jwatte's picture

Drawing silhouetted characters behind smoke particle systems

A question came up on the XNA forums: "how do I draw the silhouettes of objects in red when they are covered by smoke?"

Here is my proposal on how to use destination alpha to do it:

0) When setting up the back buffer, make sure you get destination alpha:
  graphics.PreferredBackBufferFormat = SurfaceFormat.Color; // has alpha

jwatte's picture

Triggers in XNA games using C#

"So," you may ask yourself, "what if I figure out a way to detect that the player has hit a button, or stepped on a landmine, or entered a goal zone?

jwatte's picture

Can't get custom MFC CSettingsStore to work :-(

I want to implement my own CSettingsStore that stores data in a file in local application data, rather than the registry. (I note that the documentation claims this is a good idea from a security point of view, but I'm doing it for other reasons).

jwatte's picture

Making a sprite follow a path

A while back, I posted a simple program on the XNA forums that showed how to define a path, and then have objects follow that path. I figured I'd copy the code from there onto this site, for easy reference. The program below is a command-line C# program; you can compile it from the command line with "csc flypath.cs" and run it to test it out. Or you can copy the "follower" class from the middle, and use it in your XNA project. (The additional code, including the declaration of Vector2, is just there to make the test program work stand-alone)

jwatte's picture

Wavemix -- a simple command-line wave file mixing tool for Windows

Wavemix is a command line WAVE file mixer. It is somewhat intelligent about mixing
multiple channels and might even be able to re-sample various sample rates. The
source code is included (requires STK to build).

Usage: wavemix [/SR 44100] [/16] [/GAIN g] infile1.wav ... outfile.wav

Supports at most 19 input files and one output file.

jwatte's picture

XNA Creators Club game ratings categories

I realized that there is no available description of the different XNA game ratings other than on the actual game submit and review forms, which aren't easily found through search engines (and require sign-up and attempted game submissions to actually get to read). So here are an excerpt of the descriptions, as of 2008-12-18:

jwatte's picture

Ah, yes, GCC and MSVC... Or, two compiler bugs in two hours.

Why is it that seemingly every week-end project ends up in tears and teeth gnashing over broken tools, instead of sweet progress? Why do computer companies keep cramming useless features into bloatware, instead of just making what they have, actually work?

jwatte's picture

More PIX for Windows problems. This time, I think it's NVIDIA's fault.

It seems to me as if PIX for Windows, and its integration with the NVIDIA device drivers, has just gone downhill during the last year or so. I have a single project, which can demonstrate bugs both in the latest NVIDIA graphics drivers, and in the PIX tool itself.

jwatte's picture

Rigid Body Physics in C#

Let's assume you're trying to simulate a car driving on an uneven terrain (perhaps some sort of heightmap). Let's assume you know how to measure the distance from the car's chassis to the heightmap ground at any position (typically, measure the height of the heightmap, and subtract the height of the car at that point in the XZ plane).

jwatte's picture

Profiling an XNA game on Xbox

This code file implements a simple profiler for XNA games that run on the Xbox.
It allows you to measure the amount of time spent in different parts of your code,
and bins the different durations into statistics bins (so you can see if it's
"spiky" or even).

Syndicate content