Sunday, January 23, 2005
Getting Torqued
So for this next project in the post-Void War world, I decided to use Torque as my game engine. Why not continue using the homebrew engine I developed for Void War?
A couple of reasons:
#1 - Cross-platform capability. Void War's engine was extremely heavily tied to DirectX. When I first started on it, I tried very hard to keep it platform-independent, and keep all the Direct-X specific stuff in one place. As time went on, I became lazy (well, actually, just SLOPPY due to intense development efforts). Next thing you know, I have DirectX-related bits throughout much of my code. I learned too late what kind of market there is for indie games for the Mac, and I started kicking myself. So this time I wanted something that had already been built and tested on the Mac. (And Linux too, which is a cool benefit even though it doesn't represent a huge market for games yet).
#2 - Maturity. While this can have bad connotations too (a 'mature' engine might not look as sparkley and hot as a 'new' engine), it also means it's well understood, a lot of its bugs have already been ironed out, and there's also a TON of support already out there for it --- like exporters for tools! Supporting a tools pipeline for a game engine isn't exactly the sexiest part of game programming - I'd really rather work on the game.
#3 - Features: If you are doing an engine for a single game, you are going to be hard-pressed to support those features that only that one game requires. However, if you already have a feature-rich engine to start with, you may be able to take advantage of some the features that you can get "for free" with that engine that you wouldn't consider otherwise.
Shortly after I got into the business, the rule of thumb was that it was creating your own engine from scratch was really no harder than learning someone else's engine. In 1997, with 3D hardware just starting to hit mainstream usage, this was true. Nowadays, it's not just about pushing a bunch of single-texture polygons out with lightmaps over the top of them, and things like collision detection, line-of-sight detection and other issues are a couple of orders of magnitude more significant. With the wealth of engines available for use out there that are even well within the price range of an indie developer, it just makes sense.
I still recommend writing your own 3D engine as an exercise - it's good practice. Because you will need to know all you can when you open up the hood and start ripping out the guts of whatever engine you decide to use so you can customize / optimize it for your own use. The Void War engine had some support for character animation (believe it or not), multitexturing (a requirement these days), a portalling system (which, like the animation system, wasn't used in Void War), particles (another given), and a few other goodies. It still has some hardware compatability issues that drive me nuts to this day - some machines just don't like it. Ah, well.
I opted for Torque for several reasons. The biggest was the built-in terrain engine which actually looks GOOD, and of course Mac compatability (I was also seriously impressed with Ogre3D and Irrlicht, both of which are free). In the end the built-in Torque features won out. The ongoing work on TSE (Torque Shader Engine) means a clear upgrade path to keep games from looking like they are mired in a turn-of-the-century look. Torque has good tool support (and some nice built-in tools), a thriving community (including many professionals). And a friend of mine - John Olsen, who did some programming work on Void War - already owned a license of the engine, which means I could potentially still beg him for help on another project... :)
I also have a future project in mind that could REALLY take advantage of a lot of Torques features. So while I could have easily gone elsewhere (even stuck with Void War's engine) for this current project, I made the choice with an eye for the future. The seamless integeration of indoor & outdoor environments was a pretty big deal.
Of course, having this really cool, fully featured engine and actually being able to do anything productive with it are totally different beasts. If you keep your game well within the established capabilities of the engine, it's a piece of cake. But who wants to do that? It's extremely well-suited to first-person shooters with vehicles, but I've not come up with a really compelling FPS idea yet. So I have to get down and dirty with extending and modifying the engine.
So I'm down in the guts of the engine - not too deep, but still deep enough to give me a headache. Just learning how Torque likes to do things - with it's inherent client-server model - is frustrating. I think I'm almost over that first hurdle, however. I'm now on my third pass on creating a new object in the game system - now incorporated with pieces of the new RTS starter kit. The first two seemed cool in my mind, but I wasn't satisfied with how they played. Hopefully this third time will be the charm. It's getting easier now - I understand more of the pitfalls and tricks to making sure Torque behaves itself.
I will really be glad when I finally understand the inner workings of the engine half as well as I do my own engine, however. That should make development TONS faster.
