Tuesday, November 13, 2012

Leeds' Reads - Game Coding Complete

You know you wanna make a game.

Like all good kids, I loved playing video games when I was growing up. Mario, Link, and Mega Man all have a special place in my heart. But being a bit of a dreamer, simply playing video games wasn't good enough for me. I wanted to make them. And that's what got me into this whole computer programming business to begin with. I probably programmed dozens of homemade video games in GW-Basic and QuickBasic growing up, and, of course, gave up on many of them before they were done.

Although I'm not a professional game developer, I'm fascinated by the art, because it solves unique problems and pushes technological bounds as far as they can go. But most of the game programming books out there are introductory level only, and don't explain anything about the full architecture of "real" games. And that's where Game Coding Complete comes in!

Content of the Book

Mike McShaffry and David "Rez" Graham, the authors, begin the book with an honest look at the gaming industry, and quickly move on to a high-level discussion of the approach they take for overall game architecture, which splits the code into three main groups -- the application layer, the game logic, and the views. From there, they go on to dedicate an entire chapter to each significant subsystem of the game, including game initialization and shutdown, loading game content, handling input, audio, video, physics and collisions, networking, AI, and lots more.

Now, generally I don't read books that are longer than 450 pages. And on the programming shelf at Barnes & Noble store, a book that short is just hard to find. But, hey, my spare time is also hard to find, and I don't want to spend three months reading one book. Game Coding Complete exceeded my usual limit by almost twice as much -- just under 900 pages! But somehow, I felt like the pacing of the book really made it feel like the length was just right. Each chapter covered another fresh, exciting, new area of game development, so I never felt bored or exhausted. In fact, finishing each chapter made me feel like I beat a level in a video game. And after finishing the book, I went back and read most of the chapters a second time. And some a third!

Code examples account for probably about 25-30% of the book, and they're intertwined within the narrative, so I never felt like I was reading tons of theory followed by tons of code. It's mixed together in a way that you can understand the concept, immediately see it in action, and then read the reasons for applying the particular techniques used in the code.

Audience

This book is definitely not for beginners. If you're an intermediate level programmer, you should be able to follow along just fine, even if your experience resides mostly in non-game related programming disciplines.

The code is all written in C++, except for some scripting in Lua, and a touch of C# for a game editor. If you've worked mostly with memory managed languages, you'll probably find yourself scratching your head at some of the code. But for the most part, you should be able to track just fine.

Expertise

It's clear that Mr. Mike and Rez know their stuff, and they call out frequent gotchas when implementing each part of the game. I loved the Tales from the Pixel Mines sections scattered throughout the book, where they'd relate some war stories about hunting down particularly nasty bugs, and amusing anecdotes pertaining to the chapter.

Since game development covers a broad variety of topics, they wisely chose to involve a handful of other authors to contribute to certain chapters, like the ones about physics, AI, and game editors. The same lighthearted tone is carried throughout these chapters, though, so although they were written by other authors, the writing style of the book felt seamless to me.

Grok the Code

Even with detailed narrative and exhaustive code examples in the book, I came away feeling like I wasn't 100% certain that I could Hit the Bits and make a beautifully-architected video game. I really needed to be able to sift through a fully functional game that utilizes this architecture. Thankfully, Mr. Mike provides this too, in the form of Teapot Wars, a small but complete game that he makes available on the companion web site. And if you're still stuck, the forums there answer just about any question you might have about the sample code.

Summary

Although it's a hefty tome, I can say for sure that this is the best and most comprehensive game programming book I've read. If you want to know what game programming is really like, and how it's really done, this is the book you want.

FTC 16 CFR, Part 255 Disclosure: I have no material connection to this book – I just think it's awesome.

No comments:

Post a Comment

Profile Picture
Dave Leeds
My Hobbies:
  • Programming
  • Cartooning
  • Music Writing
Full Profile