LCD response time

Regardless of whether you are developing for PC, Xbox 360, or Windows Phone, your game will most likely be viewed on some kind of LCD screen. An important characteristic of LCD technology is the response time, which measures how long pixels take to change color from black to white and then back to black again….


Why does ContentManager.Load or TitleContainer.OpenStream say file not found?

The simple answer is that the file you are trying to load must not actually exist in the location you are trying to load it from! And yet people sometimes get stuck on this error, unable to open their file and with no idea how to figure out why this is failing. I suspect this…


XNA book by my colleagues Tom and Dean

I have no idea how they managed to find time to do this at the same time as finishing up XNA Game Studio 4.0, but my colleagues Tom and Dean have written a most excellent book with the pithy title XNA Game Studio 4.0 Programming: Developing for Windows Phone and Xbox Live. Now in stock…


Isolated storage, Windows, and ClickOnce

You want to implement save games. You’ve decided to do this using isolated storage  (perhaps because you are targeting Windows Phone, or because you want something simpler than the Xbox StorageContainer APIs). But since XNA is so awesomely portable, you are also making a Windows version of your game  (perhaps you want to ship it…


Reading files in XNA Game Studio 4.0

The XNA Framework provides no less than three different APIs for reading data out of files. This table attempts to explain the differences, and thus help you understand which to choose:   Title Container Isolated Storage Storage Container Purpose Read content that was created by the developer and deployed as part of the game Read…


When WinForms met Game Loop

WinForms and XNA have quite different ideas about how a program should run. XNA assumes that games are always in motion, moving and animating. It constantly cycles around the game loop, calling your Update and Draw methods. This is convenient for most games, but wasteful if the program reaches a static state, because XNA will…


WinForms and the big red ‘X’ of doom

You are making a WinForms app. All is going well, until one day your custom control disappears. In its place you just see a big red cross: What gives? Let us back up to remind ourselves how exceptions work: If your code does something wrong (such as dereferencing a null object or passing invalid parameters…


Compressed vertex data

Compressed data is a great thing, especially when the GPU hardware is able to decompress it for free while rendering. But what exactly does vertex data compression mean, and how do we enable it? XNA defaults to 32 bit floating point for most vertex data. For instance the VertexPositionNormalTexture struct is 32 bytes in size,…


Compressed GPU data formats

Consider the flow of data through a typical game: Customer downloads game from Marketplace Game data is stored in the filesystem Game loads the data Data is stored in memory CPU or GPU fetches data from memory CPU or GPU does awesome cool stuff with the data Making the data smaller has benefits at every…


StitchUp: generating shaders from HLSL fragments

Back in 2004 I wrote an article for a book called ShaderX3 about how to tackle the shader permutation problem by automatically generating shaders from combinations of smaller code fragments. Now Tim has created an XNA 4.0 implementation of this same idea.  Sweet!  (not to mention very flattering for me personally 🙂