Random techie babbling...

Native Android OGL Game Libraries : 3 of the best

I’ve spent the last few weeks scouting out Android libraries to help write native games in OpenGL, and I’ve come up with what I think are 3 of the best, all aimed at different levels or types of developers…

Andengine :
This 2d only library is probably the most ‘Flash like’ and feature complete in terms of a full library, and the quickest to get started with. It completely shields you from the underlying OGL system, making it very easy to get sprites up on screen and give them behaviours and modifiers (kind of similar to Flash tweens).

It comes complete with loads of helper classes to handle screen scaling, tile maps, parallax backgrounds, multi-touch and on screen controls, sounds & music (including a .mod player), particle systems, object pools, collision etc. It also features a full Box2d physics implementation using JNI C calls for speed (based on the LibGDX port, see below).

It’s got a pretty active developer support forum and its main developer Nicolas seems to be constantly adding cool new features.

On the down side, this power and flexibility comes at a price and I found it to sometimes be not slow but slower than the other engines mentioned here. It’s a 2d only library based on the concept of ‘sprites’ so no 3d stuff, and quite tightly tied to OpenGL1 (so won’t take full advantage of newer OpenGL2 capable devices).

Its ease of use has also attracted a lot of beginner users and the forums can be a little full of noise from the same repetitive and basic questions, and many more complicated questions go un-answered. There is a lack of official documentation, but it does come with a comprehensive set of examples projects that illustrate just about every thing it’s capable of.

However, if you want to jump in and try making or prototyping a native Android game then Andegine is a very good place to start. There’s a 5 minute quick start video available to get you up and running.

Ardor3d for Android :
I’ve played with this the least of the 3 so far, and can’t really say to much about it technically, but it’s built on top of a very comprehensive desktop 3d library. The learning curve seems a bit steeper than Andengine, but there’s also more existing resources out there, although they are currently mostly for the desktop version.

Unfortunately as far as I can make out you can’t ‘write once run anywhere’, so you cant port your desktop app directly to Android. It also seems to be tied to OpenGL1, so comes with the same performance caveat for newer devices as above.

I’m not sure I’d recommend this for beginners, but if you already have some 3d engine experience or have worked with Ardor3d before this is definitely one project to keep an eye on.

LibGDX :
If you want to get bare bones and have some OpenGL experience this may be the one for you. It’s a much lighter lib than the other 2 and provides a wrapper around the low level OGL calls and some basic helpers to abstract out file I/O, sound and input handling. It also includes a JNI Box2d wrapper (as used in Andengine also).

The really neat thing about it is you can develop and test your app on the desktop, then with a single extra class run the same code on your device. This cuts down the compile & test cycle dramatically and is a really handy feature.

It offers bindings for OpenGL1, 1.1 and 2 so you can choose to target only the newer OGL2 capable devices if you want, and seems to offer the most raw power of the 3 here. On the other hand you will need some experience with OpenGL to get started.

It’s in fairly rapid development and the guys behind it really seem to know their stuff, but one problem with this quick turn around was shown with the recent update from 0.7 to 0.8 which had a few ‘silly’ bugs (fixed in SVN) and changed some major parts of the API, and unfortunately the rather sparse documentation hasn’t really caught up with these changes yet either. It does however come with full Java Docs.

It has a developer forum, but it’s not nearly as busy as the Andegine ones, which in some ways is a good thing.

Conclusion
Personally I’m flitting between Andegine and LibGDX depending on my needs. If you want to do a tile based RPG or Angry Birds clone Andengine may very well be all you need. If you’re looking to remake GridWars or want to work in 3d you may be better with LibGDX.

Some other options…
Rokon Android :
Not sure but this may be dead? The site has been down for a few days now and a lot of users seem to be gravitating over to Andengine recently. Code still available on Google though if you want to give it a try.

Min3d :
Only came across this a few days ago so not had a chance to try it out yet. Looks like it could be interesting, and the developer’s a Flasher so that might help ease the transition for some of us. Another one to keep an eye on.

If there are any I’ve missed or if you can add anything (or if I’ve got something completely wrong) please leave a comment…

0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

3 Comments

