Friday 21 November 2008

Game deveopment and discussion

Finding the Right 2D Game Engine

At the start of the summer I set out to program a few games. I was totally new to game programming so I wanted to find a framework to take care of some of the complicated (to me!) stuff related to timing, input, and drawing to a canvas. My search finally ended when I found the Slick framework, but along the way I managed to learn a fair deal about competing frameworks and that there is a paucity of information comparing them all. So, to help fill that void I'm going to chronicle some of my thoughts and comments on the various options I looked at.

First, however, let me tell you what features I wanted in a framework. Hopefully this will help you understand where my opinions are coming from and save you some time if you're looking for something altogether different.

  1. 2D engine
  2. Easy to pick up
  3. Well documented
  4. Active community
  5. Cheap
  6. Playable games built using it
  7. Source code for games available
  8. Portable

This seems like a pretty straightforward list but it's surprising how few libraries fit the bill. Still, I'll try to cover the ones that do and some of the ones that don't but still caught my eye. If you're looking at this list and shaking your head then you can most likely stop reading.

Pygame
The first game framework I checked out was Pygame. This is written in, surprise, Python which is a pretty nifty language. I was especially tempted to use this engine because it offered a chance to really learn the language. In the end however I found that there a couple things which kept me from using it. The biggest was easily the fact that the website and games available were awful. Furthermore, I had real problems getting the whole thing up and running. (Note I am using a mac with Tiger installed, so it should be this hard!) Finally, I didn't find Pygame easy to learn. Personally, I feel like if you can't get things up and running after a day of effort then it's time to cut your losses.

On the plus side, Pygame does have a large and active community. Testament to that is the fact that a major update was just release. In addition, the whole thing is very portable as it is written in Python. Another benefit derived from the language is strong OO support in the language, and if you believe what you many other neat bells an whistles. So, pygames is actually a pretty good deal if you can wrap your head around, which I couldn't, so definitely take a look. Anyway, here's the finally tally:

  1. X
  2. 0
  3. 0 (documented but not so well)
  4. X
  5. X
  6. X
  7. 0 (probably available somewhere...)
  8. X

Allegro
Next I checked out the Allegro library written in C. I happen to think C is a great language, so I was motivated to give this game engine a chance. Allegro is portable and fast (if you write your C code correctly). It also appears to have generated a large stable of games. Finally, it has a hodgepodge of documentation available on both its main website and an associated wiki.

All of that said it isn't actually easy to get up and going with Allegro. Partly this is due to it being written in C. You simply have to work a lot harder to get the same sort of thing to happen as in, say, Python. But it's also a product of the patchy documentation, which appears to be outdated. At least, I couldn't seem to find a "get started in five minutes" tutorial. Last but must important Allegro is not a complete framework. Instead it is a series of routines which are common to game programming. This means that you're going to have to implement all of the timing stuff, etc on your own. Since I had no experience with that sort of thing I thought it prudent to find another option.

  1. X
  2. 0
  3. 0
  4. X
  5. X
  6. X (using it plus lots of custom code)
  7. X
  8. X

Torque Game Engine
Torque is a very popular and very active commercial game engine designed to for game hobbyist (that's me). There are a lot of really excellent things going for Torque and I honestly think it would be a great choice for most people. First off Torque is a very complete package. It has a Newtonian physics component, collision detection, supports layers with parallax scrolling, and much more. In addition, there is a very active community around the framework to help field questions. Finally, the whole thing is portable and even has build paths in place for the Wii and PS3, so if you find yourself getting serious you have a clear upgrade path to follow.

The game framework also comes with an IDE. On my mac I found the IDE to be a pain to use. In fact, I couldn't even figure out how to do simple things like delete items placed on the screen... Needless to say this was a real turn off. Hopefully the problem was mine alone or at least limited to the mac build. I was also disappointed by the documentation which was out of date. I found myself reading tutorials which made reference to things which did not exist. When things didn't end up working I wasn't sure if it was my error or the instructions; very bad. Finally, the framework has you writing in a proprietary scripting language (described as being C-like) which I found to be a big put off. I didn't want to have to learn some useless scripting language and use a crappy IDE... all that said it may be worth stomaching for the great feature set.

  1. X
  2. O
  3. O
  4. X
  5. X ($100, which I think is cheap for a serious hobby)
  6. X
  7. X
  8. X

Slick
Last but not least is Slick. I stumbled across this game framework when I was looking for a 2D Java game engine. In fact, I found it sifting through projects on the LWJGL. It's a 2D game engine written in Java on top of LWJGL. It has an active community, tons of helpful documentation, and a slew of example games with published source code. In addition, the community has generated a number of useful extensions ranging from physics engines to animation frameworks. Finally, since it's written in Java you can take advantage of the great tools and libraries available such as Eclipse. Perhaps the coolest example of this is Slick's integration with Java Webstart which makes it easy to distribute your games over the internet (see my game's page for examples).

There are some drawbacks to using Slick. Since it's written in Java it may run into performance issues if you try to push things to hard -- though we're talking about 2D games here... More important, if you want to people to play your games they will have to have Java installed. This means installing the Java runtime which is a fairly package (though to be fair is usually installed already). Also, while the community is active it is not as big as some of the other game engine's.

  1. X
  2. X
  3. X
  4. X
  5. X
  6. X
  7. X
  8. X

Alright, so there you have it. I hope that you find this helpful though it is by no means an exhaustive look at these game frameworks. Please let me know if you have any questions or would like me to add some comments on a new framework.

There are currently no comments.

Leave a Reply