Saturday, May 4, 2013

Why write my own engine?

Most conversations I have about my business don't get technical.  Usually they never go much beyond the basic fact that I make games and try to sell them.  But other developers I've talked to wonder why I'm spending precious time making my own engine instead of using one of the many great existing engines/libraries (e.g. Unity, Unreal, Ogre3D, cocos2d, loom, SDL, Flash, Marmalade).

There are a few reasons (in no particular order):
  • Fun and Learning
  • Control
  • Customization
Fun and Learning

I love programming, and I enjoy all of game programming, and what I like about it is that it's hard.  But what makes the game side hard isn't so much the technical stuff but the game design issues: How do you communicate X to the player?  What's the best interface for Y?  How should we teach skill Z?  Those are essential problems to solve, but I prefer the technical problems of engine programming.

Control

I've spent a lot of time with Flash and Unity, and I've made games with both, and there are things I like and dislike about both.  I wrote Now Boarding in Flash, and we had some customers who couldn't run the game.  Our only option was to offer a refund and an apology.  Only a handful of customers ever had that problem, so it didn't really hurt us.  The trade-off between the ease and speed of development vs control over technical issues was worth it.

Then I started using Unity.  Unity is also a black box which offers the simple developer like me no control over technical issues.  However, my experience with Unity was that it was more buggy than Flash, and so those technical issues came up much more frequently.  I've spent a lot of time searching and posting on forums, looking for solutions to bugs.  Sometimes I found solutions, sometimes an update was released that fixed the problem, sometimes I found work-arounds, and sometimes I just had to live with the problems.  What else could I do without any control over the technology?

Having all the code, I can debug, fix, and enhance anything.  If a customer has a problem, fixing it is possible.

Lots of developers have founded their businesses on Unity, and many are having great success.  Unity keeps getting better and better, and they can add features to their engine so much faster than I can add to mine. Isn't it worth giving up control to let them handle the technical details so I can focus on my game?

Customization

Since you already know I'm writing my own engine, you already know what I'm going to say.  I would answer that question: "Not for me."  And it's not just because I enjoy engine programming.  This third point is about customization: my engine is exactly what I want, no more, no less.

Existing engines have lots of features I don't need, and they're missing certain key features I want.  This is what I wanted, and I didn't find all of them in any single engine I investigated:
  1. Fast device iteration (Unity, Flash, and Marmalade all require rebuilding the entire package for each change, but Loom got this one right)
  2. On-device debugging
  3. Rich 2D API
  4. Text-based, human-readable scene files
  5. Support for Windows, Mac, Linux, and Android (for consoles like Ouya)
  6. Source code
  7. Cheap
  8. Multithreading
  9. Support for Linux development
Out of those 9 possible points, Unity scores a 2 (5 & 8).  If I were focusing on PC and if I were making a 3D game, then Unity would be a much better choice (1, 2, and 3 wouldn't matter, and I could use the free version, making 7 non-applicable), but still not good enough, because 4 and 6 are all really important to me.  My engine, of course, scores a perfect 9 (or at least it will when I get around to porting to Windows and Mac). =)

Conclusion

So I'm writing my own engine because I love it, I have complete control, and I can have exactly what I want.  It's true that it'll take me longer to release my first game.  It's true that there's a ton of work and problems I could have avoided by using an existing engine.  But once I get through those problems, I'll have a solid foundation on which to build future games, with all control and customizability at my fingertips.

No comments:

Post a Comment