Android porting thread.

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
User avatar
MusicallyInspired
Posts: 1138
Joined: Fri Mar 02, 2007 8:03 am
Location: Manitoba, Canada
Contact:

Post by MusicallyInspired »

EMI works fine (as much as it can with the current support for the game in ResidualVM) on my PCs. That is, I can play beyond the credits and start the first puzzle.
User avatar
ultraneonoirantihero
Posts: 106
Joined: Mon Sep 05, 2011 5:13 pm

Post by ultraneonoirantihero »

I took my friend's Samsung Galaxy tab 2 (Android 4.1.1 Jelly Bean, Dual-core 1 GHz) and tested the game. In short - it works.

Here's a little detailed experience.
  • 1. The ResidualVM loading splash doesn't stay on the screen but shows up just for a milisec and disappears, then it continues to load on a black screen for about 30 sec. This also happens with the ScummVM. Someone who isn't very patient might think it crashed.

    2. Starting the game with default settings works fine.

    3. I tried disabling fullscreen and enabling filtering for better picture, since with the default settings the game stretches to 16:9 ratio. It launches the game in 4:3 but on screen controls don't work and you have to kill the process to exit.

    4. Then I tried with disabled fullscreen and disabled filtering. The game launches in 4:3, it works but the left part of the screen is cut off, about 25%. It resembles "vertical video syndrome".

    So I continued with the default options (fullscreen enabled, filtering disabled).

    5. Took me 5 minutes to figure out what the controls are, someone needs to make small visual instructions (maybe I will). When you tap on screen center you get movement controls but they don't work, movement only works on left screen side, not center. I don't know for other devices but here:
    • Left part of the screen controls movement, right part of the screen has interaction controls.
      Press, hold and drag your fingers to change desired action.
      Taping once on center screen is like [enter].
    6. Copied my old ResidualVM savegames to the Tablet and they worked.

    7. Didn't have any textures on Many or Martinez in the Land of the Living, they were completely black. Loaded several game points and lighting is strange.

    8. After 15 min testing: no lag, no stuttering, no crashing. RAM usage is around 30MB, didn't have time to check CPU usage.
It is unbelievable that this works on Android! It's playable. It even has integrated touchscreen controls!

The only major thing that doesn't work on Samsung Galaxy Tab 2 is "fullscreen disabled" and that mode would be very practical since it doesn't distort image and it leaves blank space for fingers and controls, leaving game screen almost fully visible and not covered by the fingers.

Thanks Botje :)
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

Thanks for finding that fullscreen bug, ultraneonoirantihero!
I never bothered to test the game without fullscreen, actually.
I pushed a quick patch to my repository that fixes the aspect ratio correction on non-fullscreen runs.
I pushed a new APK with that change, hopefully it works for you as well.
Suggestions on what to do with the left-over space at the sides is welcome :)

I'm aware of the lighting and splash issues, but really don't have time to work on them.

I posted instructions on the controls earlier in the thread, but some nice visual instructions are always nice to have :)
Botje wrote: Short overview:
- The left side of the screen functions as a joystick: touch and hold, then move up for forward, down for back, etc.
- The middle of the screen is for fine control (eg dialogs)
If you swipe up/down/left/right, you get one keypress in that direction.
If you tap the middle, you just activate the default action (like enter does)
- Swiping left/right on the right side of the screen allows you to activate more verbs, like (I)nventory, (P)ick up, (U)se, or (L)ook at.
And if you're playing EMI, swiping up-down on the right chooses between different options in the bottom menu.
User avatar
ultraneonoirantihero
Posts: 106
Joined: Mon Sep 05, 2011 5:13 pm

Post by ultraneonoirantihero »

Thanks for the quick update, as soon I take back that tablet from my friend I'll test it again.

Splash disappearing is a compatibility issue with new Android 4+ systems, on my 2.3 it works fine. So it's Google who messed it up :) Not worthy the time fixing it.

I forgot to ask: can you run in Android port? I know you can walk, but running required [shift] on PC, I tried some things on Android but couldn't find running feature.