Got something to say? Feel free, I want to hear from you! Leave a Comment

  1. oldskool73 says: (Author)

    Some great feedback from the LibGDX guys, seems I underestimated it a touch…

    //————–
    - You should call it OpenGL ES not just OpenGL, there’s a difference. The later is intended for mobile devices and misses some features of standard OpenGL (though you can do basically anything with it).

    - Libgdx currently has around 85k lines of code (counting the code in all languages). Andengine has around 17k. I would not necessarily use this as a good metric. But libgdx is far from being light

    - Andengine uses libgdx’s Box2D JNI wrapper (all hail open source software).

    - We consider the Java Docs to be the main documentation. We also have a shitton of examples at http://code.google.com/p/libgdx/source/browse/#svn/trunk/tests/gdx-tests/src/com/badlogic/gdx/tests. We also have a complete demo game that is fully open source at http://code.google.com/p/libgdx/source/browse/#svn/trunk/demos/invaders and we are currently working on a doom style 3D FPS for which the source can be found at http://code.google.com/p/libgdx/source/browse/#svn/trunk/demos/rtm. Tony is currently in the process of writting tutorials on the wiki as can be seen at http://code.google.com/p/libgdx/w/list. The architecture article is a little outdated and will be fixed soon. Apart from that i think we do pretty well in the documentation department.

    - In the utility class department we are at least as full featured as Andengine, with pools, pooled linked lists, pausable threads and so on. See http://code.google.com/p/libgdx/source/browse/#svn/trunk/gdx/src/com/badlogic/gdx/utils.

    - You don’t need to know OpenGL ES to write a libgdx game actually (apart from the one gl.glClear() call which clears the screen). We have texture atlases, sprites, spritebatches, bitmap fonts with basic layouting and so on. With this you can easily write any 2D game you want without touching OpenGL ES. See the com.badlogic.gdx.graphics package at http://code.google.com/p/libgdx/source/browse/#svn/trunk/gdx/src/com/badlogic/gdx/graphics

    - We have a full fledged 2D scene graph that can do a lot more than the layer based approach of Rokon and Andengine which is copied from Cocos2D. See http://code.google.com/p/libgdx/source/browse/#svn/trunk/gdx/src/com/badlogic/gdx/scenes/scene2d%3Fstate%3Dclosed. We have all sorts of modifiers, infinite hierarchy nesting, intersection testing and so on and so forth. That’s implemented in about 600 lines of code total and extremely fast. What we do not have is a shitton of Actor (node) implementations. Why? Cause implementing a parallax background or onscreen controls is 20 lines of code with the scene graph API and highly specific to your game.

    - We have a particle editor, a bitmap font generator, an image packer (for texture atlases) and a complete backend for the themeable widget library. Those come in form of extensions and can be found at http://code.google.com/p/libgdx/source/browse/#svn/trunk/extensions.

    - We also have a complete set of audio decoding and analysis tools written in C++, wrapped via JNI. We have decoders for MP3 and Ogg which allow you to actually get the raw decoded audio data which is not possible with Android’s audio classes. We also wrapped KissFFT a fourier transform library. With this you can write things like Audiosurf.

    - We have a comprehensive set of math utilities from vectors in 2 and 3 dimensions to matrices, catmull rom splines, frustums, bounding shapes, intersection testing between various geometrical shapes, polygon triangulation (again used by Andengine among other things…), quaternions and so on. This can be found at http://code.google.com/p/libgdx/source/browse/#svn/trunk/gdx/src/com/badlogic/gdx/math.

    - We support loading of Wavefront OBJ and to some limited extend MD5 files (Doom 3 format). We will add support for more in 0.9 with the help of David who has done some awesome stuff with MD5 already.

    - We have helper classes for everything OpenGL so you don’t need to touch the nitty gritty parts of it. Mesh, Shader, FrameBuffer, VertexBufferObject, IndexBufferObject, VertexArray, OrthographicCamera, PerspectiveCamera are just a few of the things you can find in the graphics package for that.

    I therefore wouldn’t say that libgdx is a bare bones framework, on the contrary. We do not include many of the little helpers Andengine has because with all the above you can implement that in a couple of lines. With the additional benefit that you are not bound to the single 2d pseudo-scenegraph paradigmn you are forced to use with Andengine. All our graphics oriented classes like SpriteBatch, BitmapFont and so on work with OpenGL ES 1.x and 2.0, so they are also future prove. Something that will be hard to achieve with Andengine unless you rewrite 50% of it.

    We believe that Andengine is a great place to start for beginners. Given that mobile devices have limited processing power on the CPU as well as the GPU we think however that ultimately you have to know what you do if you want to write anything more complex than a snake clone. Libgdx provides you with a lot that can help you in that case. It might look bare bones on the surface but if you dig into the packages you will see that we offer a shitton of functionality

  2. DuMkA says:

    for those who looking for java 3d game engine (like me) and missed this
    http://www.java-gaming.org/topics/why-don-t-many-of-you-use-jmonkey-engine/29474/view.html

Trackbacks for this post

  1. AndEngine vs Libgdx | Space Tale

Leave a Comment

Let us know your thoughts on this post but remember to place nicely folks!