The book is organized into four
Part One—Game Programming Fundamentals:
Exposes some stuff that you'll want in your game programming toolbox, like a good random number generator. It also introduces the major
Part Two—Get Your Game Running:
You'll find your first meaty game code examples, including
Part Three—Building Out Your Game: The tougher code examples are in this section, such as 3D code, special code for Windows games, and some great debugging tools.
Part Four—Professional Game Production: This section shows what it's like to actually work on games, from scheduling to testing and finally getting your game out the door and into the hands of your players.
Throughout the book you'll see a few
| Gotcha: |
When you see this icon you'll read about a common mistake that I'm hoping you can avoid. Mostly likely, I didn't, and suffered the consequences. |
| Best Practice: |
This inset is something I do by habit, and it helps me avoid programming trouble. Usually, I learned these tips from someone else who taught me, and I'm passing on the good word. |
| A Tale from the Pixel Mines: |
Working in the Pixel Mines is slang for working on computer games. Since I've worked in the industry since 1990, and I'm a creature of observation, I couldn't help but bring a few tall tales to the book from my game industry experiences. Some tales are taller than others, but believe it or not they all actually
|
Most people that want jobs in the computer game industry have some interesting and completely wrong
Programming games isn't like other kinds of programming. It's not better or
In case you were wondering, it's all worth it. Either that or I'm just the type to enjoy repeated blows to the head.
When I accepted my first job in the computer game industry, my second choice was a job with American General Life Insurance. They wore ties. Their
Face it; there aren't many exciting programming jobs out there. The cool jobs fall into a few categories: jobs you can't talk about,
Here's my bottom line: It's cool to work on games. Games are as much art as they are science. I think that blending both
It's great to take a game design discussion with you to
Probably the best part of game coding is starting from scratch and allowing everything in your libraries to be refreshed and rewritten if necessary. At the end of a project you can't make drastic changes, and you are forced to live with some annoying hacks and hastily designed objects. When the project is done and you are starting the
If you work in the games industry people want to know about your company and your projects. They talk to you about your job because it's high profile. They want to know when they can play your game. Every now and then you find someone that
| A Tale from the Pixel Mines |
Never wear development team tee-shirts to places where nutty fans will hang out. I
|
Another category of people you come into contact with is the hopeful would-be game programmer. I enjoy these folks and I do everything I can for
| A Tale from the Pixel Mines |
One of the best programmers I ever worked with started out as a dedicated amateur. This guy was so dedicated that he rewrote a large portion of Ultima VII on his own time and actually made a fantastic graphics engine that had Z-
|
The best people are those
Most of your interactions in game programming are with other programmers. One big difference between the game industry and more boring jobs are that there's a significant portion of programmers that are self-taught in the game industry. That's not to say these folks are slackers by any shake of the stick. Instead, they tend to be
I wish I were a better artist. This is a skill that I admire to the point of wide-eyed
The most widely used SDK is DirectX from Microsoft. It provides APIs useful for creating game software. There are many more: SDKs for physics, SDKs for rendering 3D graphics, SDKs for audio, and SDKs for networking. One of these days there'll be an SDK for fantasy role-playing games or flight sims. You can't make a professional game without SDKs. You don't need all of them, but most certainly you'll use one or two. They boost your development schedule and give you some confidence that your graphics or audio system has been well
When I first started writing this section it was in my "The Ugly" section at the end of this chapter. I felt a little guilty about giving SDKs such a bad rap. After all, if they were really useless why do I use them on every project? The truth is that SDKs give you a huge leg up. They can also be a huge pain in the ass. SDKs are widely used, so they can't
What I like most about dealing with SDKs is having to
Games run on cool hardware. Well, most games do. I can't say that the Bicycle Casino project I developed for Microsoft exactly blew the doors off the hardware requirements, but the Ultima games I worked on sure as hell did. Many of the big budget PC titles are created on hardware that has yet to reach any serious market penetration, which means that the hardware manufacturers are constantly sending you the latest greatest stuff and even a tee-shirt every now and then. I used to return from a trade show with a whole other suitcase of hardware: video cards, audio boards, controllers, joysticks, and even virtual reality goggles. I think those days are over, but an established developer can still call any hardware company out there and get on their developer program. You don't exactly get truckloads of free hardware, but you do get a few
| A Tale from the Pixel Mines |
The developer programs
|
There are a wide variety of gaming platforms, and they never stop growing. For many years we only had to deal with consoles and desktops. Since 2001, games have popped up on handheld devices like the Game Boy Advance, Palm systems, and even cellphones. Even weirder, your digital cable set top box (STB) has the equivalent power of older desktop computers. I've
At the time of this writing, the big consoles on the market are Sony's Playstation 2, Nintendo's GameCube, and Microsoft's Xbox. Right now this battle is being won by PS2 which dwarfs the units sold of GameCube and Xbox. My analyst
Sony is making a big deal lately of adopting Linux as the development environment for the PS2 and future Sony game consoles. This is fantastic because I like stable, dependable, and standard development environments. Linux is exactly that, and will serve Sony well in the future. Developing software for the Xbox is almost exactly like developing for the PC. It's almost like developing under a cleaned up Win32 and DirectX 8, something desktop PC developers wish for every day. The best part of developing on the Xbox, or any other console, is the fact that you'll never have to worry about supporting a hellish grid of operating system and hardware configurations that are
Table 1.1 lists the various platforms that are leading the pack today. When you look at the hardware comparison, it seems pretty obvious that programmers will have the most fun on the Xbox. Not only is this platform the most familiar, but there is plenty of headroomin the CPU speed and system RAM. The graphics and audio chips support a wide variety of hardware accelerated features, and the stock hard drive and Ethernet ports are nice additions.
|
Platform |
Xbox |
PS2 |
GameCube |
|---|---|---|---|
|
CPU |
733 MHz |
294.9 MHz |
485 MHz |
|
Graphics Processor |
250 MHz |
147.5 MHz |
162MHz |
|
Maximum Resolution |
1920x1080 |
1280x1024 |
Up to HDTV |
|
Memory |
64MB RAM |
40MB RAM |
43MB RAM |
|
Controller Ports |
4 |
2 (4 optional) |
4 |
|
Media |
4x DVD-ROM (3.2–6.4Gb) |
5x DVD-ROM (3.2–6.4Gb) |
3 in DVD-ROM (1.5Gb) |
|
3D Audio Support |
Dolby 5.1 |
DTS in gameplay, Dolby 5.1 for DVDs |
Dolby Pro Logic II |
|
Audio Channels |
64 |
48 |
64 . |
|
Hard disk |
Yes - 8Gb |
Addon |
No |
|
Internet |
10/100 Ethernet Port |
Optional modem /broadband |
Optional modem/ broadband |
|
DVD Movies |
Yes |
Yes |
No |
Console development in general is pretty specialized. Developers that get approval to make projects for these platforms must either jump thorough some amazing hoops or they must have standout intellectual property. If you happen to have a favorite uncle on the board of directors of Electronic Arts, you'll be in a great position.
Handheld devices include the Game Boy Advance, cellphones, Palm, PocketPC, and a few others. With these devices, game programming is returning to its roots: clever game designs and efficient implementation. Back in the mid 1980s, classic Williams games like Robotron, Joust, and Defender were technological marvels and the game designs were a blast. The handheld devices today actually have more processing and graphics power than those old stand up machines, and programmers and designers are making games that return to these classic designs.
Screen sizes vary significantly. The GBA supports a palletized 240x160 display, Palm devices are 160x160, and cellphone screens are all over the road. CPU speed and hardware capabilities are also extremely variable. These limitations force you to return to the basics. Far from having a huge development team and server farm for pre-rendering action shots, if you work on these platforms you'll be able to fit your whole development studio in a minivan. It does have a certain appeal, doesn't it?
Desktop development gives you the very best hardware. After all, you can't find CPUs topping 2Ghz in the console world, and you won't find any TV sets that can support a 1600x1200 display at 80Hz. Desktops are always ahead of consoles for raw processing and graphics power. The console programmers will try to tell you that this stuff makes you lazy. They'll say you don't have to be efficient when you have a few gigabytes of virtual memory, and you don't have to be careful if you can publish a patch over the Internet. They'll look down at you and at the same time
This
You also have to find ways to support old legacy hardware while you make your game look good on the bleeding edge gear. The CPU delta can be nearly 10:1, and the graphics delta is
It makes you glad you can send patches over the Internet.
The game industry throws awesome tradeshows and parties. Find out for yourself and register for the Electronic Entertainment Expo (E3), usually held in Los Angeles in May. You have to be part of the industry to get registered, so if you don't have a game job launch a game review website and call yourself press. Everybody else does. The second most important thing to do at E3 is play the latest games and dork around with the latest console gear. E3 is a show for the retail
| Best Practice |
Throughout this book, I'll be including a number of "best practice" tips from my years of experience as a developer. I couldn't resist including this one for your first "best practice" dose. The most important thing is to scam party invitations from the in-
|
If you want to learn about game development, go to the Game Developer's Conference in San Jose, held in March. It's brutally expensive, but you'll find the cream of the game development crop telling willing crowds some of their secrets. Before you sign up for any of the workshops, roundtables, or sessions, it's a good idea to do a Google search on the speakers and get an idea of what they've worked on recently. Choose the sessions that have