Book Review: Programming Role Playing Games with DirectX, 2nd Edition

Discussion in 'Programming & Scripting' started by Haxalot88, Jul 1, 2009 with 0 replies and 525 views.

  1. Haxalot88

    Haxalot88 VIP VIP

    Messages:
    8,051
    Ratings:
    2,482
    There have been so many good reviews about this book, I decided to pick it up myself to take a look (I'm an intermediate game developer, the book is aimed at beginner-intermediate). Since I began game programming using OpenGL (seriously, to intialize opengl is just a few lines, and it's VERY nice and simple to use), I recently started using DirectX. I got the basics down on using the API, however most tutorials, and even books tend to teach you how to use THEIR specific way of doing it, usually in the form of some easy wrapper that they create for you, teaching nothing about the real thing (so you end up learning about their API, but when it comes to programming your OWN engine, you're left clueless). Of course, this was a quick read, but due to how many things I found bad about it, I thought it might be worth bringing up these issues (with such good ratings, and being recommended for the beginner by the gamedev staff, I just have to). So just a disclaimer: I am proficient in c++, pretty decent at the windows API (I didn't care to delve into actual windows programming as it's irrelevant to game programming), and I know my way around a good game engine, yet since I've used OpenGL, DirectX is still fairly new. Regardless, here's a few things I looked at.

    The first thing that came to mind as I read the first chapter was "this seems oddly familiar", as it is essentially a cut-and-paste from the first chapter of the first edition, only changing the few times he references the book name to "Programming Role Plying Games With DirectX, second edition". He provides absolutely no updates on this outdated and bloated section on setting up visual studio (even visual studio c++ 2005 makes most of this obselete and unnecessary).
    From there, he jumps directly into COM and a bit of poorly-placed primer on windows programming. This really confused me as to what went through his mind when he put this in such an odd place that really would confuse the HELL out of beginners (his target audience). Being someone myself who picked up this book so that I can learn DirectX for my game programming, I was quite perplexed at what he was exactly trying to say here.
    Then I noticed how most of his book is just a copy-and-paste from source that's already on the disk, with a few notes here and there. One example is when he tried to describe to the user about the application framework and why it's used. Once he's satisfied with the half-page description of the idea behind it (well technically the last 2 paragraphs are about how to find the exact same thing on the CD), PLOW and you have 3 pages of source. Not just any simple demos either, he's talking about a full windows application with message loop. No windows primer, and the only 2 things he describes in the entire source are a gist of how to use the CreateMainWindow function (ie two short sentences to describe what it basically does), and the RegisterWindowClasses function with a similar-sized description. After giving us this huge (did I say 3 pages? I meant 5 1/2) block with no real description of what it does aside from the short description of "This is a basic application framework, here's what it looks like and what it does." While the only real description of how to alter anything is that he so kindly put a few definitions at the top for you to change, leading to the code itself to be very unfamiliar and the *beginner* not knowing really what everything is really supposed to do. By adding insult to injury, he ends this section with "... it's your job to insert the code that handles the initialization of objects, loading graphics, preframe processing, and so on."
    Finally, I noticed an almost horrid state system. I am used to knowing them as "screens", but his gamestate system is the same concept. The thing that I hated about it so much was his stack system only allowed one state to be used at any time. This is fairly limited in practice. For example, if I wanted to place an inventory system *over* the game (ie it still renders the game, and if you wanted to make it fancy, parts of that game still update and render by using a gamestate enumeration to determine if it is paused or not), that's not viable with his current setup. In fact, if one were to learn from these limitations, it might make it more difficult to become accustomed to a more *proper* state system later on.
    Still, I would have to say this book is good for the beginner who has a good understanding of Windows Programming (the book practically skips that area and assumes you know a good bit of windows), and a fundamental understanding of c++, especially in the area that I see many people lacking in which is that of Pointers.
    There's defiantly more that I could point out that's wrong about this book, that I could probably double or triple the size of this post. I don't want to bore you, so feel free to discuss.

     

Share This Page