As an Android junior programmer I must ask: how much skill and hard work did this Android port required?

I will try to make some visual instructions for the weekend. I'll post it here.

Blank left-over space? I don't know... Fill it up with part of the mural?
http://www.doublefine.com/forums/viewthread/5711/

OR EVEN BETTER for the blank space on the sides in 4:3, can you detect current room and set an image in that blank space according to the room you're currently in? I made that "Grim Fandango Widescreen HD" video, so if I send you the additional "widescreen borders" could you make them fill up the empty space that will give the illusion of "TRUE Grim Fandango widescreen"?
http://www.youtube.com/watch?v=cigf0ZT9pu0&hd=1

Cheers
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

ultraneonoirantihero wrote:I forgot to ask: can you run in Android port? I know you can walk, but running required [shift] on PC, I tried some things on Android but couldn't find running feature.
No support for that yet. It would be relatively easy to add sprinting beyond a certain threshold.
ultraneonoirantihero wrote: As an Android junior programmer I must ask: how much skill and hard work did this Android port required?
I just hacked up the native code of the already existing Android port.
My improvements are the "new-style" OpenGL renderer, which I then ported to OpenGL ES2 for Android, and the touch controls.

ultraneonoirantihero wrote: Blank left-over space? I don't know... Fill it up with part of the mural?
http://www.doublefine.com/forums/viewthread/5711/

OR EVEN BETTER for the blank space on the sides in 4:3, can you detect current room and set an image in that blank space according to the room you're currently in? I made that "Grim Fandango Widescreen HD" video, so if I send you the additional "widescreen borders" could you make them fill up the empty space that will give the illusion of "TRUE Grim Fandango widescreen"?
http://www.youtube.com/watch?v=cigf0ZT9pu0&hd=1
The second sounds like something that would be even cooler in the desktop version! If you can land it in residualvm trunk I'll port that to android. I suggest filing a "feature request" issue, maybe someone is inspired to hack it in :)
User avatar
ultraneonoirantihero
Posts: 106
Joined: Mon Sep 05, 2011 5:13 pm

Post by ultraneonoirantihero »

Botje wrote: I just hacked up the native code of the already existing Android port.
My improvements are the "new-style" OpenGL renderer, which I then ported to OpenGL ES2 for Android, and the touch controls.
I didn't know there was another existing fanmade Android port. What happened to it, development hell? How did you hacked it? Using this: http://code.google.com/p/android-apktool/ ?
Botje wrote: The second sounds like something that would be even cooler in the desktop version! If you can land it in residualvm trunk I'll port that to android. I suggest filing a "feature request" issue, maybe someone is inspired to hack it in :)
I already pitched that idea a year ago in the "Deluxe" thread, but no one was interested at that moment. Maybe this time I'll try to add it to the trunk, like you said. I have those initial 7 screens from the "Widescreen HD" video, and some 10 more in development (40% done). When I finish those I'll try to add the request to the project... btw how can I do that?
https://github.com/residualvm/residualvm/pulls

P.S. It would be really cool if someone packed widescreen backgrounds with Deluxe's high-poly models and higher-res textures all into one datauser.lab as a "widescreen HD user patch" :) Then we wouldn't need to wait for Disney to release a remake like MI:SE or that cancelled Day of the Tentecle SE...
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

ultraneonoirantihero wrote: I didn't know there was another existing fanmade Android port. What happened to it, development hell? How did you hacked it? Using this: http://code.google.com/p/android-apktool/ ?
No, I mean there was an earlier version that only supported software rendering.
ultraneonoirantihero wrote: I already pitched that idea a year ago in the "Deluxe" thread, but no one was interested at that moment. Maybe this time I'll try to add it to the trunk, like you said. I have those initial 7 screens from the "Widescreen HD" video, and some 10 more in development (40% done). When I finish those I'll try to add the request to the project... btw how can I do that?
In short: You fork the project on Github, do work on a branch, and create a pull request from your branch to the Github master branch.

