Android port efforts

For people working on the C++ code.
User avatar
stu
Member
 
Posts: 933
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

Android port efforts

by stu » Sat Jan 11, 2014 20:37

I have recently been following the progress of celeron55, xyz and sfan5 in the work towards an official mobile version of minetest. This is something I would really like to see and get involved with.

My idea would be to split the client and server completely, i.e. no singleplayer game per-say, only perhaps something really simple that allows new users to become familiar with the UI. This means you would have to connect to a server in order to play the game, this could be a public online server or local network device (pc/tablet/router) or even a server running on the client device itself (if it's powerful enough)

My current android branch is essentially just a carbon copy celeron55's sailfish branch, although I have added a few missing things and actually made it compilable for android. Unfortunately that's as far as it gets because the resulting app fails during the initial self testing process, here is the output of LogCat https://gist.github.com/stujones11/8375453

Does anyone have any ideas why this might be? It seems like it worked ok on sailfish os and xyz's patches work fine with freeminer. I suspect it is probably something quite simple but I have no idea where to begin looking.

Updated: 09 Mar, 2014

Now available as a debug.apk for testing purposes only.

Do not try to run this on anything you are not prepared to break!
Ok the worst that should happen is that it just won't work but I can not promise anything.

Please do not post things like: You broke my phone or it doesn't work.
At very least tell me what happens and what version of android you are running.
Please read all the previous replies before posting a question.

Cheers!
Last edited by stu on Sun Mar 09, 2014 19:19, edited 1 time in total.
 

Sokomine
Member
 
Posts: 3750
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Sun Jan 12, 2014 01:31

Sorry, can't help you there. But if you manage to get it running, please force the player to select a name as a first step after starting the game. Else new players will wonder why there's no server that wants them (with automatic Guest1234 names beeing disallowed on almost all serious servers).

Having an android version would be great!
A list of my mods can be found here.
 

User avatar
sfan5
Moderator
 
Posts: 3791
Joined: Wed Aug 24, 2011 09:44
Location: Germany
GitHub: sfan5
IRC: sfan5

by sfan5 » Sun Jan 12, 2014 09:42

stu wrote:Unfortunately that's as far as it gets because the resulting app fails during the initial self testing process, here is the output of LogCat https://gist.github.com/stujones11/8375453

Does anyone have any ideas why this might be? It seems like it worked ok on sailfish os and xyz's patches work fine with freeminer. I suspect it is probably something quite simple but I have no idea where to begin looking.

You need to somehow pass --disable-unittests to minetest, your LogCat output shows that it ran the unit tests and exited.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
stu
Member
 
Posts: 933
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Sun Jan 12, 2014 16:00

sfan5 wrote:
stu wrote:Unfortunately that's as far as it gets because the resulting app fails during the initial self testing process, here is the output of LogCat https://gist.github.com/stujones11/8375453

Does anyone have any ideas why this might be? It seems like it worked ok on sailfish os and xyz's patches work fine with freeminer. I suspect it is probably something quite simple but I have no idea where to begin looking.

You need to somehow pass --disable-unittests to minetest, your LogCat output shows that it ran the unit tests and exited.


Disabling the tests appears to have done the trick, however I could not find a way to pass command line args to a native android app, so instead I had to disable the tests using preprocessor directives for now. I am a little concerned as to why these tests cause the app to fail, they seem to pass ok with freeminer. Never the less I have it working now (of a fashion) clearly there is much work to be done before we can even think about an official release.

Thank you very much for your help
 

User avatar
stu
Member
 
Posts: 933
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Sun Jan 12, 2014 20:03

Interestingly following a rebase LogCat is now providing a little more insight into the unittest crash https://gist.github.com/stujones11/8389664

Unfortunately this does not mean much to me ;-(
Last edited by stu on Sun Jan 12, 2014 20:04, edited 1 time in total.
 

User avatar
xyz
Member
 
Posts: 450
Joined: Thu Nov 10, 2011 14:25

by xyz » Sun Jan 12, 2014 22:06

You won't be able to figure out anything without using ndk-gdb, so do that.
 

User avatar
stu
Member
 
Posts: 933
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Mon Jan 13, 2014 23:11

xyz wrote:You won't be able to figure out anything without using ndk-gdb, so do that.

Thanks, that does look promising but unfortunately the one shipped with the crystax ndk was configured for x86_64 and I am only using x86
Looks like I have to build the ndk myself, which it says could take hours (more like days on this old pos) definitely a weekend project...

Do you happen to know if there is any way I can just reconfigure the ndk-gdb?
 

User avatar
xyz
Member
 
Posts: 450
Joined: Thu Nov 10, 2011 14:25

by xyz » Tue Jan 14, 2014 12:52

stu wrote:Do you happen to know if there is any way I can just reconfigure the ndk-gdb?

No, I didn't look into it at all.
 

User avatar
stu
Member
 
Posts: 933
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Sat Jan 25, 2014 17:54

Updated, added image buttons and some touchscreen mods

Image

Build instructions now included, see minetest/build/android/README.txt
Last edited by stu on Tue Feb 11, 2014 23:17, edited 1 time in total.
 

User avatar
hoodedice
Member
 
Posts: 1372
Joined: Sat Jul 06, 2013 06:33
Location: world
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice

by hoodedice » Sat Jan 25, 2014 18:02

Great work stu! Would've tested this, but my phone's 386 MB RAM is not at all enough for MT.
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
 

User avatar
stu
Member
 
Posts: 933
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Sat Jan 25, 2014 19:08

hoodedice wrote:Great work stu! Would've tested this, but my phone's 386 MB RAM is not at all enough for MT.

I am not sure about the RAM requirements, my tablet has 1GB but it also runs in the emulator with default 512 MB
 

User avatar
hoodedice
Member
 
Posts: 1372
Joined: Sat Jul 06, 2013 06:33
Location: world
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice

by hoodedice » Sat Jan 25, 2014 19:26

Are you putting any optimizations for android? I don't think so. If you didn't, there is no way in hell anything with less than 1 GB of RAM can run it above 20 fps. BuildCraft lagged horribly on my device, and the textures never showed up either.
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
 

User avatar
stu
Member
 
Posts: 933
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Sat Jan 25, 2014 19:48

hoodedice wrote:Are you putting any optimizations for android? I don't think so. If you didn't, there is no way in hell anything with less than 1 GB of RAM can run it above 20 fps. BuildCraft lagged horribly on my device, and the textures never showed up either.


I guess there is a big difference between working and actually being playable. Although my tablet only cost around 60 Euro and I consider it to
be just about playable on that, 15-25 FPS somehow seems better than it would be on a pc, movement is quite fluid, the only real lag I get is with
node placement.
 

User avatar
Novacain
Member
 
Posts: 285
Joined: Sat Aug 31, 2013 01:03
Location: Skaaro

by Novacain » Sat Jan 25, 2014 23:17

I take it the lower right hand button is the menu, and the middle button in the directions is to jump? also, does it have multi-touch support so you can sneak and move at the same time? oh, and do you have toggles for fly, no-clip, and fast?
EXTERMINATE!!!
My Tronrealm modpack
My tronblocks mod
 

User avatar
stu
Member
 
Posts: 933
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Sun Jan 26, 2014 20:23

Novacain wrote:I take it the lower right hand button is the menu, and the middle button in the directions is to jump? also, does it have multi-touch support so you can sneak and move at the same time? oh, and do you have toggles for fly, no-clip, and fast?


The lower right button shows the player inventory and craft grid, there is currently no way to return to the menu (at least the back button is not working on my device running JellyBean) The middle button is the jump key and multi-touch is supported. There are currently no buttons for fly, fast etc but could be easily added in future but with the current performance level and view range I do not see much point right now.

Incidentally, I just pushed a change preventing a crash when soft-keyboard is closed in Android 4.1 and 4.2
Last edited by stu on Sun Jan 26, 2014 20:24, edited 1 time in total.
 

Martin_Devil
Member
 
Posts: 192
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48

by Martin_Devil » Fri Jan 31, 2014 09:44

stu wrote:
Novacain wrote:I take it the lower right hand button is the menu, and the middle button in the directions is to jump? also, does it have multi-touch support so you can sneak and move at the same time? oh, and do you have toggles for fly, no-clip, and fast?


The lower right button shows the player inventory and craft grid, there is currently no way to return to the menu (at least the back button is not working on my device running JellyBean) The middle button is the jump key and multi-touch is supported. There are currently no buttons for fly, fast etc but could be easily added in future but with the current performance level and view range I do not see much point right now.

Incidentally, I just pushed a change preventing a crash when soft-keyboard is closed in Android 4.1 and 4.2

Can I get the apk?
MultiCraft Open Sourse Project – https://github.com/multicraftproject
 

User avatar
hoodedice
Member
 
Posts: 1372
Joined: Sat Jul 06, 2013 06:33
Location: world
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice

by hoodedice » Fri Jan 31, 2014 09:49

Martin_Devil wrote:
stu wrote:
Novacain wrote:I take it the lower right hand button is the menu, and the middle button in the directions is to jump? also, does it have multi-touch support so you can sneak and move at the same time? oh, and do you have toggles for fly, no-clip, and fast?


The lower right button shows the player inventory and craft grid, there is currently no way to return to the menu (at least the back button is not working on my device running JellyBean) The middle button is the jump key and multi-touch is supported. There are currently no buttons for fly, fast etc but could be easily added in future but with the current performance level and view range I do not see much point right now.

Incidentally, I just pushed a change preventing a crash when soft-keyboard is closed in Android 4.1 and 4.2

Can I get the apk?


NO.

Ok, lol, as you can see in the above posts, the android build is not ready yet. Please be patient as this might take some time.
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
 

User avatar
stu
Member
 
Posts: 933
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Sun Feb 09, 2014 18:00

Rebased and updated.

Added auto-extraction of minetest support files from jni assets directory.
Note: If you already have a /sdcard/minetest folder from a previous version
then you must delete this before launching the new apk.

Github: https://github.com/stujones11/minetest/tree/android_new

Now available as a debug.apk for testing purposes only.

Do not try to run this on anything you are not prepared to break!
Ok the worst that should happen is that it just won't work but I can not promise anything.

Please do not post things like: You broke my phone or it doesn't work.
At very least tell me what happens and what version of android you are running.

It is probably not a good idea to connect to public servers without the consent of the owner.

Cheers!
Last edited by stu on Sun Feb 09, 2014 18:03, edited 1 time in total.
 

User avatar
hoodedice
Member
 
Posts: 1372
Joined: Sat Jul 06, 2013 06:33
Location: world
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice

by hoodedice » Sun Feb 09, 2014 18:12

stu wrote:Rebased and updated.

Added auto-extraction of minetest support files from jni assets directory.
Note: If you already have a /sdcard/minetest folder from a previous version
then you should delete this before launching the new apk.

Github: https://github.com/stujones11/minetest/tree/android_new

Now available as a debug.apk for testing purposes only.

Do not try to run this on anything you are not prepared to break!
Ok the worst that should happen is that it just won't work but I can not promise anything.

Please do not post things like: You broke my phone or it doesn't work.
At very least tell me what happens and what version of android you are running.

It is probably not a good idea to connect to public servers without the consent of the owner.

Cheers!


It will be useless to test it on my phone, as it is both impossble and a hell lot of work to get MT to run on it. However, MCp runs nicely on my phone. Should I test MT?

Phone: Sony Ericsson XPERIA x10
custom ROM, 1.2 GHz single core overclocked, 386 MB RAM, tweaked.
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
 

User avatar
stu
Member
 
Posts: 933
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Sun Feb 09, 2014 18:27

hoodedice wrote:Should I test MT?

If you have to ask this then the answer is no. I suspect you may be a bit low on RAM but then I have no idea of the requirements.
One of the reasons I have released this is to find out where it works and where it does not.
 

thetoon
Member
 
Posts: 106
Joined: Tue Dec 11, 2012 12:55

by thetoon » Mon Feb 10, 2014 10:32

It does work surprisingly well on a Nexus 4. Only ran it for a couple minutes, but noticed the following :

* android's virtual keyboard doesn't roll-out, so it's a bit hard playing when it's been used (like just after typing a new world's name). Restarting the app worked around it.
* moving around is both fluid and easy. Except the occasional "micro-freeze" every ten seconds or so. I guess it's related to chunk generation, and it might be less noticeable when playing on a remote (and stronger) server.
* overlaid keys work rather well, but could use some slight improvements. Especially moving jump (and probably other "non-directional" keys) on the right side of the screen, that may help a lot.
* it's nice to be able to select blocks by clicking them. It would be even nicer if long-pressing them could mine them (much easier than a virtual button, if you ask me).

For a first version, it's rather impressive. Congrats and thanks. I'll test it on a server as soon as possible, to see if it improves the experience.
 

Amaz
Member
 
Posts: 345
Joined: Wed May 08, 2013 08:26
GitHub: Amaz1
IRC: Amaz
In-game: Amaz

by Amaz » Mon Feb 10, 2014 11:00

This is really good! I messed around with it for about 30 minutes, and even installed some mods and the Dwarves gamemode... (There is no need to worry about my sanity, I already know that I am insane!)
There are a few bugs (but that is to be expected) like the rendering distance fluctuates massively, sometimes it is 15 blocks, over times it is 40+... When you dig nodes, you sometimes have to press the dig button several times. I'm not sure what the purpose is of the little button with an arrow pointing down in the far bottom left corner is... As thetoon said, there is no way to exit the keyboard after creating a world, so you have to leave the app and come back to be able to play... As far as bugs go that is it as far as I can see, except that it sometimes will randomly freeze and quit.

This is a much more playable game than either the Freeminer android app, or the Bulidcraft one... The controls are much more fluid, and all works well. Thank you for this great gift to the Minetest project! You have done a wonderful job of it! I must admit that when I first read the first post, I didn't think that you would manage it. Thank you again. The phone I tested it on was a Samsung Galaxy SII.

[spoiler] Screenshots!
Image
Image
Ethereal mapgen...
Image
Mobs out of the Lord of the Rings modpack.
Image
Image
Dwarves gamemode...
Image
[/spoiler]
Last edited by Amaz on Mon Feb 10, 2014 11:01, edited 1 time in total.
 

User avatar
stu
Member
 
Posts: 933
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Mon Feb 10, 2014 23:09

thetoon wrote:android's virtual keyboard doesn't roll-out, so it's a bit hard playing when it's been used (like just after typing a new world's name). Restarting the app worked around it.


I added a patch that effectively disables the 'v' button because it causes the app to crash in android 4.1 and 4.2.
I will add a more comprehensive fix asap.

thetoon wrote:it's nice to be able to select blocks by clicking them. It would be even nicer if long-pressing them could mine them (much easier than a virtual button, if you ask me).


That is how xyz originally wrote the touchscreen interface but I could not get away with it, I was digging things and placing things I didn't want to. Maybe it just needed some tweaking but I much prefer the idea of using action buttons anyway.


Amaz wrote:This is really good! I messed around with it for about 30 minutes, and even installed some mods and the Dwarves gamemode... (There is no need to worry about my sanity, I already know that I am insane!)
There are a few bugs (but that is to be expected) like the rendering distance fluctuates massively, sometimes it is 15 blocks, over times it is 40+... When you dig nodes, you sometimes have to press the dig button several times. I'm not sure what the purpose is of the little button with an arrow pointing down in the far bottom left corner is... As thetoon said, there is no way to exit the keyboard after creating a world, so you have to leave the app and come back to be able to play... As far as bugs go that is it as far as I can see, except that it sometimes will randomly freeze and quit.


To fix your viewing range, set viewing_range_nodes_min and viewing_range_nodes_max to the same value in minetest.conf

The little down arrow is for sneak (or down if you are on ladders etc). I would like a better icon for this.

Thank you both for your very encouraging feedback.

btw, great screenshots Amaz, nice to see it running the Dwarves game :-)

Cheers!
 

User avatar
stormchaser3000
Member
 
Posts: 417
Joined: Sun Oct 06, 2013 21:02
GitHub: stormchaser3000

by stormchaser3000 » Mon Feb 10, 2014 23:48

can we have a pre compiled apk because i don't want to root my devoce to run the build.sh but if there is no other way right now i might as well root
 

User avatar
VanessaE
Moderator
 
Posts: 4387
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE

by VanessaE » Mon Feb 10, 2014 23:54

Tried the debug apk on my little Xelio P1001A tablet (rooted). The install seemed to go okay, but it instantly crashes as soon as you tap the launcher icon.

[spoiler="show debug log..."]
Code: Select all
I/ActivityManager(  264): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.minetest/android.app.NativeActivity bnds=[812,481][884,553] u=0} from pid 464
D/AudioHardware(   89): AudioHardware pcm playback is exiting standby.
D/AudioHardware(   89): openPcmOut_l() mPcmOpenCnt: 0
D/dalvikvm( 1952): Late-enabling CheckJNI
I/ActivityManager(  264): Start proc org.minetest for activity org.minetest/android.app.NativeActivity: pid=1952 uid=10071 gids={3003, 1028, 1015}
I/dalvikvm( 1952): Turning on JNI app bug workarounds for target SDK version 9...
D/AndroidRuntime( 1952): Shutting down VM
W/dalvikvm( 1952): threadid=1: thread exiting with uncaught exception (group=0x418fc300)
E/AndroidRuntime( 1952): FATAL EXCEPTION: main
E/AndroidRuntime( 1952): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.minetest/android.app.NativeActivity}: java.lang.IllegalArgumentException: Unable to find native library: Minetest
E/AndroidRuntime( 1952):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
E/AndroidRuntime( 1952):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
E/AndroidRuntime( 1952):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
E/AndroidRuntime( 1952):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
E/AndroidRuntime( 1952):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1952):     at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 1952):     at android.app.ActivityThread.main(ActivityThread.java:4745)
E/AndroidRuntime( 1952):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1952):     at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 1952):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
E/AndroidRuntime( 1952):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime( 1952):     at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 1952): Caused by: java.lang.IllegalArgumentException: Unable to find native library: Minetest
E/AndroidRuntime( 1952):     at android.app.NativeActivity.onCreate(NativeActivity.java:195)
E/AndroidRuntime( 1952):     at android.app.Activity.performCreate(Activity.java:5008)
E/AndroidRuntime( 1952):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
E/AndroidRuntime( 1952):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
E/AndroidRuntime( 1952):     ... 11 more
W/ActivityManager(  264):   Force finishing activity org.minetest/android.app.NativeActivity
D/dalvikvm(  264): GC_CONCURRENT freed 998K, 17% free 10015K/12039K, paused 18ms+15ms, total 196ms
W/ActivityManager(  264): Activity pause timeout for ActivityRecord{4234b760 org.minetest/android.app.NativeActivity}
I/Process ( 1952): Sending signal. PID: 1952 SIG: 9
W/InputMethodManagerService(  264): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@422d9ae0 attribute=null
I/ActivityManager(  264): Process org.minetest (pid 1952) has died.

[/spoiler]
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
 

Next

Return to Partly official engine development



Who is online

Users browsing this forum: No registered users and 0 guests