Unity3D vs CocosSharp – which one is better for your project?
I would like to compare these 2 game engines, Unity3D and CocosSharp, because I had a chance to use them both lately. It won’t be a comprehensive guide, just the things I noticed. Obviously, Unity is much more mature and has more features, but that doesn’t mean it’s always the best for the job. Let’s look into details.
Scripting is better in CocosSharp
Unity is great for bigger games
Unity has great editor, while CocosSharp is only a layer above MonoGame and you still have to write a lot of code. This code however is much simpler than what you get with MonoGame. It’s easy to understand and fast to learn. Probably faster than Unity. When you have to make a lot of design and create levels, it will be more difficult in CocosSharp as you have to do everything in code, then compile and test on a device or emulator. In Unity you can do everything, even testing, in editor.
CocosSharp is for 2D games
Unity was originally created for 3D games and just recently some great 2D tools were introduced. It has also new GUI system which is really convenient to use and you can create complex user interfaces quite fast. CocosSharp is intended for 2D games only and in many cases it is perfectly enough, especially for mobile games. Xamarin is also developing another game engine, UrhoSharp, for 3D games.
Unity may be too complicated for simple games
In Unity you can do everything that you can do in CocosSharp and a lot of these things will be easier. However there are also some solutions that are simple in CocosSharp and complicated in Unity. For example you want to put SD and HD textures in your game and load the right one’s depending on device’s resolution. It’s a few lines of code in CocosSharp. In Unity we have AssetBundles which can do the same, but are harder to use. The reason for that is that Unity team had also some other scenarios in mind when creating this solution. Like downloading parts of the game during gameplay (for example new levels or some dlc). Because of this we have more general solution, instead of specialized one.
CocosSharp is more buggy than Unity
There are things that simply don’t work in CocosSharp yet, like masking or bitmap fonts. They are some pretty basic features, but almost always you can find a workaround. I could say now that you don’t have to look for such workarounds in Unity3D, because things here just work. The ones mentioned above work, but Unity has other problems. None of the engines is perfect, but CocosSharp is younger and it’s normal that is needs more work. Although it is worrisome that it’s development is very slow right now (or even stopped) so I’m not sure about it’s future.
Also, some bugs are not in CocoSharp, but in MonoGame, so they may be harder to fix.
And has less built-in features
This is natural consequence of CocosSharp’s young age. Unity offers a lot of ready to use GUI controls. CocosSharp also offer the most basic ones, but if you need Scroll View then you’re out of luck.
Unity has huge community
It is also very important aspect. You will encounter issues in both engines, but with Unity it is usually enough to google them and you will find the solution. With CocosSharp you’re often on your own.
AssetStore has many great packages that will make development easier. Sometimes they are free, but usually paid. Microsoft offers $50 coupon in it’s benefit program, so it’s a nice addition.
Windows Phone is problem for both
If you don’t care about Windows Phone then you are lucky. Unfortunately I care about this platform.
First issue that both engines have is that debugging is extremely slow on Windows Phone. You should test your game in release mode without debugger attached when you can and use debugging only when it is unavoidable.
Second problem is performance. Even in release mode performance on Windows Phone is worse than on PC or Android. Game can stutter from time to time and you have to look for some optimizations. We are taking here about simple 2D game. This is mainly problem for CocosSharp. In Unity I also had this problem, but in the end it was caused by banner ads. It is a problem, but it’s not Unity’s fault.
Another problem I had with CocosSharp is that textures were very pixelated on Windows Phone (and very sharp on Android). I didn’t find solution to that problem.
CocosSharp is free
Now when Xamarin is free, CocosSharp is free as well.
With Unity you can do fine with free version. Unless you want to remove their splashscreen or use some other features of Pro version.
Which one to choose?
If I create something simple, only for Android and iOS, then I would most likely go with CocosSharp. It would be enough and development would probably be faster. Otherwise I would choose Unity.