Becoming a Game Developer – Lessons 3 through 6
Date: 8/24/2005
By: Kurt Knudsen

The reason I haven’t written about these sections until now is because, to be honest, nothing much has happened since my last journal edition. Sure, a lot has been learned and I’ve even taken an exam, but it mainly covered syntax and proper usage. It is hard to showcase what I’ve learned thus far because, technically speaking, I can’t really accomplish much more than the drawing of a bunch of cubes. However, the lessons themselves cover a great deal in terms of depth, which I’ve mentioned already, and they certainly endeavor to get their progressive points across as best as possible.

Lesson 3 introduced me to the wonderful world of COM. If you’ve ever tried to learn DirectX then you probably already know about this. The Game Institute’s explanation of COM is, quite simply, the best I’ve ever read. Many related reference books willingly introduce the concept, but then fail to explain it in detail for fear of losing the reader amongst the inner complexities. By contrast, the Game Institute offers examples of COM and how to create your own module. After COM, I was introduced to the initialization of DirectX, which included back and front buffers, swap chains, full-screen and windowed modes, and the W and Z-buffer. The lab project for this particular lesson was the drawn execution of simple colored cubes. Instead of modifying that project I produced my own modification—which I’ll reveal to you a little later on.

In lesson 4 I learned how to query a device in order to see what it can do. It was all about surface formats, adapter formats, buffer formats, device creation and what to do when the user ALT+TABs or changes focus from the window. The lab project elaborated on the previous project to allow the user to select which video card they wanted to choose, what format the back buffers were in, and many other options. This lesson wasn’t all that difficult; it concerned syntax and new functions, and since there was no math involved it passed by fairly quickly and I was on my merry programming way.

Moving on to lesson 5, where I was shown a plethora of information. This lesson showed me how to render primitives with the DrawPrimitiveUP function. It also offered in-depth instruction on rendering states, such as Z-buffering, lighting and shading, and backface-culling. The remainder of the lesson utilized all of the freshly acquired information to actively show me how to display a scene properly using the DirectX functions. Again, this lesson was all about syntax and learning the basics of DirectX, and provided very little regarding tangible results.

Finally, in lesson 6, everything was tied together and, in turn, I learnt a new and very valuable tool—the vertex buffer. In previous sections I was using a slow and crude method for holding my vertex information. Lesson 6 showed me how to properly store vertex information, and later index information, in a buffer so that the hardware could go through it much faster, thus speeding up the rendering process. The transition necessary for using a vertex buffer was extremely simple and the lesson explained its implementation in a pleasingly painless way.

In lesson 6, two cubes were drawn and rotated, which is nothing especially challenging. The program then used a vertex buffer to hold the cube’s faces, and it was used twice to create the two cubes. There was no physical assignment for me to try directly, but I decided to make one up anyway. To challenge myself I decided to make a third cube and have its controls assigned to the user. I also decided to make the camera fully functional, as well as let the user choose the rotation of the cube. To download this project, please click here. Read the Help->About message box to view the controls.

Because all the programming information was stored in a vertex buffer it was then extremely easy to manipulate. The changes made to the program itself took less than 15 minutes to apply after looking up the required hexadecimal keyboard codes. I also manipulated the camera properly in this program, unlike my prior attempt. In the previous program I let Windows manage key presses, whereas in this program I queried the key state every frame, so its movement was notably smoother.

I feel somewhat as though I’m trying to teach a course myself through the writing of this section, but then it’s difficult to effectively relay what I’ve learned when I have almost nothing to show visually. These past few sections haven’t been easy, and the mathematical elements took their sweet time sinking in, but I definitely now have a better understanding of DirectX, certainly more than I’ve ever have before. At the end of lesson 6, the lab project rendered a height map, which looked absolutely incredible. I would have edited it myself but it offered a ton of functionality and, based on my accumulated knowledge up to this juncture, I was unable to really add anything.

Thus far, the Game Institute’s course is still surpassing my expectations. Personally speaking, the only thing I could ask for in terms of improvement—and I have—are more assignments. The instructor for the course duly revealed that this is definitely in the works for the future, but that other integral matters needed attention before the implementation of additional assignments. Furthermore, having students stretch out on their own motivation and challenge themselves showed necessary integrity and creativity—regardless of how mind-numbingly dull the final program was.

Aside from the lack of assignments, the course lessons have been spot on. The accompanying workbook is an absolute necessity at this stage because the textbook doesn’t cover a lot of the material in the programs. The workbook is something like a hands-on textbook and without it I would have been completely lost when the final projects were unveiled in lesson 6. The workbook thoroughly explains every piece of code and the theories behind them. In fact, the workbook is actually bigger than the textbook because it covers so much in-depth information.

The next few lessons should prove interesting as they cover some intriguing topics. I’m halfway through this course module, and by the time it finishes I hope to have gathered enough programming prowess to create something worth your downloading. The lesson plan for this course is available on the Game Institute’s website, so you can peruse what exactly is coming up in future coverage.

Questions and comments concerning this or any other journal entry can be sent to: Kurt (dot) K [at] GamersHell (dot) com.

Oh, and just in case you were wondering about my examination progress, I passed the midterm! :)

Until next time…

Note: The next edition might be delayed due to my final semester in college/work. Please be patient :)