Visual Basic Game Programming For Teens
From GPWiki
The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server. However, the GPWiki forums are still active! Come say hello. by MagicBobert As promised, I'll be writing a review of Jonathan Harbour's new Visual Basic and DirectX book. This book is literally hot off the press as I write this. It was released on January 4, 2005 and here I sit on January 7 with the book in my hands and the UPS packing material strewn across the floor. (Actually, it would have been next week sometime if it weren't for an inventory screw up at Amazon, after which they upgraded my shipping to two-day for free... ok useless info, moving on!) I'll be writing this review a little bit differently than most. Rather than read the whole book first, I'll be giving you a chapter-by-chapter overview and critique. I guess you could compare it to a very bizarre TV reality show about some guy reading a game programming book. However, I think it'll allow me to write a much better and more detailed review of the book. Not only that, but it'll get the review in your hands sooner, due to the sad fact that I am an excrutiatingly slow reader. So! That said... I read the first chapter this evening and skimmed through some of the book. Here we begin our journey...
Introduction Jonathan basically uses the introduction to cover what most programming books cover in their introductions: what you need to know, what programs and versions of those programs you'll be using, and if you don't know what you're doing where you should look for help. Jonathan goes over why Visual Basic and programming in general are a better choice than something simple like RPG maker and what you can learn by doing it the hard way. He also notes that he'll be using Visual Basic 6.0 (with Service Pack 6) to do the coding in the book. He also claims that he has verified the source to work in version 5.0 as well. The book will be using exclusively DirectX 8, no version 7, even though the premise of the book is creating a 2D RPG game. This was probably a good move because the only real thing that DX7 has going for it is the ease of using DirectDraw. Graphics, sound, input... everything is in DX8 in this book. A short section is provided with contact information should you have any questions while working through the book. Jonathan has a personal website at www.jharbour.com, something I never knew even after reading his first book, which is devoted to his books, games, life, etc. He has provides some forums there for assistance as well as provides his email address in the text itself. Finally, the intro is wrapped up with the cliche conventions explanation that appears in the intro to almost all programming books.
Chapter 1: Getting Started With Visual Basic Jonathan does a basic overview of game programming and why he's using Visual Basic. He also spends a good amount of time in this section telling the reader exactly how this book is going to be written and who it is intended for. Luckily, it looks like it was aimed directly at us, the users of the GP Wiki. Harbour explains that he's not going to teach you VB, nor is he going to go into DX theory. Instead he's going to assume you have at least operating knowledge of VB and will briefly cover DX basics in chapter 2. There is no discussion of the Windows API method of doing things (something he spent a great deal of time covering in his previous book) which is nice because it cuts out about 200 pages of info that's not that useful to people concentrating solely on DirectX. The size of the book is nice, only about 360 or so pages which makes it big enough to cover the details while small enough that it does not end up like the magnum opus that Harbour wrote previously. I am definitely liking the scaled back size. One of my complaints about his previous book was that it was so large that soon after I bought the book, the spine broke and so now I have two halves of the book with a couple free-floating Direct3D pages in between. This book is a much more managable size. Jonathan explains a lot about the importance of creativity, the trade of game design, and how he wrote the book to be used by hobbyists (us!). He then continues with basic instructions on how to load up the DX8 SDK and get it referenced to your new project in VB. Finally, he finishes up the chapter by giving us an overview of the RPG we'll be creating, with all sorts of information about the various character classes, game types, etc. The name is Celtic Crusader and it is set in old England/Ireland where your main quest will be fighting off the Norwegian Viking Invaders. He'll be using tiles and sprites from Reiner's Tileset.
Chapter 2: Your First DirectX Program Harbour takes this chapter to get all his readers up to speed on using DirectX Graphics in version 8. He presents some simple code to get DX8 initialized (some of the simplist and best-explained examples I've seen) to take the pace initially pretty slow but he picks up quickly. Some of the sample code may seen odd if you try to actually work through the code as it's presented (because it appears that he forgets to define a variable or two) but when you put all the pieces together at the end of the chapter the source works fine. He covers initializing DirectX, creating the DirectX and Direct3D objects, creating the primary display device, setting screen resolution, and how to switch between windowed and fullscreen mode. He also shows you how to load a bitmap into a Direct3DSurface8 object using the D3DX helper library. There are tons of tutorials out there on getting up and running with DirectX Graphics, but none I've seen are as thoroughly explained as this. He may not explain everything, but it was enough for me (a DX7 user moving to DX8) to understand and grasp what was going on. More advanced programmers could probably skip this chapter if they already have a decent handle on using DX8 in VB. |


