Happy New Year 2016

Happy (belated) New Year 2016! And now on to updates.

It seems I have abandoned HaxeFlixel almost completely in favour for Kha. Two months ago, I was in a limbo between using HaxeFlixel or Kha. Here is my list of pros-and-cons of using them. Note that these are my opinions after all, and YMMV (your mileage may vary):

  • HaxeFlixel pros
    • Very matured game framework
    • Has a lot of convenient libraries, e.g. Tiled parser, Nape integration, Quadtree collisions
    • One of the Haxe frameworks with large use-base (compared to OpenFL or HaxePunk)
    • Battle-tested to work and compile with minimal issues, since it originates from the Flixel framework.
    • Actively updated by the HaxeFlixel team, all of whom are very experienced.
    • Very, very easy to prototype platformers and other common 2D games.
  • HaxeFlixel cons
    • Bloated features – I doubt anyone uses about 80% of the library for prototyping purposes
    • Bloated classes – Too many properties; While this may not be significant, it can still be an issue for performance (CrossCode developers’ article on their experience with composite vs inherited classes) in the long run.
    • Bloated size – An empty HaxeFlixel game in HTML5 is a whopping 2MB, which is unacceptable for bite-sized games. Using minifiers reduces the size by half, but it still includes a lot of unnecessary code.
    • Difficult to find support – This is an anecdote — It’s tough to give and receive help when the only people who know their stuff are too busy fixing the core HaxeFlixel features, and the others are simply too busy working on their own games.
    • Experimental HTML5 support, with no WebGL support.
    • Attempting to tinker with HaxeFlixel’s code requires thorough knowledge of the underlying flow of Lime, OpenFL -and- HaxeFlixel. That’s a lot to stomach for me.
    • Doesn’t support shaders out of the box.
    • Doesn’t support 3D out of the box.
  • Kha pros
    • It’s an SDK similar to SDL for C++
    • One API for all targets
    • Almost native speed
    • Supports HTML5, WebGL with fallback on Canvas
    • Supports 2D and 3D.
    • Easier to dive into the code to tweak and make minor changes for custom builds.
    • Robert (the author of Kha) is super duper responsive, very helpful on the IRC channel, and knows his stuff.
  • Kha cons
    • The codebase is pretty volatile every now and then. This causes a lot of stuff to break frequently. Although, it’s somewhat stable now at version 16.1.
    • Kha is a work-in-progress, so expect some things to not be working yet, e.g. (anecdote, again) Audio on Chrome mobile is pretty bad.
    • Because Kha is an SDK rather than a game framework, you have to roll your own game engine or framework. On the positive side, this means you get full flexibility for how your app/game is written.
    • Since most of the work is done by Robert alone, updates may not come as fast as you’d expect. However, Robert looks at every single Pull Request and merges frequently, so contributions are greatly appreciated.
    • Lack of documentation. Although, you could always ask Robert directly (via twitter, IRC, or his forum) and he’ll get back to you pretty quick.

The comparison above may not seem fair, considering that Kha is more likened to Lime or OpenFL than HaxeFlixel, but even when I tried using Lime or OpenFL, Kha still feels a whole lot easier. I’m not exactly a great programmer, so if I can feel comfortable about Kha than I do with Lime or OpenFL, then it should speak volume.

Over the past two months of experimenting back and forth with Kha, and eventually rolling out my own game framework for Kha, Wyngine, I am quite content to say, I’m happy enough with my own lightweight component-based game framework. It’s missing a lot of the fancy stuff like Quadtrees (I removed it due to performance issues on mobile), Nape, animation, or Tiled parsers, but when I need them, I’ll definitely add those in.

4 thoughts on “Happy New Year 2016

    • WY Leong says:

      Hi Brad, thanks! I have in fact checked out KhaPunk (and HaxePunk for the matter), and even based Wyngine off it when I started writing. Now I’m just too invested in my own engine to be learning a new framework. 🙂 I’m sure KhaPunk will be a great framework for those who’re already familiar with Flash/HaxePunk.

  1. Rafael Oliveira says:

    Just a gerenal tip, maybe you don’t know, but haxe has a compiler option to remove unused code.
    http://haxe.org/manual/cr-dce.html

    I used haxeflixel in the past, and had this issue on the file size, I tried dce but the haxeflixel code wasn’t ready for dce, so I opened a issue.
    https://github.com/HaxeFlixel/flixel/issues/1397
    The issue was fixed, and my code were from 1,85mb to 845kb and 558kb with dce and the -minify option in openfl. But I stopped using haxeflixel because other things, like some assets being hard coded in the code, and I didn’t found a good way to make html5 games for mobile browsers that used all available screen (without black borders).

    From haxeflixel I went to Phaser and now I’m using Kha. What I like in Kha is that is very small and flexible, and yet powerfull, so it doesn’t take assumptions about your workflow, and you can use it in the way you want. And with this I was able to make a library to manage the screen in html5 mobile games.
    https://github.com/RafaelOliveira/Mobile (but probably I need to update it to work with the latest changes in Kha).

    • WY Leong says:

      Oh! Thanks Rafael! TIL about dce. 🙂

      That aside, the main reason I stopped using HaxeFlixel are two — the experimental HTML5 support and the bloated framework.

      And awesome work on the mobile screen support, and thanks for sharing! I think I already have my own simple fix for it in Wyngine, but I could definitely learn something from your code. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *