Jibble

Author Topic: AGS engine Android port  (Read 198456 times)

Crimson Wizard

  • Local Moderator
  • Posts: 8,730
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #700 on: 02 Feb 2017, 08:21 »
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.
« Last Edit: 02 Feb 2017, 08:40 by Crimson Wizard »

Radiant

  • Posts: 5,231
  • Return once more to the Two Kingdoms!
    • I can help with publishing
    • I can help with story design
    • Radiant worked on a game that was nominated for an AGS Award!
      Radiant worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #701 on: 02 Feb 2017, 13:35 »
Great, thank you very much!

da1writer

  • Posts: 3
Re: AGS engine Android port
« Reply #702 on: 23 Apr 2017, 01:35 »
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

  • Local Moderator
  • Posts: 8,730
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #703 on: 23 Apr 2017, 02:20 »
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

  • Posts: 3
Re: AGS engine Android port
« Reply #704 on: 23 Apr 2017, 05:16 »
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

  • Posts: 3
Re: AGS engine Android port
« Reply #705 on: 23 Apr 2017, 22:44 »
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?
« Last Edit: 23 Apr 2017, 22:47 by da1writer »

BlackMageJ

  • Posts: 1
Re: AGS engine Android port
« Reply #706 on: 02 May 2017, 00:00 »
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

  • Posts: 42
Re: AGS engine Android port
« Reply #707 on: 23 May 2017, 02:25 »
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!!!
« Last Edit: 24 May 2017, 01:08 by sawyer »

monkey0506

  • Posts: 7,031
  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
Re: AGS engine Android port
« Reply #708 on: 26 Jun 2017, 13:46 »
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).
« Last Edit: 26 Jun 2017, 19:09 by monkey0506 »

eri0o

  • Posts: 390
    • eri0o worked on a game that was nominated for an AGS Award!
Re: AGS engine Android port
« Reply #709 on: 26 Dec 2017, 23:21 »
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: ShowHide
Code: Adventure Game Studio
  1.  ~/Android/Sdk/ndk-bundle/ndk-build
  2. Android NDK: Found platform level in jni/../project.properties. Setting APP_PLATFORM to android-16.    
  3. 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.    
  4. /home/erico/Android/Sdk/ndk-bundle/build/core/setup-app.mk:81: Android NDK: Application targets deprecated ABI(s): armeabi mips    
  5. /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.    
  6. Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb    
  7. Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
  8. Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
  9. Android NDK:     current module    
  10. Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua    
  11. Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
  12. Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
  13. Android NDK:     current module    
  14. Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb    
  15. Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
  16. Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
  17. Android NDK:     current module    
  18. Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua    
  19. Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
  20. Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
  21. Android NDK:     current module    
  22. Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb    
  23. Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
  24. Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
  25. Android NDK:     current module    
  26. Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua    
  27. Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
  28. Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
  29. Android NDK:     current module    
  30. Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb    
  31. Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
  32. Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
  33. Android NDK:     current module    
  34. Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua    
  35. Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
  36. Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
  37. Android NDK:     current module    
  38. [armeabi] Compile++ arm  : agsengine <= audiochannel.cpp
  39. warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
  40. warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
  41. In file included from jni/../jni/../../../Engine/ac/audiochannel.cpp:16:
  42. In file included from jni/../jni/../../../Common/ac/roomstruct.h:25:
  43. jni/../jni/../../../Common/util/wgt2allg.h:29:10: fatal error: 'allegro.h' file not found
  44. #include "allegro.h"
  45.          ^~~~~~~~~~~
  46. 2 warnings and 1 error generated.
  47. make: *** [obj/local/armeabi/objs/agsengine/ac/audiochannel.o] Error 1
  48.  


Crimson Wizard

  • Local Moderator
  • Posts: 8,730
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #710 on: 27 Dec 2017, 00:04 »
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).
« Last Edit: 27 Dec 2017, 00:10 by Crimson Wizard »

eri0o

  • Posts: 390
    • eri0o worked on a game that was nominated for an AGS Award!
Re: AGS engine Android port
« Reply #711 on: 27 Dec 2017, 00:15 »
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

  • Local Moderator
  • Posts: 8,730
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #712 on: 27 Dec 2017, 00: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.
« Last Edit: 27 Dec 2017, 13:36 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
  • Posts: 8,730
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #713 on: 28 Dec 2017, 10:34 »
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
« Last Edit: 28 Dec 2017, 11:55 by Crimson Wizard »

eri0o

  • Posts: 390
    • eri0o worked on a game that was nominated for an AGS Award!
Re: AGS engine Android port
« Reply #714 on: 28 Dec 2017, 16:12 »
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

  • Posts: 42
Re: AGS engine Android port
« Reply #715 on: 28 Dec 2017, 20:37 »
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

  • Posts: 390
    • eri0o worked on a game that was nominated for an AGS Award!
Re: AGS engine Android port
« Reply #716 on: 28 Dec 2017, 21:54 »
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: ShowHide
Code: Adventure Game Studio
  1. [misc]
  2. config_enabled = 1
  3. rotation = 0
  4. translation = default
  5. [controls]
  6. mouse_method = 0
  7. mouse_longclick = 1
  8. [compatibility]
  9. clear_cache_on_room_change = 0
  10. [sound]
  11. samplerate = 44100
  12. enabled = 1
  13. threaded = 1
  14. cache_size = 10
  15. [midi]
  16. enabled = 1
  17. preload_patches = 0
  18. [video]
  19. framedrop = 0
  20. [graphics]
  21. renderer = 0
  22. smoothing = 1
  23. scaling = 1
  24. super_sampling = 0
  25. smooth_sprites = 0
  26. [debug]
  27. show_fps = 0
  28. logging = 0
  29.  


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
« Last Edit: 28 Dec 2017, 22:25 by eri0o »

Snarky

  • Global Moderator
  • Posts: 6,706
  • Private Insultant
    • I can help with proof reading
    • I can help with translating
Re: AGS engine Android port
« Reply #717 on: 29 Dec 2017, 00:01 »
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

  • Local Moderator
  • Posts: 8,730
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #718 on: 29 Dec 2017, 00:33 »
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.
« Last Edit: 29 Dec 2017, 00:36 by Crimson Wizard »

Snarky

  • Global Moderator
  • Posts: 6,706
  • Private Insultant
    • I can help with proof reading
    • I can help with translating
Re: AGS engine Android port
« Reply #719 on: 30 Dec 2017, 17:20 »
OK. I took eri0o's comment:

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.