-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Experimental] Native android export #246
Conversation
Which version of SFML should I use ? |
Use the latest master from https://github.com/SFML/SFML : clone it and follow Retrieving and Building SFML from https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android (build and install Note that by default, exported game are built for x86. You can change these lines in jni/Application/mk :
and then re-run |
If I understood correctly the process, there's no need to update the SFML version used by GDevelop itself ? |
Exactly, what the exporter creates is a stand-alone project which can be compiled with a Android SDK/NDK in which there is a version of SFML installed. This version of SFML installed in the Android NDK is totally different. |
I get an error when previewing a native game inside GDevelop (with this exporter enabled) :
Don't know if it's related to the change of Exporter EDIT: It's related to the change of exporter as it works in the last GDevelop version. EDIT: It's seems that it's caused by the compiler version I use (5.1.0) |
Mmm sounds strange to me that the exporter broke the code to launch the compiler. |
No, I'm trying again with TDM-GCC 4.9.2... |
That's strange. The official GDevelop is working but not the one I built myself (even with MinGW 4.9.2). I still have this error message. |
There's no problem with the master branch. The problem only occurs on this branch (no matter if I enable the AndroidExporter or not). By the way, the AppVeyor check fails, maybe related. EDIT: I think the error message is badly parsed by GDevelop. So, the error is not that cc1plus.exe is not found but that the precompiled headers are not found |
I should have looked at the compilation log (instead of the error panel of GDevelop), the full error message is :
|
Fix EventsPrecompiledHeaders.h.pch location on Windows
Fix Extensions headers not included
The commit I merged in your branch fix the issue (and also include the Extensions includes). |
I had another problem when doing
I'll send a commit that fix it soon. |
TiledSpriteObject is displayed correctly on Android devices
I'll check again with the updates made to TiledSpriteObject :) EDIT: Forget the rest, I made some mismatches with my folders :)
Any idea why? I merged your changes related to templated object creation before doing the PR but I guess I didn't check the Android compilation was still working for me. That's strange. |
Is TextObject.h included ? Le mer. 10 févr. 2016 à 18:56, Florian Rival notifications@github.com a
|
Are you sure the GDCore/GDCpp file are updated in GDevelop folder and in Le mer. 10 févr. 2016 à 19:11, Victor Levasseur victorlevasseur52@gmail.com
|
No worries my directories were all messed up :) |
I'll try (I manage to make ndk-gdb works) Le mer. 10 févr. 2016 à 19:35, Florian Rival notifications@github.com a
|
The game is was testing on my phone is now crashing on startup :/ But working great on the simulator. |
I've no crashes when changing scenes on my tablet. You can try to launch the game with ndk-gdb (ndk-gdb-py on Windows) to see where the crash is happening. |
Which game were you trying ? (I'm testing with the platformer project template) |
The crash on startup was related to a compilation mismatch between x86/armv7 ^^' (better use For the crash on scene changing, it's in one of my games, I'll dig a bit to see what's going on and/or if I can reproduce it in an example. I tried ndk-gdb but no stack trace (only function named "????"). I took a look at the devices logs and got a stack trace (will put it here later), but it was changing between runs. Often it crashed while deallocating objects related to the platform behavior. |
@victorlevasseur Here is a minimal example: crash-example.zip Export/compile/launch it, click on the big button in the center on Android and it will crash. It's surely related to the platforms but I'm not sure why. |
I'll try ASAP |
Cool let me know if you can reproduce the crash and if you have any idea on how to debug it efficiently :) |
It also crashes on my tablet. Investigating... |
It get a stack trace from ndk-gdb :
|
Nice stacktrace (much more complete than the ones I had), seems related to ScenePlatformObjectsManager and scene unloading! |
This is awesome progress guys. Gaining native android support will attract a lot of new users |
I'm also experimenting with another alternative: using Cocos2d game engine, which would bring cross platform/JS compatibility with native rendering on Android/iOS/Mac/Windows/Linux and HTML5 for web games. :) |
See this issue for discussions about this alternative: #238 😃 |
I've heard a lot of good things about cocos2d in the past. It is a very solid and battle tested as a mobile game development engine- both games and apps. If you manage to integrate it with gd you will also have to maintain only one engine rather than two. The other advantage of course would be the updates that it gets. It seems like a better choice than further implementing sfml, but also a lot more work. I think it would be worth it in the long run as it is more advantageous |
Did you manage to catch the Platformer bug ? for (std::set<PlatformBehavior*>::iterator it = allPlatforms.begin();
it != allPlatforms.end();
++it)
{
(*it)->Activate(false);
} Here void PlatformBehavior::OnDeActivate()
{
if ( sceneManager )
sceneManager->RemovePlatform(this);
registeredInManager = false;
} By removing the platform while iterating on it, it may invalidate the
Personally, I still think SFML is the best choice as it does request less things to be installed (except when you want to build your game for Android) compared to Cocos2d. |
Fix crash when ending a scene with Platform objects in it
The platformer behavior should be fixed now. :D |
Awesome, thanks for the debugging! Will try it soon :) |
I've made some refactoring and made an experimental exporter to see if SFML powered games could be run on Android.
I've made a really quick explanation about it here: http://4ian.github.io/GD-Documentation/GDCpp%20Documentation/d5/dfa/class_android_exporter.html
The result is that simple games are working, with great performances but I've got some graphical glitches with some objects and weird crash from time to time on a larger game.
I'll probably merge this even if the Android exporter is not working as it's not visible for end users for now and there are some improvements nevertheless.