Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Return of Dr. Destructo releases for Android!

This thread is locked; no one can reply to it. rss feed Print
Return of Dr. Destructo releases for Android!
Max Savenkov
Member #4,613
May 2004
avatar

So... Another commercial Allegro game released for Android, and this is my own Return of Dr. Destructo.

It's been a somewhat rough ride with Allegro on that platform, but in the end, everything seems to (mostly :)) work!

I'd like to thank all who contribute to Allegro development. And by the way, SDL2 on Android is also awful (or was awful about a year ago, when we last tried to use it for some things at work) :)

Mark Oates
Member #1,146
March 2001
avatar

Awesome! :D

Allegro FTW!!

Did you have performance difficulties or battery drain problems at all? My frameworks seem to take a bit of heat on my mac/pc, but haven't tried on mobile.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Max Savenkov
Member #4,613
May 2004
avatar

I have a problem with the device heating up a bit too much during the game, which I haven't paid enough attention to yet, and there are some slowdowns. I'll see how many users that will affect and try to fix it later, if possible. All in all, Allegro is not very effective. I'm not much of a graphics programmer myself, but my colleague who is one, told me Allegro changes OpenGL state too often, without the need. Also, somewhat of a surprise for me, playing MOD files on mobile via libdumb proved to be a bit too CPU-intensive, so maybe I'll convert my music into ogg later.

But my main problems all were with context preservation when user switches away from the game. I had to use a lot of textures with NO_PRESERVE flag for speed reasons (I write to texture a lot), so I had to find a way to restore them after user returns to game, and that proved to be difficult in some cases.

For example, just a few days before release, I discovered that Allegro display emits a different sequence of events if user switches out/switches in and powers off/powers on the device. In the second case, there will be no DISPLAY_RESUME_DRAWING event, as the drawing is not actually ever halted, so I had to rely on DISPLAY_SWITCH_IN to restore my textures. However, in the first case, I CAN'T restore textures in DISPLAY_SWITCH_IN, because it comes before DISPLAY_RESUME_DRAWING, and it is yet impossible to draw anything, so I have to wait for the later event.

I'm still not sure if switch-out/switch-in works in all cases on all devices, because our tester reported that she hit a case once where the game was unable to re-create a shader after she returned to it, but she was unable to reproduce it consistently, and I'm frankly out of ideas what could go wrong.

All in all, mobile OpenGL ES is even worse than DirectX when it comes to keeping/restoring resources. It's a major pain for everyone (in fact SDL2 was doing it so bad we had to stop relying on it to handle Android events in our other game, and write our own code, which seem to do a better job).

LennyLen
Member #5,313
December 2004
avatar

It would be interesting to check out how libgdx operates under the hood. It seemed to run very well on Android when I tried it out.

amarillion
Member #940
January 2001
avatar

Woot!

I plan to get into Allegro + Android development so I'm very interested in your experience. Hopefully the difficulties you run into will lead to some useful improvements.

Go to: