Native Android export?

Just would like to ask about if native android export is planned so we could export native (C++) projects to Android or not.

The reason I’m asking is because I decided to target Android devices in first place but I’m not happy with the performance
and compatibility I can get using HTML5/JS.
For example:

Scenes using Three.js built as an android app but also in browser can’t run on one of my android device because of compatibility problems (not sure what), and on an other android device it running at 8FPS. This is a 3D scene with lights and some objects casting shadows and playing animations.
Similar 3D scene made in AGK2 running at 30+ FPS on both of my Android device.

Also Pixi.js is not great which is used by GDevelop and GDevApp, scenes using Pixi.js built as an android app but also in browser runs at 10FPS on both of my android devices.
The scenes are 2D scenes nothing fancy just few objects created on the fly and moving around.
Similar 2D scenes made in AGK2 runs at 40+ FPS on both of my android device and if I
apply some fancy shader effects and physics in AGK2, the FPS is still above 30FPS .

So, where Pixi.js and Three.js (HTML5) scenes are running at 8-10 FPS, AGK2 scenes are running at 30-40 FPS
and this is not even native I believe as I’m using Basic to code in AGK2, (according to AGK2 devs) by using C++ with AGK2 I could get even better performance.

About the Android devices I’m using:
One of them got 1.6GHz Cortex-A7 CPU, 1GB RAM and Mali-400 GPU and the other one got 1GHz Cortex-A7 CPU, 512MB RAM and Mali-400 GPU.

Maybe you think okay people (already) stop using such low-range devices anyway as today high and mid-range devices gonna get cheaper to buy and performance difference is less noticeable on better devices, also HTML5/JS may get also faster in the future but what I have in mind at this very moment is that even though on better devices the performance difference is less noticeable, the difference is still there and when you are about to introduce some resource hungry graphical effects and gameplay mechanics, the extra FPS you can get with native apps can be extremely useful to keep the game at playable frame rate and so I’m about to make the decision to drop everything I have done so far in the past one year in GDevelop and start everything from scratch in AGK2 for the sake of performance and compatibility on Android devices.

So all I would like to know to make my decision easier, is native Android support in GDevelop is under development already by any chance, or at least planned or not even planned?

Thanks.

Not actually planned. The next version of GDevelop will have better performances (because 4ian updated pixi.js to the third version).

Are you sure you’re compiling your HTML5 project using the “Crosswalk Android” option in the Intel XDK ?

Here are things to keep in my mind when it comes to export to Android and iOS:

-For Android, always export using Crosswalk. This enables the game to use the Chrome engine internally which is very fast.
-For iOS, target iOS 8 (used by 75%+ of iDevices). There have been lots of improvements in the JS engine powering the games packaged for iOS in iOS 8.

For example, I’m developing a platformer game for Android and iOS. It’s super smooth on iPad and iPhones 5+ and runs properly on my mid-end Android phone. But I took great care to make sure that I deactivate all automatisms for objects that are too far and that I launch collisions detection and events only on objects who are close to the player and visible on screen :slight_smile:

You may want to try CocoonJS WebView+ also for iOS :slight_smile:

Note that for HTML5 games, Three.js and Pixi.js are the state of the art library for 3D and 2D, so nothing to do much here on my side to improve performances. (Pixi is really great and the fastest 2D rendering engine for HTML5 :slight_smile: )

A native export for Android/iOS would be theorically possible when SFML (the underlying rendering engine) will be fully supporting these platforms. For now the support is still a bit experimental and incomplete :frowning:
Maybe I would give it a try but honestly I can’t promise anything. Right now we are not lots of developers working on GD so we can’t afford having to maintain different native ports for Desktop, iOS and Android, we have to rely on a technology (SFML) which allow us to target all platforms (Mac/Linux/Windows and maybe later iOS and Android).

Added here: trello.com/c/qxntSAXU/22-develo … tive-games

But right now nothing is planned in the near future. HTML5 still the easiest way to export to ios/android.

I open the project in IntelXDK as Cordova and export it as Crosswalk Android.
I know you can’t do anything about Pixi.js that’s why I’m asking about native export but I didn’t realised the Android support in SFML only experimental I though it fully supported…

I have just tested actually at what speed, how many sprites able to render for me Pixi.js on my android device:
100 sprites at 21FPS,
1000 sprites at 8FPS
Which is not bad as normally we don’t really need so many sprites rendered on the screen and also my Android device is old but I have also done the same test in AGK2 and I get:
100 sprites at 60FPS
1000 sprites at 24FPS