Off the top of my head, you'll need to do at least the following:
  • Modify the SDL setup to create wide-screen windows / set wide fullscreen resolutions.
  • Restrict the Grim OpenGL/TinyGL renderers to only draw in 640x480 in the middle.
  • Add code to check for and load the widescreen textures if available.
  • Draw the widescreen textures for backgrounds in addition to / instead of the original ones.
ultraneonoirantihero wrote: P.S. It would be really cool if someone packed widescreen backgrounds with Deluxe's high-poly models and higher-res textures all into one datauser.lab as a "widescreen HD user patch" :) Then we wouldn't need to wait for Disney to release a remake like MI:SE or that cancelled Day of the Tentecle SE...
You can use the mklab tool from the residualvm-tools project to create such a thing. I have no idea what the deluxe project is up to, though.
Larrin
Posts: 5
Joined: Mon Sep 26, 2011 3:06 am

Post by Larrin »

I'm trying to use the betting stub creator but the display of the numbers/days is black. While the lighting issues and pop in don't affect gameplay this certainly does. I'm using a Nexus 7 2013 with Android 4.4.
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

Cool, somebody actually played that far :)
I've removed the lighting for now and implemented the last few parts of the renderer in my android branch, so these issues are probably fixed.

Thanks for the input, I'll probably try to merge this into master so we can start producing daily builds.
hooby3dfx
Posts: 16
Joined: Tue Dec 31, 2013 6:01 am

Post by hooby3dfx »

Nightly builds, nightly builds!

:mrgreen: :oops:

Keep up the good work.
GF starts up fine on my HTC DNA running CM10.2
User avatar
Flamekebab
Posts: 13
Joined: Wed Sep 18, 2013 6:12 pm

Post by Flamekebab »

Does this bode well for the Raspberry Pi version?
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

I had code for the Raspberry Pi that created a window and then quickly stopped. I couldn't work out whether that was my fault, its OpenGL library, or the hack you need to actually get that window.
mac_es
Posts: 145
Joined: Mon Oct 31, 2005 9:37 am

Post by mac_es »

Hello Botje,

I'm trying to compile the Android version but I get errors of missing GL/gl.h

Is the code compilable atm? I though that it should include gles/gl.h or gles2/gl2.h...

Also there is no glut/freeglut for OpenGL ES, only a partial port: http://code.google.com/p/glues/ is this sufficient?


cheers
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Post by Botje »

Can you show a transcript of your call to configure and the compilation process?
mac_es
Posts: 145
Joined: Mon Oct 31, 2005 9:37 am

Post by mac_es »

Sure!

Compiling under MSYS... (scummvm compiles correctly mingw32 and Android) and ResidualVM compiled before, now only compiles for mingw32.

It was time ago when I compiled a version for android, and when I see that there were commits to use OpenGLES in android I tried...

Code: Select all

Running ResidualVM configure...
Android toolchain already installed.
Looking for C++ compiler... arm-linux-androideabi-g++
Checking for compiler version... 4.6.x-google, ok
Building as C++11... no
Checking for whether -Wglobal-constructors work... no
Checking endianness... little
Checking 64-bitness... no
Type with 1 byte... char
Type with 2 bytes... short
Type with 4 bytes... int
Type with 8 bytes... long long
Alignment required... yes
Checking host CPU architecture... ARM
Checking hosttype... android
Cross-compiling to android
Checking if host is POSIX compliant... yes
Checking whether to have a verbose build... no
Checking whether building plugins was requested... no
Checking for Ogg Vorbis... no
Checking for Tremor... yes
Checking for FLAC >= 1.0.1... yes
Checking for MAD... yes
Checking for ALSA >= 0.9... no
Checking for libjpeg >= v6b... no
Checking for PNG >= 1.2.8... yes
Checking for libtheoradec >= 1.0... skipping. no vorbis
Checking for libfaad... no
Checking for SEQ MIDI... no
Checking for sndio... no
Checking for TiMidity... no
Checking for zlib... yes
Checking for libmpeg2 >= 0.4.0... no
Checking for Sparkle... no
Checking for libfluidsynth... no
Checking for readline... skipping (text console disabled)
Checking for libunity... no
Looking for freetype-config... /mingw/bin/freetype-config
Checking for FreeType2... no
Checking for OpenGL... yes (OpenGL ES2)
Building translation support... no
Building taskbar integration support... yes
Building Bink video support... yes
Building SafeDisc decryption support... no
Building updates support... yes
...disabling support for video cutscenes in PS2 version of Escape from Monkey Island. mpeg2dec is required
Backend... android, savegame timestamp
WARNING: Disabling engine Myst 3 because the following dependencies are unmet: JPEG

