XaiJu
Shattered Pixel
Shattered Pixel

patreon


LibGDX 1.12 Native Code | Patreon Weekly #243

Hey Patrons! In this weekly I’m going to talk a bit about Shattered’s internal changes that are releasing today with v2.3.1.

There’s a new Shattered Secrets this week too! In this Shattered Secrets I’m going to share some rough concepting ideas I have for trinkets in v2.4.0!

The Easy Part

libGDX is the game library Shattered uses. It lets me easily build Shattered to work on multiple platforms, without writing a bunch of code for each one. Over the last week I’ve been updating Shattered from libGDX 1.11 to 1.12. Updating libGDX doesn’t change much for the user experience, but it’s important for code maintenance and general stability.

On Desktop and iOS the updating process went smoothly. libGDX 1.12 does drop support for iOS 9 and 10, but users on these devices were warned of this, and they make up only ~0.05% of Shattered’s iOS playerbase. On the upside for this, requiring iOS 11 lets me simplify the game’s iOS build process slightly and finally update the game’s version of Google Firebase for iOS.

Android Troubles

Unfortunately, on Android I discovered that an unintended internal libGDX change completely borks the game on Android 4.0 to 4.3. These are about 0.5% of Android players, and I haven’t given any warning, so I’m not willing to drop support for them just yet. I set about seeing if I could fix this.

To make a long story short, the issue was in libGDX’s native libraries (bits of code written in C++ instead of Java, for better performance), because of updates to Android’s native build tools. It looks like Google is moving to kill off support for these old versions of Android, and so any native code built with newer tools just does not work below Android 4.4. In fact, the very latest release of the build tools even drops support for 4.4! Thankfully, there were no significant native code changes between libGDX 1.11 and 1.12, so for now I’ve managed to get things working by using libGDX 1.12 with the old native code from 1.11.

Doing this is dangerous though. The natives from 1.11 are only designed and tested to work with 1.11, and if they’ll only work with 1.12 by coincidence. Shattered v2.3.1 has been in beta for a few days now with no ill effects though, so I’m reasonably confident that everything is working. I’ll eventually need to drop support for Android 4.0-4.3, but not today!

---

I’m likely going to be releasing a v2.3.2 in another couple of days with a few more tiny changes, and then it’ll be on to v2.4.0!

Comments

> don't really use Yup I know - no Scene2D for starters... Keep up the good work as the saying goes.

Robert Heinig

Thanks! Shattered mainly uses libGDX as a wrapper for openGL, audio, input, etc, so there are a lot of changes that I don't really use anyway. I have noted a few things that I plan to look into in v2.4.0 (the touch cancel changes, mainly), but the ideal outcome is no user-facing change anyway so I wasn't keen on it for a v2.3 patch. As for 4.0-4.3, it's pretty rare for apps to support such old andorid versions at this point so it's not surprising that you missed it. Heck v1.12 has been in production for almost 7 months and I think i'm the first one to bring it up. EDIT: also v1.12.2 is going to formally drop 4.0-4.3 support, so I suspect I'll be sticking with v1.12.1 for quite a while.

Shattered Pixel

I remember spending hours and days reviewing 1.12 and what it might do to hacks and workarounds circumventing Gdx errors and weaknesses in another project, but that one I did not stumble over. So - well done, I respectfully bow to a proof of competence.

Robert Heinig


More Creators