Python 2d game engines for Android/iOS
I would like to create a game. Something rougue-like for example. And because I like Python, I would like to create it in Python. And because it makes sense today to write games for iOS and Android, I would like to use some framework that somehow supports these platforms. And this post is about my attempt of finding some suitable framework. The only frameworks I could find were Kivy, libRocket and Ignifuga.
Kivy
Kivy (homepage) looks good. Not exactly a game engine, it's GUI framework created with touch devices in mind. I played with it for a while and it has nice documentation and the widget oriented design makes sense. I was able to create tile-based editor basically in no time.1 I was even able to create a silly 2d grid prototype with path-finding using map created by my editor. There are a few problems though. First ouch, it's partially written in Cython, so you can't use PyPy. Then it forces you to use Kivy DSL to describe structure and behavior of your UI. You can usually use Python all the time, but I got to a point when writiting one part in Python was almost impossible. And now to the last and the real problem: it's licensed under LGPL. If you need to develop for iOS, you can't use LGPL/GPL code. This platform does not support third party libraries and App Store license is basically not compatible with LGPL/GPL (v2, v3)2. Don't ask me how someone managed to get an application to App Store made with Kivy - I guess it was a mistake made by Apple.
libRocket
In libRocket (homepage), Python is not used in a way Python developer would expect - you need to write RML (HTML-like stuff) where you can use Python within <script> tag. News on their homepage look old (2011?), code is not being updated too often (latest commit 4 months ago?). Hm, no. No thanks.
Ignifuga
Ignifuga (homepage) is using entity component system. This architectural pattern is quite clean, it's used for example in Unity 3d. It does not suffer from crazy, complicated inheritance of game objects but dependencies between components can also lead to interesting problems. Still methinks this approach is better than everything else. The framework is using Cython - I see, nobody likes PyPy. And it is somehow compatible with RML libRocket files. As far as I understand first you create json description of scene/scenes, then you describe your scene in RML. However this approach is a little bit verbose - doing it all by hand means a lot of json garbage - stuff that should be processed by game maker like tooling. Ignifuga is using original BSD 'advertising clause' license. Hm, splash screen. At least it does not suffer from LGPL/GPL poisoning.
Summary
I guess the best you can find for truly multiplatform development is Kivy, but LGPL is no go for iOS. Ignifuga is interesting, yes, but I would prefer some tooling. And everything looks "in-progress", nothing stable and no really butt-kicking applications. I see that Python is not yet ready for Android and (logical AND) iOS. Damn. It's probably time to check solutions with less Python in it (sad emoticon).
I'll check HTML5 applications development next time - basically you don't need to re/deploy it every single time you change something, you just push the refresh button on your device, no matter what the device actually is. Priceless.
In comparison to other GUI frameworks I met of course. ↩︎
Apple is the distributor and they don't let you recompile any application and install it on your device. VLC tried and Adium was investigating the possibility (source). Not legal. ↩︎








