Game Development Reference
In-Depth Information
Minidumps Rock
On The SimsMedieval, we ran multiple soak tests every night. This is where
one or more people ran the game and just let it simulate all night. If the
game crashed or threw an exception, a minidump file was automatically
generated. These files were all posted to a particular shared drive (along
with the PDB files) so that the tech director and lead engineer could sift
through them. We found and fixed a huge number of very difficult bugs
this way.
Another trick we used was that whenever the build machine created a new
build, it would save all the PDB files with it. If QA ever hit a nasty crash, they
could give us the dump file and tell us the build number. This allowed us to
pull the appropriate build (complete with PDBs) and load up the dump to see
exactly where they crashed.
There
s a simple and extremely useful class in the GameCode4 codebase called
MiniDumper that you can use to generate minidumps. You can find it in the
Dev\Source\GCC4\Debugging folder.
'
Graphics and Shader Debugging
DirectX, OpenGL, and consoles are all moving away from the fixed-function pipeline
and into the world of shaders. Shaders can be extremely complex and are a complete
nightmare to debug if you don
t have the proper tools. Fortunately, you have several
to choose from, depending on your particular hardware setup. Personally, I
'
'
m partial
'
to nVidia
s PerfHUD, and if you have an nVidia card, I suggest checking it out. If
you use DirectX, you can take a look at PIX, which comes with the DirectX SDK.
Since this topic uses DirectX, let
s take a look at PIX. You can find it in the DirectX
SDK folder. When you start up the program, you see an uninteresting blank screen.
Go to File
'
New Experiment, and you will be presented with a number of options.
One of the more useful options is
A single-frame capture of Direct3D whenever F12
is pressed.
When you select this option and run your game through PIX, every time
you press F12, the data for that rendering call will be saved. Once you exit the pro-
gram, PIX will show you all the frames you captured, and you can walk through the
entire graphics pipeline call-by-call and watch the scene being built before your eyes.
You can examine the various D3D objects, inspect the shaders, and even see the
shader assembly code that your HLSL code produced.
This is only the beginning. In the Render tab, you can right-click anywhere and select
to watch exactly how that single pixel color was built. You can see
every vertex shader, pixel shader, and Direct3D call that had any effect on that pixel
and see them applied in order. You can even debug the HLSL shader code directly!
Debug this pixel
 
 
Search WWH ::




Custom Search