Engines (builtin):
    Grim [all games]

Engines Skipped:
    Myst 3


Creating config.h
Creating config.mk
Creating Makefile
Creating engines/engines.mk
Creating engines/plugins_table.h



    C++      backends/platform/android/jni.o
    C++      backends/platform/android/texture.o
    C++      backends/platform/android/asset-archive.o
    C++      backends/platform/android/android.o
    C++      backends/platform/android/gfx.o
    C++      backends/platform/android/events.o
    C++      backends/platform/android/touchcontrols.o
    C++      base/main.o
    C++      base/commandLine.o
    C++      base/plugins.o
    C++      engines/grim/costume/bitmap_component.o    
    C++      engines/grim/costume/chore.o    
    C++      engines/grim/costume/colormap_component.o
    C++      engines/grim/costume/component.o
    C++      engines/grim/costume/head.o
    C++      engines/grim/costume/keyframe_component.o
    C++      engines/grim/costume/lua_var_component.o
    C++      engines/grim/costume/main_model_component.o
    C++      engines/grim/costume/material_component.o
    C++      engines/grim/costume/mesh_component.o
    C++      engines/grim/costume/model_component.o
    C++      engines/grim/costume/sound_component.o
    C++      engines/grim/costume/sprite_component.o
    C++      engines/grim/costume/anim_component.o
    C++      engines/grim/emi/costume/emianim_component.o
    C++      engines/grim/emi/costume/emichore.o
    C++      engines/grim/emi/costume/emiluavar_component.o
    C++      engines/grim/emi/costume/emiluacode_component.o
    C++      engines/grim/emi/costume/emimesh_component.o
    C++      engines/grim/emi/costume/emiskel_component.o
    C++      engines/grim/emi/costume/emisprite_component.o
    C++      engines/grim/emi/costume/emitexi_component.o
    C++      engines/grim/emi/sound/aifftrack.o
    C++      engines/grim/emi/sound/mp3track.o
    C++      engines/grim/emi/sound/scxtrack.o
    C++      engines/grim/emi/sound/vimatrack.o
    C++      engines/grim/emi/sound/track.o
    C++      engines/grim/emi/sound/emisound.o
    C++      engines/grim/emi/sound/codecs/scx.o
    C++      engines/grim/emi/animationemi.o
    C++      engines/grim/emi/costumeemi.o
    C++      engines/grim/emi/emi.o
    C++      engines/grim/emi/modelemi.o
    C++      engines/grim/emi/skeleton.o
    C++      engines/grim/emi/poolsound.o
    C++      engines/grim/emi/layer.o
    C++      engines/grim/emi/lua_v2.o
    C++      engines/grim/emi/lua_v2_actor.o
    C++      engines/grim/emi/lua_v2_sound.o
