[OLD-1] AGS engine Android port

Started by JJS, Thu 03/11/2011 20:18:29

Previous topic - Next topic

Crimson Wizard

#700
Quote from: Radiant on Wed 01/02/2017 13:01:20
To facilitate further android development, could someone with GIT access please take five minutes to alter ags/Engine/platform/android/acpland.cpp to change line 700 from
I already did this in the branch "release-3.4.0". This is last branch which was tested to work on Android.
https://github.com/adventuregamestudio/ags/commit/a78a6431a715c7a91df61594437e8da454c11dc9

The change will be included into the new 3.4.0 patch I am releasing in the end of this week.
Ofcourse it will be merged to master branch too.

Also, honestly, one does not have to have our git write access, anyone can freely clone repository to their account and then make a merge request of their changes via the github page, this is how most of our contributors work when they want to suggest particular code changes.

Radiant

Great, thank you very much!

da1writer

Hi guys, a bit new here. Thought I'd let you know the newest build for Android runs quite well, many of the AGS engine titles have been quite playable to completion. My only qualms I have is the Trilby series has no music audio for some reason.

http://www.g4g.it/2009/11/30/fullyramblomatic-special-editions-pack/

On PC, the music plays fine but for Android, only the sound effects are heard. Try for yourselves if you like. The Special Editions even have the midi files, which if you try to load up the game with the Midi Enabled, you get "Digmid Patch" errors.

If there is a solution to this, could someone elaborate or explain why the music is missing on Android?

P.S, I've tried other games with music and they run just fine...

Crimson Wizard

Quote from: da1writer on Sun 23/04/2017 01:35:19
On PC, the music plays fine but for Android, only the sound effects are heard. Try for yourselves if you like. The Special Editions even have the midi files, which if you try to load up the game with the Midi Enabled, you get "Digmid Patch" errors.

Have you tried the digmid patches? You need to download and unpack them, as explained in this readme:
https://github.com/adventuregamestudio/ags/blob/master/Android/README.md#midi-playback

da1writer

Quote from: Crimson Wizard on Sun 23/04/2017 02:20:44
Quote from: da1writer on Sun 23/04/2017 01:35:19
On PC, the music plays fine but for Android, only the sound effects are heard. Try for yourselves if you like. The Special Editions even have the midi files, which if you try to load up the game with the Midi Enabled, you get "Digmid Patch" errors.

Have you tried the digmid patches? You need to download and unpack them, as explained in this readme:
https://github.com/adventuregamestudio/ags/blob/master/Android/README.md#midi-playback
It wasn't renamed to patches.dat I come to find out. My mistake, thanks for the help.

da1writer

#705
Hey @Crimson Wizard, one more thing I'd like to mention. Some AGS games like PLEURGHBURG require a keyboard input (search on his computer for instance), but I can't seem to pull it up. It mentions to hold the Menu button on Android but there lies the issue. I have an NVIDIA Shield tablet that was upgraded to Marshmallow (Android 7.0), which integrates Google even more into our lives with their Google Now/Assistant if you hold down the Menu button. I use this fairly often in everyday use so I can't just disable it, yet as stated in the readme I must hold down the Menu button to have the AGS Interpreter register the action to pull up the keyboard. So the two are conflicting with each other. Do you think you guys could tear a page from the guys at Scummvm and have a hovering transparent keyboard button somewhere to open the keyboard?

BlackMageJ

Did anyone ever find a way to get games with Steam/GOG Galaxy achievements working in the Android player? I've looked around the forums and there's several mentions of a stub plugin for AGS2Steam/AGS2Client, but I can't tell if a solution was ever released.

sawyer

#707
Quote from: BlackMageJ on Tue 02/05/2017 00:00:27
Did anyone ever find a way to get games with Steam/GOG Galaxy achievements working in the Android player? I've looked around the forums and there's several mentions of a stub plugin for AGS2Steam/AGS2Client, but I can't tell if a solution was ever released.


Problem with Al Emmo and the Lost Dutchman's Mine, Tales and Chronicle of Innsmouth on android. Hope new android ags is coming that runs without script link fail.Thanks to all who make this happen...Truly thank you!!!

monkey0506

