Game Engine Based on Marmalade and IwGame

Since August 2012, 2 developers(including me) and 2 graphic designers come together and started a small game studio to work on some mobile casual games, as the tech lead, I need to choose a development way for our first batch of games.

Our games will be mostly 2D games, might with some 3D charactors, though the scenes or levels will be 2D, I think that’s better for the team and the graphic quality of the games.

After quite some readings and experiments, I finally have a clear idea about how we gonna build these games, We will create our small game engine, on top of Marmalade and IwGame.

Why choose Marmalade?

I did have quite some experience on cocos2d, though it’s been ruled out pretty quickly. I want our game to work on multiple platforms, since we don’t use much platform-specific features, we don’t get much with objective-c. Also personally I am not really a big fan of cocos2d, it’s kind of a simple framework with good quality, though missing some of the features I want with a solid framework, e.g. Tool or Markup for graphic scene editor, I’ve tried Cocos Builder and Level Helper very breifly, might be just me, but I don’t like neither one. A similar option is to go with cocos2d-x, which is cross platform, but because of similar reason, I didn’t dig into it deeply.

The second option is Unity3d, I’ve used it for about 3 months before, It’s pretty good, easy to use, and have a hugh community with tons of good plugins. My biggest concern about it is the binary format of the prefebs, it’s a bit like the xib file in App development, hard to change and track, as a developer, I want a text based format. Also don’t really think the .Net virtual machine is the best way for our rather small games. My feeling is that it’s more like a tool for game designers and graphic designers, as developers, we gave up full control in exchange with a full-feature game development environment. And also it’s mostly 3D centric, 2D works are possible, but a bit awkard, since we don’t need the 3D power and I want more control with my codes, I did not take this path either.

For good performance and graphic effects, I didn’t investigate the fast development tools, most of them are HTML based or LUA based, more like quick prototype tools for me.

I’ve played with Airplay for a couple of days 2 years ago, technically it was very good, though with a rather steep learning curve, and lack of tutorials and blog post, so I didn’t really learn it as a hobby. Now it’s renamed to Marmalade, been updated pretty often, and having a much bigger user base and many successful games are based on it, like Draw Something or Cut The Rope. Since I will use the chosen platform for at least 1 or 2 years, I spend a week to really try to learn it this time.

The first impression was kind of negative, the OSX support seems to be much weaker than the windows one, a bunch of small problems were met, which almost make me give it up. Now I’ve been using it for about 1 month, still got some problem, though I think I start to feel comfortable with it.

There are still very few technical information about marmalade other than the official documents and forum, the only helpful tutorial I can find is the DrMop tutorials. It’s very helpful to provide basic ideas for new Marmalade users.

The API documents of Marmalade is actually quite good after you get the basic ideas about it. Also the examples included are good learning source.

My current feeling about Marmalade is quite positive, it has nice features and solid quality, provide full control, has native bridge for potential platform-specific development.

The things I wish to be better:

  • 1st class OSX support, add the missing features of the simulator, fix the broken “mkb –iphone” device building (only trid on 10.8 + Xcode 4.4, not sure about other environments). (Update: –iphone is fixed in 6.1, simulator seems not updated)
  • Release to osx ability, then I can create desktop tools such as customized level editor instead of let my graphic designers to use the simulator to run them. (Update: Added in 6.1)
  • Float data types in IwGx, it’s said to be included in 6.1 release which should be out soon, much simpler and less error-prone, we’ll target on OpenGL ES 2.0 devices only (iOS devices first) to make our life easier since we can’t afford dedicated tester anyway. (Update: Float added in 6.1 and works great, though we probably will not change IwGame to use float)
  • High level document besides API reference, and generally more documentations.
  • Better community and 3rd party components, it’s quite unpopular in stackoverflow, very few blogs, and the github community projects are not very active and organized.

What is IwGame, and Why it is Helpful

Marmalade is very low level, its design priciple is that people can make their engine working on it rather easily, but we don’t have any game engine yet, so either I need to write a 2D engine from scratch, or choose a C/C++ engine to work with. Cocos2d-X works on Marmalade, though I want something more powerful. Many 3D engine works on it too, but they are too complex to me, I probably will choose Unity3D if I want a 3D engine.

According to the website, IwGame is a “Free Open Source Cross Platform Mobile Game Engine for Smart Phones and Tablets”, it’s a quite ambitious project, already has a long feature list with many future features, though still in an rather early stage.

The main reasons I chose it:

  • Open source, I can tweak the codes to suit my needs better, and even if its development stopped, we can still improve it by ourselves.
  • XML file format, it’s very powerful, e.g. make simple animations easily without coding. Also it’s very easy to extend the system to add our own extensions. This is a hugh advantage to me.
  • Complete 2D framework, including sprite, scene, particle, physics, UI… No need to reimplement the basic things from the scratch, we can focus on more interesting stuffs.
  • Support 2D and 3D rendering, since the rendering codes are based on IwGx now, even for 2D games, some part of 3D elements can be very useful, so I think this flexibility is very good.
  • Good document and a full game source included, there are quite some typos in the included PDF document, though it provide most information I need to get started, plus reading the source code, It’s kind of easy to learn (though still much harder comparing to cocos2d family).
  • Good code quality, easy to read and not hard to expand.

Some worries about base our codes on it:

  • It’s a big project, and seems most code and docs are written by DrMop in several monthes. He did very great so far, though he has too many works ahead him, I am not sure where this project will be after 1 year, what if it’s dead? also it’s been a while since the last update.
  • On the other hand, if it’s been developed rapidly, since it’s not finished yet, we will need to expand it by ourself, it can be a problem to keep update with the future updates. I don’t want to make a fork since many good features are on the list, though we can’t wait for they to appear, We will be careful with out changes to make them easy to merge, but what if the owner decide to change the API interface drasticly?
  • The core string class (CIwGameString) is not unicode compatible, and the author didn’t have plan to support it soon. This can be a big problem for us to support multiple language, especially the asian languages. I want to find a clean solution for this, though haven’t started working on it yet.
  • There is no unit tests yet, so it might introduce its own bugs, especially if it’s been update quickly.

My Plan on The Game Engine

Now I feel OK working with Marmalade and IwGame, the next steps will be creating the features/tools we need for our games, i.e. create a game engine for our requirements.

Here is the current list of works to be done:

  • Basic level editing, to arrange 2D sprites on screen, supporting basic operations such as moving, scaling, rotating, etc. Our level/scene will be 2D non-tile with multiple layers, something similar to this
  • Complex charactor editing, 2D or 3D charactors with body parts, movement and animations.
  • Advanced level editing, particles, visual effects, events, etc.
  • UI editing.

All these editors will base on the XOML markup system of IwGame.

These are still quite some works, might be over engineering for our first game, though as a developer, I don’t want to just do things in the quick and dirty way, I want to do it in a proper way. And I think a proper engine can make future games easier to develop, so in the long run, it will worth the efforts.

Think I will start to write more about Marmalade and IwGame in the future, both help myself to understand them better, and hopefully might help some other developers too.

comments powered by Disqus