Thursday, December 01, 2005

The Ever Growing Engine
My game engine continues to grow. As I work on each new project, I always encounter a few things that are worthy of bunging in the game engine rather than the game itself. It has been a while since I added new features to it, but today I put in some low level stuff. I added a ProcessObject class, which is like a really generic object that gets processed, and is maintained in a list of similar objects. In an RTS game, these objects might be buildings, units and maybe weather effects etc. By putting this basic code in the engine, I can avoid rewriting the same stuff every time I start a new game.
Now if you are only releasing a game every ten years like the guys doing Duke Nukem, this isn't much of a saving, and to be honest, every big name corporate game that I worked on used a brand new engine (for NO reason at all), so it's probably less common to have reusable code in this industry than you would think. In my case, I can't afford to (and don't intend to) throw money away reinventing the wheel every year, so I've gradually built up a re-usable 2D game engine over a period of maybe 5 years now.
My engine isn't the Unreal engine, nor does it support infinite polygons, but it does the job nicely. I haven't written any code to handle mouse and keyboard input, sound playback or sprite rendering in about 4 years now. It let's me concentrate on doing original game design instead. Hurrah for that.