Sunday, February 22, 2009

Using an off the shelf engine or build one yourself?

When doing games, this is a question that you will come across over and over again. I've went through the pains of writing a 3D engine and a physics engine a few years back. I never used it in any of my own games, but it was a blast to work through all the different problems, and there was many problems.

One of the biggest problems to coming up with your own 3D engine is a general lack of direction if you don't tie it to a specific project. Aimlessly doing an engine with no goals is not necessarily a bad things. Just make sure you understand what is your own personal objectives of the project. If you want to learn, then this great way to go about it. If you want to build an engine that you'll be able to use on all of your future projects, then I'm afraid you'll probably fail. I'm not attacking your own skills or dedication. The problem is that it takes a lot of time to create a generic 3D engine that can be used by multiple projects. By the time that you get finished a couple of projects with a successful engine, you will probably need to provide an update for it. That time could be much better spent on an actual game. Before creating your own engine, ask yourself what you want out of it. If what you want is to create a game and not the engine itself, then chose an existing engine that will cover your need.

So what are the engine of choice? It really depends at what level you are working at I guess. The only professional engine I've worked with was Gamebryo, so I can't compare it to Unreal or any of the other engines out there. On the free side, I've worked with Irrlicht and Ogre3d. I have a preference toward Ogre since I find the user base larger and more active. There also seems to be more updates on the Ogre engine itself. Although I have to say I was pretty impressed with Irrlicht software renderer.

Wait a minute, this is an IPhone blog. Well, it turns out that at this time, there's no Irrlicht or Ogre port for the IPhone. Although I've thought long and hard about porting Ogre to the IPhone myself, I've decided that my time would be better spent on working on a game instead. So, what engines can we use on the IPhone? Well, if what you want to do is 2D, then I would suggest a look at Cocos2D for the IPhone. This is the engine I'm currently working with and I have to say that I am pleasantly surprised. One thing to note is that it is completely written using Objective-C, which I'm still not completely familiar with at this time. Although looking through the code of the engine, I have a much better appreciation for the language than I did when I started. I just hope that I can get to a point where the code I write in Objective-c just rolls out as easily as C# or C++/STL/Boost. Another alternative if you want to build 3D games would be Oolongengine (doesn't roll of the tongue quite right). I've personally haven't used it yet. It uses mainly C++ with some help from Objective-C for gluing the whole thing together on the IPhone SDK. A person of interest working on this would be Wolfgang Engel, who I believe had started (don't quote me on that) (I attended some class there) a while back and also who is the editor for the Shader X series of books. A personal favorite series of mine along with Game Programming Gems.

Do I regret working on my own engine for the better part of a year? Absolutely not, beside learning a few things of myself, I now understand other peoples engine much easier. Also it's normally not too complicated for me to go and change the engine if there is something that doesn't work the way I like or if there's a defect. For example, I had to rewrite quite a bit of code in the Gamebryo engine to make it work on Linux. It was a challenge, but it was well worth it.

No comments:

Post a Comment