What You Should Know Before You Knock on My Door


This book is written for programmers. Non-programmers could probably get something from the book too, but if you flip through the pages you'll see how much C++ code is included—you'll find plenty. The code is written in C++, so if you are a die-hard C programmer you'll have to at least be able to read C++ to get the most out of this book. If you don't know either language, you'll probably struggle a little with the code samples, but I'll bet you can get enough from the comments and the explanations to feel you got your money's worth.

All of the code in this book works under Visual Studio.NET, or at least it did when I copied it into Microsoft Word, which is how I wrote the book. I apologize ahead of time for making no attempt whatsoever to make sure the code worked in other compilers like CodeWarrior or GNU C++. I hope you'll forgive me. I figured my time would be better spent by covering as much technical ground as possible, instead of working on multi-compiler compatible code.

The code in this book also has a heavy Win32 bias. I'm a Win32 programmer, and I was a DOS programmer before that. I've had some brief forays into Unix on the Ultima Online server code, but I'm hardly an expert. Much of the code in this book assumes Win32, and I didn't change the code to support cross compiling into other operating systems for much the same reason as I chose a single compiler. It was simply better for me to cover lots of technical issues than for me to check my code under Linux.

As far as graphics APIs are concerned, I assume you'll use DirectX 7 for 2D graphics and DirectX 9 for 3D. As to the reasons for this, you'll read about that later because it's something of a long story. I don't have anything against OpenGL, of course, I'm just not an expert in the nuances. Basically, if you have a good working knowledge in C++, Win32, and DirectX you'll be fine. You don't have to be godlike in your skill, but you should be pretty comfortable coding in these areas.

If you are a complete newbie, and perhaps only know a little C++, don't feel dejected and don't return this book! I have a plan for you. Throughout this book I'll refer to other tomes of knowledge that helped me learn how to program. They can help you too, and use them in conjunction with the humble collection of knowledge you hold in your hands. With a little concentration you can boot strap yourself into programming prowess. I learned more about programming in C++, DirectX, and Win32 by looking at working code, of which there is plenty included in these pages for you to enjoy. Other than that, there are a few other things that you should be familiar with:

  • Pixel pushers like Photoshop or Microsoft Paint

  • The Standard Template Library (STL)

Pixel Pushers

Good programmers should be able to make their own art, which requires a working knowledge of bitmap tools like Adobe Photoshop or Microsoft Paint. Some of the code examples will require you to "res up" a bitmap for a texture or some other thing, and if you don't know how to do that you won't be able to run the example. Microsoft Paint is perfectly fine for this book, but if you want to get serious you'll want to get something like Photoshop.

In a real game company, it's also good to have some remedial skill with modeling tools like Maya or 3D Studio Max, but you won't need that for anything in this book. Luckily, DirectX has supplied some basic modeling tools, and we'll be using those in the 3D chapters.

The Standard Template Library (STL)

This book uses STL for common data structures. If you don't know anything about STL you'll see some good examples in this book, and I'm sure you'll be able to follow the code. I'm not attempting to teach you STL—something that is beyond the scope of this book. Instead, go read The C++ Standard Library: A Tutorial and Reference by Nicolai M. Josuttis. After you get your bearings, go read Scott Meyer's books on STL because they're fantastic.

STL is a body of code that is extremely well tested, has a widely understood API, and is available on almost every development platform. If you haven't seen it yet, stop reading right now and do a little research. You'll never have to write code for common data structures like linked lists, resizable arrays, and trees ever again. I've saved hours of grief using <list>, <vector>, and <map>.

Whatever happens, don't get caught writing your own linked list class or tree when STL would have worked. All implementations are extremely well tested. Every bug or implementation oddity has already been exposed and discussed on the Internet. Your own code, on the other hand, is not.




Game Coding Complete
Game Coding Complete
ISBN: 1932111751
EAN: 2147483647
Year: 2003
Pages: 139

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net