#708
Quote from: BlackMageJ on Tue 02/05/2017 00:00:27
Did anyone ever find a way to get games with Steam/GOG Galaxy achievements working in the Android player? I've looked around the forums and there's several mentions of a stub plugin for AGS2Steam/AGS2Client, but I can't tell if a solution was ever released.

Source of the stub may be found here. I haven't tested running this plugin on Android, but it should (theoretically) work out-of-the-box, but rebuilding with the NDK would be necessary. There isn't currently a Makefile, but the Code::Blocks project file may be used for reference (I will try to look into writing a Makefile, I don't have much experience working with them).

eri0o

How does one build this?

I followed the guide here: https://github.com/adventuregamestudio/ags/tree/master/Android

But I get the error:

In file included from jni/../jni/../../../Engine/ac/audiochannel.cpp:16:
In file included from jni/../jni/../../../Common/ac/roomstruct.h:25:
jni/../jni/../../../Common/util/wgt2allg.h:29:10: fatal error: 'allegro.h' file not found
#include "allegro.h"
         ^~~~~~~~~~~
2 warnings and 1 error generated.
make: *** [obj/local/armeabi/objs/agsengine/ac/audiochannel.o] Error 1


full output:
Spoiler
Code: ags
 ~/Android/Sdk/ndk-bundle/ndk-build 
Android NDK: Found platform level in jni/../project.properties. Setting APP_PLATFORM to android-16.    
Android NDK: WARNING: APP_PLATFORM android-16 is higher than android:minSdkVersion 9 in jni/../AndroidManifest.xml. NDK binaries will *not* be comptible with devices older than android-16. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.    
/home/erico/Android/Sdk/ndk-bundle/build/core/setup-app.mk:81: Android NDK: Application targets deprecated ABI(s): armeabi mips    
/home/erico/Android/Sdk/ndk-bundle/build/core/setup-app.mk:82: Android NDK: Support for these ABIs will be removed in a future NDK release.    
Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
[armeabi] Compile++ arm  : agsengine <= audiochannel.cpp
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
In file included from jni/../jni/../../../Engine/ac/audiochannel.cpp:16:
In file included from jni/../jni/../../../Common/ac/roomstruct.h:25:
jni/../jni/../../../Common/util/wgt2allg.h:29:10: fatal error: 'allegro.h' file not found
#include "allegro.h"
         ^~~~~~~~~~~
2 warnings and 1 error generated.
make: *** [obj/local/armeabi/objs/agsengine/ac/audiochannel.o] Error 1
[close]

Crimson Wizard

#710
Maybe try building from 3.4.0.16 tag? You won't be able to build it from master right now anyway, because of this: https://github.com/adventuregamestudio/ags/issues/420
There is already a built APK for 3.4.0 linked here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=54631.0

Other than that, do you actually have allegro 4.4.2 installed?
I think you may check download scripts here: https://github.com/adventuregamestudio/ags/tree/master/libsrc

I have a bad feeling Nick Sonneveld changed something in the Android building process without ammending readme. I may try contact him for some details (unless someone else knows).

eri0o

Uhm... Thanks Crimson Wizard! I will try later to see if this solves my currently bug! I was able to build an APK here, but for some reason DragAndDrop from the DragAndDrop module isn't working . :/

Crimson Wizard

#712
Quote from: eri0o on Wed 27/12/2017 00:15:22
Uhm... Thanks Crimson Wizard! I will try later to see if this solves my currently bug! I was able to build an APK here, but for some reason DragAndDrop from the DragAndDrop module isn't working . :/

Dang. Well, I don't think compiling different variant of APK may solve it (I mean, I don't know much, but that just seem doubtful).
Maybe this has something to do with how left/right mouse clicks are simulated on Android? I recall Wadjet Eye had a special plugin for mobile ports that handles touch screen. WadjetUtils, or something.

EDIT: I suggest writing a script that would display mouse states on screen, to find out whether AGS thinks that mouse button is held down while you are moving the finger.

Crimson Wizard

#713
I have a very bad feeling that drag&drop won't be working with current Android port without either additional port development and/or special fixes in module.

This is a quote from Android port's readme:
Quote
-   Finger movement: Moving the mouse cursor
-   Single finger tap: Perform a left click
-   Tap with two fingers: Perform a right click
-   Longclick: Hold down the left mouse button until tapping the screen again

