I’ve used haxe / nme for my latest project Cosmoplan for 5 months because I wanted my game to be on every major mobile platform. The second main reason to use haxe was to see if it is suitable for my future project which is a realtime multiplayer mobile game.
I’ve successfully finished my game with haxe and during private beta I gave up using it and switched to actionscript / starling. It was a though decision to make and I think it would be good to post the reasons behind that decision.
Here are the advantages of Haxe / Nme
- Haxe is great and nme seems great at first glance. When you run bunny mark tests it clearly is one of the best options at the market.
- It is free and has an active community
- It is fast
- It is very similar to actionscript so guys like me can make smooth transitions to haxe.
- It is cross platform.
And here are the problems I faced
- It is not truly cross platform. It seems like but it is not. You have lots of times running your code working in flash target, cpp target, ios target but not on android target ( or pick one of them not working properly)
- Mobile platforms except blackberry can’t get opengl context. So no access to shaders, which means you don’t have fast filters, nor vertex shaders nor custom drawing. I’ve waited for this for 3 versions of nme but no update so far and I think it is VERY critical on mobile development.
- Lots of things are rendered in software which is not stated anywhere. You all learn these with experience which may be very frustrating. These are:
- Gradient fill
- Gradient lines
- Bitmapdata operations
- Setting up new platforms need some work. It may take lots of time to accomplish or it may be done in first attempt. It is very possible to make mistakes and when you make mistake you’ll face with tons of lines of hxcpp output and your only option is to wait response from creators of nme or hxcpp. (Btw they are really really great guys and trying to help as fast as they can.)
- Audio is very problematic. You can only play one mp3 at a time. ( for cpp targets – mobiles included -)
- There are not enough sample codes about native extension. Or samples / tutorials are outdated. ( nme moves really fast)
- Most frustrating thing was facing not implemented methods. It is nearly impossible to see which methods are available for which platform and which are not. For better clearance check Capabilities class and you can see nearly %80 of that class is not implemented for mobile targets. They only work for flash.
- There are also non implemented features on mobile like BitmapData.perlinNoise, you all find these with experience also…
- Debugging on cpp target is pain in the ass and just for debugging purpose you have to keep support on flash target which leads lots of extra conditional compile code. Coding just for cpp was not an option for me because of this problem and also compiling to cpp takes damn too long. ( As I experienced your cache is being erased after you compile for another target or changed the debug mode. If you switch back and forth on ios, mac targets or debug or relase you may find your self waiting rather then developing)
- There are lots of ide’s around there which claims they support haxe but there is not fully supported one. They are only like code completion and syntax highlighted text editors. I used IntelliJ which is the ide I’m in love with – seriously that’s the only thing I’m fan of – but the support of haxe is not official so you don’t have error highlight nor you don’t have syntax highlight inside conditional code. You can’t optimize imports nor refactor package. I’m using mac but afaik Flash develop also doesn’t have error highlight.
- There is not a set of native extensions working properly. There is nmex around there but you have to spend a week for make that thing work. I don’t know a game developer who enjoys implementing iAd, adMob, iRate, inApp, flurry, push Notification, Facebook etc. We all want to write games and these native extension part is a hump we want to get rid of really fast. So having option to buy stable versions or having these things inside nme would be awesome.
- Tilelayer has issues. It doesn’t change alpha when it’s container views alpha changed. This works properly on flash but not on cpp targets. ( This caused me a huge problem by the way. All my scene transitions were not working on cpp targets ) Tilelayer doesn’t perform good on flash target.
- Stable builts may have problems also. (http://www.nme.io/community/forums/programming-with-haxe/hxcpp-30-fails-android/)
- Building from source is a nightmare. It just truly is.
You may all say ” you are whining but haxe / nme is opensource, you can fix it”. That’s not what I’m good at nor that’s not what I want to do. All I want is developing my game on a cross platform framework without worries. Personally I think nme tries to do much more than it should. I think nowadays it is way more important to have ios, android targets working stable and all features implemented than supporting mac, pc, html, blackberry, webos, android, ios, flash sloppy. Seriously why html support ?
I really appriciate what nme team trying to do and I believe it will win the cross platform development race eventually.I’ll keep an eye on them. Maybe developing without a game engine was a mistake, maybe I dived into it in a wrong time ( during haxe 3 and sdl2 transition). Awe6, haxe flixel, haxe punk seems good. They may have issues on their own but they seem more stable than using tilelayer as main renderer. I chose stability over speed by getting back to actionscript, hope nme gets better till I start developing my second project.