views:

412

answers:

7

Is there any reading material you would recommend on the subject of game engine development? Specifically 2D engines.

I've read up on SDL and I want to get started programming some games but I find myself a bit overwhelmed by the whole thing and I don't have a clear picture of what needs to be done. I just end up building complex, inefficient, rube goldberg programs.

Is there a book written on the subject that walks you through popular game engine designs or something along those lines?

+1  A: 

Back when I still dabbled in games, Gamasutra ( http://www.gamasutra.com/ ) was one of my favorite resources. Lots of interesting papers by people in the industry, and many many useful links to resources technical, design-oriented and anything else.

For programming aspects, of course their Programming section ( http://www.gamasutra.com/category/programming/ ) would be the most instructive.

Carl Smotricz
+2  A: 

I have these 2 books in my wish list:

Taking account of the Amazon comments, they are very good books.

(if I was going to buy only one that would be the "Game Coding Complete")

Nick D
A: 

I own many game realted books, including:

  • 2 from gpu games
  • directx and opengl game programming
  • game physics engine programming

and a few others. None of them teach proper design. If you're doing C++, you really need to learn design patterns and C++ specific techniques. I would recommend Effective C++, effective STL, boost (beyond the stl) The important thing to note is that there are no game specific design patterns. Learn to make good classes and decouple functionality. This comes from experience and reading. I know there are books on game engine design, but they tend to get bad reviews. More of them should be called "Meh guide to game engines", and not "Game engine architecture" or whatever, it misleads people into thinking there is an underlying correct design for every game. There isn't.

Chris H
+1  A: 

There are a lot of different components which typically go into a game engine. You will often have:

  • image loading, storing, drawing, and transforms
  • sound support - load, play and mix sounds
  • game dynamics - physics, input handling
  • GUI - font rendering, widgets, score boards
  • possibly script support - Lua, python, javascript
  • possibly package handling
  • possibly particle effects
  • possibly Ai and or path finding

My suggestion is to focus on one feature and really explore it. Any of these components can be very involved and has a lot to learn about. I would also suggest playing around with existing engines and looking at their source code if possible. There are many open source engines out there some are better and or more modern than others.

Nick
+1  A: 

If you want to create games and not game engines I highly recommend Torque 2D, and if you really want to know how it works under the hood there is always the option to purchase the source code as well for the price of a couple of game programming books.

fuzzy lollipop
A: 

What's your target? If it's Windows/Max/Linux computers, then I sugest PyGame. It comes with some tutorials, and is easy to get into for 2D games. If you target Xbox 360 development and/or Windows-only, I suggest creators.xna.com, which lets you write 2D (and 3D) games in C#, and run on your Xbox. There are a lot of 2D (and some 3D) examples on the creators.xna.com site. Finally, www.gamedev.net has discussion boards for a variety of game development subjects.

Jon Watte
+9  A: 

If you've not made a game yet, then learning about how to make game engines is counter-productive. The engine should emerge from the game, not vice versa. After all, for code to be reusable, it must first be usable, and unless you have successfully written a game with it, you can't prove that your code is usable for a game.

You might think that reading a book on game engines would tell you exactly what you need, but the fact is that different games have very different requirements. The better the engine, typically the wider a range of requirements it will cover, which means both a higher level of complexity and a more abstract level of working, meaning it will bear very little resemblance to the sort of problems you will face as a beginning game programmer.

As a beginner, you need to focus on keeping it small and simple. Your basic game loop will look like this and you just have to fill in the functions:

init
while 1:
    get_input
    update_objects
    render
shutdown

Obviously you will come across some specific issues, but the best way to approach them is to ask a specific question about the sort of feature you're trying to implement, because it's easier for someone to tell you how to do something than it is for them to recommend a book that covers everything that you might possibly want to do (largely because such a book doesn't exist). If you can cite existing games as examples, even better.

You didn't state whether you are new to programming or just to game programming - often, a lot of the problems faced by game programmers are down to a lack of understanding of basic programming fundamentals. Your Rube Goldberg comment implies the latter, and if so, it's worth picking up good books like Code Complete to get you out of bad coding habits.

Kylotan
+1. Excellent answer. I started to write something like this, but you beat me to it :)
Milan Babuškov