views:

126

answers:

2

Is there some books that teaches the game structure:

  • How to create UI, menu, game flow (for e.g. What happen when you proceed to next phase of the game? What are the changes to the main loop?)

and also I would like the books that really show a working complete game code/structure with explanation, because most of the books I found contain just practical example to each field (such as how to use this function from the graphics engine... How to get the object displayed). I can't find ones that really have the whole thing.

Any graphics engine is preferable.

A: 

There isn't really a book of this type. In general, any books that cover game development from the programming perspective cover the low-level details of how to make things appear on the screen, but not a whole lot about game flow or the specific task of creating a UI.

The only books I've read that come close are 3D Games: Real-time Rendering and Software Technology and Game Programming in C++: Start to Finish, and I can't really heartily recommend either one.

greyfade
+3  A: 

I think this is very important: Learn C++ first, then game programming strictly after!

I've expressed this sentiment before. I tihnk the worse thing you can do is try to learn both at the same time. Get a good beginner C++ book, then a good intermediate book, then start on a game programming book.

Here's the thing: Many "experts" in the field like LaMothe aren't very good C++ programmers. (In fact, many game programmers aren't very good C++ programmers.) While they certainly know the overall design of a game, if you try to learn C++ while reading their books you're going to end up with down-right terrible C++ code without any bit of modern style to it. Old C++ code with respect to game programming is often C-with-classes. That's no way to go.

You're much better off learning proper C++ and good, modern style. Once you understand C++, game programming is just the application of that knowledge in a specific field. Then nearly any book will do. (Because you'll not be stumbling over understanding the code, but rather be learning what it does.)

I can't recommend any start-to-end books since I haven't picked up any modern books (haven't had the need.) I do have old books from the type of author I mentioned, and I can't say I recommend it. I do have "Game Programming All In One", and I recommend you don't get this. He spends a portion of the book making a CString class; this is the stuff I'm talking about, just use std::string and move on with your life.

I can recommend "Introduction to Game Development" as a good start on game structure. It's not code rich and is a bit enthusiastic about design patterns (I hate design patterns, if code was some pattern we just had to apply we wouldn't be here.), but it's a good start.

Once you have gotten to an intermediate level, do start simple. Ignore the idea of getting a game loop on your first game: you should make a text adventure. Then something simple like Pong, then try making your own 2D engine and remake Pong with that.* Then make more 2D games. And after that, use someone else's engine to make 3D Pong (Pong from a perspective). Then make another simple 3D game. Then make your own engine and remake 3D Pong or some other simple game.* Then use someone else's engine to make a more complex 3D game, then improve your engine and port that game, and so on. That's how you learn game programming: trying to jump into a 3D will just dismay you.

But indeed, learn C++ first!

*The purpose of remaking a game in your own engine is to separate game programming from game engine programming. Never try to do both at the same time, until you're very experienced. In the same way you should separate your learning of C++ from game programming, separate your learning of game programming from game engine programming.

GMan
I agree with this 100%. Here is why: http://cogwheel.pastey.net/138808 That's a game a friend and I wrote when we were in High School. Don't bother trying to compile it. I broke it before I learned about version control systems (among other things). -_-
Cogwheel - Matthew Orlando