views:

675

answers:

10

I am teaching myself C++, and I am learning more of the compsci side of the issue, like data structures. I want to get into game programming (and, as a side effect, windows programming), especially 2d games (at this point, I really want to clone tetris, since that is my favorite game of all time). I do want to do 3d programming, but that seems unfeasible alone.

My question is, is it possible to learn from old books/textbooks? People have recommended "Tricks of the Windows Game Programming Gurus" (or similar), but that is almost a decade old. Has the gaming industry changed too much to learn from that? At the rate that computers change, it seems like teaching from a biology textbook from the age of spontaneous generation.

If it isn't possible, what are some good textbooks I can pick up to learn on today's software (I feel like it might be pointless to learn anything about DX9, when DX11 is around the corner)?

+9  A: 

it depends on the book. There's many old techniques that are still used today. On the other hand, there's many books that exist that were artlessly written to get someone quickly up and running putting something up on the screen in dos.

here's an old book with a timeless quality, with a small amount of archaic information: The graphics programming black book. http://www.gamedev.net/reference/articles/article1698.asp

The basic techniques haven't changed in decades. The main things that will have changed are faster hardware, parallel processing, and specific api's. But it's still useful, for instance, to know how to apply matrix math to create a 3D projection, and 3D transformations. It's still useful to know how particle simulations work. It's still useful to know some basic physics math, and the common techniques for computing them in real time. It's still useful to know how phong shading works. There's lots of things like that which haven't changed, and probably never will.

Breton
Thanks for the book recommendation. I need to learn some more mathematics, but I do understand what you mean - I believe Valve's title Team Fortress 2 made great use of phong shading to emulate its cartoon environment.
Hooked
+1  A: 

It depends.

It depends on your learning style. My learning style is highly adapted to books. But I know people that don't learn well from books and instead learn well from a little one-on-one and experimentation.

It depends on the book. Some books age so quickly that they irrelevant within months of release. Other books are timeless and have been valuable for decades (e.g. K&R).

It depends on your ambition. If this is something that you are willing to spend multiple hours on multiple nights per week you will likely be far more successful than if you can only find the energy to put in a few hours a month.

It depends on your background. Do you have a mathematical bend so that the mathematical concepts necessary for graphics programming will come naturally? You say you are learning C++. Do you have prior experience programming in other languages, perhaps one that is object-oriented? Not knowing these concepts could cause them to become distractions as you try to work through the core concepts of the book.

Good luck. I find few things more satisfying than applying self-taught knowledge.

Jason
I don't understand. Is C++ not object oriented?
Hooked
I believe he means "Will you be learning just C++, or will you be learning C++ AND object-oriented programming at the same time?"
Geerad
@Hooked: Geerad is correct.
Jason
I am learning both. I do know about classes, inheritance, abstraction, etc. I am still learning about polymorphism and operator overloading.
Hooked
+7  A: 

The industry hasn't changed that much. It's still flooded with bad books and programming advice and practices that went out of fashion in the 80's. :p

Seriously, what you need to do is:

  • Learn programming. Not game programming, but programming. Use a good programming textbook, and use whichever language you like. You don't have to start with C++ unless you have a desire to torture yourself. But learn general purpose programming. Write simple text-based applications, learn to express yourself in code and break any given problem down into pieces that can be programmed. (And that is basically timeless. )
  • And... that's it. Once you've learned programming well, you don't need any rip-off "Learn Game Programming In An Afternoon - by an Authentic Game Programming Guru" books. They suck.
  • Learn the necessary 3D maths: Vectors and matrix transformations, basically, and be prepared to pick up other bits and pieces as you need them.
  • Learn the necessary API's. That's fairly simple. You know programming, and the API's are documented. Whether you use OpenGL or DirectX, raw Win32 or some convenience library like SDL, it's basically just a matter of following the instructions.
jalf
What programmer isn't masochistic?
Hooked
Some of the first programs I wrote were games. Best way to learn programming is to program something that interests you.
Nosredna
@Nosredna: I don't think @jalf is saying he shouldn't make a game. I think he is just saying that his first few programs shouldn't be games (due to complexity).
Lucas McCoy
+1  A: 

Most things haven't actually changed all that much. Really, as long as you aren't reading up on rendering techniques from a decade ago (i.e. pixel shader 1 or tricks you can do with the fixed function pipeline), most of what you learn will be what is required for modern PCs.

For hobbyists games, you don't really need to worry about most of the modern innovations anyway, as the games probably won't be stressful enough (system wise) to warrant them. You should be able to get away with just learning DirectX 8 (yes 8, not 9) as it will allow you to do most rendering tasks you'll be after (to begin with at least). After you've got a grasp on that, you can start looking into shaders IF you need them, at that point, its best to look just learn D3D9, as it will still be supported by operating systems, even when D3D11 comes out. I'd only recommend getting into D3D10/11 if you need geometry shaders or better multithreaded support, but learning proper, efficient multithreading and design is a whole subject in itself.

Basically, if you do just want to make some fairly simple games (i.e. doesn't have to have awesome next-gen effects, complex sandbox worlds where everything interacts with everything or an MMO), any book published since 1996 should be more than enough.

Grant Peters
+3  A: 

Tetris is a great game to try, because the gameplay is irritating if you get it wrong. For instance, you need enough time to "slide" the piece over when it lands. It can't just "stick" or you won't be able to fill in space under overhangs.

Some of the old games are good. But the problem is that the really ground breaking game books were BASIC, assembly language, and C. (Computer Gamesmanship holds up well and it's language agnostic. But it covers board game AI, not action games.)

I'd say you're probably best off find good current game programming books, but picking up a couple old classics won't hurt because you'll still be learning approaches.

One of my goals is to program a game for MAME. I'll pick some cool arcade game that had a good processor (68000 maybe) and a great sprite engine (maybe with scale/rotate hardware) and do a game that fits the hardware.

There are still some people who write games for Atari 2600. You really learn some lessons there. The gameplay has to be fun because the graphics just flat-out suck. (RIP Jay Miner--no offense.)

Nosredna
A: 

Some of the old text are great. I personally learn C from the Absolute Beginner's Guide to C, by Greg Perry. Later on, his "Moving from C to C++" helps me to absorb OOP principles like inheritance, encapsulation, data hiding and most importantly polymorphism. Too bad those books are out of print now.

Extrakun
+1  A: 

Im going to suggest another way of learning programing, that can off course be merged with the once above. If you start out with simple server side plugins for games, you can do a lot of game mechanics and your semi forced to learn netcode. And when you have done that for a while join a full mod team, there are plent of mods out there. I would pick on that you think is fun to play and one that has other coders and is released ( so that you can talk to other more senior coders if you have issues, and your code is actualy used ).

The advantages of doing it this way instead of "make number XXXXXXXXX tetris clone" is that you get real world feedback on your creations. - A server administrator will not accept that the plugin you wrote makes his server laggy, and the same goes for a game mod.
- When you create a mod you can easly have 200k downloads, and you can have your code tested on large range of computers
- If your looking for a job in the games industri this will give you experience thats "valid" and its commen path for people going from mod community to paid job making games.

Because im from the Half-life community i would suggest making server side plugins or mods for those engines. I would also point out that valve controls around 90% of the online FPS marked, so if your after share number of users it might be the best choice.

Server side plugins for Valve games ( Can be either in c++ or in a scripting language simular to c++. This language is a good way of getting used to the C style syntax )
Moddb is a great site for finding a list of mods and what their status is.
Half life games can be found on steam ( with a full sdk )

EKS
+1  A: 

The problem with older games programming books from my POV is, that they are more about graphics programming instead of games programming, especially the mentioned "Tricks of the Windows Game Programming Gurus" is pretty light on actual game development tips. (And the book title is pretty embarrassing)

Learning graphics programming is hard. Especially the API specific details. Programming DirectX or OpenGL directly is also hard. And no fun, to me at least.

Regarding the graphics aspect, I can recommend this book: Real-Time Rendering. I own the second edition, but I've looked at the third edition and it certainly is better, but not better enough to shell out the money for the upgrade. Yes, the book is pretty expensive, but at least you get a thorough yet concise introduction to 3d graphics programming. The book is API(DirectX/OpenGL) agnostic, it presents the actual algorithms instead of API specific implementations. It explains all aspects of 3d programming in a general way with lots of useful illustrations, it also has a math primer on all the math needed to understand the topics. It is just the book on 3d graphics right now.

I am probably going to buy this one: Game Coding Complete The table of contents just speaks to me, don't find it in a local (German) book store so I can't vouch for its quality. But at least it doesn't seem to neglect the basics(project setup, memory, debugging) and it presents the visuals as only one aspect of many, which they really are.

You also ask, whether to bother learning directx9 with dx11 coming. First: dx10 is easy enough to learn with knowing dx9, and dx11 won't be much different from dx10. But instead of learning a specific API like dx(Number) or OpenGL, learn 3d graphics programming. Understand stuff like transforms, vertex/index buffers, texturing, shaders and all the basics. This knowledge will greatly help with learning a specific API and it will also help when not using an API directly. Instead you can also use 3d graphics engines. There are lots around, likely one will suit your needs. A selection of open source engines in alphabetic order: Crystal Space, Horde3d, Irrlicht, Ogre, OpenSceneGraph.

haffax
A: 

I want to get into game programming (and, as a side effect, windows programming), especially 2d games (at this point, I really want to clone tetris, since that is my favorite game of all time). I do want to do 3d programming, but that seems unfeasible alone.

My question is, is it possible to learn from old books/textbooks? People have recommended "Tricks of the Windows Game Programming Gurus" (or similar), but that is almost a decade old. Has the gaming industry changed too much to learn from that?

These two paragraphs don't match up. The 'industry', for the most part, isn't making 2D games or cloning Tetris. So why worry about what they're doing? If you want to make your own games, especially 2D ones, then you are best off avoiding the tools and languages that the pros use and instead picking more appropriate ones.

If you're hoping to join the industry later, that's fine. But you don't need to learn everything in one go, nor is any learning wasted if it gets you started and gets some games made. I'd be more inclined to recommend Flash or Python/Pyglet for aspiring games programmers.

If you insist on C++ them I'd recommend using the SDL or SFML libraries to get started on your tetris-like games, rather than using old texts that feature DirectDraw and the like. The old books contain plenty of useful conceptual information but with the old APIs you'll be jumping through hoops that you'll never need to jump through again. It's up to you how much time you have to spend.

If it isn't possible, what are some good textbooks I can pick up to learn on today's software (I feel like it might be pointless to learn anything about DX9, when DX11 is around the corner)?

Note that DX10 and DX11 only run on a very small number of platforms. If you go with them then you exclude not only over 75% of desktop PCs but pretty much every non-Xbox games platform. Forget about bleeding edge technology - today's cards push patterned triangles around, have done for 10 years, and probably still will in 10 years. Learn the underlying basics with OpenGL or DX9 or even better a pre-made 3D engine to begin with, and you'll have transferrable skills.

Oh, and remember that games != rendering. Whenever people see games they think it's all about 3D but the graphics are only perhaps 10%-25% of the game. You won't be spending the majority of your time on graphics unless (a) you're the best graphics programmer on the team, and (b) you didn't just buy in an external engine from someone else like most companies do.

Kylotan
+1  A: 

You might want to look at XNA if Windows/XBox is your platform. There are lots of resources and free tools to use as a starter including many books just for the beginner and Microsoft provides online resources and examples specific to getting new users started with game development.

http://creators.xna.com/en-US/news/xnagamestudio3.1 http://blogs.msdn.com/coding4fun/

VHF