../engines/grim/emi/lua_v2.cpp: In member function 'virtual void Grim::Lua_V2::NewLayer()':
../engines/grim/emi/lua_v2.cpp:441:21: warning: variable 'zero' set but not used [-Wunused-but-set-variable]
../engines/grim/emi/lua_v2_actor.cpp: In member function 'virtual void Grim::Lua_V2::PlayActorChore()':
../engines/grim/emi/lua_v2_actor.cpp:660:8: warning: variable 'param' set but not used [-Wunused-but-set-variable]
    C++      engines/grim/emi/emi_registry.o
    C++      engines/grim/imuse/imuse.o
    C++      engines/grim/imuse/imuse_mcmp_mgr.o
    C++      engines/grim/imuse/imuse_music.o
    C++      engines/grim/imuse/imuse_script.o
    C++      engines/grim/imuse/imuse_sndmgr.o
    C++      engines/grim/imuse/imuse_tables.o
    C++      engines/grim/imuse/imuse_track.o
    C++      engines/grim/lua/lapi.o
    C++      engines/grim/lua/lauxlib.o
    C++      engines/grim/lua/lbuffer.o
    C++      engines/grim/lua/lbuiltin.o
    C++      engines/grim/lua/ldo.o
    C++      engines/grim/lua/lfunc.o
    C++      engines/grim/lua/lgc.o
    C++      engines/grim/lua/liolib.o
    C++      engines/grim/lua/llex.o
    C++      engines/grim/lua/lmathlib.o
    C++      engines/grim/lua/lmem.o
    C++      engines/grim/lua/lobject.o
    C++      engines/grim/lua/lrestore.o
    C++      engines/grim/lua/lsave.o
    C++      engines/grim/lua/lstate.o
    C++      engines/grim/lua/lstring.o
    C++      engines/grim/lua/lstrlib.o
    C++      engines/grim/lua/lstx.o
    C++      engines/grim/lua/ltable.o
    C++      engines/grim/lua/ltask.o
    C++      engines/grim/lua/ltm.o
    C++      engines/grim/lua/lundump.o
    C++      engines/grim/lua/lvm.o
    C++      engines/grim/lua/lzio.o
    C++      engines/grim/movie/codecs/blocky8.o
    C++      engines/grim/movie/codecs/blocky16.o
    C++      engines/grim/movie/codecs/vima.o
    C++      engines/grim/movie/codecs/smush_decoder.o
    C++      engines/grim/movie/bink.o
    C++      engines/grim/movie/mpeg.o
    C++      engines/grim/movie/movie.o
    C++      engines/grim/movie/smush.o
    C++      engines/grim/update/packfile.o
    C++      engines/grim/update/mscab.o
    C++      engines/grim/update/lang_filter.o
    C++      engines/grim/update/update.o
    C++      engines/grim/actor.o
    C++      engines/grim/animation.o
    C++      engines/grim/bitmap.o
    C++      engines/grim/costume.o
    C++      engines/grim/color.o
    C++      engines/grim/colormap.o
    C++      engines/grim/debug.o
    C++      engines/grim/detection.o
    C++      engines/grim/font.o
    C++      engines/grim/gfx_base.o
    C++      engines/grim/gfx_tinygl.o
    C++      engines/grim/gfx_opengl_shaders.o
    C++      engines/grim/gfx_opengl.o
In file included from ../engines/grim/gfx_opengl.cpp:42:0:
../engines/grim/gfx_opengl.h:34:19: fatal error: GL/gl.h: No such file or directory
compilation terminated.
make: *** [engines/grim/gfx_opengl.o] Error 1
make: *** Waiting for unfinished jobs....
../engines/grim/gfx_tinygl.cpp: In member function 'virtual void Grim::GfxTinyGL::getBoundingBoxPos(const Grim::EMIModel*, int*, int*, int*, int*)':
../engines/grim/gfx_tinygl.cpp:537:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

The gfx_opengl.h's snippet

Code: Select all

#if defined (SDL_BACKEND) && !defined(__amigaos4__)
#include <SDL_opengl.h>
#undef ARRAYSIZE
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
Obivusly it doesn't find the GL/gl.h as it doesn't exists. At least in my NDK... looking into the config log it should include GLES2/gl.h and also there is no glu.h so I should compile GLUES?

do you have a prebuilt libraries? I like to use the 'standard' ones, so my executable gets closer to the real one and I assure to use the exact same version of the library to avoid potential problems...

cheers
Post Reply