“Professional XNA Game Programming” by Benjamin Nitschke

Overall I liked this book. Like most books that are “first” on a subject there are a few small errors that reflect how the XNA Framework changed between early betas and the final release. This is just the facts of life when you buy the “first” book on a new technology given the lead times on books. Its just not feasible to rework a book extensively based on the final code and have the book come out “first”. Even with that disclaimer, this is still a good book for the game developer that wants to learn about the XNA Framework and write a single set of source that runs on Windows and on the Xbox 360. This book covers XNA Game Studio Express 1.0

This book is not a comprehensive reference to every class in the XNA Framework. As the author of such a comprehensive style book I can tell you that it takes much, much longer to prepare that sort of book and the book becomes so large that publishers become unwilling to publish it because of the high cost such a book would have. However, the XNA Framework ships with a set of comprehensive reference material that can be used to exhaustively explore every class. What Nitschke does in his book is to cover enough of the basics of the classes in the framework that you can see how to build a game that is reasonably fun while not being too complex. The fancier games of today have teams of hundreds of people (programmers, testers, artists and designers) working together to put them together. Don’t kid yourself into thinking that one book is going to allow you to creat World of Warcraft or something similarly complex. However, you don’t need to make something that large and complex in order to make a fun game. All of the winners of the “Dream, Build, Play” contest had relatively simple games that were fun to play. Tetris is an amazingly simple game, but it is incredibly fun and addictive to play! So start out small with your game and make sure you keep it fun to play and you won’t need a lot of complexity.

The book is divided into four parts: Part I: XNA Programming Basics, Part II: Basic Graphic Engine, Part III: Improving Your Game Engine and Part IV: Writing a Racing Game. Part I covers the basics of getting the XNA Framework installed and configured with Visual C# 2005 Express Edition. (XNA Game Studio Express 2.0 supports all editions of Visual Studio .NET 2005.) The basics of writing your first simple game (a Pong game) are shown. Along the way you’re introduced to the concept of unit tests for your game. This is not a “unit test” in the sense of Michael Feathers because the tests require a human operator to evaluate the results. However, in the context of visual rendering and sound playback, I don’t know of a good automated way to test these things. An automated test can validate that the correct sound file was played at an appropriate point, but it can’t evaluate the quality of the played sound. Only the human ear suffices for that sort of evaluation so far. Still, Nitschke’s gives the good advice of creating test harnesses for these portions of your game. Adopting this technique lets you evaluate these portions of your game code without playing the game itself.

Part II gets into the world of making more advanced graphic rendering. The author doesn’t spend much time explaining the theory of advanced graphics rendering, shader development, and so-on. So a good book on shader programming and graphics theory (i.e. why does bump mapping make a surface look “bumpy”?) would be a good companion to the beginning game developer reading this book. A basic rendering engine for 3D models is presented along with the use of shaders and FX Composer for shader development. Not much detail is given on all the aspects of shaders, as it is a subject for a book of its own. Enhancing basic shader rendering through normal mapping and full-screen effects are presented in subsequent chapters.

Part III elaborates on the basics of the game engine. Parts I and II concentrated mostly on output with simple input and sound effects. In Part III, the sound capabilities of XACT are explored in more detail. Player input and menu creation and navigation are discussed as well. The author explains how to design menus that will be functional on the Xbox 360 as well as the PC, since the PC has access to the full screen, while the Xbox 360 is designed for use with televisions which don’t display portions of the image near the edges. The final chapter integrates the knowledge of Part III into a scrolling shooter game.

Part IV presents a racing game that increases the complexity over the games presented earlier in the book. The racing track and landscape is generated procedurally from design data for each track. A simple physics simulation is presented for handling collisions and keeping the car on the road during the race. The final chapter discusses “modding” of the game and tuning it for performance.

Overall this is a good introduction to the XNA Framework with useful examples of simple games that can be written with the framework. Personally I got a little tired of having everything be described as “cool”, but that is a criticism that would apply equally well to the entire gaming industry and not just this book.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: