Unity3D vs Cocos2d-x

July 24th, 2014

One year ago we were still developing our games in XNA. This was a heritage of how we became a game studio. On Windows Phone 7 - the first platform we developed games for - XNA was your only choice. The only other option was going through the trouble of making a game in silverlight.

Since then, a lot happened. We did not release many titles, but we quietly worked on many projects. We also evaluated two game engines that weren’t available for Windows Phone 7: Unity3D and Cocos2d-x.

Both of these engines were in a completely different state at the time we started thinking about a new game engine. Cocos2d-x was still on version 2.0, there was no way to integrate it in a hybrid XAML + cpp application. Unity3D on the other hand wasn’t yet free and didn’t had 2D support yet.

We are a year later now. A year in which we have made a complete game with both engines. Our view on both these game engines has changed just as much as the engines themselves did. We have made our choice for the future, and these are the things we have based this decision on.

Unity 3D

Unity 3D is both powerful and easy (if you know how to program :-) ). If you know one of the supported programming languages you can learn it in a couple of days. Without any doubt you can quickly bring into being a decent looking prototype of your game. After all, there are many tutorials available (unfortunately, not that many for 2D games).

The Unity Editor is a great tool and a huge timesaver. With the Unity Editor you can simply test your game in the editor on different resolutions without deploying it to a device, and cross-platform comes almost out of the box. Monodevelop - the programming IDE of Unity - on the other hand is quite the contrary.

However, it is not all sunshine and roses. You need to think differently about programming as every game object can have many scripts attached. Furthermore you will discover many caveats while making your game marketplace-ready.

Making your game marketplace-ready means that you will need to create decent menu screens. Unity 3D does not support this yet, it is planned for the next release. At this moment your only choice is to use one of the Unity plugins that you can get from the asset store: NGUI is a good choice, but as with every SDK you need to be aware of the many tips and tricks to let it work smoothly. Once you understand how NGUI works it is quite easy to get decent working menu screens.

A second feature that we were missing in Unity 3D is the ability to easily add multiple resolution images. While it is true that this is not something you really need for a 3D game, it can make your 2D game and menu screens look a lot better.

One last thing you want to do when you make your game marketplace-ready is the integration of things like in app purchases, push notification analytics, ad networks, … There are different Unity plugins available for iOS and android - the question is how well do these work? If you are on Windows Phone you have no other choice than implement the Unity - native bridge yourself. Luckily, this is very well documented and works almost immediately.

Now you are ready to publish your app. But wait, do you want that fancy splash screen? If so, you have to buy the paid version of Unity 3D which comes at a price of 75$ per month. Quite expensive if it is your first game and you are not sure if you are going to make any money.

Cocos2d-x

Please note that our findings are based on an older version of cocos2d-x.

If you have never used any C++ or C: don’t read on, Unity 3D is your choice. Although Cocos2d-x takes away many difficulties of C++ (mainly memory management), pointers are still a concept that is hard to grasp by many. At the same time you also get all the benefits from C++ (performance being one of them).

For us, Cocos2d-x had a steeper learning curve than Unity 3D. One of the reasons for this is that at the moment we were developing our game Cocos2d-x v3.0 wasn’t released yet. Version 3.0 was quite different from previous versions, and therefore it didn’t have a lot of documentation on certain features we required. If there was any documentation available, it usually was in Chinese.

Luckily, new books about Cocos2d-x are being published. Still, learning Cocos2d-x is harder than learning Unity 3D. The Cocostudio tool is a huge timesaver, but at the same time it had a “beta” feeling: you need to know how to do things to let them work correctly. There are many other 3rd party tools for bitmap fonts, particle systems, tilemaps,… which are often free. The better ones are sometimes only available for MAC and you have to pay for them.

Once you know the ins and outs of the tools, there is only one more obstacle. For cross platform development you have to create the project and make files yourself, and then you need to find the flavour of C++ that is understood by all compilers.

Conclusion

If you can’t program, buy a book, read it, and then buy a couple more books. There is no game engine that will allow you to make a decent game if you do not know how to program.

Both Unity 3D and Cocos2d-x are very decent game engines. Unity 3D adds the power of its editor and the reusability of its game objects and packages. With Cocos2d-x it is a little harder to set up new projects and cross platform development, but you get the power of C++. It is a great engine for 2D games.

The match would be pretty much a draw if Cocostudio would be a little easier to work with. At this moment however the Unity editor is much more powerful and allows us to speed up development a lot.

let's connect