I don’t know but I think it a lot of FPS to loose only on rendering, no animations, no movement, no collision, no physics, no lights, effects, automatisms or anything but rendering sprites :neutral_face:

Just an update on this, I was looking for different ways to get HTML5 games exported and running on Android devices and I’ve found Canvas+ which is a sort of virtual machine used by CocoonJS, and the results are:

CocoonJS (Canvas+)
Rendering 100 sprites at 60FPS
Rendering 1000 sprites at 20FPS
AngryPeas running at 31FPS

Compared to IntelXDK-Crosswalk which is using Webview
Rendering 100 sprites at 21 FPS
Rendering 1000 sprites at 8 FPS
AngryPeas running at 13FPS

Canvas+ which is exclusive to CocoonJS brings huge improvement on my old low-end devices but playing AngryPeas I have noticed a little bit of lag time to time.
The FPS is always around 30 using Canvas+ but the whole app just freeze for a moment time to time but maybe it because of the amount of memory as I’m experience the lag on my device with 512MB of RAM, on my other device with 1GB of RAM I don’t have such problem.

So, if anybody care about performance on old devices or in general I can recommend CocoonJS with Canvas+
ludei.com/

But Canvas+ doesn’t support every HTML5 engines and all features so it may not a solution for everybody in all cases, Webview has better HTML5 engine and feature support but has horrible performance on old devices (from my experience) so I think native Android support is a must have feature.

Just wondering if SFML could be replaced with something that actually comes with Android support something like Oxygine maybe.
oxygine.org/

Not completely but at least for android devices:
Windows,Mac,Linux = SFML
HTML5 = Pixi.js
Android = Oxygine

SFML supports Android (but it’s still a bit experimental). 4ian and I are making some tests with it to see how we can integrate the ability to build native games for Android in GDevelop.

Just would like to ask about did you have any success with the tests or better not to hope native android support in near future (let say in the next 1 year or so)?

The only test we’ve done so far is to build an SFML example app on Android. It works but the compilation process is quite complex and we need to adapt all the GDevelop libs (+ extensions) to be able to cross-compile them for Android.
Do not hope the native Android export in a near future because we are working on other tasks (4ian on scenes stack and me on unicode support).

Okay, I thought about something.

I’m struggling a bit to get my project to android using HTML5. It not performance this time, but the fact every time I want to test something, I need to actually upload my HTML5 project to a server, wait for uploading, wait for compile and then download the apk, I hate it… As my project getting bigger and bigger it takes more and more time to upload it and compile it. Last time I had to wait 20 minutes, which is not bad when It about to compile the final game, the actual release version, but when it comes to testing, that 20 minutes just killing… and then download it, copy to device, install it, oh crap it wrong, change it, upload it again… :cry:

I decided to search for an offline solution, I was hoping that, there is an offline software that I can install, run and just do the same locally on my PC without need to upload my project to any servers, but nothing. So I thought, all these online services are basically just embed my HTML5 game inside a native android app. I know they also do some optimisation under the hood, but basically, they are just exporting a native android app that is using a web browser engine (Chromium in most cases) to display in full screen the HTML5 game.

So, here is the thing:
Instead of porting the complete native game engine (SFML) to android, how about that, if GDevelop would be able to export a native android app and render the HTML5 game inside the app using a browser engine?
So basically, when we choose to export to android, GDevelop would export our game to HTML5 and then export a native android app (apk) with our HTML5 game inside and would use a browser engine to open it inside the app in full screen?

I know it would definitely not help with performance but it would help with my current problem which is the required time (and broadband connection) to upload our game to serves and wait for compile and then download it (don’t even mentioned limitations that comes with free account in many cases)…
It could be a nice out of the box experience, maybe not as advanced as IntelXDK and others, but easy, quick and simple for the end user.

Engines that GDevelop could use to render the game inside the native app:

Gecko (used by Firefox)
developer.mozilla.org/en-US/docs/Mozilla/Gecko

Blink (used by Chromium and Google Chrome):
chromium.org/blink

Webkit (used by Safari)
webkit.org/

I was already looking for development tools that are able to export directly to apk and comes with a built in web browser engine, so after done my game in GDevelop I could ‘simply’ fire up an other offline tool and write a simple application that would be open the specified index.html in full screen using the built in browser engine.
But unfortunately, all the tools capable to do such thing out of the box are paid ones and pretty expensive ones.

Since I don’t know if such an idea would makes any sense (performance and compatibity wise, it may ok to load a static page, but not for games), I don’t want to buy any of the tools I’ve found only to try it, instead I’m here to suggest it to you to make it as an out of the box experience for GDevelop :laughing:

So, what do you think? Would you be able to and willing to add such thing to GDevelop? Does it makes any sense at all?

To create an Android app, you’ll need the JDK, the Android SDK and the HTML5 web engine which takes quite a lot of space. That’s why all HTML5 Android export services are online. :wink:

Definitely, GDevelop wasn’t designed to make native mobile games. In the current state of the software, using SFML + proprietary libraries, it will be tricky generate an apk. Not impossible, but very difficult. As far as i know, there are several ways that GDevelop can become a tool for developing mobile games with good performance. But they are all very disruptive… i mean… it will take a lot of work to implement some of these forms.

I suggest rewrite the native runtime GDevelop using some other C ++ library that has a good support for mobile platforms, such as cocos-2d-x and organize external dependencies (plugins, behaviors, etc.) in ways that are also compatible with the Android NDK, Emscripten etc…
It will be a lot of work to do this but will improve GDevelop substantially, allowing it to produce games with great performance on any platform.

I suggested Cpp + cocos-2d-x, but could also be made in Haxe + OpenFL. It was a great performance too. It is used on Stencyl Runtime.

I don’t think the size would be a problem, if you look around, most development tools capable to export directly to APK all of them cost ‘only’ few GB’s to download and install, but I don’t think it would be a problem these days when the cheapest PC I can ever find got at least 16GB storage but if you are interested in games and game development probably you got few hundred GB of storage…
AGK2 actually takes only 800MB and I never had to install Android SDK and JDK to be able to export an apk from the tool :confused:

Anyway, I have Installed Android Studio and been able to write a simple app to render a HTML5 game made in GD using Android WebView :slight_smile: I got horrible performance, pretty useless :laughing: , but I like the fact I got the apk on my hard drive under 5 seconds, I didn’t had to upload anything and I didn’t had to wait so long for compilation, and I did come across a tutorial, how to replace Android WebView with Crosswalk in Android Studio, so I’m pretty optimistic on this one :slight_smile:

I’m less optimistic on this one :laughing:
If I can remember, 4ian would be more interested in using only Pixi.js and Three.js even on the desktop and turn GDevelop in to a HTML5 based tool more like Construct 2 is, but it was a long time ago when he was talk about this topic, maybe he’s changed his mind since.

:cry:
despite html5 have advanced much, it’s gonna take a while to have a great performance on Android devices.
It’s funny that GDevelop has a native compiler for PCs, and this is the device that don’t need a native compiler, since the NW.js performs well.
The good thing here is that GDevelop is open source, so we can adapt a native runtime for these platforms.

Which device doesn’t need to compiler ? :confused:

Computers :open_mouth:
I mean… you can create html5 games using GDevelop and use NW.js to run these games on PCs. There is loss of performance, but computers have sufficient processing power for this loss is not noticeable. That’s what I mean by “[…] this is the device that don’t need a native compiler…”
HTML5 games performs well on PCs, but sucks on mobile devices.So, would be nice if GDevelop native compiler compiles for Android too :wink:

My dream :mrgreen:

The native mode of Gdevelop is so far better from my point on view (performance analysis, extensions, stability). I keep reading stuff about tutorials on sfml to android export, and it seems really possible… Also the idea is the Trello roadmap.

But, even with SFML (which I successfully built for Android), we need the Android SDK and Android Studio to build the application.

Even with a hundred of MBs, the hability of generate android apps with good performance is a amazing plus for GDev, IMHO

It not a big dial, Unreal Engine 4 is a 4+GB download but it still requires on the top of that JDK and Android SDK to be downloaded, installed and configured manually in order to be able to export to Android. The option is there to export to Android, but it not gonna work until you get your hands dirty…
Even Android Studio requires to download, install and configure JDK (mess with the user variables) to get it working.
With a nice documentation I think it okay to put an Android export option that pops up a message about 3rd party software required and a link to the documentation to follow these steps…

I know, it not a nice and easy user experience in case you worry about that, but if I’m gonna get by end of the day what I need, which is native performance on Android using my favorite game development tool, it totally worth it to get my hands dirty. The only thing we need is an easy to follow documentation, a universal solution, step by step guide that works for everybody and everywhere. If you and 4ian able to release such a documentation along with an Android export option, in my opinion it worth it to include Android export option that way.