As you can see, "finger movement" is translated to moving mouse cursor, not "moving cursor and keep mouse button pressed".
Module probably needs different behavior for the touch control case. But how is it supposed to distinguish cursor move and drag?
EDIT: Hmm, maybe this depends on game. In the case of your game, mouse movement does not have any function except for drag-n-drop. Therefore module may be made a special mode when it assumes that the mouse button is pressed whenever mouse cursor moves. Does this make sense? I do not think it will be too hard to do.
EDIT2: No, it still won't know when to release it...

Android engine must have a control mode when it honestly sets mouse button states as it receives/looses finger touch.

EDIT3: There is actually an option in android config, called "mouse_longclick" which description sounds like what I described above:
"Dragging with longclick: A longclick keeps the left mouse button pressed"

Try putting this into acsetup.cfg:
Quote
[controls]
mouse_longclick = 1

eri0o

Thank you Crimson Wizard! I will take a look tonight - I will test how to use acsetup.cfg in Android because I really don't know, maybe it will be easier if I just change the engine source and recompile :/

sawyer

Quote from: Crimson Wizard on Wed 27/12/2017 00:04:17
Maybe try building from 3.4.0.16 tag? You won't be able to build it from master right now anyway, because of this: https://github.com/adventuregamestudio/ags/issues/420
There is already a built APK for 3.4.0 linked here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=54631.0

Other than that, do you actually have allegro 4.4.2 installed?
I think you may check download scripts here: https://github.com/adventuregamestudio/ags/tree/master/libsrc

I have a bad feeling Nick Sonneveld changed something in the Android building process without ammending readme. I may try contact him for some details (unless someone else knows).




Thank you very much for your time :)

eri0o

#716
Just a small update, the android config file is named android.cfg, it's options are actually a little different (it's below, in spoiler tag), and I couldn't trace from source exactly where it should be place, but I think it's the /data/data/packagename folder.

android.cfg
Spoiler
Code: ags

[misc]
config_enabled = 1
rotation = 0
translation = default
[controls]
mouse_method = 0
mouse_longclick = 1
[compatibility]
clear_cache_on_room_change = 0
[sound]
samplerate = 44100
enabled = 1
threaded = 1
cache_size = 10
[midi]
enabled = 1
preload_patches = 0
[video]
framedrop = 0
[graphics]
renderer = 0
smoothing = 1
scaling = 1
super_sampling = 0
smooth_sprites = 0
[debug]
show_fps = 0
logging = 0
[close]

Edit: in android studio, placing the android.cfg file in the assets folder places the config file in the correct place. Unfortunately, it's useless for my case. In the ags project, the file Android/library/src/com/bigbluecup/android/AgsEngine.java deals with the touch to mouse click. I will need to modify the method dispatchTouchEvent so that touch is a click and releasing touch is a mouse release, and edit Android/library/src/com/bigbluecup/android/EngineGlue.java to provide a method for both click and release - now there is only a method for click. I will not do this soon, since I have another game to make and I still seem to get a weird missing allegro.h when building... Maybe in 2018. :P

Snarky

It's usual in UI libraries to have events for MouseDown, MouseUp and MouseClick (a MouseDown followed by a MouseUp). The way AGS does this always seemed a little broken to me. Of course, you can check Mouse.IsButtonDown() to detect when a button is released.

Crimson Wizard

#718
Quote from: Snarky on Fri 29/12/2017 00:01:52
It's usual in UI libraries to have events for MouseDown, MouseUp and MouseClick (a MouseDown followed by a MouseUp). The way AGS does this always seemed a little broken to me. Of course, you can check Mouse.IsButtonDown() to detect when a button is released.

It's not about how AGS script functions work, it's about how Android port translates touch state into AGS "mouse" state.
I never explored that myself, from what I see there are some specific config options that control that, but they may not be enough.

Snarky

OK. I took eri0o's comment:

Quote from: eri0o on Thu 28/12/2017 21:54:49
I will need to modify the method dispatchTouchEvent so that touch is a click and releasing touch is a mouse release

... to be related to the similar implementation in AGS, but maybe he's just making the same mistake independently.

SMF spam blocked by CleanTalk