Adventure Game Studio | Forums

AGS Development => Engine Development => Topic started by: JJS on 03 Nov 2011, 20:18

Title: AGS engine Android port
Post by: JJS on 03 Nov 2011, 20:18
Here is the initial version of an engine port to Android. It is based on the PSP port, so it also shares some features:

- Support for AGS data files version 2.50 - 3.21 UPDATE: now supports up to 3.4.0-P2
- Plugin support including AGSBlend and open-source recreations of the Snow/Rain and Flashlight plugin
- All color depths and screen resolutions

The mouse cursor is moved by dragging, a left click is done by a quick touch and a right click by touching with two fingers. You can bring up the software keyboard with the MENU button.

I chose the namespace as "com.bigbluecup.android". The reason was that I want to avoid the situation of the ScummVm project, where another private namespace was initially used and is still kept to avoid breaking updates through the market. Still, this is open to discussion. For now, the application is also not on the market (would be too early in development anyway).

Games must be placed on the SD card root in the "ags" directory. Each game needs its own subdirectory (like in the PSP port). The data file is automatically detected within the folder.

Native libraries are included for all Android platforms (armeabi, armeabi-v7, x86).

I am no expert in Android development so I would appreciate any feedback.  :=


:= DOWNLOADS AND OTHER LINKS :=

[Crimson Wizard's EDIT] Because JJS has long abandoned development, his builds are very much outdated. You can still use them to run games made with AGS 3.2.1 and earlier, but you won't be able to use them to run newest game created with newest versions of AGS.
Since 3.4.0-p2 release there will be Android APK download link along other downloads provided in respected forum threads. Check "AGS Engine & Editor Releases" forum section.
Current release:
-===    http://www.adventuregamestudio.co.uk/releases/finals/AGS-3.4.0-P2/Android.3.4.0.14.APK.zip   ===-

Old JJS's daily builds (circa 2013 and earlier):
http://jjs.at/daily/ (http://jjs.at/daily/)

Source here: https://github.com/adventuregamestudio

For usage instructions see here:
https://github.com/adventuregamestudio/ags/blob/master/Android/README.md

Please also post feature requests and bugs there.
Title: Re: AGS engine Android port
Post by: magintz on 03 Nov 2011, 20:36
Where can I find the 'like' button...

oh here it is  :=
Title: Re: AGS engine Android port
Post by: Dualnames on 03 Nov 2011, 20:44
Despite i find this ultra-amazing, my android phone doesn't. Xperia 10 mini.
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 03 Nov 2011, 20:51
magic, will report back.

I have a new HTC sensation tho so i wont be much use for performance testing
Title: Re: AGS engine Android port
Post by: JJS on 03 Nov 2011, 21:03
Despite i find this ultra-amazing, my android phone doesn't. Xperia 10 mini.
Hmm, so what happens? Does it not install or not run?

Maybe I should add that for non-market apps to work, you have toggle some setting in the system options (allow installation from "unknown sources").

The minimum Android version this runs on is 1.6 and I have only run it on my T-Mobile G1 (HTC Dream) which is probably a very low performance device nowadays. Overall games run way worse on it than on the PSP which is mostly due to lack of an FPU I guess.
Title: Re: AGS engine Android port
Post by: Dualnames on 03 Nov 2011, 21:15
Despite i find this ultra-amazing, my android phone doesn't. Xperia 10 mini.
Hmm, so what happens? Does it not install or not run?

Maybe I should add that for non-market apps to work, you have toggle some setting in the system options (allow installation from "unknown sources").

The minimum Android version this runs on is 1.6 and I have only run it on my T-Mobile G1 (HTC Dream) which is probably a very low performance device nowadays. Overall games run way worse on it than on the PSP which is mostly due to lack of an FPU I guess.

It installs, and when i run a game (the application seems to run okay), it freezes with a white screen. If you have some sort of test game, to make sure it's something else, I'd be happy to try it out.
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 03 Nov 2011, 21:19
yes! I hope this works on my phone.
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 03 Nov 2011, 21:26
I have the same problem as duals.

The music does play tho, albeit in a distorted, stuttering kind of way.
Title: Re: AGS engine Android port
Post by: JJS on 03 Nov 2011, 21:34
I see. The white screen could be a problem with creating the screen texture (drawing is done via OpenGL). Does the white area fill the whole screen or does it change size when turning the phone?

e: Maybe not relevant because this might be a more fundamental problem, but basically all games I tried run on my phone. This includes e.g. all Ben Jordan titles.
Title: Re: AGS engine Android port
Post by: Dualnames on 03 Nov 2011, 21:38
I was able to rotate. It's not like the application freezes.
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 03 Nov 2011, 21:44
yes, ditto. The white texture resizes on rotate and the app doesnt crash
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 03 Nov 2011, 21:45
My game doesn't load for some reason. I get a script error about some import called menu? Then when i try to quit I end up having to force close. btw I got a Sidekick 4g
Title: Re: AGS engine Android port
Post by: JJS on 03 Nov 2011, 22:09
Ok, thanks. I have a lead, obviously something rotten is going on with garbage collection and the sound buffer. I only get errors in the emulator though and not on my phone  ???. Will investigate this further, sorry for the trouble.

Edit: Is this any better? http://jjs.at/temp/AGS_1.apk
Title: Re: AGS engine Android port
Post by: Dualnames on 03 Nov 2011, 22:29
Ok, thanks. I have a lead, obviously something rotten is going on with garbage collection and the sound buffer. I only get errors in the emulator though and not on my phone  ???. Will investigate this further, sorry for the trouble.

No trouble at all.
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 03 Nov 2011, 22:53
Edit: Is this any better? http://jjs.at/temp/AGS_1.apk

Nope, no better
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 03 Nov 2011, 23:13
Ok, it works on my hero but not on my sensation but the mouse movement doesnt work very well. The track ball seems to move the mouse a tiny bit and click the left button every time you move it.

dragging the mouse doesnt work at all.
Title: Re: AGS engine Android port
Post by: pcj on 04 Nov 2011, 02:32
I get the white screen on my Galaxy Tab 10.1 and Galaxy S.
Title: Re: AGS engine Android port
Post by: Gilbert on 04 Nov 2011, 02:56
Yeah, I've tried 5 Days a Stranger on my Galaxy S2 and the same thing happened.

Also, my test game, which was compiled with V2.6SP1, didn't show up. Is it because my game is 8-bit and the engine does not support 8-bit modes?

I actually tried the PSP version some time earlier out of curiosity and it also didn't recognise my game, but since I just tested it with an emulator (I don't own a PSP, and never will) this cannot be any indication.

EDIT: I just put another 8-bit test game compiled with V3.21 and it was recognised (also white screen though), so it shouldn't be a colour depth. Maybe it has difficulties recognising V2.6SP1 games.
Title: Re: AGS engine Android port
Post by: R4L on 04 Nov 2011, 03:36
Same white screen results. On rooted LG Optimus V. Could be because my device is only clocked at 760 MHz, and that's overclocked. :P
Title: Re: AGS engine Android port
Post by: abstauber on 04 Nov 2011, 07:03
First of all: have they finally released an Android port of Allegro? This is too good to be true ;)

Unfortunately I'm also stuck with that white screen. (Moto Defy on Cyanogen7 Android 2.3.5)
Title: Re: AGS engine Android port
Post by: JJS on 04 Nov 2011, 07:21
Ok, as I cannot reproduce the problem it might take a bit of time to get this sorted out. But it will work eventually  ;)

First of all: have they finally released an Android port of Allegro? This is too good to be true ;)
Actually I did the port myself, a patch to allegro 4.4.2 is in the source repository.

Also, my test game, which was compiled with V2.6SP1, didn't show up. Is it because my game is 8-bit and the engine does not support 8-bit modes?

I actually tried the PSP version some time earlier out of curiosity and it also didn't recognise my game, but since I just tested it with an emulator (I don't own a PSP, and never will) this cannot be any indication.

EDIT: I just put another 8-bit test game compiled with V3.21 and it was recognised (also white screen though), so it shouldn't be a colour depth. Maybe it has difficulties recognising V2.6SP1 games.
Can you post a link to the non-working game? I would like to check it out. Trilby Notes is an 8 bit game compiled with 2.62 and works, so it might be a file format difference that I didn't account for.

Ok, it works on my hero but not on my sensation but the mouse movement doesnt work very well. The track ball seems to move the mouse a tiny bit and click the left button every time you move it.

dragging the mouse doesnt work at all.
Trackball movement is something I couldn't figure out. The ball on my G1 seems to be pretty much useless because it needs about a full turn to register any movement. Dragging the mouse should work though.

My game doesn't load for some reason. I get a script error about some import called menu? Then when i try to quit I end up having to force close. btw I got a Sidekick 4g
I am aware of this problem and will try to correct it.
Title: Re: AGS engine Android port
Post by: Gilbert on 04 Nov 2011, 08:31
Can you post a link to the non-working game? I would like to check it out. Trilby Notes is an 8 bit game compiled with 2.62 and works, so it might be a file format difference that I didn't account for.
Well... Turned out the executable was compiled with the DOS engine for some reasons. I swear the last time I tested it it was using the Windows engine. :P After recompiling it with the Windows engine the game was recognised, however, it just crashed upon loading, not even showing the white screen, so I think it's still worthwhile in sending you the game (check your PM).

Also, I had also checked stuffing the ac2game.ags file into the folder before but it was not recognised, so this engine may be unable to locate (or has some troubles in locating) a game using raw data file, without the Windows engine appended to it.
Title: Re: AGS engine Android port
Post by: AGD2 on 04 Nov 2011, 10:31
This is absolutely fantastic. Great work!

I'm also getting the white screen on my Samsung Galaxy S (Android 2.2) for all the games I've tried. I can rotate it and it will flip without crashing. There are no glitches with the sound or music.

Out of curiosity, I decided to test some of our games compiled with differing AGS versions. Several of them behaved differently to others:

Al Emmo and the Lost Dutchman's Mine v3.0: (AGS 3.2.1.1115)
Loaded with a white screen. For some reason, this game skips over the Ogg Theora logo movie file that plays before the title screen (all other games play movies). If I run the game files from the Android's folder on my PC, the logo movie does play.

King's Quest I Remake v4.1c: (AGS 3.2.0.1110)
Loaded with a white screen. Ogg Theora movie logo played upon start-up (couldn't see it, but could hear the music).

King's Quest 2 Remake v3.0: (AGS 3.1.2.1074)
White box appears on-screen briefly and then the game automatically exits.

King's Quest 3 Redux v1.1: (AGS 3.2.1.1115)
Loaded with a white screen. Ogg Theora movie logo played upon start-up (couldn't see it, but could hear the music).

Quest for Glory II v1.1: (AGS 2.72.920.0)
White box appears on-screen briefly and then the game automatically exits.

Quest for Glory II v2.0: (AGS: 3.2.0.1110)
Loaded with a white screen. Ogg Theora movie logo played upon start-up (couldn't see it, but could hear the music).

Also, quick question: is it possible for this Android port to include an optional mode where the player doesn't need to physically drag the mouse pointer around with their finger to position it? In other words, simply tapping the screen to have the 'click' register directly at the tapped location?
Title: Re: AGS engine Android port
Post by: JJS on 04 Nov 2011, 10:50
I think I found the problem with the white screen and I will post an updated version later (in a couple of hours). Thanks for all the feedback!

Overall, the input method has to be refined and is open to discussion. Such a mode could certainly be implemented. Also it has to be decided how to do a mouse "drag" with held down left mouse button.
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 04 Nov 2011, 14:42
I would suggest adding new functions to the engine specifically for use with android so that the game dev can change things depending on the platform.

Alternatively you could just add a value to the Game.OS (or whatever it is) enum.

i.e

Code: Adventure Game Studio
  1. //pseudo
  2.  
  3. if (Game.OS == eOSAndroid) {
  4.  mouse.visible = false;
  5.  
  6. }
  7.  
  8.  

and then the game just registers clicks from finger taps without showing the cursor.

Obviously this doesnt help for older games but some form of emulation could be added for older versions of the engine.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 04 Nov 2011, 14:55
Here is the initial version of an engine port to Android. It is based on the PSP port, so it also shares some features:

- Support for AGS data files version 2.60 - 3.21
- Plugin support including AGSBlend and open-source recreations of the Snow/Rain and Flashlight plugin
- All color depths and screen resolutions (scaled to the screen size with correct aspect ratio)

The mouse cursor is moved by dragging, a left click is done by a quick touch and a right click by a slightly longer touch. Only hardware keyboards are supported right now (no way to open the software keyboard atm.)

I chose the namespace as "com.bigbluecup.android". The reason was that I want to avoid the situation of the ScummVm project, where another private namespace was initially used and is still kept to avoid breaking updates through the market. Still, this is open to discussion. For now, the application is also not on the market (would be too early in development anyway).

In this version, no options can be set but I would implement it the same way as in the PSP. So there would be a config file for all games that can be overridden by each individual game. This would ideally be accessible from within the game or launcher.

Games must be placed on the SD card root in the "ags" directory. Each game needs its own subdirectory (like in the PSP port). The data file is automatically detected within the folder.

The native libraries are compiled for generic ARM cpus. Therefore performance could be improved on newer ARM7 cpus by building a "fat" package with multiple libraries (maybe even for x86 Android).

I am no expert in Android development so I would appreciate any feedback.  :=


Download of the package here: http://jjs.at/temp/AGS.apk

Source here: http://gitorious.org/~jjs/ags/ags-for-psp

I LOVE YOU!!!!!!! I am gonna try this on my phone and tablet as soon as I get a chance. Oh, after reading Steve Jobs New biography, please do not port to IPhone. I do not want another feather in apples cap.
Title: Re: AGS engine Android port
Post by: abstauber on 04 Nov 2011, 15:00
Quote
Oh, after reading Steve Jobs New biography, please do not port to IPhone. I do not want another feather in apples cap.
Have you bought the biography, my feathered friend ;) ?
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 04 Nov 2011, 15:04
Unfortunately. While a lot is interesting and I admire what the man has done, that dude had some issues and I felt like he thought he was a god or something.
Title: Re: AGS engine Android port
Post by: R4L on 04 Nov 2011, 16:18
I may be stupid for saying this but...

You said this engine uses OpenGL to render right? Well maybe to fix the white screen issue you could use Chainfire 3D on the app market. Again, just suggesting. I might be stupid for suggesting that lol.

Also, does the ROM matter? It should work on any android ROM right? Because I have rooted LG Optimistic V with bumblebee rom.
Title: Re: AGS engine Android port
Post by: JJS on 04 Nov 2011, 17:22
Hopefully this fixes the white screen bug: http://jjs.at/temp/AGS_2.apk
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 04 Nov 2011, 17:31
yep that fixes it.

Still cant drag the mouse on either of my phones tho.
Title: Re: AGS engine Android port
Post by: Gilbert on 04 Nov 2011, 17:47
yep that fixes it.

Still cant drag the mouse on either of my phones tho.
+1

And there seems to be some sprite problems when running my test game (check the horizontal at the title screen).
Title: Re: AGS engine Android port
Post by: Jim Reed on 04 Nov 2011, 19:00
=D \o/

...but

mouse control doesn't work, it doesn't move the mouse (can't click either) and there is no support for landscape mode.

Samsung Galaxy SII, tried Kuma Story and Barn Runner 4.

Still, glad to see this happening =)
Title: Re: AGS engine Android port
Post by: AGD2 on 04 Nov 2011, 19:37
The white screen issue is fixed for me on the Samsung Galaxy S.

The mouse pointer was very hard to move for me as well. I found that if I held my finger still on the screen for a few seconds, then moved it very slowly, I could sometimes get the pointer to start moving. Sometimes it would follow my lead for a while and I could move it around in patterns. Other times (more often than not) the pointer moved a few pixels and then stopped following my finger. It seemed slightly more responsive in high-res games... but that may just be my imagination.

If the pointer stopped moving, I found the only thing that could possibly get it following again was to rotate the phone and then trying to drag and move it again on the new view.

The games themselves seem to run well for the most part, with little slowdown.

A few other things worth mentioning:

-Ogg Theora videos are pretty laggy during playback. They're somewhat acceptable in 320x200 games, but way too slow at any higher res.

-in Al Emmo, a very lengthy character animation that has "Run next loop after this to make a long animation" checked to span 4 loops always seems to freeze the game in the same place and makes it auto-exit.

-DosBox for Android handles right-clicking by holding one finger down on the screen, and then tapping a second finger on the screen simultaneously. That might be less frustrating that using a single finger for both click modes where you have to correctly determine the duration of your taps?

-You can't currently use the volume buttons on the side of your phone to increase/decrease the overall volume of the game.

I also agree with the idea of having editor functions to control certain things. That way, if people want to release commercial AGS games to the Android Market, authors will be able to prevent the PC builds of their games from being run on Android. They'll also be able to include Android specific features.
Title: Re: AGS engine Android port
Post by: Bòógieman on 04 Nov 2011, 19:53
a dream comes true!  :o  :-*

I tested some Maniac Mansion Mania episodes with different AGS-versions on my Samsung Galaxy Ace and they all worked but suffered from the following problems:
- the mouse control
clicking always worked, but I was most of the time unable to drag the cursor around
it only worked once in a while and then the cursor moved only a very short distance before stopping again  :'(
- the speech text font
when a character says a longer sentence, the black border of the font is not on its right position
- no music
all games I tried use MIDI music which did not play
but I am not sure if my Samsung Galaxy Ace supports MIDI anyway, so this might not be a problem at all  ;)
MP3 and WAV sounds did work just fine

keep on the good work  :-*
Title: Re: AGS engine Android port
Post by: JJS on 04 Nov 2011, 20:01
The way I consume the touch events seems to only work on my phone.  :'( I am working on it though.


At the moment I am targeting Android 1.6 and that doesn't support multitouch, but I will see if backwards compatibility can be assured while still using features of newer versions if available.

Ogg videos being choppy is somewhat expected since there is no hardware acceleration at all for the video, not even optimized assembler code. Everything is done in C. Also videos are being played without framedrop. This is necessary for slow devices because they will always lag behind and therefore skip rendering all frames (happened on the PSP). This could be made optional though.

Al Emmo is a 2.72 game? I suppose this is a bug in the backwards compatibility code, but I cannot tell without checking it out myself (and I don't have the game). It is most likely not Android specific, though it should be noted that overall I haven't really tested highres games because the PSP port didn't support them.

As for midi music, it works the same as on the PSP port:
- Download this file: http://www.eglebbk.dds.nl/program/download/digmid.dat
- Rename it as "patches.dat"
- Place the file in the "ags" directory on the SD card
- Midi should play

I know about the wrong outline bug. It happens on all games that use a certain Lucasarts style template (like Murder in a Wheel). Seriously, I have no idea what causes it but it occurs on both the PSP and Android. I also tried different versions of Freetype, but I cannot get rid of that strange effect. It doesn't even make any sense since the font itself is drawn correctly. Just the outline is wrong as if the font spacing was dependent on the screen position. Weird, really.
Title: Re: AGS engine Android port
Post by: AGD2 on 04 Nov 2011, 20:13
Quote
Also videos are being played without framedrop. This is necessary for slow devices because they will always lag behind and therefore skip rendering all frames (happened on the PSP). This could be made optional though.

Ah, so that would allow Theora videos to play and keep their speed, by dropping frames where necessary? Would be better than the lag, I think.


Al Emmo was originally compiled with 2.72, but I've been testing the newer version compiled with 3.21. I haven't checked this crash in the 2.72 build yet (QFG2VGA v1.1, the other 2.72 game I tried, exited on startup).  But I'll upload a copy of the 3.21 Al Emmo game later for you so you can take a look if you want. It'll also demonstrate the other video-related issues I referred to elsewhere in the thread.
Title: Re: AGS engine Android port
Post by: Bòógieman on 04 Nov 2011, 20:16
As for midi music, it works the same as on the PSP port:
- Download this file: http://www.eglebbk.dds.nl/program/download/digmid.dat
- Rename it as "patches.dat"
- Place the file in the "ags" directory on the SD card
- Midi should play
thanks, MIDI works just fine now  :D
Title: Re: AGS engine Android port
Post by: JJS on 04 Nov 2011, 20:41
Another version: http://jjs.at/temp/AGS_3.apk

This should have a working mouse. Don't be surprised if it feels a bit "loose" (for lack of a better word), this is because the touch events are only processed with 10 Hz as not to waste too much CPU on it. Might be worth increasing it for faster devices though.

I also enabled frameskip for theora in this version.

And it contains binaries for ARM7 CPUs, so potentially this is much faster on newer hardware. At least I hope it is without recompiling all libraries, not sure about that though. Please let me know if you see a performance difference. A good test case should be something like the main menu of Beacon which stresses the CPU a lot.

AGD2, I would certainly like to check the game if you can upload it.
Title: Re: AGS engine Android port
Post by: pcj on 04 Nov 2011, 21:08
Don't get the white screen anymore, but Theora video doesn't play.

EDIT: OK, it plays some Theora video, but very slowly if at all.
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 04 Nov 2011, 22:08
well.. the mouse 'works' but its essentially impossible to accurately control.
Title: Re: AGS engine Android port
Post by: Dualnames on 04 Nov 2011, 23:10
What Calin, said. I also confirm that it works now.
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 05 Nov 2011, 01:25
I keep getting that error.

Script link failed: Runtime error: unresolved import 'Menu'
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 05 Nov 2011, 01:32
Ok well I managed to play through Eternally Us from start to finish without any problems but right clicking takes *many* attempts to get right.

I have a feeling the draw order/z-buffer might be a little screwed up tho. Objects are drawing on top of the debug text which i think is an overlay internally.

Title: Re: AGS engine Android port
Post by: Jim Reed on 05 Nov 2011, 02:15
It works almost perfectly now! =D

I ran BEACON at a flat 40fps on gingerbread 2.3, tho tere is no soud at all =(.
The mouse moves about 2x faster than my finger, I wish, if it is possible, that the mouse snaps to wherever I touch, ie. so I don't need to move the cursor. I'm not sure about the control scheme(left/right click), maybe you could make it adjustable later on. While on the point, maybe add a virtual mouse mover to adjust the pointer precisely for those nasty pixel hunts.

Anyway, I like it very much!
Title: Re: AGS engine Android port
Post by: R4L on 05 Nov 2011, 03:06
Ha! Awesome stuff now! Playing Ben Jordan 2 and 3 at a solid 40 FPS. Well, I had to set my governor to performance and clock at 768 MHz, but it's smooth, and the mouse is great.

Good work so far!
Title: Re: AGS engine Android port
Post by: AGD2 on 05 Nov 2011, 15:07
JJS: The mouse pointer movement is fixed for me in the newest build and seems to follow my finger quite well. On my Galaxy S, the pointer doesn't move at twice the speed, as others have experienced.

Also, I have sent you a PM with the Al Emmo v3.0 (AGS 3.21) download link for testing hi-res related issues. In my PM I've posted examples of how to recreate several of the issues I mentioned earlier in the thread.
Title: Re: AGS engine Android port
Post by: salewa on 05 Nov 2011, 18:16
Test AGS_2.apk-Robo-Quest

Title: Re: AGS engine Android port
Post by: Bòógieman on 05 Nov 2011, 21:01
first of all, I love your App!  :-*

here is my feedback for AGS_3.apk:

the mouse control works fine now, but it is hard to point at smaller hotspots  :-\
and the cursor moves further or shorter as my finger moves on the screen depending on the position of my finger

how is it supposed to perform a right-click?
is it normal to get a right-click (or ESC) by fast clicking with two fingers on different positions in turns?
I put two fingers on the screen and click like "finger 1, finger 2, finger 1, finger 2" and then the current running cut-scene using eSkipESCOrRightButton gets skipped  :D

I had also problems with the Z-order at one single test game of mine
the LucasArts-GUI and inventory were invisible but clickable
I think they got covered by a big black non-clickable rectangle GUI object that should normally be behind them

animations using views with multiple loops and many sounds seem to bring the FPS down on my Samsung Galaxy Ace

there are also some sounds that make ugly random noises when played
maybe it is just my phone, but I am not sure  :-\

and the game completely ignores the volume-settings of my phone and always uses max. volume
Title: Re: AGS engine Android port
Post by: salewa on 06 Nov 2011, 13:10
Pocket Quest - Android port
Do not display properly color; Do not switch the cursor and do not take things


R`n`B Quest - Android port.mpg


The City Adventure - Android port.mpg
Title: Re: AGS engine Android port
Post by: mjomble on 06 Nov 2011, 17:34
Just tested on an HTC Desire Z with Android 2.3.3.
Mouse cursor didn't appear at all, tried tapping and dragging but no effect on any hotspots. And after a short while it just crashed every time I tried - sometimes sooner, sometimes later, without an obvious trigger.

But apart from that, having the title screen appear at all was epic :D
And the music worked.
Looking forward to the next updates.
Title: Re: AGS engine Android port
Post by: R4L on 07 Nov 2011, 01:17
Confirming that 5 Days, 7 Days, Trilby's Notes (Although parser doesn't work due to having no physical keyboard), 6 Days works awesomely.
Title: Re: AGS engine Android port
Post by: uswin on 07 Nov 2011, 04:41
OH MY GOOOOD. JJS,
Thank you so much for making AGS to be able to run in Android.
Confirming that this is working on my LG P990 smoothly.

This is like a dream come true man. I wet my pants off as I write this  ;D.

Well, still need improvement regarding controls and playback of ogg movie though.

especially regarding how to optimize right click function and tapping.

I really hope you doesn't give up on this android port project friend.

Will get back to you guys if I found any bugs.

Thanks a lot. I really mean it.  :) ;) :D ;D

Title: Re: AGS engine Android port
Post by: Intense Degree on 07 Nov 2011, 20:59
This really is brilliant! ;D

Certainly it may need more work re controlls etc. but seeing AGS games on my phone is FANTASTIC!

Keep going man!
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 08 Nov 2011, 03:59
Tried it on my Asus Transformer and Evo 4G. Works. But same issues as above.
Title: Re: AGS engine Android port
Post by: monkey0506 on 08 Nov 2011, 13:17
I have a feeling the draw order/z-buffer might be a little screwed up tho. Objects are drawing on top of the debug text which i think is an overlay internally.

Nope. The Debug function RawDraws the FPS to the background, so EVERYTHING will show on-top of it (except the room background).

Also, my games run slowly but it might just be the fact that my phone only has like 100 MB of RAM*. 8)

*Well, at least what's not used up by Android.
Title: Re: AGS engine Android port
Post by: monkey0506 on 08 Nov 2011, 21:17
In my experience, possibly device-specific, putting the games in /sdcard/ags/ didn't work. I had to put them in /storage/ags/ where /storage/ is my phone's memory root. If you don't have access to the phone memory then the SD card is probably the right place, but otherwise check both. ;)

Just a friendly tip from a situation that was driving me insane. :=
Title: Re: AGS engine Android port
Post by: JJS on 08 Nov 2011, 21:27
Unfortunately you cannot simply tell Android to return you the sdcard mount point. The path the system returns on calling getExternalStorageDirectory() is only the "primary" mass storage device, whatever the device thinks that is.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 08 Nov 2011, 23:04
Hey JJS: I am new to Android Development and Java, but can you try the following changes and see if these do what they are supposed to do:


For File: http://gitorious.org/~jjs/ags/ags-for-psp/blobs/psp/Android/app/src/com/bigbluecup/android/AgsEngine.java

Lines 192 and 193 change to :
glue.mouseMoveX = (short) (ev.getX() * 5);
glue.mouseMoveY = (short) (ev.getY() * 5);
/// That was to change the cursor being in the wrong spot.

////These next code changes are so that a left click is one tap and a right click is holding two buttons on the screen instead of one.

After line 199:

Case MotionEvent.Action_Pointer_Down:
{
Glue.mouseClick = 2;
}

Replace line 111 with:

public boolean dispatchTouchEvent(View V, MotionEvent ev)

Replace lines 135 to 147 with:

case MotionEvent.ACTION_DOWN:
        switch(v.getId())
        {
long down_time = ev.getEventTime() - ev.getDownTime();

             case R.id.btn1:
if (down_time < 150)
{
               glue.clickMouse(EngineGlue.MOUSE_CLICK_LEFT);
                break;
}
             case R.id.btn2:
if (down_time < 150)
{
               glue.clickMouse(EngineGlue.MOUSE_CLICK_RIGHT);
                break;
}

        case MotionEvent.ACTION_POINTER_DOWN:
        switch(v.getId())
         {
            case R.id.btn1: if (down_time < 150)
{
               glue.clickMouse(EngineGlue.MOUSE_CLICK_LEFT);
                break;
}

            case R.id.btn2:
if (down_time < 150)
{
               glue.clickMouse(EngineGlue.MOUSE_CLICK_LEFT);
                break;
}

-------------------------------

Also, perhaps create a menu option to show the Keyboard by using something somewhat like this:

((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)) 
.showSoftInput(editText, 0);

-------------------------------

Hope this works for you.
Title: Re: AGS engine Android port
Post by: Dualnames on 09 Nov 2011, 12:43
Unfortunately you cannot simply tell Android to return you the sdcard mount point. The path the system returns on calling getExternalStorageDirectory() is only the "primary" mass storage device, whatever the device thinks that is.

It would be nice when you update the port, that you list the changes. Or say that a new version is up. I am kinda nitpicking here, so well, but I had to say it, that's all.
Title: Re: AGS engine Android port
Post by: DutchMarco on 10 Nov 2011, 10:45
Have yet to test this, but would like to say thank you for this! Ultra-cool!
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 24 Nov 2011, 00:36
Hey JJS, I just noticed that you added some new commits to this project and I tried to compile using the NDK, but I have a feeling I am doing something wrong as my environment doesn't seem to pick up the NDK. Any instructions or help? Also, do I need to download anything else to compile it or are all the necessary files there? Sorry, I am more of an SDK than an NDK Developer.
Title: Re: AGS engine Android port
Post by: JJS on 24 Nov 2011, 07:49
The recent commits are a bit less refined than usual since they were an effort to repair my local repository that got corrupted. I just did another commit though that should fix building of the native libraries.

To compile you need the NDK version 6! http://dl.google.com/android/ndk/android-ndk-r6-linux-x86.tar.bz2
The newer versions of the NDK (6b or 7) will error out while linking the native libraries.
Also the cygwin version of the NDK will not work to build the libraries.

I put the NDK under /opt/android-ndk-r6, but no script should depend on that I think.

These have to be exported:

export NDK_ROOT=/opt/android-ndk-r6
export PATH=$PATH:$NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin


The scripts in the Android/buildlibs/armeabi* directory should automatically download, patch and install the required libraries. Some of them have depencies on each other.
A safe order should be: png, freetype, ogg, tremor, theora-svn, allegro, dumb.
The difference between theora and theora-svn is that the latter is version 1.2 alpha which will make use of ARM assembler instructions to speed up decoding.

The library autotools scripts have their own dependencies that I don't know off hand. What is certainly needed is autotools, cmake and subversion.


Once all libraries are built for armeabi and armeabi-v7a, you can build the AGS engine library. This is done with the NDK build tool "ndk-build":

/opt/android-ndk-r6/ndk-build NDK_PROJECT_PATH=<full path up to here>/Android/app/

NDK_PROJECT_PATH has to point to the root of the application directory.


The native libraries are automatically recognized by the SDK build system. So just running the application in Eclipse will put them into the APK.


Please note that the native libraries for armeabi are actually built with an arm-v6 target to enable the optimizations in libtheora. This means that the application will not run in the emulator.


Btw, this is not dead or anything  :P. I am at the moment working on speeding up rendering, so stay tuned.
Title: Re: AGS engine Android port
Post by: R4L on 26 Nov 2011, 04:13
You are amazing
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 30 Nov 2011, 17:46
Very nice.  It's always good when someone comes along and does something you'd like to do yourself, thus saving you the effort :).

Edit:  I just tried this with a few of my games and got some different results.

1.  Limey Lizard ran perfectly with voices.
2.  I couldn't start one of my games in progress because it required the ENTER key.
3.  Another of my games in progress stuttered and slowed down whenever large screen animations occur.

It seems as though it works pretty much spot on but needs some optimization, access to the virtual keyboard, and a menu system whereby we can choose target folders for the games rather than store them all in internal memory.  Mouse emulation's also pretty rough, with the mouse moving exponentially in the direction you're swiping instead of moving with it, and of course it doesn't track to where you press.  Something else I'd like to see is proper stretched fullscreen without smoothing.  Aside from that, brilliant work so far.
Title: Re: AGS engine Android port
Post by: bbalint85 on 05 Dec 2011, 19:56
Wow!!! Amazing work!
I tried it on my HTC Wildfire S, and it works! The game's slow, but everything works! My phone is not the fastest though...
So keep up the good work, I'm so excited!
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 05 Dec 2011, 20:00
Very nice.  It's always good when someone comes along and does something you'd like to do yourself, thus saving you the effort :).

Gosh Progz, if only you had the time you'd probably have ported AGS to everything by now.
Title: Re: AGS engine Android port
Post by: timofonic on 08 Dec 2011, 12:33
Are there some compatibility list? A wiki can be used and testers could check the compatibility :)
Title: Re: AGS engine Android port
Post by: uswin on 08 Dec 2011, 16:26
I have just tried "Lost in the nightmare" in my LGP990

a bug occur, standard message box are missing the background color (white), so it is almost impossible to read the message box since in this game the display text are in black and the message box is in white.

Other than that, still run almost flawlessly.
Well except the stuttering sound which is a known issue in AGS.

Will report back to you guys if I found something else.   
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 10 Dec 2011, 21:03
Gosh Calin, if only you had a brain you'd keep your snarky comments to yourself.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 10 Dec 2011, 21:30
Is it just me, or has many in this community become more hostile towards eachother? Come on guys, we are all in this together. Are EEe ESS PEE EEE SEE TEE EEE guys.  ;D
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 10 Dec 2011, 21:37
Progz's attitude annoyed me but Progz and I rarely play together well.

Presumably because I have been brainwashed by the New World Order.

 
Title: Re: AGS engine Android port
Post by: monkey0506 on 10 Dec 2011, 22:03
That's it. No more opinions allowed.


 ;D
Title: Re: AGS engine Android port
Post by: Gilbert on 11 Dec 2011, 15:42
Right. Stop that off-topic drama. :P
Title: Re: AGS engine Android port
Post by: AGA on 11 Dec 2011, 20:37
I tried this with one of my games (http://games.agagames.com/?game=js) and it seemed to run fine on my Samsung Galaxy S. However, it didn't seem very easy to actually click.  I seemed to have to press down for quite a while before it would react...
Title: Re: AGS engine Android port
Post by: Mati256 on 27 Dec 2011, 16:43
Just tested it with my LG GT540.
Murder in a wheel ("Works fine but in German because you can't access the conf file)
FOY Demo (Works like a charm)
Technobabylon part 2 (The first room works at 7 or 8 FPS, the other rooms work just fine)
Latest Wretcher Demo (Does not work, don't remember why)

As others have said, this is a great thing! You should work a little on the mouse and a virtual keyboard and you have a killer app.
Congratulations and thank you!
Title: Re: AGS engine Android port
Post by: HappehLemons on 28 Dec 2011, 11:24
I can't even begin to tell you how fantastic this is! Thank you so much for making this. In the future an onscreen keyboard would be AMAZING. But please whatever you do don't stop working on this!
Title: Re: AGS engine Android port
Post by: .M.M. on 30 Dec 2011, 12:42
Great work! I tried it with about 5 games and always got the same result - everything works fine, except sound doesn't play at all. My phone is Sony Ericsson Xperia Neo V. It works so good, that it took me less than hour to change a bit my game in progress (action RPG) to be playable without bigger problems.   :)
Title: Re: AGS engine Android port
Post by: pcj on 01 Jan 2012, 00:19
Just tested it on my new Galaxy Nexus (ICS) - works a lot better. 40 FPS :)  Still some trouble playing OGG video...
Title: Re: AGS engine Android port
Post by: subspark on 03 Jan 2012, 05:41
Fantastic! What kind of resolution can we run on the galaxy nexus?
I'm building port of our game for the device in an hour and a bit.

Kudos!
Title: Re: AGS engine Android port
Post by: pcj on 03 Jan 2012, 05:51
Max resolution on the Galaxy Nexus is 1280x720.  That is of course a widescreen aspect, so the AGS window is a bit smaller.  VSB runs fine at 800x600.
Title: Re: AGS engine Android port
Post by: subspark on 03 Jan 2012, 07:52
I almost had the Samsung Galaxy confused with the Galaxy Nexus. In contrast, the Samsung Tablet could effectively run our games at 4x 320x200 under a native 1280x800 resolution.
We could get 3x (960x600) running with black padding on the Nexus though, right?

Cheers!
Title: Re: AGS engine Android port
Post by: pcj on 03 Jan 2012, 13:02
Probably, I could check it out if needed, but I don't have any 320x200 games in mind...
Title: Re: AGS engine Android port
Post by: pcj on 03 Jan 2012, 13:21
Just checked, and SQ2VGA runs great at 960x600.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 05 Jan 2012, 20:04
Hey JJS, any chance that we can get an updated build of whats on Gitorious since I still cant seem to build using c++?
Title: Re: AGS engine Android port
Post by: JJS on 05 Jan 2012, 20:52
You can find the current Android build here: http://jjs.at/daily/

I also have a bugtracker now: http://jjs.at/tracker/

Actually I thought that I could iron out a few more issues before going sort of public, but I cannot sit on this forever ;).

At this point, I'd also like to thank AGD2 for his support!
Title: Re: AGS engine Android port
Post by: uswin on 06 Jan 2012, 09:48
Hi JJS, thanks for the newest update for AGS android port

Just want to report though

Using the apk from AGS_2011-12-29_15-16-10.apk - AGS_2012-01-05_21-40-39.apk, the game will quickly crash as soon as it is launched. I have tried this on LGP990 and Sony Ericsson Neo V.

This issue doesn't occur in all previous apk before AGS_2011-12-29_15-16-10.apk.

Please see the following crash logs and video

Crash log :
http://www.hostfile.nl/files/m7gtl816ba/1434/device.txt
http://www.hostfile.nl/files/m15e7f902r/1435/logcat.txt

Crash Video :
http://www.hostfile.nl/movies/9jtacq83yq/124/NeoV_Crash_while_launching.avi

You might want to check this issue out.

Thanks a lot.
uswin
Title: Re: AGS engine Android port
Post by: HappehLemons on 11 Jan 2012, 00:17
Would an iOS port in the future be possible?
Title: Re: AGS engine Android port
Post by: David_OSU on 16 Jan 2012, 18:16
-->  Games must be placed on the SD card root in the "ags" directory.

Can the path to the ags directory be made configurable?  With Android 3 and up, the external SD card is located on a different path (sometimes sdcard2, othertimes ex_sdcard), and it would be nice to store the games on the external SD card.
Title: Re: AGS engine Android port
Post by: cianty on 16 Jan 2012, 19:11
Finally tested this with my new Galaxy Nexus yesterday - awesome!!! It is sooo cool to have your own game run on such a device. And to be able to run others as well of course!! AgsVM, yay!

I tested my game a bit and it worked just fine. Did a couple of interactions, save, load, music was playing. Great!

There is just one thing: The right click rarely ever works for me (like 1 time out of 10) and it makes me feel like an idiot. Is there any reason why you opted not to use the ScummVM style of recreating right-click? Touching the screen while you already have one finger on the screen. I tried a few games in ScummVM and I LOVE the controls. It's sooo intuitive once you know what to do. It'd be great to have this in the ags port too.

Oh and also: Is there a way to enforce (or at least pre-configure) landscape mode? I usually disable the automatic tilting of the screen because I like to lie in bed and read sideways (am I weird???). But the auto-adjusting is the only way to "enter" landscape mode as it remains in portrait otherwise. I don't think you'd ever want to not go landscape.

Anyways, thanks a ton for your work on this! I really believe that this can take the engine to the next level.
Title: Re: AGS engine Android port
Post by: AGD2 on 16 Jan 2012, 19:28
JJS has done an excellent job at implementing a lot of new things in the Android port. It has improved greatly since the first versions he posted. If you check the bug tracker at http://jjs.at/tracker/ you can see some of the issues that have been changed and fixed since (things like ARM support for Theora video playback, render-to-texture, and OpenGL driver support).

To lock the rotation of the screen orientation, you can long-touch on the game's title from the menu. That'll allow you to open a preferences menu for the game in question (which will store an individual android.cfg in that game's folder). There's an option in that menu allowing you to lock the screen orientation to either vertical or horizontal (as well as a bunch of other options).
Title: Re: AGS engine Android port
Post by: cianty on 16 Jan 2012, 21:08
Aah, I see! Thanks a bunch for the info, AGD2! That's perfect! I had no idea about the configuration panel.
Title: Re: AGS engine Android port
Post by: JJS on 17 Jan 2012, 17:53
New daily available: http://jjs.at/daily

It features ScummVM-style right clicking (hold down one finger and tap with the another). The reason I hadn't implemented this before is that I was on Android 1.6 when I started the port. That version does neither support ScummVM nor multitouch ;).
Title: Re: AGS engine Android port
Post by: cianty on 17 Jan 2012, 19:22
Thanks, JJS!

Just tried the new version and it's wonderful! This right-click fix makes controlling really comfortable.

I noticed that in ScummVM the cursor moves "faster" than the finger, i.e. the distance the cursor moves is something like 1.3x the distance the finger moves on the screen. This makes it easier to move the cursor across the screen because you don't have to move the same distance. What do you think about this feature?

In my game I make heavy use of Escape-only cutscenes not skippable with a mere left-click/touch. I don't know bout others but would having the "back" button work as Escape not be a better idea than the current "exit" option?

Will you make this available on the android store? I believe that would be huge in promoting AGS to the world, making it even more attractive to both players as well as developers.
Title: Re: AGS engine Android port
Post by: JJS on 17 Jan 2012, 19:36
I thought about adding a "skip cutscene" button to the exit menu if a cutscene is currently playing.

It would also be possible to have the exit menu only appear if the button is held for, say, 2 seconds. Otherwise it would act as the ESC key.


Does the ScummVM behaviour not make it difficult to pixel hunt? I actually cannot really comment on this because ScummVM runs poorly on my HTC Dream. The mouse is very hard to control and jumps around a lot because the CPU is not very fast and seems to get pegged by the input events.


Regarding the Android store: I surely would make this available once it stabilizes a bit more. But I would only want to do this if it is alright with CJ and the people here. Especially the usage of the namespace com.bigbluecup.android should be discussed. I think it is appropriate and good for future updates but it might make it look too "official"? I would like to hear opinions on that.
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 17 Jan 2012, 20:08
This is REALLY coming along.  The cursor trails a fair distance away from my stylus, and the cursor still doesn't go to where you click on the screen automatically (like scummvm) but other than that I think it's really coming along  (basically having the onscreen cursor to go to the x/y of wherever the stylus press is detected would fix this).  Some kind of on-screen transparent button arrangement for supporting the right and middle mouse without using gestures would be welcome as well.  I think once you take care of usability issues like these and allow custom locations for the games (sdcard, usb) it will put android ags on par with how scummvm works!
Title: Re: AGS engine Android port
Post by: Trapezoid on 17 Jan 2012, 20:39
Testing on a Thunderbolt. 8-bit games show the loading icon for a moment and then just a black screen. You can quit or show the keyboard, but the game never appears.
I tried loading the LucasArts-verb template demo, which worked, but once I changed its graphic mode to 8-bit it failed as above. I haven't tried any older games, just builds from 3.2.1.
Title: Re: AGS engine Android port
Post by: cianty on 17 Jan 2012, 22:25
"It would also be possible to have the exit menu only appear if the button is held for, say, 2 seconds. Otherwise it would act as the ESC key."

That sounds perfect to me. A custom exit function is very useful in general (especially since alt + X is not doable anymore) so it'd be great to keep this feature. Also, you never know how people implement their menus - I can imagine the main menu popping up on ESC or having other useful functions on the ESC key as it's just a very common key. So maintaining (ie. supporting) that one key would be very useful indeed.

Would it be possible to create some kind of wrapper tool to have developers convert their AGS games to *.apk and to ensure the correct configuration for their game? I guess we should ship the game with a pre-defined android.cfg file... How about a plugin to enable the players to configure the android.cfg in-game?
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 17 Jan 2012, 22:39
JJS, any chance you can create a customized editor that would compile a game into an APK with the AGS engine?

Or possibly a way to create an APK with a config file that indicates where a game can be downloaded from sort of how some EA games do it. This way we can all submit our games to the marketplace, even commercial ones.
Title: Re: AGS engine Android port
Post by: JJS on 18 Jan 2012, 08:08
How about a plugin to enable the players to configure the android.cfg in-game?
You know what? This is genius. I had thought a bit about how to make Android specific commands available to the game author without fiddling with the editor and breaking things and this never occurred to me for some reason. But it is perfect for e.g. selecting between a "touch mode" without a cursor and the way it is now.

As for custom APKs, I am not sure how this has to be done at the moment. Ideally you would be able to pack every game file into the APK and it would then be installed into the default application directory indicated by the namespace instead of /sdcard/ags/. Building the APK would require the Android SDK though I guess.

[edit: I forgot that you have to sign the APK too, d'oh. So obviously you will want your own key and such.]

I have to disclose here that I am not an Android god in that this is my first Android app and I have never published anything on the market. So if anyone has experience there, I am listening  ;).


Uswin, I tried to reproduce the crash and I can't unfortunately. I tried it on a HTC Desire S where everything ran smoothly. I will send you a version that logs more debug output if that is ok for you?


Trapezoid, I will check that template out.
Title: Re: AGS engine Android port
Post by: cianty on 18 Jan 2012, 20:18
I have the Android SDK and the eclipse plugin installed on my notebook, guess it's time to experiment a bit with it. Requiring the Android SDK for an AGS apk sounds fine to me.

I'd love to include an android settings panel in my game...
Title: Re: AGS engine Android port
Post by: uswin on 19 Jan 2012, 04:11
How about a plugin to enable the players to configure the android.cfg in-game?

Uswin, I tried to reproduce the crash and I can't unfortunately. I tried it on a HTC Desire S where everything ran smoothly. I will send you a version that logs more debug output if that is ok for you?

Let me try that mate,
I don't have any idea too as of why the game crash using the apk from AGS_2011-12-29_15-16-10.apk - AGS_2012-01-05_21-40-39.apk, the game will quickly crash as soon as it is launched.

Thanks a lot, cheers
Title: Re: AGS engine Android port
Post by: Snarky on 19 Jan 2012, 10:13
I've been testing the port on my HTC Desire Z, and it's very cool!

I'm not sure I've quite figured out the UI yet (I'm having a hard time clicking, and can't say whether right-clicking works), and in the latest build (AGS_2012-01-17_18-49-50.apk) Blackwell Deception crashes back to the desktop directly on load (it worked in the version posted in the first post). Nor is it clear to me how to bring up the keyboard. It would be great to have an application menu you could bring up with the menu button (which is a hard key on my phone, anyway).

Oh, and in a game-in-production I'm working on, the font outline doesn't always line up correctly with the text (using LucasFanFont/LFFOutline.ttf).

Other than that, it seems to work great!
Title: Re: AGS engine Android port
Post by: Joe on 19 Jan 2012, 14:47
I tried this and it's so amazing!!  GJ

Report:
I don't know if this is a bug or just something no one cares of... but wouldn't it be nicer if the cursor was placed exactly where I put my finger instead of having to drag it?? I'd really prefer this 1st option because every android game works like that...

Joe.
Title: Re: AGS engine Android port
Post by: Trapezoid on 19 Jan 2012, 17:41
I like the drag cursor. It helps to not have your finger blocking what you're trying to click on, and AGS games are designed for a real mouse (which you drag), not a cursor that can teleport all over the place.
Title: Re: AGS engine Android port
Post by: cianty on 19 Jan 2012, 19:20
Definately preferring the "drag" cursor. It is way more convenient a way to move the cursor about. I wouldn't want having to move my hand all across the whole screen of my nexus. :)
Title: Re: AGS engine Android port
Post by: pcj on 19 Jan 2012, 19:22
Maybe make it an option.
Title: Re: AGS engine Android port
Post by: JJS on 19 Jan 2012, 19:37
I will make it an option.

Also I will get rid of reading acsetup.cfg. The only two relevant options are the translation and "smooth scaled sprites", which I will include into the option menu.
Title: Re: AGS engine Android port
Post by: David_OSU on 21 Jan 2012, 14:56
I've been testing the latest build (1/17/2012) on an Acer Iconia A500 running Android 3.2.1.  Here's the results so far:

Working:  Apprentice 1, Apprentice 2, Ben There Dan That, Space Quest IV.5, The Oracle

Not Working:  Infinity String, King's Quest I, Quest for Glory II

With the games that are working, I have had some random crashes, or the sound gets messed up at some point and stays that way.

Infinity String loads, and gets to the "Press the Spacebar" screen, but won't continue.  I even tried a USB keyboard, but it seems to ignore keyboard input.

King's Quest and Quest for Glory both load, show the disclaimer screen, then start loading some more, and crash back to the desktop.  I have no clue what is happening there.

When it does work, this app is awesome on a tablet.  Please keep working on it JJS.  :)
Title: Re: AGS engine Android port
Post by: JJS on 21 Jan 2012, 16:04
There does seem to be a problem with theora video playback on nVidia Tegra devices (like yours and uswin's). The crashes in the Sierra remakes occur most probably when the intro logo video is supposed to be played. I guess I have to find a way to make the use of advanced CPU feature optional.

I just tried The Infinity String and I can confirm that the space key is not properly detected. In general keyboard input via hardware keyboard or via software (press the MENU button) should work.

Thanks for the reports!
Title: Re: AGS engine Android port
Post by: uswin on 21 Jan 2012, 19:21
There does seem to be a problem with theora video playback on nVidia Tegra devices (like yours and uswin's). The crashes in the Sierra remakes occur most probably when the intro logo video is supposed to be played. I guess I have to find a way to make the use of advanced CPU feature optional.

I just tried The Infinity String and I can confirm that the space key is not properly detected. In general keyboard input via hardware keyboard or via software (press the MENU button) should work.

Thanks for the reports!

Hi JJS, thanks a lot, it seem that after I installed the latest apk AGS_2012-01-17_18-49-50.apk the issue is gone.

It seem that I have a corrupt game data (My bad), because after I recopied my game into the ags folder again, the game run smoothly and I could not reproduce the crash bug anymore, and guess what,

THE THEORA video can run smoothly on my device Sony Ericcsson Xperia Neo V (I unchecked the setting "DROP FRAME IF NECESSARY" to OFF. Horray for that !!!  ;D

So it now basically my game almost run perfectly on my device. Haven't try this through yet but I found a bug,

If you interrupt the game by minimizing it, when you go back to AGS, the game will reload instead of back to last state. unlike in previous apk version.

Conclusion, so far this is really neat friend, almost come close. Brilliant JOB ! ;D

Will report if I found something. 
Title: Re: AGS engine Android port
Post by: David_OSU on 21 Jan 2012, 22:53


THE THEORA video can run smoothly on my device Sony Ericcsson Xperia Neo V (I unchecked the setting "DROP FRAME IF NECESSARY" to OFF. Horray for that !!!  ;D


FYI, I tried changing this setting to OFF, and the Theora video is still crashing on the Iconia A500.
Title: Re: AGS engine Android port
Post by: David_OSU on 22 Jan 2012, 00:17
I just tried The Infinity String and I can confirm that the space key is not properly detected. In general keyboard input via hardware keyboard or via software (press the MENU button) should work.

I tried Stargate Adventure, and it has the same problem (not detecting spacebar).  Same author, same problem.  I think Sektor 13 is doing something odd.

A Tale of Two Kingdoms is working fine on the Iconia A500.
Title: Re: AGS engine Android port
Post by: JJS on 23 Jan 2012, 07:31
Uswin, you write that the Theora crash is gone on your Sony Ericcsson Xperia Neo V. But I remember that the original crash occurred on a LG P990 Optimus 2X. Can you confirm that the crash is also gone on that device? The logcat I have shows a SIGILL exception which means that an illegal instruction was fed to the processor.

The "framedrop" option cannot really have influence on the crash btw (at least not in a way that I can imagine).
Title: Re: AGS engine Android port
Post by: JJS on 23 Jan 2012, 14:40
New daily: http://jjs.at/daily

- Fixed font outline drawing
- acsetup.cfg file is now always ignored
- Translation and "smooth character scaling" is now configurable through the UI
- Prevented accidental mouse movements while performing the two finger rightclick
- Same source now compiles for PSP, Android, Windows and Linux
- Exit menu only shown when holding the back button for a bit and releasing, but ESC key functionality not yet working


e: Oops. Didn't realize I would doublepost, sorry.
Title: Re: AGS engine Android port
Post by: cianty on 23 Jan 2012, 22:33
Yay! *downloading*
Title: Re: AGS engine Android port
Post by: Trapezoid on 23 Jan 2012, 23:19
I managed to get my 256-color test game working. A problem I noticed right away: Right clicking causes two right clicks. One when you put down your second finger, another when you release.
Title: Re: AGS engine Android port
Post by: Mati256 on 23 Jan 2012, 23:47
Thank you very much! I will try this new version in the following days.
Its really mazing how much you can do, and you say you don't really have any knowledge about programming on Android.
My goal for this year is learning Java and Android (and finish an AGS game).
Title: Re: AGS engine Android port
Post by: uswin on 24 Jan 2012, 04:32
Uswin, you write that the Theora crash is gone on your Sony Ericcsson Xperia Neo V. But I remember that the original crash occurred on a LG P990 Optimus 2X. Can you confirm that the crash is also gone on that device? The logcat I have shows a SIGILL exception which means that an illegal instruction was fed to the processor.

The "framedrop" option cannot really have influence on the crash btw (at least not in a way that I can imagine).

Hi JJS, yes, I confirm that the Theora video still crash in LGP990 Optimus 2X, in Neo V it is working fine. Here are the newest log that I had, you might want to check it out again.

Device:
http://www.hostfile.nl/files/vhk9ifecsn/1445/device.txt

Log
http://www.hostfile.nl/files/6en722ymff/1446/logcat.txt

Video of Crash:
http://www.hostfile.nl/movies/6pbd92c3gp/125/ags_theora_crash.avi

BTW, I want to suggest regarding stretch to screen function,
If possible, make stretch function into 3 option
Option 1. Original size. (already implemented)
Option 2. Fit to Screen (correct ratio). (already implemented)
Option 3. Stretch to screen (without correct ratio). (Stretch game to the maximum screen available without correct ration).

Regarding newest version of APK,
it seem that if the game is using a lot of heavy function such as fade in fade out (I use this a lot to pop up the Speak GUI), the game performance might get slow down a bit, the fade in fade out effect come out a bit slower sometimes (Not always).
My game is 640x400 with a lot of color image as bg room (the photo taken using HDR tech).

Regarding sound,
I confirm that the music and sfx still got stuttering on my game even after turning of the Multi-thread sound function. This issue doesn't occur on other AGS game that I tried so far, for example Purgatorio, Lost in the nightmare, Airwave, Donna. this multi-thread seem working on other AGS games.

So the problem could be from my game itself, maybe I haven't optimized the code yet or something, I have no idea either. but my game doesn't stuttering in windows after using your Windows Fix, kudos for that.

So for now, my only solution for android now is using WAV as audio files, as this will not stutter the audio at all in android.

Thanks a lot. Will inform if there is anything. Cheers
Title: Re: AGS engine Android port
Post by: JJS on 24 Jan 2012, 08:13
Regarding the sound stuttering and slow fading, did you try one of the hardware renderers (in the options menu)? It sounds like updating the screen and decompressing the audio is simply too much work for your CPU.

And thanks for the confirmation and logs.


Also: New daily. Should fix the mouse issues.


EDIT:
Regarding the theora crash: Uswin or David_OSU, does anyone of you have a rooted device? If so, can you post the output of the command "cat /proc/cpuinfo" in a terminal emulator? I guess you can also open the file in a text editor/viewer. Somehow I suspect that the Tegra 2 lies about its available features.

EDIT 2:
Maybe this new daily fixes the theora problem on Tegra CPUs: http://jjs.at/daily/AGS_2012-01-24_19-04-16.apk
But it is a stab in the dark. I will post the source later because my local repository got out of sync with the online one and I have to fiddle around with it some more to make it usable again ::).
Title: Re: AGS engine Android port
Post by: pcj on 25 Jan 2012, 00:21
Just tried the new daily.  I have to enable frame dropping to keep audio and video in sync while playing Theora on my Galaxy Nexus.
Title: Re: AGS engine Android port
Post by: uswin on 25 Jan 2012, 01:39
EDIT:
Regarding the theora crash: Uswin or David_OSU, does anyone of you have a rooted device? If so, can you post the output of the command "cat /proc/cpuinfo" in a terminal emulator? I guess you can also open the file in a text editor/viewer. Somehow I suspect that the Tegra 2 lies about its available features.

EDIT 2:
Maybe this new daily fixes the theora problem on Tegra CPUs: http://jjs.at/daily/AGS_2012-01-24_19-04-16.apk
But it is a stab in the dark. I will post the source later because my local repository got out of sync with the online one and I have to fiddle around with it some more to make it usable again ::).

JJS, Unfortunately I don't have an access to rooted device yet,

but Good news, I confirmed that using the latest AGS_2012-01-24_19-04-16.apk, the theora crash DOESN'T OCCUR on LGP990 Optimus 2X ANYMORE. Kudoooos.  ;D ;D ;D
Where is the LIKE button mate !!
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 28 Jan 2012, 07:58
Just curious can this play AGS 3.2 games yet?
Title: Re: AGS engine Android port
Post by: JJS on 28 Jan 2012, 08:03
It could always run games from 2.6 to 3.2.1.

Uswin, this is good news indeed!
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 28 Jan 2012, 08:07
I see but what I mean is 3.2.2 I think. The PSP version can run those games but I wanted know about  the Android version.
Title: Re: AGS engine Android port
Post by: JJS on 28 Jan 2012, 08:11
Ok, so you mean the current development version in the SVN. All changes were only to the editor as far as I can tell, so no problem there. Also all ports are built from the same engine source, so they should be identical in compatibility.
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 28 Jan 2012, 18:10
Oh sweet it works. Thanks man I had asked cause I remember I couldn't get my game to load when you first released the port.

Great so now I can confirm it works on the Sidekick 4g. Only problem is the sound does this weird sound when the game is not reading my finger.
Title: Re: AGS engine Android port
Post by: David_OSU on 29 Jan 2012, 04:20
EDIT:
Regarding the theora crash: Uswin or David_OSU, does anyone of you have a rooted device? If so, can you post the output of the command "cat /proc/cpuinfo" in a terminal emulator? I guess you can also open the file in a text editor/viewer. Somehow I suspect that the Tegra 2 lies about its available features.

Here is the Features list from the cpuinfo command:

Features:         swp half thumb fastmult vfp edsp vfpv3 vfpv3d16

Also, I know that the Tegra 2 does not have the NEON instructions, which is surprising.
Title: Re: AGS engine Android port
Post by: GMoney on 02 Feb 2012, 05:14
Would it be possible to compile the APK to a BAR for PlayBook users? That would make my day if it were possible. :o
Title: Re: AGS engine Android port
Post by: JJS on 02 Feb 2012, 08:38
David_OSU, thanks for the info! The problem is that the compiler generated code for neon, but to target the Tegra CPU it has to be set to vfpv3-d16. Fortunately this was easy to fix, a problem in the optimized assembler code would have been very hard to resolve for me.

The PlayBook is a Blackberry device, right? I have no clue how the development environment for that looks, but it is certainly not a simple recompile. This would be an entirely different port and I don't think it will happen tbh (at least not from me).
Title: Re: AGS engine Android port
Post by: uswin on 02 Feb 2012, 13:05
David_OSU, thanks for the info! The problem is that the compiler generated code for neon, but to target the Tegra CPU it has to be set to vfpv3-d16. Fortunately this was easy to fix, a problem in the optimized assembler code would have been very hard to resolve for me.

Thanks god it is not that friend.  ;D
Title: Re: AGS engine Android port
Post by: GMoney on 02 Feb 2012, 19:38
JJS, yes, the PlayBook is the BlackBerry tablet. With the new PlayBook OS (OS 2.0) Android developers will be able to release their Android apps in Blackberry App World. The only thing that is required is that the APK be converted to a BAR file. I'm sure there is more tweaking that might need to be done, but, generally apps seem to work well after the conversion.

I actually converted "AGS_2012-01-24_19-04-16.apk" to a BAR last night, but am unable to install it on my PlayBook without first getting a signing key from the RIM servers.

Here's a little video tut:


I might be able to tinker with it later tonight or tomorrow and let you know how it works out.

* EDIT: This just popped up today:
http://crackberry.com/android-developers-submit-your-apps-february-13th-and-get-free-playbook

So, if you have any other existing Android apps, you could get your hands on a free PlayBook--it's how I got mine.

Title: Re: AGS engine Android port
Post by: R4L on 03 Feb 2012, 04:31
JJS, I can't even describe how awesome this project has come along in such short time. From not functioning to almost perfect compatibility in this amount of time is impressive my friend, and I applaud you for taking the time to make it possible. You can't beat playing 6 Days a Sacrifice in bed when I'm too lazy to get up and play on the computer. Especially considering my phone is very limited in terms of games.

Seriously man, bravo.  :=
Title: Re: AGS engine Android port
Post by: uswin on 03 Feb 2012, 04:37
JJS, I can't even describe how awesome this project has come along in such short time. From not functioning to almost perfect compatibility in this amount of time is impressive my friend, and I applaud you for taking the time to make it possible. You can't beat playing 6 Days a Sacrifice in bed when I'm too lazy to get up and play on the computer. Especially considering my phone is very limited in terms of games.

Seriously man, bravo.  :=

Couldn't agree more mate.
This is absolutely a brilliant effort to make the AGS step up to the next level.
Kudos.
Title: Re: AGS engine Android port
Post by: GMoney on 03 Feb 2012, 09:33
I managed to get it loaded onto my PlayBook, but it force closes immediately. I ran RIM's compatibility test and this is what it gave me:

uses-access-native:impact=5:com.bigbluecup.android.EngineGlue
uses-access-native:impact=5:com.bigbluecup.android.GamesList
uses-access-native:impact=5:com.bigbluecup.android.PreferencesAcivi ty

Basically, the PlayBook doesn't support the above APIs. I'm not sure what they are exactly. "EngineGlue" sounds pretty important though.

"impact=" refers to the severity of "unsupportedness". 5 is the absolute highest.

I'm hoping this could potentially be only a few tweaks away from being PlayBook compatible.
Title: Re: AGS engine Android port
Post by: JJS on 03 Feb 2012, 10:02
Thanks guys!  :D

Looks like the PlayBook can only run the Java code, but not native ARM instructions. Because the whole AGS engine is in native code, this is of course bad news. I guess nothing except for reimplementing the whole engine in Java could fix this :(.
Title: Re: AGS engine Android port
Post by: GMoney on 03 Feb 2012, 19:47
Yeah, I found your code online and was looking through the different classes. In the back of my mind, I knew that would have been too good to be true.

Oh, well, I have an Android phone and I think I might play through Gemini Rue again using that! Very awesome stuff you've accomplished.  :D
Title: Re: AGS engine Android port
Post by: JJS on 04 Feb 2012, 11:42
Gemini Rue
At the moment you will not be able to do the fighting and box pushing minigames I think. You could use the Windows binary from my daily build site and play through those sections on your PC because it should be savegame compatible though.
Title: Re: AGS engine Android port
Post by: cianty on 06 Feb 2012, 22:27
I dunno if it's exclusive to my device (Nexus) but the backspace key doesn't do anything. Which is really annyoing.... jus started playing Ghost's Hubris on my phone and the prefilled text of "player" can only be extended with further characters, but not deleted.
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 06 Feb 2012, 22:31
It's not just you phone. My sidekick does the same thing which sucks.
Title: Re: AGS engine Android port
Post by: uswin on 07 Feb 2012, 01:44
I dunno if it's exclusive to my device (Nexus) but the backspace key doesn't do anything. Which is really annyoing.... jus started playing Ghost's Hubris on my phone and the prefilled text of "player" can only be extended with further characters, but not deleted.

You mean backspace in keyboard right, yeah this delete text feature hasn't been implemented yet by JJS. it is a known issue.
Title: Re: AGS engine Android port
Post by: David_OSU on 07 Feb 2012, 17:55
David_OSU, thanks for the info! The problem is that the compiler generated code for neon, but to target the Tegra CPU it has to be set to vfpv3-d16. Fortunately this was easy to fix, a problem in the optimized assembler code would have been very hard to resolve for me.
JJS, I confirmed the Theora video is working now on Tegra 2.  King's Quest I and Quest for Glory II are now running OK on the Acer Iconia A500.

Also, I found a work-around for moving the ags folder to the external sd card.  Using "GL to SD" (https://market.android.com/details?id=com.slf.ListglApp&hl=en), I was able to softlink the ags folder to my 32G external sd card (my 8G internal is nearly full).

However, I think it would be preferable to be able to set the location of the ags folder from the android.cfg file, with something like "path=/mnt/external_sd/ags", for my setup, or "path=/sdcard/ags" as default.
Title: Re: AGS engine Android port
Post by: JJS on 11 Feb 2012, 10:10
New daily.

Should fix the keyboard and the drawing problem in LITN (see bugtracker).

Edit: I am aware of the main menu text in The Infinity String not being drawn ;).
Edit2: Yeah, looks like that was just a problem with the translation file. Nothing to see here.
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 12 Feb 2012, 06:46
Hey JJS I think I might have already asked this but is there a way to check if AGS is running on the Anroid OS? like I want to have my game check if it's running on windows and if it's not then it will do something good for the player however when I last tested this it said the game was running on windows while on the PSP. Should I have it set to if it's running on linux instead of windows?
Title: Re: AGS engine Android port
Post by: JJS on 12 Feb 2012, 07:37
At the moment the ports always return Windows as the operating system. I did that because some games don't work right otherwise (e.g. Gemini Rue doesn't play the rain sound effect on the main main).

So, no. Currently there is no way to find out that you are running on Android.
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 12 Feb 2012, 18:36
Ok, Well thanks for letting me know that. :)

Been on my mind for a grip now.
Title: Re: AGS engine Android port
Post by: JJS on 13 Feb 2012, 17:48
The engine now compiles for x86 Android devices, so the newest daily should run on any Android device available. An advantage of the x86 build is that it can be run in VirtualBox, which speeds up debugging (it's obviously faster than the Qemu ARM emulation).
Title: Re: AGS engine Android port
Post by: uswin on 14 Feb 2012, 01:40
The engine now compiles for x86 Android devices, so the newest daily should run on any Android device available. An advantage of the x86 build is that it can be run in VirtualBox, which speeds up debugging (it's obviously faster than the Qemu ARM emulation).

Horrraaaay !!!
Will try to run this on as much android device as possible
Brilliant jobs Jochen
Title: Re: AGS engine Android port
Post by: JJS on 14 Feb 2012, 09:22
I actually don't know how many x86 Atom tablets are already on the market. But there are of course also people who for some reason use it on their eeePc or something.

Also daily builds are now always done for Windows, Android and PSP. The three versions with the same build date should generally be savegame compatible.

Latest build fixes a scripting exception in Ben There, Dan That! when entering the graveyard.
Title: Re: AGS engine Android port
Post by: Adamski on 14 Feb 2012, 15:36
Hello! Bear with me while I ask some potentially daft questions but...

* Has the windows build benefitted from any of the changes/fixes from the port?
* Does the windows build have a list of useful fixes noted down anywhere (such as the music stuttering fix)?
* Will the OpenGL driver work on the windows build of the engine?

I'm basically hoping that some of my bugbears with AGS are possibly addressed in the Android port and have somehow made it back in to the windows build as a result of this! :)
Title: Re: AGS engine Android port
Post by: JJS on 14 Feb 2012, 16:11
Quote
Has the windows build benefitted from any of the changes/fixes from the port?
It builds from the same source and is therefore identical in features.

Quote
Does the windows build have a list of useful fixes noted down anywhere (such as the music stuttering fix)?
You could check the commit log of the git repository. But it basically boils down to backward compatibility and no sound stuttering.

Quote
Will the OpenGL driver work on the windows build of the engine?
Yes, but it can only be enabled in code. It is also not fully functional. What is missing is fullscreen mode and the mouse cursor is not correctly captured.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 14 Feb 2012, 16:27
I vote for JJS for the new team leader! Seriously.. Awesome stuff JJS.
Title: Re: AGS engine Android port
Post by: Alan v.Drake on 14 Feb 2012, 21:19
I tried your repository JJS, I had to copy over the old dumb-0.9.2 library to get VS 2008 to compile, are you still in the process of updating to the 0.9.3 or did I miss something ?

Too bad I don't have any android device or psp  :(

Great work so far, though.

- Alan
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 14 Feb 2012, 22:00
What you could do is get the Android emulator or a PSP emulator.
Title: Re: AGS engine Android port
Post by: RoliX on 14 Feb 2012, 23:54
Nice work!
Would be awesome to play AGS games on mobile devices.
I tested the application on my xperia x10 and worked perfectly except it is way too laggy. FPS counter displays 30-35 fps, but my real fps is about 2-3. My phone runs on 1Ghz without any tweak, btw.

I hope it is possible to improve the performance significantly.

I used to run ScummVM on my 133 Mhz windows mobile without problem, so I think there is something to improve on the performance here.

Awesome work although!
This is a very important project. You add a great value to all AGS games and to the AGS community!
Title: Re: AGS engine Android port
Post by: JJS on 15 Feb 2012, 07:28
Quote
I tried your repository JJS, I had to copy over the old dumb-0.9.2 library to get VS 2008 to compile, are you still in the process of updating to the 0.9.3 or did I miss something ?
No, I forgot to check the files in. For Windows, it still uses 0.9.2 at the moment and compiles it in every time. The ports have 0.9.3 as a library that only gets linked. Thanks for mentioning it because it is hard to spot these errors when everything works on your own computer :). I checked the files in now.

Quote
I tested the application on my xperia x10 and worked perfectly except it is way too laggy. FPS counter displays 30-35 fps, but my real fps is about 2-3. My phone runs on 1Ghz without any tweak, btw.
Did you run the newest version from http://jjs.at/daily ? Also the speed greatly depends on the game, especially on the resolution. 800x600+ games will suffer from slowdown as well as games that rely heavily on scripting. What game did you try?
Title: Re: AGS engine Android port
Post by: RoliX on 15 Feb 2012, 10:01
No, I ran the version from the 1st comment  ::)

The newest version is much better!

It seems like 5 times faster at the first look. Still have some lag in 800x600 resolution, but much more playable.
Also, the right clicking by 2 points touch is more responsive now.
I tried some lower resolution Ben Jordan games(320x200) and they are flawless.

Now I grab some great, unplayed AGS games and enjoy them on my weekly travels.  ;D

Thank you!
Title: Re: AGS engine Android port
Post by: fuzzie on 16 Feb 2012, 08:52
Works fairly well on my Galaxy Tab 8.9.

Can I assume the snowrain/flashlight plugins are Artistic License 2.0 also? :) Probably I'd have to rewrite them for ScummVM anyway, but the authorship/licensing of the whole tree isn't too clear.

(By the way, JJS - ScummVM runs nicely on my ADP1, which is an unlocked HTC Dream, but it's modded to a newer version of Android. Were your ScummVM input problems on the HTC Dream using pre-2.x Android?)
Title: Re: AGS engine Android port
Post by: JJS on 16 Feb 2012, 09:48
I am not hung up on the license at all. If I can license my own code under a different license than the original engine code, then I would choose this: http://sam.zoy.org/wtfpl/ . Restricting the use of the code doesn't do me or anyone else any good.

My HTC Dream was also rooted, first on 1.6 and later on 2.2.1. ScummVM would start on 1.6 and then proceed to crash on the splash screen. I never got it to work at all (but I didn't try too hard).
On 2.2.1 it would start, but I had really trouble with controlling the mouse in Beneath a Steel Sky. It was basically jumping all over the place and putting the finger on the display slowed down the game a lot. Again, I didn't fumble around with it too much and now I don't have that phone anymore.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 19 Feb 2012, 19:27
Is there a way to load games compiled to single exe?
Title: Re: AGS engine Android port
Post by: JJS on 20 Feb 2012, 11:54
Is there a way to load games compiled to single exe?
Not sure if I understand this correctly. Do you mean if it is possible to bundle the game data with the Android application? If so, then no. At least not at the moment because it would require a rewrite of the file handling functions in the engine. Everything would have to go through the Android resource management functions.

If you mean loading of AGS games that have everything bundled into one executable, then yes. This should be perfectly possible.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 20 Feb 2012, 12:30
Yes, the latter. Lol Sorry for the confusion. I have downloaded several games all compiled into EXE's and the engine would not detect them in the folder. Is there something I am doing wrong or has it just not been implemented yet?
Title: Re: AGS engine Android port
Post by: JJS on 20 Feb 2012, 12:33
Even if it is a single exe, each game still has to be in a subfolder of the /ags directory (e.g. "/ags/my_game/my_game.exe"). Apart from that the only problem could be a too old engine version (< 2.60) of the game. Only compatible games are shown in the list.
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 20 Feb 2012, 12:56
Hey jobs would it be possible for the Agsirc plug in to work on the android? Cause i tried playing pub master quest legends on it and it crashed before it even started given me a error message.
Title: Re: AGS engine Android port
Post by: JJS on 20 Feb 2012, 15:09
No idea who that jobs fellow is :P, but: If the source code to that plugin was available I am pretty confident that it could be ported. BSD sockets make for fairly portable code.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 20 Feb 2012, 19:19
Worked like a charm on my Evo 4G and my Asus Transformer and even better on my ASUS Transformer Prime! Awesome Job JJS! By the way, I have a development account payed for with Android if you want to ever publish it. Right now I am working on an app that will allow users to download games into the AGS Folder for easy set up of games.
Title: Re: AGS engine Android port
Post by: JJS on 20 Feb 2012, 20:10
You know, something like Nexus/Nimbus for Android would be the bomb. Nice.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 22 Feb 2012, 02:50
I have an alpha version almost ready to be uploaded to the market.

Features of Version 0.1.0:
*Scroll through a list of games to choose from
*Ability to download the latest version of AGS for Android and install it.
*Featured Games page.
*Ability to download and install games automatically.
*Ability to run AGS from within the app.
*The Game page features a description, images, creators, team, etc.. and other features for each game.
*Has the ability to tell you if a game has already been downloaded from the market.

Roadmap (Not Guaranteed):
Version 0.1.1 will have:
*A hopefully nicer UI
*The ability to rate games and add comments.
*Sort by Genre feature - Hopefully.

Version 0.1.2:
*Ability to uninstall a game.
*Ability to search for a game.

Future:
*Stability fixes
*Even Nicer UI
*Ability to sell commercial games.
*Ability for users to upload their own games to the market.
*Have more games listed in the market.

I will probably release an early APK here tomorrow as well showing you what the main functions of the app are. I couldn't come up with a clever name for the app, so it is called "AGS Stream". If you have a better name for it, I will take that into consideration.
Title: Re: AGS engine Android port
Post by: JJS on 24 Feb 2012, 15:57
New daily. Fixes bugs in 2.xx games caused by errors in the dialog interpreter and the loop selection algorithm. Ben There, Dan That is now completable and so should be Lost in the Nightmare.
Title: Re: AGS engine Android port
Post by: uswin on 24 Feb 2012, 18:02
New daily. Fixes bugs in 2.xx games caused by errors in the dialog interpreter and the loop selection algorithm. Ben There, Dan That is now completable and so should be Lost in the Nightmare.

Thanks a lot for fast update. Will try this ASAP and let you know if there is something.

Sorry i just managed to upload the LITN Deluxe version.
here it is
http://www.mediafire.com/?gm6zigizgz39wd8

I will post this in original thread also
Title: Re: AGS engine Android port
Post by: JJS on 25 Feb 2012, 09:45
Another daily. This time support for 2.5x games is added. Also the 2.60 game No Action Jackson now loads. Turns out the way dialogs are stored is the same on 2.5x and 2.60. It probably only changed in 2.61.

What prevents the loading of even older files now is that the interaction format changed in 2.41 and I don't see definitions for the old format in the source. The definition and conversion code for the old character format and "game" struct is still there though.
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 25 Feb 2012, 10:55
Any chance of working in an option for the cursor to go directly to wherever you touch the screen (essentially like scummvm)?  This is a far superior way of playing these games with touchscreen devices and really should be implemented even if as an option.  If not, I'll have to download the source and make it happen sooner or later.  Other than that, it could really use onscreen button overlays that can be programmed (nesdroid does this, for example) so you can have a visual right mouse button to press that the cursor position ignores.  :D
Title: Re: AGS engine Android port
Post by: fuzzie on 25 Feb 2012, 13:45
Another daily. This time support for 2.5x games is added. Also the 2.60 game No Action Jackson now loads. Turns out the way dialogs are stored is the same on 2.5x and 2.60. It probably only changed in 2.61.

What prevents the loading of even older files now is that the interaction format changed in 2.41 and I don't see definitions for the old format in the source. The definition and conversion code for the old character format and "game" struct is still there though.

The older interactions don't use the stuff in acroom.h labelled/commented as things like "obsolete v2.00 action editor"? It seemed to match (sort of) the Interactions documentation of the 2.4 editor, but I didn't look any further than that yet.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 25 Feb 2012, 14:28
Great job as always JJS.
Title: Re: AGS engine Android port
Post by: JJS on 28 Feb 2012, 20:07
New daily.

- added option to stretch graphics to fullscreen while ignoring the aspect ratio
- added option to enable/disable writing debug output to logcat

I will eventually get around to implementing more control options. One thing I would like to add is positioning the mouse cursor at the finger position if you slide the finger onto the screen from outside the screen boundary. This would make bringing down the topbar in Sierra style adventures pretty convenient I think.
Title: Re: AGS engine Android port
Post by: JJS on 16 Mar 2012, 19:38
New daily.

- added option for selecting the folder in which games are searched
- added option to "continue" a game from the launcher (it automatically loads the latest save)
- fixes for 2.5x compatibility, Pleurghburg (first AGS game I had played, oh the memories!) now loads and speech box backgrounds should be fixed for good now
Title: Re: AGS engine Android port
Post by: Bòógieman on 17 Mar 2012, 12:07
some games use for example F5 to bring up the save menu (for example the Maniac Mansion Mania games)
but the on-screen keyboard does not support any F-keys. (at least my Samsung Galaxy Ace does not)
maybe you can add a way for mapping other keys instead  :-*
so if I press S on the on-screen keyboard, the game will receive F5

this would be great  :D
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 17 Mar 2012, 16:08
Or maybe away to press/hold F then followed by a number cause some games might use S to bring up Save menu.
Title: Re: AGS engine Android port
Post by: David_OSU on 23 Mar 2012, 12:42

- added option for selecting the folder in which games are searched


Thanks for adding this feature, works great!
Title: Re: AGS engine Android port
Post by: jannar85 on 27 Mar 2012, 22:07
Hey, Chris. Love the way AGS has become. Great work, great to see you still working on it!
One thing, though, I would like to ask.

Could you add touch controls to the engines next release? It's so much handy having that control method, instead of the dragging cursor around :)
Title: Re: AGS engine Android port
Post by: subspark on 29 Mar 2012, 00:33
Quote
Hey, Chris. Love the way AGS has become. Great work, great to see you still working on it!
One thing, though, I would like to ask.

Could you add touch controls to the engines next release? It's so much handy having that control method, instead of the dragging cursor around

Whoa! Hold up. You've missed out on a world of stuff. I recommend reading back through the release threads and catch up on what you've undoubtedly missed.
To point you in the right direction:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=42063.0 (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=42063.0)

All the best! Welcome back.
Title: Re: AGS engine Android port
Post by: sharktamer on 06 Apr 2012, 23:07
Hey, Chris. Love the way AGS has become. Great work, great to see you still working on it!
One thing, though, I would like to ask.

Could you add touch controls to the engines next release? It's so much handy having that control method, instead of the dragging cursor around :)

This is pretty much a necessity. A good model is the way this works on the ScummVM Android apps, being able to drag your finger around the screen to pixel hunt, then tap somewhere to actually click.

This app is an amazing feat, having such an amazing library accesible on my phone and tablet is just so cool. With this change and a few other small changes, this would be absolutely perfect.
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 07 Apr 2012, 04:24
I agree.  The only other thing would be an option to add on-screen buttons (for right mouse click, F5,etc) for specialized functions.
Title: Re: AGS engine Android port
Post by: JJS on 12 Apr 2012, 09:38
That input method will be implemented soon.

In the meantime, have another daily. It fixes some draw order bugs on non-Windows platforms that stem from different qsort() implementations and their handling of equal values.

Also I found the reason why the hardware accelerated driver sometimes messes up the draw order too. Turns out that objects with the ignore_walkbehind flag set are always drawn in front of everything.

Furthermore the engine now builds on Mac OS X too and I started looking into iOS.
Title: Re: AGS engine Android port
Post by: subspark on 13 Apr 2012, 01:31
Thats the three letter word I've been holding excitement for JJS!
If you need Apple Developer tools, PM me or catch me on Steam again. We're a licensed developer and I can share an abundance of useful resources for your iOS port.
Good going man! :D
Title: Re: AGS engine Android port
Post by: 2dMatty on 13 Apr 2012, 08:18
Exciting stuff here! Same as Subspark, I work as an Objective-C programmer so give me a yell if you're having issues as I'd love to help get AGS running on MAC and iOS :D
Title: Re: AGS engine Android port
Post by: sonneveld on 13 Apr 2012, 08:22
Furthermore the engine now builds on Mac OS X too and I started looking into iOS.

Nice, is this building against latest xcode?
Title: Re: AGS engine Android port
Post by: JJS on 13 Apr 2012, 12:27
I am not using the xcode IDE for the Mac OS port, but a makefile ;) Packages I installed through fink are: allegro4 theora0 vorbis0 ogg dumb freetype2-dev . I had to fiddle around with dumb sources so that it would build aldumb (Allegro support).

Also I only have Snow Leopard and xcode 3.2.6 with iOS SDK 4.3 (or something) because that is the latest one available for that without paying teh big bux. I don't really think that matters though.

What I am doing right now is cross-compiling libraries, which is a lot of fun because of interesting syntactical differences between the Apple tools and GCC (like "__asm__" vs. "asm" ::)). Also the Apple assembler is some outdated version of the gcc assembler, joy.
Title: Re: AGS engine Android port
Post by: sonneveld on 13 Apr 2012, 12:48
Also I only have Snow Leopard and xcode 3.2.6 with iOS SDK 4.3 (or something) because that is the latest one available for that without paying teh big bux. I don't really think that matters though.

One of the reasons why my mac port is using SDL is because allegro 4 does not compile for osx Lion. It relied on deprecated apis for the graphics layer which Apple actually removed instead of leaving for all eternity.

I couldn't believe how old the latest libdumb is!  There doesn't seem to be a decent alternative though!
Title: Re: AGS engine Android port
Post by: JJS on 13 Apr 2012, 13:02
So they just remove libraries from the system and shrug it off that it breaks old applications? How nice. And Indeed I get a message in the console about the deprecated NSQuickDraw API when I run the engine.

Libdumb is old but it seems to just work because it doesn't have exotic dependencies.
Title: Re: AGS engine Android port
Post by: sonneveld on 13 Apr 2012, 13:09
So they just remove libraries from the system and shrug it off that it breaks old applications? How nice. And Indeed I get a message in the console about the deprecated NSQuickDraw API when I run the engine.

Well I think there's a bit more to it.  I believe it was deprecated from the first release of osx and was only available to aid in porting to the new platform.  Also, they never ported the api to 64bit.  Different philosophies vs Microsoft I guess.
Title: Re: AGS engine Android port
Post by: cianty on 13 Apr 2012, 19:03
Oh man... this is so exciting! The sheer thought of playing our games on my new ipod has me running around with excitement. :)
Title: Re: AGS engine Android port
Post by: Neole on 15 Apr 2012, 08:19
I came across this topic by accident from google so am not sure if Im asking a dumb question (Im familiar with AGS from 2005 but not the recent version or the android port)

Is it possible to make a standalone android application from an ags game? Just the way a person just has to download an ags game and not the engine separately, can they simply download and run a single game on android without needing to download the ags engine separately?

Title: Re: AGS engine Android port
Post by: DazJ on 15 Apr 2012, 18:25
I came across this topic by accident from google so am not sure if Im asking a dumb question (Im familiar with AGS from 2005 but not the recent version or the android port)

Is it possible to make a standalone android application from an ags game? Just the way a person just has to download an ags game and not the engine separately, can they simply download and run a single game on android without needing to download the ags engine separately?

Yes, this is my question too.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 15 Apr 2012, 20:53
Currently JJS has not added a way to compile games into its own Android APK file for distribution in the market. However, I am developing an AGS market app for Android where a user can install AGS via that app and then download games which will install it properly.

Go here: https://play.google.com/store/apps/details?id=com.agsstream.diperla&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5hZ3NzdHJlYW0uZGlwZXJsYSJd

I am planning on adding support for commercial and non-commercial games. I am starting a kickstarter project for this. Eventually I will add a tool which will allow you to package your game and AGS Together and install it automatically on an android device so that you can submit the game directly to the google play store.
Title: Re: AGS engine Android port
Post by: DazJ on 15 Apr 2012, 21:03
Quote
I am planning on adding support for commercial and non-commercial games. I am starting a kickstarter project for this. Eventually I will add a tool which will allow you to package your game and AGS Together and install it automatically on an android device so that you can submit the game directly to the google play store.

That's what I wanted to hear! Keep up the great work my friend and let me know when this feature is available. Actually, do you have any idea at all roughly when this WILL be available?
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 15 Apr 2012, 22:50
Hehe. Should be a few months before it will be where I want it.
Title: Re: AGS engine Android port
Post by: DazJ on 16 Apr 2012, 08:05
That's brilliant news :)
Title: Re: AGS engine Android port
Post by: Neole on 17 Apr 2012, 19:24
"Eventually I will add a tool which will allow you to package your game and AGS Together and install it automatically on an android device so that you can submit the game directly to the google play store."

Looking forward to that! Its all android and ios these days, especially for point and click!
Title: Re: AGS engine Android port
Post by: DazJ on 17 Apr 2012, 21:24
Exactly. The concept of this is potentially ground-breaking in terms of possibilities and the Android at last receiving TRUE point & click games.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 18 Apr 2012, 03:19
It would. But I would like to point out that Chris Jones and JJS are the true wonders of having AGS on these platforms.
Title: Re: AGS engine Android port
Post by: DazJ on 18 Apr 2012, 08:30
Oh of course! I didn't mean any disrespect :)
Title: Re: AGS engine Android port
Post by: JJS on 24 Apr 2012, 11:16
New daily.

- Added option to switch between relative and absolute positioning of the mouse cursor.
- Added option to enable holding down the left mouse button by performing a longclick (useful for dragging and verbcoin guis). The phone vibrates when the mode gets enabled. To deactivate it, tap the screen again.
- Added ingame menu from which you can press the F1-F12 keys.
- Changed invoking method of the onscreen keyboard to a longlick on the MENU button.
Title: Re: AGS engine Android port
Post by: Bòógieman on 26 Apr 2012, 13:13
works just fine!  :-*  :)
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 27 Apr 2012, 19:41
Honestly... I think for a port thats handheld touch based, this is as good as it gets. Awesome job JJS.
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 01 May 2012, 05:13
Awesome work, buddy!  Now if you could find a way to allow user-defined buttons be displayed on screen (like nesdroid) it would be pretty much as user-friendly as it gets!

Edit:  Just wanted to add that now a couple of my games can be started since I have access to keys that weren't available before.  Adding ESCAPE to the list of custom keys would also be helpful though not mandatory since I'm in the process of retrofitting my games to be more android-friendly.

Thanks again for the new cursor functionality.
Title: Re: AGS engine Android port
Post by: jannar85 on 08 May 2012, 23:07
Hey Chris! Thanks for the new touch-support. Works perfect.
But I tried to run Al Emmo, but I only get a dialog box saying
Quote
WARNING: Please run the setup program and check the 'use digital music pack' and use speech pack' options before playing. These files must be available for the game to run."

I've tried to look in the AGS Android settings, but I can't figure it out. Someone able to help?
Title: Re: AGS engine Android port
Post by: JJS on 09 May 2012, 18:05
I didn't include ESC because it is already implemented with a quick press on the "back" button. :wink: The exit dialog only opens on a longpress.

As for Al Emmo, are the files "audio.vox" and "speech.vox" correctly copied? I can reproduce the message if the files are missing. Apart from that, make sure that sound is enabled in the settings.
Title: Re: AGS engine Android port
Post by: jannar85 on 10 May 2012, 12:37
Yes, they were. And they are in the same folder as the game.
Same problem with KQ-remakes with speech.

Sound is enabled in settings :P
Title: Re: AGS engine Android port
Post by: Nixxon on 14 May 2012, 01:00
This is amazing!

What would be the schematics behind bundling a game with the engine for commercial sale?

Please let us know!

Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 14 May 2012, 01:06
Nixxon. You would have to build an APK File that would install both AGS and the game together. But thats not an easy task to do. I am trying to create something for the community so that you can all sell commercial games independantly in the Android Market. Of course, this tool will be available free of charge as well. Just give me some time to finish it up.
Title: Re: AGS engine Android port
Post by: uswin on 14 May 2012, 03:27
Nixxon. You would have to build an APK File that would install both AGS and the game together. But thats not an easy task to do. I am trying to create something for the community so that you can all sell commercial games independantly in the Android Market. Of course, this tool will be available free of charge as well. Just give me some time to finish it up.

God bless man, I know you can do it. moreover, you might want to consider about google expansion drive implementation on your tools for a game that has data package bigger than 50 MB. this way developer doesn't have to pay a lot of server cost. This could be very good news.
Title: Re: AGS engine Android port
Post by: DazJ on 14 May 2012, 12:33
They'd still need to download the additional files from your server, surely?
Title: Re: AGS engine Android port
Post by: Nixxon on 15 May 2012, 01:07
Nixxon. You would have to build an APK File that would install both AGS and the game together. But thats not an easy task to do. I am trying to create something for the community so that you can all sell commercial games independantly in the Android Market. Of course, this tool will be available free of charge as well. Just give me some time to finish it up.

That's absolutely unreal! I'd pay sums for that. Legend.

Now if only we could implement some more 'modern' resolutions/aspect ratios in the editor.
Title: Re: AGS engine Android port
Post by: Eric on 15 May 2012, 02:02
Now if only we could implement some more 'modern' resolutions/aspect ratios in the editor.

I brought this up in another thread, and was pointed to this development branch (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=43955.0). FYI!
Title: Re: AGS engine Android port
Post by: Nixxon on 15 May 2012, 02:31
Now if only we could implement some more 'modern' resolutions/aspect ratios in the editor.

I brought this up in another thread, and was pointed to this development branch (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=43955.0). FYI!
\

Nice! Let me know if you need a hand with the UI.

I did the graphics for Dospad (idos) among other things - http://toucharcade.com/2010/10/26/idos/ (screenies in there).

Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 15 May 2012, 03:42
How would you feel about a package that would download and install AGS and your specific game seperately? Would that help at all? Then it would be just a matter of editing a file inside the APK manually for everyone. APK's are actually zip files(Just rename them to zip and open it with an unpacker), but the content inside is encrypted. However, you can insert a text file that would specify specifics of your game(EG: Name and download location). Then the installer can actually install AGS and the game together.

JJS: If you want, I can probably write the code for you to put it into your port so that anyone can do this without me having to write a whole new app for it. The steps for the user would be something like this:

1) Rename AGS.apk to AGS.zip.
2)Open ags.zip and edit config.txt
3)Either upload the game to a website or pack it into the zip file
4)In config.txt, enter the location to where to download the game or give the name of the directory you just created with the game files.
5) Save Config.txt
6)Make sure config.txt was updated in the compressed file.
7)Rename ags.zip to ags.apk or whatever you want to call it as long as the extension is always .apk.
8)Upload to the Market and you are all set.

Would everyone be ok with a system like this? Or would they prefer some other way?
Title: Re: AGS engine Android port
Post by: DazJ on 15 May 2012, 09:04
Joseph! A simple and unique idea. Wonderful. As long as it works then I've no problem whatsoever. The potential of this for indie commercial game developers is truly amazing.
Title: Re: AGS engine Android port
Post by: JJS on 15 May 2012, 09:25
So the idea is that the engine checks the config.txt file and then either downloads the game files from a given URL or unpacks the game files from the APK on the first startup? That sounds like a good idea.

Some issues I can see though:
- Can two applications have the same namespace? Ideally game developers would want to change it from com.bigbluecup.android but this would break the native layer interface (I think, not quite sure about it).
- Game authors would want to change the name and icon. Icons are hashed and probably checked against the hash at installation (didn't test this though). The name is in the AndroidManifest.xml file which is also hashed and also not human-readable in the APK.
- Game settings, how should they be implemented. It is possible to invoke the current settings dialog from within the game but some options need a restart of the game. Code to handle that must be written.

The signing makes me think that game authors still would have to get the SDK and do modifications there (namespace, icon, name, building standalone engine without the launcher). But at least they could bundle their game data directly.
Title: Re: AGS engine Android port
Post by: QuestingHero on 15 May 2012, 21:42
Can anybody recommend a good onscreen keyboard to use? I have been trying to play Quest for glory 2 and when I get in to fights you have to use the number pad, this works fine, except that it takes up half the screen. what I would like to find is a keyboard that is semi transparent and only has a number pad. if anybody has any suggestions, I would love to hear them.

Thanks
Title: Re: AGS engine Android port
Post by: DazJ on 16 May 2012, 15:52
Running my 1280x720 game I receive the following error as soon as I try to run it:

"The background scene for this room is smaller than the game resolution. If you have recently changed the game resolution, you will need to re-import the background for this room."

ALL backgrounds are 1280x720 and I even double-checked and re-imported them all so I've no idea why I'm receiving this error? I also tried starting the game in different rooms but still receive the same error.
Title: Re: AGS engine Android port
Post by: JJS on 16 May 2012, 17:05
1280x720? Is the game created with the regular AGS 3.2.1 or with a modified version? Because I don't think the standard engine can handle that resolution.
Title: Re: AGS engine Android port
Post by: DazJ on 16 May 2012, 17:46
It's the modified engine so I guess that's the reason why?
Title: Re: AGS engine Android port
Post by: JJS on 16 May 2012, 18:17
Yes, that is the reason. The ports are built on top of AGS 3.2.1 with no enhancements from any of the development branches.
Title: Re: AGS engine Android port
Post by: DazJ on 17 May 2012, 00:00
No problem, thanks for letting me know. Is it something you are considering implementing?
Title: Re: AGS engine Android port
Post by: jannar85 on 10 Jun 2012, 13:07
Still problems with voice and music packs in Kings Quest X and Al Emmo...:/ Both are in the same folder..
Title: Re: AGS engine Android port
Post by: Haggis on 10 Jun 2012, 18:10
This is superb, great feeling seeing your own game running on your phone!

Just a question regarding verbcoin interfaces -
My game uses the verbcoin template created a while back by Electroshokker. I've enabled the long leftclick option so it should consider a long tap as a held left mouse button however the verb coin interface does not display. Anyone else have this issue and any known ways to resolve it. Everything else is working incredibly well.

Should add - I've played through Monkey Island 3 on this phone which implements the double tap and hold verb coin interface. Phone is a Samsung Galaxy S2.

Appreciate any help and looking forward to seeing this app develop!
Title: Re: AGS engine Android port
Post by: JJS on 10 Jun 2012, 18:32
I have another report from AGD2 about non-functional longclicking here: http://jjs.at/tracker/view.php?id=66

A common point I see between your issues is that you both use Samsung Galaxy devices. Up to now I have no real lead and it works on my HTC Desire so I cannot reproduce the issue. I could imagine that it is either related to me enabling the longlicking after setting the handler or that the amount of movement I allow while the finger is down is too low for those devices (< 4 pixel in x and y direction). I will have to do some test versions to narrow that down.
Title: Re: AGS engine Android port
Post by: Frito Master on 10 Jun 2012, 19:08
I got a galaxy s 1 I can test on, Its running custom ics though.
Title: Re: AGS engine Android port
Post by: Haggis on 10 Jun 2012, 19:30
Same here - can test on my Galaxy S2 if needed (also upgraded to ICS).

I PM'd you some extra details but may as well post here too:
I read earlier in this thread that when you enable the longleftclick functionality the phone will vibrate. Mine did not vibrate (the long click functionality was turned off by default).
Title: Re: AGS engine Android port
Post by: Frito Master on 10 Jun 2012, 21:47
My vibrated.

Also if I put to fingers down my right click on hold menu flashes on and then off.
Title: Re: AGS engine Android port
Post by: JJS on 11 Jun 2012, 14:05
The longclick issue should be fixed in the newest daily build. Special thanks to Haggis for testing and also thanks to Frito Master for the testing offer.
Title: Re: AGS engine Android port
Post by: JJS on 21 Jun 2012, 21:06
I have now split the engine from the launcher app. This means that the frontend can be more easily switched to a custom one for releasing a game on the market.

The engine part is now in /Android/library, the standard launcher in /Android/launcher_list. The engine is included into launcher project as a library through the "project.properties" file. I will later include a more basic example for a simple single-game launcher.

For a market release there is still the problem that the game files must somehow be placed on the memory card. Either through downloading them from the net in the launcher or by bundling them in the APK and unpacking them on first start. The engine cannot read the game files directly from the APK.
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 25 Jun 2012, 16:21
Isn't the .apk format basically just a renamed .zip?  Surely you could design the frontend to extract the contents temporarily to a folder (ram being the first choice), run the game, then clear the folder when the game is closed (just keep save games elsewhere)?
Title: Re: AGS engine Android port
Post by: voh on 29 Jun 2012, 23:12
There's a lot of pages here, and I'm in a hurry, so I'll just ask this, risking a repeat: Can you add Escape to the keys menu? I'd like to be able to skip cutscenes :)

Anyway, HTC Desire Z, runs Resonance and the Ben Jordans fine :)
Title: Re: AGS engine Android port
Post by: JJS on 30 Jun 2012, 13:26
The "back" hardware button acts as the ESC key.
Title: Re: AGS engine Android port
Post by: unicronic on 05 Jul 2012, 12:10
Just wanted to extend some heavy thanks for the all the work that has gone into getting the Android AGS app where it is.

I tried it recently on my Xoom tablet and Xperia S phone and it works flawlessly.

Now to enjoy some great games on the go.
Title: Re: AGS engine Android port
Post by: Blackthorne on 15 Jul 2012, 15:07
I'm very interested in this, and I think a lot of others will be, with the coming of OUYA ( http://www.kickstarter.com/projects/ouya/ouya-a-new-kind-of-video-game-console )  Being able to make our games for a console would be pretty interesting. 

Bt
 
Title: Re: AGS engine Android port
Post by: Frito Master on 17 Jul 2012, 07:59
I forgot about that, Yes that would be very awesome :D!
Quote
Isn't the .apk format basically just a renamed .zip?

Yes or It was last time I checked which was like ginger bread.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 17 Jul 2012, 15:13
I forgot about that, Yes that would be very awesome :D!
Quote
Isn't the .apk format basically just a renamed .zip?

Yes or It was last time I checked which was like ginger bread.

The problem with the APK files is that once the Android SDL builds the APK, even though you can open it with a zip tool, the files inside are encrypted. Atleast the XML files and Java files are.
Title: Re: AGS engine Android port
Post by: Frito Master on 18 Jul 2012, 04:59
Yeah. The pictures and such are not.

There is a few tools out there that let you resign the apk.

I used to use it for modding someones graphics for there game without them sending me the source or me waiting for them to compile.
Title: Re: AGS engine Android port
Post by: Greg Squire on 20 Jul 2012, 19:30
I'm very interested in this, and I think a lot of others will be, with the coming of OUYA ( http://www.kickstarter.com/projects/ouya/ouya-a-new-kind-of-video-game-console )  Being able to make our games for a console would be pretty interesting. 

Bt
 

Yes an OUYA port of AGS would be awesome!  I'm sure it could be just an extension of this Android port.
Title: Re: AGS engine Android port
Post by: retrobeans on 25 Jul 2012, 11:44
First of all, excellent work on the Android port!

I'm wondering if anyone has tried this port on the Google/Asus Nexus 7 tablet, or knows if it would work?

I'm thinking of buying one, the ability to play AGS games on it would be the deciding factor for me.

Thanks
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 27 Jul 2012, 09:21
It works just fine on my Acer Iconia a500 so I'm sure it works on the Acer nexus 7.
Title: Re: AGS engine Android port
Post by: Nixxon on 30 Jul 2012, 05:47
Running my 1280x720 game I receive the following error as soon as I try to run it:

"The background scene for this room is smaller than the game resolution. If you have recently changed the game resolution, you will need to re-import the background for this room."

ALL backgrounds are 1280x720 and I even double-checked and re-imported them all so I've no idea why I'm receiving this error? I also tried starting the game in different rooms but still receive the same error.

Just thought I'd mention. I have a 1024 x 800 game, wouldn't work (same error as you'd received) on my galaxy s2. I recently bought a galaxy note and the game works fine (as the note is 800 pixels wide/high - Galaxy S2 only 480 pixels. wide).
Title: Re: AGS engine Android port
Post by: lukas2288 on 30 Jul 2012, 21:59
Are king quest remakes supported by latest version of AGS Android Port?
Title: Re: AGS engine Android port
Post by: QuestingHero on 07 Aug 2012, 16:05
Are king quest remakes supported by latest version of AGS Android Port?

Sure are, and they work great!
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 11 Aug 2012, 08:22
JJS, I really hate to do this since it's not really any fault of yours, but after a forced update to my Acer now all the music in ags games either stop playing or never start at all.  I have 3 of my games installed and since this update all three do this.  My music players (like Pandora and xmplay) seem unaffected by the update and so far only AGS has showed any negative results.  I'm not sure if this is or going to affect other people or what since it did some modifications to the android os as well so I thought it was better to just post this here than ignore it.

I should add that all three use mp3/ogg, not midi.

Just to be safe I uninstalled ags and reinstalled the latest august build and didn't get any positive results.
Title: Re: AGS engine Android port
Post by: BigMc on 11 Aug 2012, 18:44
You should probably mention the old and new versions of what was updated.
Title: Re: AGS engine Android port
Post by: JJS on 12 Aug 2012, 20:37
It will be hard for me to work on this error without the device :(

But the logcat of the device could give some information on what causes it though. Can you run a game that shows the bug and then upload the log from your device? You need a logcat reader for doing that (e.g. https://play.google.com/store/apps/details?id=com.nolanlawson.logcat&hl=de). Also enable the "write log" debug option in the settings of the Android AGS app. The log contains all kind of system messages, you can crop out everything before and after the game.

Also how much of a sound gets played before it cuts out? Is the behaviour always the same or does it randomly play more/less?

What version of Android do you run?
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 13 Aug 2012, 17:04
I'm using ice cream sandwich and I've messaged you the logs you asked for.
Title: Re: AGS engine Android port
Post by: SSH on 17 Aug 2012, 22:29
I'm curious. What does System.OperatingSystem return on JJS's new ports, as there's no defined values for iOS, PSP or Android?
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 17 Aug 2012, 22:32
In the current ports it returns windows because some of the engine functions like plugins rely on it being so.

I imagine that will be changed eventually.
Title: Re: AGS engine Android port
Post by: giom on 18 Aug 2012, 18:57
I've been using it for the past 2 months on my Touchpad running cyanogenmod. Thanks JJS, great work! Having this run on a tablet is my dream come true ever since I first saw adventure games on a DS.

I've finished the following games without any issue:
- All the blackwell games (some slowdowns in the last game, particularly the yacht scene)
- King quest 2
- PISS

I've tried to play Gemini Rue but couldn't get past the action scene (and the tutorial) where I needed to press ctrl...
I've also just purchased the Summerbatch bundle (great bundle by the way, I've only played PISS so far and it's really a great game...) but both Patchwork and  Barely Floating fail.

I get the following error with Patchwork:
unresolved import 'SetVariableSpriteFont' I'm guessing it's an unsupported plugin for higher resolution sprites?

With Barely floating, here's the error I get:
Error: load room: unable to deserialize prop schema

Again, great work! It's nice to be able to play AGS games on a tablet...

Title: Re: AGS engine Android port
Post by: JJS on 18 Aug 2012, 19:47
In the current ports it returns windows because some of the engine functions like plugins rely on it being so.
The engine could technically return the real operating system to the game. The real problem is that some games make assumptions based on the returned value that are untrue or just don't work properly. E.g. some games disable plugins if the returned value is not Windows and Gemini Rue doesn't play background sound on the main screen (you don't want to know how long I tried to "fix" that because I thought it was a bug in the port).

Ideally games should not query the operating system at all. Asking the engine for the availability of a feature would be much better, but even then I don't know a real usage scenario for that. Personally I would like it best if games would just go ahead and assume that the engine does the right thing.


I get the following error with Patchwork:
unresolved import 'SetVariableSpriteFont' I'm guessing it's an unsupported plugin for higher resolution sprites?
The plugin is for drawing bitmap fonts, but yes that is essentially the reason.

With Barely floating, here's the error I get:
Error: load room: unable to deserialize prop schema
The error occurs because I don't include the agslua plugin (yet). But the game won't work regardless because it is made with a modified AGS engine (to support widescreen resolution).
Title: Re: AGS engine Android port
Post by: SSH on 19 Aug 2012, 00:39
Perhaps what we need is some System variables that actually tell the games what they want to know rather than them trying to assume it from the platform, e.g.

System.IsTouchScreen
System.HasHWKeyboard
System.SupportsPlugins
System.HasMindControlInterface
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 19 Aug 2012, 09:28
I get the following error with Patchwork:
unresolved import 'SetVariableSpriteFont' I'm guessing it's an unsupported plugin for higher resolution sprites?
The plugin is for drawing bitmap fonts, but yes that is essentially the reason.

Omg, someone used my spritefont plugin?

I will provide you with source ASAP JJS OAO
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 19 Aug 2012, 10:46
Delivered: https://dl.dropbox.com/u/27247158/AGSSpriteFontsrc.zip

Sorry about the programming. It's almost certainly terrible.
Title: Re: AGS engine Android port
Post by: JJS on 19 Aug 2012, 11:35
Nice, thanks! I will add it to the repository. Should I assume the same license as for AGSBlend?
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 19 Aug 2012, 12:07
I don't remember exactly what the license for AGSBlend is but you can consider this giftware or public domain. I really don't care that much. Credit would be nice but not required.
Title: Re: AGS engine Android port
Post by: JJS on 19 Aug 2012, 15:57
Alright, I pushed the changes to the repo and uploaded new daily builds with the AGSSpriteFont plugin. As for the license, I added a readme saying that the code is public domain. That should be ok from what you wrote, if not I will change it. Thanks again for making the source available.

Played a bit of Patchwork on my phone: outstanding production values there! I recommend using the standard hardware renderer for best performance.
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 19 Aug 2012, 17:13
public domain is fine.
Title: Re: AGS engine Android port
Post by: BigMc on 19 Aug 2012, 18:09
Please use CC0 instead: http://creativecommons.org/publicdomain/zero/1.0/

Just saying that something is public domain is ambiguous and it's not clear if such a statement is valid always and everywhere. CC0 has the necessary legalese.
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 19 Aug 2012, 19:12
feel feel to appropriate ownership and apply that license. I really dont mind. I'm unlikely to work on it again and if I do I will change the format entirely and make it OOP and thus break compatibility.
Title: Re: AGS engine Android port
Post by: JJS on 19 Aug 2012, 19:37
I changed the license to CC0.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 19 Aug 2012, 20:05
A bit offtopic, but Sprite Font sounds like a good candidate for a new engine feature, rather than being separate plugin, don't you think?
Title: Re: AGS engine Android port
Post by: Calin Leafshade on 19 Aug 2012, 20:52
Yea, i certainly think its feature worthy.

AGS already has mechanisms to add new font renderers easily so the engine code would be easy.
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 23 Aug 2012, 18:16
I've noticed that usb keyboard support is kind of iffy with ags android right now.  I can get it to work fine for typing and other games/emus but ags seems to ignore some keys (like return) entirely.  Is this a known issue?
Title: Re: AGS engine Android port
Post by: JJS on 23 Aug 2012, 18:34
Not a known issue yet as I have no means to test usb keyboard support. The closest I come is running android-x86 in VirtualBox. In there I can type and the Return key works (e.g. in the save dialog). There is no support for keys that are not found on the Android onscreen keyboard though. That means no ESC, F1-F12, Alt, Ctrl, Shift. I could look into adding those if that is what you mean.

In which game do you have problems with the Return key and in what context?
Title: Re: AGS engine Android port
Post by: Alex.001 on 25 Aug 2012, 11:44
Good job so far, it works almost perfectly on my Galaxy Tab 2 7.0 ! I'm playing the Blackwell games at the moment, apart from the occasional sound issue which causes the game to force close it works perfectly. Sound issue: 1. the sound suddenly stops (usually when I try to skip a conversation), then the game force closes. This sometimes happens even when I do not skip a conversation. 2. sound suddenly starts to "stutter" (i.e. repeats first part of a spoken sentence, music as well). Game continues, and after restarting the engine, sound works fine again.
Anyway, thank you very much for making it possible to play those games on android devices, it is greatly appreciated.
Title: Re: AGS engine Android port
Post by: JJS on 25 Aug 2012, 21:34
The multithreaded sound system is not perfectly stable yet. This especially applies to multiprocessor systems. So this is certainly something that has to be fixed.
Title: Re: AGS engine Android port
Post by: Intense Degree on 30 Aug 2012, 11:58
Yeah, the sound stuttering/force close thing is really the only thing against this otherwise excellent port (on Galaxy S3) and it's great to hear it's being worked on. For clarification it only seems to happen when 2 channels are used, i.e. background music and speech or background music and sound effect.

The only other minor issue I have encountered is a massive slowdown (consistently) on a couple of screens in the last Blackwell game where the background was animating (moving yacht and nightclub). This isn't too serious though and on some other games where the background is animating it seems fine.

Thank you once again for giving us AGS games on our phones, commuting hasn't been the same since!
Title: Re: AGS engine Android port
Post by: JJS on 30 Aug 2012, 12:39
For an instant fix you can turn off multithreading in the sound preferences. This will cause sound stuttering e.g. when changing rooms though.
Title: Re: AGS engine Android port
Post by: Intense Degree on 30 Aug 2012, 14:55
Brilliant, I'll give that a go! :-D
Title: Re: AGS engine Android port
Post by: SKYY on 01 Sep 2012, 03:42
I can't get the QWERTY keyboard to pop-up when I focus the engine on text fields. Samsung Galaxy note w/CWM 9 (paranoid android ). Any ideas?
Title: Re: AGS engine Android port
Post by: JJS on 01 Sep 2012, 06:58
The keyboard does not automatically open. You always have to longpress the MENU hardware button.
Title: Re: AGS engine Android port
Post by: SKYY on 01 Sep 2012, 11:15
I longpress the Note's soft-menu button, and it does not bring up the keyboard.  I can only access the function keys (F1-F12).  I'm welcome to suggestions--I love AGS.  The fact that it works on Android is just phenomenal.  I just wish I could get it to work for my phone!

I'll keep trying things--maybe if I upgrade to JB it will work.  As of now, I've only tried the N7000 in GB (stock), and ICS (CM9).
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 01 Sep 2012, 15:56
Quote
In which game do you have problems with the Return key and in what context?

Return and Escape tend to have problems triggering on all of my games at the title screens (when skipping cutscenes or checking for iskeypressed to begin the game).

Actually, it almost seems like the keys you didn't hardcode to work from the menu just aren't reliable.  I can't use the arrow keys to move around, though the space bar works, but then the enter key is unreliable and escape doesn't work...but then the tilde key works.  It's really odd behavior and since I've tested my keyboard thoroughly I know it's not defective.
Title: Re: AGS engine Android port
Post by: SKYY on 24 Sep 2012, 08:06
Well, I've tried again with JB on the Galaxy Note, but the soft keyboard still does not work.  Hardware keyboards connected with USB work, but pressing any character or backspace results in a double-keypress (ie.  "s" does "ss").

I know this was designed purely for no KB/Mouse, with touch being the primary cursor and clicking interface.  However, newer versions of android fully support KB/Mouse functions, so perhaps in future releases you somehow make an option to enable "desktop" mode for cursor movement/key functions?
Title: Re: AGS engine Android port
Post by: SKYY on 24 Sep 2012, 10:07
OK--my OSK issue was resolved by changing the android system's default action for long-press-menu-key.  I wish I would have thought of this sooner.

For others with this issue, go to (android) System settings->System->Hardware keys->Menu key (long press), [No action]
Title: Re: AGS engine Android port
Post by: davros on 25 Nov 2012, 09:01
Hi there

how exciting for starters! looking forward to playing QFG2 in particular. its a fantastic initiative and being able to play on phone when rocking a baby to sleep at 3am is a big bonus!

wondering if anyone has experienced the following issue (I've searched but didn't find any reference)

My soft menu button has disappeared - it was there before (was using for file save naming) but all of a sudden doesn't show up when in either KQ1 or KQ2... can't see any settings to modify this either?

Im running JB on a galaxy nexus, and the download from daily/refactory 2012*11*01

Ive tried uninstall/reinstall and phone restart but no effect. very strange

any help greatly appreciated

also, i saw earlier question re soft keyboard input for number pad - (relevant to fighting in QFG2) - has anyone found an elegant solution to this? as I take it you can't use 'on screen' (mouseclick) controls for battle in that game

cheers!
Title: Re: AGS engine Android port
Post by: JJS on 25 Nov 2012, 10:39
I had changed the target SDK version to 4.1. That way it shows the default system styles for the menus, before it was always in 2.x style. Probably this change has removed that icon. But the onscreen keyboard should pop up if you longpress the "menu" (hardware) button. I must admit that I am not sure how that "soft menu" button worked before.
Title: Re: AGS engine Android port
Post by: davros on 25 Nov 2012, 10:50
thanks for the quick reply!

on a galaxy nexus, as some others, there isn't a hard menu (or anything) button - so I used the soft menu button to generate the keyboard.

it sounds then like under this update there isn't a way to access type for any android device lacking hard buttons? unintended consequence?

from what I gather (not that Im a developer) there is a move away from the menu button into the 'action bar overflow' as is presented in the launching space for the AGS app. this works fine in that environment but within the game iteself one relies on the 'soft' menu, home, back etc buttons...

dont know the most elegant way to address this? if you are moving permanently away from the option, could you please point me to a stable older build that works? I was trying a recent daily but it had errors with recovering saved games

probably also worth noting that scummvm for android maintains this soft key to date...

cheers - and again, thanks for the project!
Title: Re: AGS engine Android port
Post by: JJS on 25 Nov 2012, 13:48
Ok, this is a real problem and I hope that it can be solved by setting the API level only.

Can you please try this version: http://jjs.at/temp/AGS_api11.apk

And if it doesn't have the desired behaviour, this one: http://jjs.at/temp/AGS_api8.apk

Unfortunately I don't have a device without hardware buttons and the emulator doesn't really cover this (there is a setting for deactivating the hardware buttons but it doesn't make the emulator show soft buttons).
Title: Re: AGS engine Android port
Post by: davros on 25 Nov 2012, 19:17
yes - first link api11 does the trick
menu button brings up 'keys' or 'exit game' - long press brings up soft keyboard

no other issues apparent

thank you!
Title: Re: AGS engine Android port
Post by: davros on 29 Nov 2012, 10:37
How stable are.you expecting this port to perform at this stage? As its pretty typical for me to be dumped out to of games and to the desktop when playing. Sometimes every 15-30 mins, then sometimes not at all

No clear pattern, I'm playing kings quest remakes mainly...

Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 29 Nov 2012, 17:41
There is a new daily at jjs.at/daily . Released today. Seems like a lot has been done to the AGS engine and the Android port from what I could see from the github portal. I used it and all the games I have been playing still work pretty well. I haven't tried Resonance on my Device yet though. Davros, try it and see if it works well. :)
Title: Re: AGS engine Android port
Post by: JJS on 29 Nov 2012, 17:48
The main issue for stability should be multithreaded audio processing. You can disable that in the settings menu. But the newest daily build has an additional fix in that regard so your crash might (or might not) be fixed.

Can you enable "Log debug messages" in the settings menu and upload your logcat file when it crashes again? It contains all kind of system messages, so you might want to remove everything that was logged before AGS started.
Title: Re: AGS engine Android port
Post by: TinaMaria on 01 Dec 2012, 00:14
just started playing resonance on the android port of AGS - great job, can you tell the porters of scummvm and dosbox turbo how to do absolute mouse tracking please!? AGS works great with touch screens! Only problem is I can't seem to emulate a right click, not even a right click on my Asus transformer keyboard with mousepad! so cant examine anything! Any ideas? Thanks x
Title: Re: AGS engine Android port
Post by: BigMc on 01 Dec 2012, 01:20
You have to put one finger down and shortly after that another finger next to it.
Title: Re: AGS engine Android port
Post by: TinaMaria on 01 Dec 2012, 07:46

You have to put one finger down and shortly after that another finger next to it.

Ah thanks - yeah can do it by tapping two fingers at once, doesn't always work though, so have to tap several times to get it to examine something! - would be good if right click emulation with a physical mouse could work, since android supports track pads froim docking keyboards etc and mice plugged into usb ports now! x
Title: Re: AGS engine Android port
Post by: BigMc on 01 Dec 2012, 10:20
Once you get the hang of it it always works. But yeah, would be better if physical right mouse buttons would also work.
Title: Re: AGS engine Android port
Post by: TinaMaria on 02 Dec 2012, 07:35
Yeah getting the hang of it now doesnt matter where you put the second finger - as long as the first finger is placed over the hotspot in question! Only other problem i've found is in resonance there's a lot of typing, like finding files, passwords on the mainframe etc. but it doesn't bring up the onscreen keyboard when needed, so always have to have the asus transformer physical keyboard docked when playing! I think omn some devices you can force the virtual keyboard up but doesn't seem to be a way on the asus.
Title: Re: AGS engine Android port
Post by: JJS on 02 Dec 2012, 09:43
Longpressing the "menu" button does not bring up the software keyboard?
Title: Re: AGS engine Android port
Post by: TinaMaria on 02 Dec 2012, 18:21
Longpressing the "menu" button does not bring up the software keyboard?

doesnt look like the asus transformer pad has a menu button! oh well hardly have my docking keyboard off it anyway! x
Title: Re: AGS engine Android port
Post by: QuestingHero on 05 Dec 2012, 15:06
I think I have Solved the Num Pad issue with Quest for Glory 2. I installed "Flit Keyboard (https://play.google.com/store/apps/details?id=com.locnet.flitkeyboard&feature=search_result#?t=W251bGwsMSwyLDEsImNvbS5sb2NuZXQuZmxpdGtleWJvYXJkIl0.)", and the add-on "Flit NumPad Layout (https://play.google.com/store/apps/details?id=com.locnet.flitkeyboard.plugin.keypad.numpad&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5sb2NuZXQuZmxpdGtleWJvYXJkLnBsdWdpbi5rZXlwYWQubnVtcGFkIl0.)". This Keyboard alows you to have a Primary and Secondary Keyboard that you can swap on the fly, so I set the first one to qwerty and the secondary to num pad. I then set the Flit Keyboard transparency to about 70% so when I bring up the num pad in battle I can still see everything going on. I have not had a chance to fully test it, but it seems to do exactly what I was looking for. You do have to reassign the battle keys, but at least the layout is correct.

Hope this helps,
Title: Re: AGS engine Android port
Post by: davros on 07 Dec 2012, 13:02
cool - thanks for that! I have tried flit in QFG1 VGA through SCUMMVM but it doesn't respond... (despite the num pad being the default mapping for combat in this game) holding my breath that it will work for QFG 2, perhaps the AGS port responds differenty? - I'm just sitting around with the mirror, building stats in #1 as I've been wary of committing to the next game until I know it will work!
Title: Re: AGS engine Android port
Post by: davros on 08 Dec 2012, 00:25
tested the keys and did the trick

came acros an interesting problem though...

in qfg2, the 'special' icon doesnt work at all... all the others (talk, walk etc) do, but when i click on special (for walk/run/sneak/sleep etc) nothing happens

this is running off the most recent version which works fine on my computer, so I'm presuming it is something about the port?

i looked on the adg forums but didn't see anything about this.

is it possible that its an issue with this android port?
Title: Re: AGS engine Android port
Post by: JJS on 08 Dec 2012, 09:29
I can reproduce the problem. Pretty sure that it is because QFG2 moves the mouse cursor downwards onto the popped up action menu when selecting the "special" icon. If you then move the mouse up again it automatically closes that menu. This is exactly what happens on Android because the mouse cursor stays on the top of the screen under the finger.

If the "relative" mouse motion is selected in the engine settings this should not happen but of course the game becomes more cumbersome to play.

Not sure how to fix this but I will think about it some more.
Title: Re: AGS engine Android port
Post by: davros on 08 Dec 2012, 09:35
hey thanks for the feedback. will try relative - been managing under scumm - but would be great to know if you can think of a workaround!

ps was logging crashes despite not knowing how to compile/send, but did find that it seems quite game dependent. in kg1-3 a bit, on another game constantly, another not at all

if you still want the logs id appreciate a pointer for how to best compile for you?

cheers
Title: Re: AGS engine Android port
Post by: davros on 09 Dec 2012, 14:48
heres a new one - do you think it might be in the port, or more likely the game?

im having some consistent issues with my hero name in qfg2:
- on import of my qfg1vga character, the name was replaced by nonsense symbols
- i fixed it up and started game, checked my name was correct no problems - but then on save/restore its gone to the 'copyright symbol'!

this has later impact on completing the game, as you cant type in the symbol when answering questions on your characters name, meaning you fail a test
 
is this reproduceable? thoughts on a suspect, game or port? all other stats seem to save ok, its just the name

thanks as always
Title: Re: AGS engine Android port
Post by: JJS on 09 Dec 2012, 16:12
It is a port problem and it seems related to a recent change in the script interpreter. We will look into it.

if you still want the logs id appreciate a pointer for how to best compile for you?
If you are asking how to get them to me, you can just mail them to jjs@jjs.at. Maybe I am not correctly understanding the question though.
Title: Re: AGS engine Android port
Post by: davros on 09 Dec 2012, 18:00
Thanks, what app or process should I use to collect crash logs?
(It's been pretty stable recently though )
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 09 Dec 2012, 22:26
im having some consistent issues with my hero name in qfg2:
- on import of my qfg1vga character, the name was replaced by nonsense symbols
- i fixed it up and started game, checked my name was correct no problems - but then on save/restore its gone to the 'copyright symbol'!
I pushed a new commit which should resolve this issue. Sorry for inconvenience!
Title: Re: AGS engine Android port
Post by: JJS on 09 Dec 2012, 23:42
I uploaded new daily builds.
Title: Re: AGS engine Android port
Post by: davros on 15 Dec 2012, 23:54
:thumbs up: does the trick, thank you
Title: Re: AGS engine Android port
Post by: ArmyMage on 18 Dec 2012, 07:27
Btw, this application worked fine, on my Samsung Galaxy Player 4.0.

Thanks for letting me use it :op~
Title: Re: AGS engine Android port
Post by: AGD2 on 14 Jan 2013, 11:31
I was just playing around with the latest Android build from the daily builds page. I was running King's Quest 3 Redux on a Samsung Galaxy tablet running Android 3.2 (Honeycomb). I noticed a few little quirks that didn't seem to exist in previous builds:

1) If you go into the wizard's bedroom and open the cupboard on the right OR the drawers on the left, a full-screen close-up of the area in question appears on-screen with black borders surrounding it. However, some room objects, such as the wizard's chamberpot and the cupboard doors get drawn in front of the black background. Seems to be a Z-order baseline glitch.

2) I'm not sure if it always worked this way, but I noticed when loading the AGS app on Android 3.2, the menu button on the tablet's lower graphic bar just disappears. This happens in both the AGS games list and when running a game. Unfortunately, it means there's no way to bring up the on-screen keyboard or other F keys associated with that menu.

3) An old bug I reported, is that if you have Swype installed (which lets you drag your fingers across the keys to input words, rather than tapping one key at a time in the traditional way, then AGS simply doesn't recognize any keystrokes at all. It doesn't make any difference whether they keys are swyped or tapped individually - if you have the Swype keyboard active, keystrokes just won't register and the textbox remains blank. Changing back to the default Samsung keyboard is the only way to get it working again.

Also, I was just curious if any headway was ever made on implementing gestures which could be programmed to accomplish certain in-game actions? (Would be very handy for fast-paced, real-time battle actions) or if the keyboard could somehow be made to auto-appear when an AGS textbox field is tapped on.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 17 Jan 2013, 03:30
Having some trouble getting "The Journey Down" To run on AGS for Android with the latest build. Seems it cant find an AGS Datafile, but the game works on windows and I have done the exact same thing with this game as I have with the others. Any thoughts?
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 19 Jan 2013, 05:32
Scratch that. I just tried your latest Daily from yesterday and it solved the issue. The game fully works. Awesome as always JJS and crew!
Title: Re: AGS engine Android port
Post by: .M.M. on 22 Jan 2013, 17:19
Would it be possible to have buttons in the application, which would return ASCII key code (they would trigger on_key_press function)? For example, having a D-Pad that would act as WASD on the keyboard. I know it sounds like a nonsense for Adventure Game Studio, but this engine is great for making RPGs as well, and the lack of multi-touch controls is the only thing that makes it impossible to port real-time RPG from AGS to Android.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 22 Jan 2013, 17:41
I guess engine needs virtual keyboard remap feature that would translate any keycode from system to virtual key for the game. The mapping could be then set up in game configuration file.
Title: Re: AGS engine Android port
Post by: piperhcombs on 23 Jan 2013, 15:28
Speaking of keyboards, I can't bring up the keyboard on my Android tablet.

 I have a Google Nexus 7 tablet (with Jellybean), and I have the game Primordia running on the Android AGS Engine. According to one of the resolved suggestions on your old bug tracker, you've implemented the ability to invoke the onscreen keyboard on the Android by holding on the Menu button (and I'm assuming swiping up, since simply tapping would quit the app). However, this does not work on my Nexus. Holding on the menu button just brings up the ability to swipe up to the the Google Plus/Voice feature that the Nexus defaults to on that action. On your old bug tracker, it looks like there is an unresolved bug report that reports a similar issue on the Kindle Fire. Without the ability to bring up the keyboard, I can't save the game as anything other than the AutoSave already available in the list (good thing it's there or I wouldn't be able to save at all).
Title: Re: AGS engine Android port
Post by: JJS on 27 Jan 2013, 18:00
The engine invokes the standard system keyboard which should be configurable somewhere in the system settings. From what I can tell it won't work (no input is sent to the game) for swype or voice input, only with a standard keyboard. Other than that, I honestly don't know why the keyboard doesn't show on the Kindle Fire and I have no such device to test either.
Title: Re: AGS engine Android port
Post by: AGD2 on 28 Jan 2013, 18:43
Been testing out the latest version and I've got a few updates and new reports:

1) The KQ3 Redux issue I reported in my previous post above (about the baseline issues and z-order messing up) are not actually due to this at all. Sorry! The actual problem -- and you're aware of this already -- is that I was running the game with the "Hardware" renderer and when opening the closet/drawer in the wizard's bedroom, an ambient tint is set to make the game background look a bit darker. The "Hardware" and "Hardware (Pixel Perfect)" settings cannot handle tints, which is why it was making the screen black with non-transparent rectangles where room objects were. The "Software" renderer works fine, though.

2) When running Al Emmo I get this crash on startup, which has only started happening since AGS_2013-01-17_19-21-51.apk:

in "GlobalScript.asc", line 263
Error: FileWriteInt: invalid file handle; file not previously opened or has been closed.

The FileWriteInt line in question is in the game_start() function.

3) An odd glitch that I noticed. I have "use custom preferences" checked for KQ3. For some reason, when I turn the phone sideways, the "use custom preferences" box suddenly shows as unchecked and all the other options revert to the 'default' state. If I then turn the phone upright again, all the checkboxes reappear. I can keep turning the phone sideways and upright and the options keep changing back and forth.

The opposite happens for another game which does not have "use custom preferences" checked. If I turn the phone sideways, then all the buttons do become checked and vice versa.

In the general/Global Preferences, I do have custom settings and checkboxes ticked. So maybe the individual game settings are getting confused and displaying those when turned sideways and upright?


Also, I can confirm that the "not being able to access the keyboard" issue persists with the Kindle Fire and Samsung Galaxy tablet. But the reason why seems different on both:

Samsung Galaxy tablet:
Some of these tablets don't actually have a physical "menu" or "back" button. Instead, they display virtual "menu" and "back" buttons that sit on a persistently-visible toolbar at the bottom/top of the screen while the game (or any other app) runs. In this case, the "menu" button is visible when you run the AGS app (i.e. where you can can see the games list), but it instantly disappears from the toolbar as soon as you actually run a game. The "back" button remains visible the entire time, however.

Kindle Fire:
Below is a shot of KQ1 running on the Kindle Fire:

(http://www.agdinteractive.com/temp/kq-kindle 001.jpg)

Note that the only "button" visible is a virtual upward pointing arrow,located on a toolbar beneath the game window. Tapping this upward arrow button makes the virtual "back" and "menu" buttons appear on the toolbar. Tapping the "menu" button makes the "Keys" and "Exit Game" options appear, as expected. But long-pressing it doesn't make the on-screen keyboard appear. Likewise, tapping the "back" button acts like hitting the ESC key, but long-pressing it doesn't make the "Exit Game" prompt appear.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 28 Jan 2013, 22:07
Interesting, I seem to be unable to run Al Emmo's Demo on our engine, probably because the executable is not a common AGS game, but modified to display "Register" reminder.
I hope full game has not this peculiarity?

E: Oh, well, the game looks good, so I will perhaps buy it and check :).
Title: Re: AGS engine Android port
Post by: AGD2 on 28 Jan 2013, 23:48
If you have the full version and it doesn't work on Android, let me know and I can send you a game .exe without the DRM.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 29 Jan 2013, 08:04
Ok, I was able to reproduce this with a test game, at least got similar error.
The file handle used for writing is global variable, right?


@JJS: I think we should change the old-style FileOpen function to return the integer handle instead pointer, like it did before (and still does, just with different pointer type). Currently it works for stack (local vars) because interpreter stack makes distinction for "object" types, but global variables do not (they are not supposed to store pointers anyway, just managed memory handles). Besides, FileOpen is declared with "int" return value in the editor, which means script writer may then treat it as int in all aspects, like storing in array of ints or struct, making things even worse for 64-bit builds.
Why it worked before but not anymore - because of the type distinction I added for function return values. In pre-january builds it was tossed around as pure integer (which still was pretty dangerous for 64-bit linux builds), and now the script API return values are structs, which store basic types and pointer separately.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 01 Feb 2013, 23:08
JJS, can you, please, make a new Android build? I made some changes to how file functions work in script. I think that should fix this issue in Al Emmo.
Title: Re: AGS engine Android port
Post by: JJS on 01 Feb 2013, 23:43
Done, new daily builds are now available.

They also include the possibility to open/close the keyboard from the menu. Maybe this works on the Kindle Fire.
Title: Re: AGS engine Android port
Post by: AGD2 on 02 Feb 2013, 03:41
Thanks for the upload! :)

The FileWriteInt error no longer occurs during start-up when the game loads. However, now there's no music. It's really odd! Starting the game from scratch results in no music in the logo movie, title screen, or game. Sound effects, ambient sounds, and speech all play just fine, though. (This happens in all games, not just Al Emmo).

For some reason, Mage's Initiation stays on a black screen for about 10 seconds before the game actually loads up. Previously, it would just start instantly.

Haven't yet tested the new "toggle keyboard" option out on the Kindle Fire, but will let you know how that goes. Will post an update soon-ish.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 02 Feb 2013, 16:47
If you have the full version and it doesn't work on Android, let me know and I can send you a game .exe without the DRM.
Do you mean that if I buy a full version of Al Emmo, it will still have the modified executable? Or will I have a new exe free of modifications?
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 02 Feb 2013, 17:08
Hey JJS, any chance you can also expose the ShowPreferences Activity with the intent filter like you did with the AGS Runtime?

Also, According to this:

Code: Adventure Game Studio
  1. private void showPreferences(int position)
  2.         {
  3.                 Intent intent = new Intent(this, PreferencesActivity.class);
  4.                 Bundle b = new Bundle();
  5.                 b.putString("name", (position < 0) ? "" : folderList.get(position));
  6.                 b.putString("filename", (position < 0) ? null : filenameList.get(position));
  7.                 b.putString("directory", baseDirectory);
  8.                 intent.putExtras(b);
  9.                 startActivity(intent);
  10.         }

What are the extra's in "name" and "filename"? Is it the position the directory holds inside of the AGS Games directory? Does it start at 1 or 0 if that is the case? For that matter, how is the position determined? "Name" seems a bit more obvious, but I have no clue where/what the "filename" grabs.
Title: Re: AGS engine Android port
Post by: AGD2 on 02 Feb 2013, 22:43
Do you mean that if I buy a full version of Al Emmo, it will still have the modified executable? Or will I have a new exe free of modifications?

Check your PMs, Crimson Wizard.

Alright, just tested this on the Kindle Fire and I'm happy to report that the toggle keyboard option does show up when hitting the menu button, and the on-screen keyboard turns on and off just fine. Nice work!

The keyboard still isn't possible to bring up on the Galaxy tablet/Honeycomb, though. And a small correction; the menu button actually disappears when you run the AGS app (not when you tap on a game from the list, like I previously reported). I took a video of this here (http://www.himalayastudios.com/scratch/Android_Galaxy_Menu_Button.avi). Watch at the end, after I hit the "Back" button and tap "yes" to quit the game. the menu button (which had disappeared) re-appears after AGS closes.

Now, I just tested the latest version on my Galaxy S1, Galaxy tablet, and on a Kindle Fire. In all cases the music did play. For some reason, it just refuses to play on my Galaxy S3, which is very strange, as the sound effects work. The music worked without any problems on my S3 in all the previous builds.

Another peculiar anomaly is that Al Emmo averages about 44 FPS on my 'ancient' Galaxy S1, yet fluctuates between 35 and 40 FPS on my Galaxy S3, which is technically superior (dual core) and much newer. This is with identical settings for the game on both S1 and S3 ("Hardware" Renderer setting)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 03 Feb 2013, 01:59
OK, I got your package :)
The FileWriteInt error no longer occurs during start-up when the game loads. However, now there's no music. It's really odd! Starting the game from scratch results in no music in the logo movie, title screen, or game. Sound effects, ambient sounds, and speech all play just fine, though. (This happens in all games, not just Al Emmo).
Does not happen to me on Windows. And, frankly, I can't test this on Android simply because I don't have any device with it. The only portable device I own is a cellphone. I am a bit conservative user :).
Maybe JJS could check this?


E: Hmm, I probably could use this: http://developer.android.com/tools/help/emulator.html
How precise is this emulator in its simulation?
Title: Re: AGS engine Android port
Post by: JJS on 03 Feb 2013, 13:07
The emulator is based on qemu and therefore offers full hardware emulation. But according to the last post, the "no music" issue only occurs on the Samsung Galaxy S3. I cannot reproduce it on my HTC Desire.

I don't see anything in the last changes that would cause music to stop. Would it be possible that the issue is caused by something else specific to the phone? I had weird issues that were caused by file system corruption which rather easily happens on Android in my experience.

The keyboard still isn't possible to bring up on the Galaxy tablet/Honeycomb, though. And a small correction; the menu button actually disappears when you run the AGS app (not when you tap on a game from the list, like I previously reported). I took a video of this here (http://www.himalayastudios.com/scratch/Android_Galaxy_Menu_Button.avi). Watch at the end, after I hit the "Back" button and tap "yes" to quit the game. the menu button (which had disappeared) re-appears after AGS closes.
Ok, here is the problem: Starting with 4.0 there is no more "menu" functionality. Instead apps are supposed to use the "action bar". The problem is that AGS runs fullscreen which hides the action bar. I also don't see an easy way to display it (or the menu) on demand without interfering with the game itself.

A quick and dirty solution would be setting the target SDK version to Android 2.x. This will force the menu button to appear but it will also make all UI elements look very huge and ugly. Another solution would be replacing the "longpress on back" functionality with popping up the menu. At least I can reproduce the issue in the emulator because with recent updates it seems to display software buttons correctly.


3) An odd glitch that I noticed. I have "use custom preferences" checked for KQ3. For some reason, when I turn the phone sideways, the "use custom preferences" box suddenly shows as unchecked and all the other options revert to the 'default' state. If I then turn the phone upright again, all the checkboxes reappear. I can keep turning the phone sideways and upright and the options keep changing back and forth.

The opposite happens for another game which does not have "use custom preferences" checked. If I turn the phone sideways, then all the buttons do become checked and vice versa.

In the general/Global Preferences, I do have custom settings and checkboxes ticked. So maybe the individual game settings are getting confused and displaying those when turned sideways and upright?
I pushed a possible fix.



Hey JJS, any chance you can also expose the ShowPreferences Activity with the intent filter like you did with the AGS Runtime?
Done. The parameters mean this:
Code: Adventure Game Studio
  1. name = "5 Days A Stranger" // Is displayed at the top of the preferences, can be anything
  2. OR
  3. name = "" // Indicates that the global preferences should be shown
  4.  
  5. filename = "/sdcard/ags/5days/5days.exe" // Full path to the game exe
  6. directory = "/sdcard/ags" // Path to the "root" ags directory
  7.  

The position in the launcher is of no concern for your application.


Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 03 Feb 2013, 14:29
Awesome! Thanks JJS.
Title: Re: AGS engine Android port
Post by: AGD2 on 03 Feb 2013, 23:50
Quote from: JJS
I don't see anything in the last changes that would cause music to stop. Would it be possible that the issue is caused by something else specific to the phone? I had weird issues that were caused by file system corruption which rather easily happens on Android in my experience.

I thought so too, but then I tried playing with it a bit more and I think I've pinpointed the issue. It actually happens on my S1, Galaxy Tablet, and S3 and I have confirmed the bug and the solution on all devices. The "no music" glitch seems to be related to the "Needs MIDI patches on the SD card" setting. If you have this option checked in an individual game's preferences, then the digital music will play. However, if you have it unchecked, then the digital music will not play.

I actually downloaded several older versions of the AGS app from the daily page and have confirmed that it happened as far back as AGS_2012-11-29_17-36-18.apk.

Quote from: JJS
Ok, here is the problem: Starting with 4.0 there is no more "menu" functionality. Instead apps are supposed to use the "action bar". The problem is that AGS runs fullscreen which hides the action bar. I also don't see an easy way to display it (or the menu) on demand without interfering with the game itself.

A quick and dirty solution would be setting the target SDK version to Android 2.x. This will force the menu button to appear but it will also make all UI elements look very huge and ugly. Another solution would be replacing the "longpress on back" functionality with popping up the menu. At least I can reproduce the issue in the emulator because with recent updates it seems to display software buttons correctly.

I still don't understand why they didn't just keep both as physical buttons on the tablet devices, like they do on smartphones. (wrong)

Hmmm... the problem with long-press is that Jellybean seems to come with a "multi-window mode" toolbar that is auto-configured to appear whenever you long-press the back button. I'm sure it can probably be reconfigured or disabled someplace, but by default it hijacks the long-press function when AGS games are running. In addition to that, the Kindle Fire doesn't register long-presses on the Back button either.

The only other thing I can think of would be to make the Back button handle everything by popping up the menu instead, which would probably mean sacrificing its ESC key functionality.

I guess this is more of an engine implementation, but would it eventually be possible to let game authors put a perpetually-visible AGS GUI button on their game screen, which would invoke the Android's Menu button functionality when pressed?


Quote from: JJS
I pushed a possible fix.

Thanks! From what I've tested so far, it seems to work.
Title: Re: AGS engine Android port
Post by: R4L on 05 Feb 2013, 05:52
Hey JJS I'm getting a weird occurrence in Pleurghburg. About halfway through you can't advance any further because parker will not walk into the old mans apartment. Therefore you can't show her an item to advance. any way I can get around this or is it engine related? Playing on my HTC Evo 3D
Title: Re: AGS engine Android port
Post by: JJS on 05 Feb 2013, 06:59
Can you provide a savegame that shows the issue? If you cannot upload it, just send it to my email jjs@jjs.at. It is most probably a problem with backward compatibility.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 08 Feb 2013, 14:06
Can you provide a savegame that shows the issue? If you cannot upload it, just send it to my email jjs@jjs.at.
Wouldn't it be a good idea to find a centralized place to allow people upload files related to their errors? This might be essential now, when there's Wadjet Eye's releases for Linux.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 09 Feb 2013, 13:58
So JJS, I was having some issues in getting the preferences to load properly. For instance, this is what I am passing to com.bigbluecup.android.PreferencesActiv ity:

Name: Pleurghburg
Filename: /storage/sdcard0/ags/Pleurghburg_DA/Pleurgh.exe
directory: /storage/sdcardo/ags

Yet, when I start the preferences from my app, it says that AGS had to close. Any thoughts? Are any of these details wrong?
Title: Re: AGS engine Android port
Post by: R4L on 10 Feb 2013, 04:51
I'll upload my save game soon.

EDIT: Here you are! (http://www.mediafire.com/?dosp874mv4jvrj4) Note that you'll have to go to the fourth floor and talk to the boss first then it will automatically bring you to the room where the problem is happening.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 10 Feb 2013, 19:47
Hey JJS, looking through the code for PreferencesActivity...

Should line 71 read:

Code: Adventure Game Studio
  1. public void onCreate(Bundle bundle)

rather than be protected?

And on lines 47 to 49, it reads:

Code: Adventure Game Studio
  1. gameName = getIntent().getExtras().getString("name");
  2.         gameFilename = getIntent().getExtras().getString("filename");
  3.                 baseDirectory = getIntent().getExtras().getString("directory");
  4.  

Would this make it a difference:


Code: Adventure Game Studio
  1. String gameName = getIntent().getExtras().getString("name");
  2.         String  gameFilename = getIntent().getExtras().getString("filename");
  3.                 String baseDirectory = getIntent().getExtras().getString("directory");


And remove the declarations on line 17,18 and 20. Could that be causing my issue with Accessing Preferences Activity? Because if I pass nothing to it, the engine wont crash. So I am wondering that because those items are hidden to be used within the code itself, it could be causing my crashing when I try to access the Game's Preferences.
Title: Re: AGS engine Android port
Post by: piperhcombs on 12 Feb 2013, 17:02
Quote from: AGD2
Quote from: JJS
Ok, here is the problem: Starting with 4.0 there is no more "menu" functionality. Instead apps are supposed to use the "action bar". The problem is that AGS runs fullscreen which hides the action bar. I also don't see an easy way to display it (or the menu) on demand without interfering with the game itself.

A quick and dirty solution would be setting the target SDK version to Android 2.x. This will force the menu button to appear but it will also make all UI elements look very huge and ugly. Another solution would be replacing the "longpress on back" functionality with popping up the menu. At least I can reproduce the issue in the emulator because with recent updates it seems to display software buttons correctly.

I still don't understand why they didn't just keep both as physical buttons on the tablet devices, like they do on smartphones. (wrong)

Hmmm... the problem with long-press is that Jellybean seems to come with a "multi-window mode" toolbar that is auto-configured to appear whenever you long-press the back button. I'm sure it can probably be reconfigured or disabled someplace, but by default it hijacks the long-press function when AGS games are running. In addition to that, the Kindle Fire doesn't register long-presses on the Back button either.

The only other thing I can think of would be to make the Back button handle everything by popping up the menu instead, which would probably mean sacrificing its ESC key functionality.

I guess this is more of an engine implementation, but would it eventually be possible to let game authors put a perpetually-visible AGS GUI button on their game screen, which would invoke the Android's Menu button functionality when pressed?

I can confirm that you still can't bring up the keyboard on the Google Nexus 7, which runs Jellybean.

Actually I have an idea about why. Here is a picture of the standard bottom navigation bar that you see while in an app on the Jellybean platform, which believe is the navigation bar Android 4.0 tablet and smartphones without hardware/physical keys have: (http://img.photobucket.com/albums/v293/Duquesne/regmenu.png)
As you can see there are only three buttons. This is also what you see when running AGS. From left to right, the first button is the back button. The middle button is the Home button- quit to home screen and long press and swipe up to start Google Voice. The Home button is what I initially though you meant by the menu button to trigger the keyboard. More on that in a bit. The last button is the multiwindow one, bringing up a thumbnail list of active apps to choose from.

As you can see, there is no menu button. Thus, no way to bring up the keyboard. However, there is a possibility here. I recalled from other apps/games (for instance Gameloft's Backstab) that there is a fourth button that can be sometimes be used in the right corner that can act as a menu button. In BackStab, this serves as a way to bring up the game's pause/options menu. Here is a picture of the menu bar with this fourth button visible- known as the overflow menu button:
(http://img.photobucket.com/albums/v293/Duquesne/image_7.png).
From what I've read, the overflow menu is meant for apps written for older platforms (that make use of the old menu button which is no longer there on newer platforms/devices). It is the equivalent of the old menu button, basically.

 My suggestion is that you could use the overflow menu button to trigger the keyboard like you used the menu button on devices that still have it. 
Title: Re: AGS engine Android port
Post by: Intense Degree on 13 Feb 2013, 17:33
I don't suppose there is any chance that the tab key could be added to the keys available in the “keys” menu? (at the moment it’s just the “F” keys I think)

This is because there have been a couple of games recently where the inventory is opened by pressing the tab key and there isn’t one on my Galaxy S3 keyboard, so the otherwise perfectly functioning games are unplayable!

Cheers.
Title: Re: AGS engine Android port
Post by: Hece on 15 Feb 2013, 16:02
This is exellent emulator! 5/5
works great on LG Optimus
Title: Re: AGS engine Android port
Post by: Schwiney on 19 Feb 2013, 03:12
Sorry if this is already known but I cannot open up the keyboard on the Kindle Fire HD 8.9 inch while playing AGS games usiing teh latest build.  So I can't name saved games.  Am I doing something wrong?  Is there a way to open the keyboard directly using a shortcut kept in Favorites?  Thanks for your help!
Title: Re: AGS engine Android port
Post by: Schwiney on 19 Feb 2013, 03:54
Found a way to bring up the keyboard manually:
http://android.stackexchange.com/questions/28045/is-there-any-way-to-manually-bring-up-the-keyboard

I installed Hacker's Keyboard, setting to "permanently notify" and open the keyboard on the Kindle HD by pulling down the notification bar and pressing on the notification.
Title: Re: AGS engine Android port
Post by: piperhcombs on 19 Feb 2013, 16:10
Sorry if this is already known but I cannot open up the keyboard on the Kindle Fire HD 8.9 inch while playing AGS games usiing teh latest build.  So I can't name saved games.  Am I doing something wrong?  Is there a way to open the keyboard directly using a shortcut kept in Favorites?  Thanks for your help!

Seems you've already found a workaround, but I'll reply anyway. The keyboard issue was brought up on this page of the thread and the page before it.

JJS did program in a way to bring up the keyboard, but it only seems to work on tablets/phones that still have the old MENU button (not the home button). That means he made so that the keyboard is activated by pressing the MENU button. Unfortunately, many newer Android phones/tablets like your Kindle Fire and my Google Nexus 7 no longer have the MENU button. I have already suggested a solution a few posts above yours (http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636445890#msg636445890) that involves using the overflow menu button which shows up in the right corner of the navigation bar (as my pictures show) as a way to enable apps programmed to have a MENU button function (aka written for older Android versions) to still have the MENU function. 
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 24 Feb 2013, 01:36
JJS, do you know if the code (At this state) of the engine would compile with the r8 NDK? Also, any instructions on compiling the NDK part in Windows? The NDK is awefully foreign to me.
Title: Re: AGS engine Android port
Post by: .M.M. on 24 Feb 2013, 09:59
Do you mean the libraries? I struggled with it for a few days with no outcome, in the end I had to ask JJS for the library files built by ndk...
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 24 Feb 2013, 12:49
Yeah the SO files I believe :)
Title: Re: AGS engine Android port
Post by: JJS on 24 Feb 2013, 17:39
The libraries build just fine with the latest NDK (8d). I don't understand the problems with compiling because for me it is very simple. Download the NDK zip file and extract it somewhere. Then either add the ndk directory to the PATH environment variable or don't (works either way if you don't mind typing the full path to ndk-build). To build the libaries, open a command prompt, change into the source directoy "Android/library/" and type "ndk-build" or "c:\path\to\ndk\ndk-build". That's it.

But I just realised that the libraries are included in the APK file in my daily builds too. You can get them by adding a ".zip" extension to the APK and opening it. Then copy the folders in the "lib/" folder (that is armeabi-x, mips, x86) into "Android/library/libs/".
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 24 Feb 2013, 17:55
Hehe thanks JJS. Yeah, the issue I keep having involves the PATH Environment variables. I have no idea why my system doesn't register or find them properly. Thats part of the reason why I have so much trouble with the compiling. Oh well. Thanks JJS, you are awesome as always. We can never stop telling you that ;P
Title: Re: AGS engine Android port
Post by: JJS on 10 Mar 2013, 14:31
I'll upload my save game soon.

EDIT: Here you are! (http://www.mediafire.com/?dosp874mv4jvrj4) Note that you'll have to go to the fourth floor and talk to the boss first then it will automatically bring you to the room where the problem is happening.
This should be fixed in the newest daily build. Because wrong values were previously stored in the save game you have to use my patched save from here: http://jjs.at/temp/pb_agssave.zip . It is at the same position as the save you uploaded. Loading from any other previous savegame would still cause the error, starting a new game works fine.
Title: Re: AGS engine Android port
Post by: R4L on 13 Mar 2013, 17:55
Thanks for the fix JJS. I owe you a coffee or a brew haha.
Title: Re: AGS engine Android port
Post by: Giskard on 19 Mar 2013, 12:31
Trying to play Time Gentlemen Please on my Nexus 7 I get the following error at startup:

Quote
Script link failed: Runtime error: unresolved import 'NGFX_GRAPHICS_Enable'


This is the content of the agsgame.log file:

Quote
Debug system: output subsystem initialized
Debug system initialized
Built library path: ./libags_nickenstien_gfx.so
dlopen returned: Cannot load library: load_library(linker.cpp:745): library "./libags_nickenstien_gfx.so" not found
Built library path: /data/data/com.bigbluecup.android.launcher/lib/libags_nickenstien_gfx.so
dlopen returned: Cannot load library: load_library(linker.cpp:745): library "/data/data/com.bigbluecup.android.launcher/lib/libags_nickenstien_gfx.so" not found
Plugin loading failed, trying built-in plugins...
No built-in plugin found. Plugin loading failed!

Is it a known issue? Any help?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 19 Mar 2013, 12:37
I would guess that game requires a plugin, that has not been ported to other platforms yet (therefore it is not included to Android port).
Title: Re: AGS engine Android port
Post by: Giskard on 19 Mar 2013, 12:39
I've thought the same thing but that:

Quote
trying built-in plugins...

was giving me some hope..
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 19 Mar 2013, 12:41
I've thought the same thing but that:

Quote
trying built-in plugins...

was giving me some hope..
Well, the engine makes two attempts to find a plugin: looks for separate library, and checks if it is built in the engine.
Until the plugin is either ported (if author opened its source), or rewritten, nothing can be done.

Plugin name is "libags_nickenstien_gfx".
Title: Re: AGS engine Android port
Post by: raven2099 on 26 Mar 2013, 11:30
works fine on a rooted nook.. now how do i install games and play?
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 26 Mar 2013, 11:58
On the sd card, create a folder called AGS. Put the directory of the game (Make sure the directory which contains the game has all the AGS Files and game content in its root) into the AGS Directory. Start up AGS and play! :)
Title: Re: AGS engine Android port
Post by: DazJ on 27 Mar 2013, 14:33
Do we know why OGV files are stuttering, even on a Note II? I'm playing them at 640x480 so it surely can't be too high a resolution can it?

They seem to stutter on near enough all phone models.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 30 Mar 2013, 05:34
Hey JJS. I finally got the engine to compile with the NDK. However, the actually Java part is giving me the following errors in Eclipse:

Description   Resource   Path   Location   Type
PEHelper cannot be resolved to a type   GamesList.java   /AGS Game Launcher/src/com/bigbluecup/android/launcher   line 50   Java Problem
Attribute minSdkVersion (7) is higher than the project target API level (4)   AndroidManifest.xml   /AGS Game Launcher   line 1   Android ADT Problem
PEHelper cannot be resolved to a type   GamesList.java   /AGS Game Launcher/src/com/bigbluecup/android/launcher   line 31   Java Problem
CreditsActivity cannot be resolved to a type   GamesList.java   /AGS Game Launcher/src/com/bigbluecup/android/launcher   line 175   Java Problem
PEHelper cannot be resolved to a type   GamesList.java   /AGS Game Launcher/src/com/bigbluecup/android/launcher   line 50   Java Problem
AgsEngine cannot be resolved to a type   GamesList.java   /AGS Game Launcher/src/com/bigbluecup/android/launcher   line 192   Java Problem
PreferencesActivity cannot be resolved to a type   GamesList.java   /AGS Game Launcher/src/com/bigbluecup/android/launcher   line 181   Java Problem
PEHelper cannot be resolved to a type   GamesList.java   /AGS Game Launcher/src/com/bigbluecup/android/launcher   line 274   Java Problem
PEHelper cannot be resolved to a type   GamesList.java   /AGS Game Launcher/src/com/bigbluecup/android/launcher   line 255   Java Problem


Any thoughts?
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 30 Mar 2013, 05:45
Nevermind. I was able to compile the latest build. ;)
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 30 Mar 2013, 16:00
4/2/13 Build of Android Port:
LINK (https://mega.co.nz/#!UttxQYQS!D7bOOnUhesPP2F_udggI7wJgjAs2pbjO0yl4SG5qjKo)
Again, I take no credit other than the fact that I built a build with the latest changes to the engine. Latest Change includes:
Common, Engine: fixed few pointer conversion warnings.
The credit for the Android Port fully goes to JJS.
----------------
If anyone is interested, I compiled AGS for Android with the latest code changes from the Git Repository. You can find it here:
LINK (https://mega.co.nz/#!Et9yjaQB!R0yZviPYyFSZgO13C3Ef4nmsuUdHsYdDxaO3_zdim8U)

This should contain the following changes that are noticeable (I assume) within the app itself:

Corrected Theora Playback
3.30 Version code change
Fixes to AGSNative
Fixed Exception message in exception handler

Nothing big, but I will try and provide Daily Builds whenever something is applied. Please remember, I take no credit for the improvements and enhancements to AGS. JJS is responsible for the Android Port. I am simply compiling it for who ever wants an updated version. As fixes keep coming, I will post them here. Learning to compile this takes me one step closer to getting you all to build your own AGS APK's. Thanks!
Title: Re: AGS engine Android port
Post by: Saurabh on 03 Apr 2013, 08:41
4/2/13 Build of Android Port:
LINK (https://mega.co.nz/#!UttxQYQS!D7bOOnUhesPP2F_udggI7wJgjAs2pbjO0yl4SG5qjKo)
Again, I take no credit other than the fact that I built a build with the latest changes to the engine. Latest Change includes:
Common, Engine: fixed few pointer conversion warnings.
The credit for the Android Port fully goes to JJS.
----------------
If anyone is interested, I compiled AGS for Android with the latest code changes from the Git Repository. You can find it here:
LINK (https://mega.co.nz/#!Et9yjaQB!R0yZviPYyFSZgO13C3Ef4nmsuUdHsYdDxaO3_zdim8U)

This should contain the following changes that are noticeable (I assume) within the app itself:

Corrected Theora Playback
3.30 Version code change
Fixes to AGSNative
Fixed Exception message in exception handler

Nothing big, but I will try and provide Daily Builds whenever something is applied. Please remember, I take no credit for the improvements and enhancements to AGS. JJS is responsible for the Android Port. I am simply compiling it for who ever wants an updated version. As fixes keep coming, I will post them here. Learning to compile this takes me one step closer to getting you all to build your own AGS APK's. Thanks!

Thanks! and also a BIG Thanks to JJS :) :)
Title: Re: AGS engine Android port
Post by: QuestingHero on 03 Apr 2013, 16:20
Hey JJS, do you have any interest in "porting" the android version to the OUYA? I guess it would be more of a code update then a port, but either way I woud love to play AGS games on my TV. I would be glad to test once my OUYA gets here.

BTW, the ODK is free from devs.ouya.tv/developers (https://devs.ouya.tv/developers)
Title: Re: AGS engine Android port
Post by: HappyCat on 11 Apr 2013, 12:40
Great work on port! Just finished The Rail with it yesterday.
Here are some usability thoughts. It would be great to see S Pen and external muse support like it's done with ScummVM android SDL variant.
Best part is floating that moving pen over the screen translates to cursor movement and pen button works as right click.
Title: Re: AGS engine Android port
Post by: Matt Frith on 12 Apr 2013, 14:08
Hello. I don't know if anyone else has experienced this but the latest Android build (AGS_2013-04-09_22-04-13) seems to crash out randomly. Currently running it on a Nexus 7 tablet and have yet to try it on my phone (Galaxy S2).  I rolled back to the previous version and it seems to be stable.  Just thought I'd let you know!
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 12 Apr 2013, 14:19
Previous Android build was... 10th March? Quite a lot changed in between :-/.
Title: Re: AGS engine Android port
Post by: JJS on 12 Apr 2013, 14:58
Joseph DiPerla provided two intermediate builds in this post: http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636449832#msg636449832 You could also try those.

The newest version is compiled with the latest NDK and GCC 4.7. The previous ones were with older toolchains, I hope this didn't break anything (it didn't for me, but you never know).

Also can you provide system logs (logcat) that show the engine crashing?


Edit: About Ouya... I guess it is all about supporting the controller and providing meta information for their store. Since their launcher app doesn't really work on my phone (screen too small and I cannot manage to sign up) and the launcher also doesn't work on the emulator because it requires a "real" network connection (emulator only has 3g network) I will not do any work on it for the moment. The overarching problem of deploying for Android has not been solved anyway so Ouya support is not that useful right now.
Title: Re: AGS engine Android port
Post by: MrProsser on 13 Apr 2013, 07:54
I am hoping someone can help clarify a few things about this project. I am new to AGS and only recently learned of this port. I have not had a chance to try using it yet, but my understand is that one manually must place the game in a folder ags on the sd card and install the engine. Is this correct?

Also, when I was looking at this a few days ago I thought I read some discussion about coming up with a method that would allow commercial, standalone releases but I cannot find those posts again. I was wondering if this is being worked on and how this was going to be accomplished (and where that discussion might be in here, I would love to read it).
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 13 Apr 2013, 16:27
I am hoping someone can help clarify a few things about this project. I am new to AGS and only recently learned of this port. I have not had a chance to try using it yet, but my understand is that one manually must place the game in a folder ags on the sd card and install the engine. Is this correct?

Also, when I was looking at this a few days ago I thought I read some discussion about coming up with a method that would allow commercial, standalone releases but I cannot find those posts again. I was wondering if this is being worked on and how this was going to be accomplished (and where that discussion might be in here, I would love to read it).

I am working on both actually. I have AGS Stream (You can find it in the Google Play Store) which I allow it to install the games for you easily. It has a few bugs which I just fixed (It wouldn't download on the SIII, the Nexus Tabs and Transformer Tabs) and I need to implement a game settings option to properly work which I am in the middle of. Also Some users are experiencing issues with the Android port on devices without hardware keys. For instance, they cannot get the Keyboard to be displayed or the menu option for the Function Keys, etc... Once these kinks are worked out, I will add more games. Expect an update to AGS Stream in a couple of weeks.

For the later part, I am also the one working on that. The issue with this latter part is that its not currently integrated into the editor to compile for Android, so I am trying to figure out a way that a user can easily package a game for Android without too much of work going to the Java Side. The next issue is working with OBB Files. But rest assured, I am finding a fix for all of these and will release something in the coming weeks, hopefully. Its just been busy for me lately, so I haven't had a chance to properly work on these things.
Title: Re: AGS engine Android port
Post by: sunerune on 15 Apr 2013, 00:53
hi. i'm trying to play gemini rue and i have a question: i can't seem to save...
Title: Re: AGS engine Android port
Post by: MrProsser on 15 Apr 2013, 01:04
I obtained the latest release and have been trying to build it, but have gotten into trouble pretty quickly. When I try to build the native engine library using ndk-build, as explained in the docs and in this comment (http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636446882#msg636446882) I end up getting this error:

Install        : libagsengine.so => jni/../libs/armeabi/libagsengine.so
Install        : libpe.so => jni/../libs/armeabi/libpe.so
Install        : libags_snowrain.so => jni/../libs/armeabi/libags_snowrain.so
Install        : libagsblend.so => jni/../libs/armeabi/libagsblend.so
Install        : libagsflashlight.so => jni/../libs/armeabi/libagsflashlight.so
make: *** No rule to make target `jni/../jni/../../../Engine/../Plugins/agslua/agslua/agslua/agslua_autogen.cpp', needed by `obj/local/armeabi/objs/agslua/__/Plugins/agslua/agslua/agslua/agslua_autogen.o'.  Stop.

The only thing that I seem to be doing differently is that I am using revision 8e rather than 8d.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 15 Apr 2013, 03:05
I obtained the latest release and have been trying to build it, but have gotten into trouble pretty quickly. When I try to build the native engine library using ndk-build, as explained in the docs and in this comment (http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636446882#msg636446882) I end up getting this error:

Install        : libagsengine.so => jni/../libs/armeabi/libagsengine.so
Install        : libpe.so => jni/../libs/armeabi/libpe.so
Install        : libags_snowrain.so => jni/../libs/armeabi/libags_snowrain.so
Install        : libagsblend.so => jni/../libs/armeabi/libagsblend.so
Install        : libagsflashlight.so => jni/../libs/armeabi/libagsflashlight.so
make: *** No rule to make target `jni/../jni/../../../Engine/../Plugins/agslua/agslua/agslua/agslua_autogen.cpp', needed by `obj/local/armeabi/objs/agslua/__/Plugins/agslua/agslua/agslua/agslua_autogen.o'.  Stop.

The only thing that I seem to be doing differently is that I am using revision 8e rather than 8d.

Which Directory are you running it from? Most likely the reason why its doing that is that the .SO files are compiled already. Delete the OBJ folder inside library folder and then run the NDK Again. It should work.
Title: Re: AGS engine Android port
Post by: MrProsser on 15 Apr 2013, 05:41
I deleted the obj directory and started again. I ran ndk-build in ags/Android/library. This ran nicely, but once again failed:
Quote
SharedLibrary  : libagsblend.so
Install        : libagsblend.so => jni/../libs/armeabi/libagsblend.so
Compile++ thumb  : agsflashlight <= agsflashlight.cpp
jni/../jni/../../../Engine/../Plugins/AGSflashlight/agsflashlight.cpp: In function 'void CreateLightBitmap()':
jni/../jni/../../../Engine/../Plugins/AGSflashlight/agsflashlight.cpp:394:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
SharedLibrary  : libagsflashlight.so
Install        : libagsflashlight.so => jni/../libs/armeabi/libagsflashlight.so
make: *** No rule to make target `jni/../jni/../../../Engine/../Plugins/agslua/agslua/agslua/agslua_autogen.cpp', needed by `obj/local/armeabi/objs/agslua/__/Plugins/agslua/agslua/agslua/agslua_autogen.o'.  Stop.
Title: Re: AGS engine Android port
Post by: JJS on 15 Apr 2013, 07:00
The agslua plugin is pulled in from its original repository as a submodule, which has to be initialized separately.

On the command line this is done like this:
Code: Adventure Game Studio
  1. git submodule init
  2. git submodule update
Title: Re: AGS engine Android port
Post by: MrProsser on 15 Apr 2013, 07:29
Thanks JSS. I tried ran those commands and it got a little farther but it ran into another problem just after that where it is unable to find the header file:
Quote
jni/../jni/../../../Engine/../Plugins/agslua/agslua/agslua/agsplugin.h:543:0: warning: "DLLEXPORT" redefined [enabled by default]
jni/../jni/../../../Engine/../Plugins/agslua/agslua/agslua/AGSLua_Main.cpp:6:0: note: this is the location of the previous definition
jni/../jni/../../../Engine/../Plugins/agslua/agslua/agslua/AGSLua_Main.cpp:10:20: fatal error: agslua.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs/agslua/__/Plugins/agslua/agslua/agslua/AGSLua_Main.o] Error 1

I notice that the file AGSLua.h exists, but there is no agslua.h. Could this just be a due to the case sensitive nature of Linux? I am running lubuntu 12.10.
Title: Re: AGS engine Android port
Post by: JJS on 15 Apr 2013, 07:44
Yes, that is the problem. I ususally build on Windows or through a virtual machine connected to a Windows share so I don't notice usually :(.

Having both AGSLua.h and agslua.h (i.e. copying the file) should be the easiest fix for now. This has to be really fixed in the agslua repo.
Title: Re: AGS engine Android port
Post by: MrProsser on 15 Apr 2013, 07:50
Windows breeds bad habits, but I cannot say anything because I have done tons of Windows development and know how easily it can happen. I modified the includes in the other files, but creating a new copy might be a good idea as well. It is currently building in the background and got past building the Lua components this time. Hopefully that was the only error.
Title: Re: AGS engine Android port
Post by: sunerune on 16 Apr 2013, 04:10
there's a tutorial part in gemini rue where you must use ctrl button to focus before shooting. i have dl the hackers keyboard but the ctrl button doesnt seem to work when pressed. anyone know what i am talking about?
Title: Re: AGS engine Android port
Post by: km3k on 17 Apr 2013, 16:28
there's a tutorial part in gemini rue where you must use ctrl button to focus before shooting. i have dl the hackers keyboard but the ctrl button doesnt seem to work when pressed. anyone know what i am talking about?

I ran into the same issue last year. I created an issue in the old issue tracker ( http://jjs.at/tracker/view.php?id=72 ) but we weren't able to figure out what was wrong. I went back to playing Gemini Rue on PC, where it worked fine. Sorry that I can't help, but I wanted to let you know that this issue has been seen before.
Title: Re: AGS engine Android port
Post by: garry4all on 25 Apr 2013, 02:59
Hi, first of all let me congratulate and thank u 4 the wonderful work u did.
Npw, I'm testing the aandroid port in a galaxy tab 2, which doesnt have a physical menu button. So I cannot save, load, etc.
Do you have any plan on modifying that to use the button bar that android 4 devices have ?
Thanks
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 25 Apr 2013, 04:26
I believe that if you replace the target Android SDK to be 14 or higher, it will show a soft key menu button, which would then allow you to pop up the keyboard. That has to be done in the Android Manifest file of the source code. I will try re-compiling the sources I have to see if that would do the trick.

EDIT:

Actually, JJS, if you change the Keycode_Back to perform this this:

Code: Adventure Game Studio
  1. if ((key == KeyEvent.KEYCODE_BACK) && ((ev.getFlags() & 0x80) > 0)) // FLAG_LONG_PRESS
  2.                                 {
  3.                                         ignoreNextActionUp_Back = true;
  4.                                         openOptionsMenu();
  5.                                 }

in dispatchKeyEvent in AGSEngine.java, it should allow you to longpress the back button on screen and pop up the menu which has all the options we need: Toggle Keyboard, Exit Game, F Keys, etc... That would then allow the game to work on Nexus 7/10, ASUS and Kindle devices or other devices without hardware keys.
Title: Re: AGS engine Android port
Post by: SKYY on 01 May 2013, 18:48
Is there any way to make the ags cursor coincide with the android system cursor? I have to aim way high with my galaxy note stylus, in relation to the game cursor.
Title: Re: AGS engine Android port
Post by: rykkeri on 02 May 2013, 11:52
How about a bit of redesign in the way how cursor handles for touch screens:

-Left and right hand modes for cursors.
-For the cursor not to hide under users fingertip, place the cursor to the upper left or upper right corner of the users fingertip, depenging on the cursor mode. I do not know without measuring how far in pixels this would be, maybe a configurable value?
-The effective cursor position would be the upper left or upper right corner of the cursor icon, depending on the cursor mode.

This way the user would be capable of "dragging" the cursor while actually seeing it and placing the cursor would be a lot easier. After dragging, tapping would initiate the action. By making cursor icons that would visually point to the upper left or right corner, the user would have better idea on where the game actually thinks you are trying to click.

The way you usually grab a tablet or a phone would in my opinion make this the most ideal solution for emulating a mouse; the effective cursor position to trigger the actions would be close to the continuum of your finger's position and angle.

Or do you guys prefer seeing your finger and nothing else, while trying to click that tiny object in your screen? Try a HTC Explorer & AGS if you do...
Title: Re: AGS engine Android port
Post by: DoorKnobHandle on 02 May 2013, 11:55
I've always just used the alternative input mode where you can put your finger down anywhere on the screen and it WON'T warp the cursor over there but leave the cursor where it was and just move it RELATIVE to your finger position. Works really well!

The problem with your idea is that, when the cursor is always to the top left of where your finger is, all of the sudden you can't click things on the right or bottom edge of the screen. :p
Title: Re: AGS engine Android port
Post by: rykkeri on 02 May 2013, 12:00
I've always just used the alternative input mode where you can put your finger down anywhere on the screen and it WON'T warp the cursor over there but leave the cursor where it was and just move it RELATIVE to your finger position. Works really well!

The problem with your idea is that, when the cursor is always to the top left of where your finger is, all of the sudden you can't click things on the right or bottom edge of the screen. :p

Oh, didn't either notice that relative behavior or it didn't work for HTC Explorer with Android 2.3.5. Will try again, thanks for the tip.

And yes, for the idea that I presented there should be the standard way activated for using the cursor when closing to the bottom corners.
Title: Re: AGS engine Android port
Post by: garry4all on 06 May 2013, 22:45
I tried to build the Android libraries with ndk-build and I get the following error.

C:/android-ndk-r8e/build/core/add-application.mk:128: Android NDK: WARNING: APP_
PLATFORM android-14 is larger than android:minSdkVersion 4 in jni/../AndroidMani
fest.xml
Install        : libagsengine.so => jni/../libs/armeabi/libagsengine.so
Install        : libpe.so => jni/../libs/armeabi/libpe.so
Install        : libags_snowrain.so => jni/../libs/armeabi/libags_snowrain.so
Install        : libagsblend.so => jni/../libs/armeabi/libagsblend.so
Install        : libagsflashlight.so => jni/../libs/armeabi/libagsflashlight.so
make: *** No rule to make target `jni/../jni/../../../Engine/../Plugins/agslua/a
gslua/agslua/agslua_autogen.cpp', needed by `obj/local/armeabi/objs/agslua/__/Pl
ugins/agslua/agslua/agslua/agslua_autogen.o'.  Stop.

I was finally able to extract the libraries from the apk, but I would like to know why the ndk-build didn't work.

Thanks.
Title: Re: AGS engine Android port
Post by: fischkopf on 08 May 2013, 22:38
Could you add to the port, a virtual screen keyboard  that pops up, if i open save game menus? Or, if you don't type anything name the savegames save[$], etc...That is the only thing i have to critisize, great port nonetheless!
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 08 May 2013, 23:08
Could you add to the port, a virtual screen keyboard  that pops up, if i open save game menus?
I doubt it is possible to detect when savegame menu is on, because for the engine all menus are the same (unless the game uses default built-in AGS functionality, which is not very common in latest games).
Probably it would be possible to detect when a text input control is shown and has focus.
Still, this won't help in exceptional cases when game has some custom way to program user input. Therefore, I am wondering if it would be better to bind virtual keyboard appearance to any of the persistent device's controls?

If you don't type anything name the savegames save[$]
Again, that depends on the game. If the game does not test for empty string and tries to save game even with empty name, then engine will be able to hack in and change that name, but if the game is scripted in such a way that it checks for empty string and does not let to save if string is empty, then not much may be done...

To summ up, since the engine is a "virtual machine" which executes scripts, in most cases it has no means to "understand" the meaning of script actions as we, users, see it and find the ways to override it.
Unless the overrides are programmed on per-game basis, that is.
Title: Re: AGS engine Android port
Post by: Cubbie on 09 May 2013, 12:30
Hi,

I was wondering if there was any progress on the 'no keyboard on nexus 7' issue.
I've made some experiments with Tasker, trying to have the keyboard pop up on certain conditions. I.e. 'AGS running and display orientation = portrait' works well. alas, not in AGS... :)
something seems to prevent the keyboard from popping up. Maybe there is some kind of flag to set, that enables input?

everything else works really well and it's a shame that such a little problem renders the whole thing pretty much unusable.
Hope this can be resolved somehow :)

Title: Re: AGS engine Android port
Post by: garry4all on 09 May 2013, 14:59
I believe that if you replace the target Android SDK to be 14 or higher, it will show a soft key menu button, which would then allow you to pop up the keyboard. That has to be done in the Android Manifest file of the source code. I will try re-compiling the sources I have to see if that would do the trick.

I tried this with no luck, my tablet already has 4 buttons in the navigation bar (home, back, recent apps, screenshot) so the menu button never appears.

EDIT:

Actually, JJS, if you change the Keycode_Back to perform this this:

Code: Adventure Game Studio
  1. if ((key == KeyEvent.KEYCODE_BACK) && ((ev.getFlags() & 0x80) > 0)) // FLAG_LONG_PRESS
  2.                                 {
  3.                                         ignoreNextActionUp_Back = true;
  4.                                         openOptionsMenu();
  5.                                 }

in dispatchKeyEvent in AGSEngine.java, it should allow you to longpress the back button on screen and pop up the menu which has all the options we need: Toggle Keyboard, Exit Game, F Keys, etc... That would then allow the game to work on Nexus 7/10, ASUS and Kindle devices or other devices without hardware keys.

And this doesn't work either because the call to openOptionsMenu() does nothing if the activity doesn't have an ActionBar (as explained here: http://blog.perpetumdesign.com/2011/08/strange-case-of-dr-action-and-mr-bar.html)

So, Cubbie, a temporary workaround I did for this is to make the ActionBar visible and show the menu options in it:
In AgsEngine.onCreate delete line 76
Code: Adventure Game Studio
  1. //              requestWindowFeature(Window.FEATURE_NO_TITLE);
  2.  

And add these lines just before and after the setContentView
Code: Adventure Game Studio
  1.                 getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
  2.                
  3.                 setContentView(R.layout.loading);
  4.                
  5.                 displayActionBar();
  6.  

Method displayActionBar:

Code: Adventure Game Studio
  1.         @TargetApi(11)
  2.         private void displayActionBar() {
  3.                 if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
  4.                         final ActionBar actionBar = getActionBar();
  5.                 actionBar.setDisplayShowHomeEnabled(true);
  6.                 }
  7.         }
  8.  

Finally, in ingame.xml, add the following to the three menu items (@+id/toggle_keyboard, @+id/keys, @+id/exitgame)
Code: Adventure Game Studio
  1.  android:showAsAction="always"
  2.  

When running the games, they will not be fullscreen, you'll see the ActionBar, but at least they are playable.

There might be other ways to solve this but for the moment is all I could find. Hope this helps.
Title: Re: AGS engine Android port
Post by: Cubbie on 09 May 2013, 16:02
Am I assuming right that those instructions would require me to compile the port myself? That's a bit out of scope for me. :)
I'm also not sure it would help me. On my tablet (Nexus 7), the action bar is always there! It's just missing the Menu-Button. But the Back-Home-Recent buttons never disappear. I guess since there are no hardware buttons, the system just won't allow any app to hide the bar completely. Some apps like e.g. video players can "dim" it (the three icons will just appear as dim circles until pressed), but it's never completely gone.
Title: Re: AGS engine Android port
Post by: garry4all on 09 May 2013, 17:18
What you are referring to is the Navigation Bar (Home, Back, etc), located at the bottom.
The Action Bar is always located at the top of the screen.
I'll see if I can send you my apk later in the day
Title: Re: AGS engine Android port
Post by: garry4all on 10 May 2013, 16:34
Sooo it was much easier than what I did. I reverted my changes and just set android:targetSdkVersion to 10 in both projects.
The blue theme is lost in the game selection screen, but a menu button appears in the navigation bar, as you can see in this screenshot (https://dl.dropboxusercontent.com/u/46438838/Screenshot_2013-05-10-12-23-26.png)

Here's the modified apk (https://dl.dropboxusercontent.com/u/46438838/AGS_api10.apk), I'm confident it will work on your device.
Title: Re: AGS engine Android port
Post by: Cubbie on 10 May 2013, 19:53
Awesome, thanks a lot. Works perfectly. :)
I remember the developer mentioning that possibility, but he seemed to be against it. So all the more thanks for making this available!

The Space Quest II remake still won't let me enter a name for the save game, though. Bummer :)
Title: Re: AGS engine Android port
Post by: Blackthorne on 11 May 2013, 00:29
Awesome, thanks a lot. Works perfectly. :)
I remember the developer mentioning that possibility, but he seemed to be against it. So all the more thanks for making this available!

The Space Quest II remake still won't let me enter a name for the save game, though. Bummer :)


Hmm.  I wonder why that is.  If there's anything I can do to adjust to help fix that for Android, let me know.  (My group made that.)


Bt
Title: Re: AGS engine Android port
Post by: JJS on 11 May 2013, 09:02
As for the build failing on the lua plugin: You have to initialize and update the lua submodule. See here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636451342#msg636451342

I switched the SDK target to 10 now, so the backward compatibility stuff should be in full effect now. The new daily build has that change.

I tried Space Quest II on my phone and on the emulator and I could enter characters via the onscreen keyboard, so I cannot reproduce the problem.
Title: Re: AGS engine Android port
Post by: Cubbie on 11 May 2013, 13:58
Turns out my keyboard was at fault. Although I'm pretty sure I tried the stock keyboard and it didn't work yesterday... Well, it does now. So all is good. Thanks for all the help!
Title: Re: AGS engine Android port
Post by: zdj on 16 May 2013, 06:55
Found a work around for those stuck on the gun training part of Gemini Rue due to the ctrl key issue:
1. Open the game menu by pressing back button
2. Press "keyboard" button.
3. reassign breathe action to the '6' key
4. Resume the game and you can now perform breathe by pressing the 'f' key on the on screen keyboard.

I stumbled upon this by accident and have no idea why it works but it does on my Galaxy S3. I don't know if it works on other phones.
Title: Re: AGS engine Android port
Post by: deee on 08 Jul 2013, 10:58
First of all, this is really awesome and gets us all one step closer to cross-platform published AGS games.
Wonderful work, JJS, I just can't describe the moment I had when running one of my games on a tablet for the first time.

Actually I had some heavy performance problems (a maximum of 13 FPS) when testing a 1024x768 game (32 bit).
Even when deactivating room objects, so there are only animated characters, the frames capped at ~17, whereas my PC runs the game at ~140 FPS.
Is this normal, or can I do something to get a better performance?
I am just asking before resizing everything to 640x480 and deactivating all the good looking stuff.

Edit:
Testing devices (both at a very low frame rate) were:
-Asus Eepad Transformer tf201
-Samsung Galaxy Note n7000
Title: Re: AGS engine Android port
Post by: cianty on 14 Jul 2013, 19:52
I know it's been mentioned/requested before, but MAN would I love to see an OUYA port. I'm actually kind of disappointed by the weak portfolio of OUYA games. Well, at least it made be conscious of the Fester Mudd release but I ended up playing it on my iPad instead. Until there's a ScummVM - or better even - AGS port for OUYA I don't see me using the OUYA much...
Title: Re: AGS engine Android port
Post by: JJS on 15 Jul 2013, 08:49
Actually I had some heavy performance problems (a maximum of 13 FPS) when testing a 1024x768 game (32 bit).
Have you tried using one of the hardware renderers from the preferences menu? It should boost the performance like using the D3D driver on Windows does. It is a bit incomplete though because there is no character tinting yet.

I know it's been mentioned/requested before, but MAN would I love to see an OUYA port.
It should be possible to sideload AGS onto the OUYA. There would be the problem of missing controller support though. I don't have an OUYA (no intention on buying one either) and the SDK probably still doesn't work right on the emulator (I will test if that holds still true). If someone else wants to implement OUYA support be my guest.
Title: Re: AGS engine Android port
Post by: QuestingHero on 16 Jul 2013, 00:03
It side loads just fine on OUYA. The only thing I wish I could do (and honestly, this would be good on ALL Android version), is use a real mouse. I have a USB Keyboard and Mouse hooked up to my OUYA, and it works great in DosBox and ScummVM. In this AGS port however, it moves to the point I click and then I have to click again if I want to single click (double Click to single click... kinda). having a way to enable real mouse tracking would be great, and would also work with OTG cables on phones.

Thanks,
Title: Re: AGS engine Android port
Post by: deee on 17 Jul 2013, 21:07
Thank you very much, JJS, I didn't even know about the settings.
I played around with it, and it's getting better (around 30 FPS now).
This is so wonderful! (and character tinting isn't really that important)
Title: Re: AGS engine Android port
Post by: JJS on 19 Jul 2013, 07:27
It side loads just fine on OUYA. The only thing I wish I could do (and honestly, this would be good on ALL Android version), is use a real mouse. I have a USB Keyboard and Mouse hooked up to my OUYA, and it works great in DosBox and ScummVM. In this AGS port however, it moves to the point I click and then I have to click again if I want to single click (double Click to single click... kinda). having a way to enable real mouse tracking would be great, and would also work with OTG cables on phones.

Thanks,
Can you try this build with experimental mouse/keyboard support? I can only test it in a virtual machine, so I cannot tell how it behaves on a real device. Moving and left/right-click should work as well as most keyboard keys (including ESC and F1-F12). Is the AGS mouse cursor for you offset from the Android cursor? http://jjs.at/temp/AGS_mouse.apk
Title: Re: AGS engine Android port
Post by: HappyCat on 19 Jul 2013, 14:09
Jumping into testing) Gonna give this build a try too.
Title: Re: AGS engine Android port
Post by: StarkRG on 22 Jul 2013, 20:06
Hey JJS, I'm just getting started exploring AGS and all it's wonderful goodness. I love what you've done so far on the Android port (though I am having issues where nearly all the games I loaded onto it crash at one point or another and return me to the home screen).

RE: Ouya Support
It shouldn't be necessary to install any particular things to support this as long as you can add controller support. I haven't delved into Android development too much so I can't give you any hints on supporting controller input. That said I have side-loaded a few games onto the Ouya that already had controller support and they work just fine. This might be useful to you: http://docs.nvidia.com/tegra/data/How_To_Support_Android_Game_Controllers.html (http://docs.nvidia.com/tegra/data/How_To_Support_Android_Game_Controllers.html) (yes it's on a site dedicated to a particular chipset but it deals solely with InputDevice and InputEvent objects within the standard ADK) As an added bonus you'd be adding controller support for all android devices. Getting it on the Ouya store is another thing altogether but I can't imagine that would be too difficult.

I will certainly be keeping my eye on this project. One thing, though: eventually (as the bugs dwindle down), it would be nice if there were a way to use this as a wrapper on an AGS game that could then be released on the play store. I, for one, would be perfectly willing to provide some sort of monetary kickback to you if I ever decided to release something commercially (assuming the license allows such a thing, if not then maybe a donation to the... er... Charitable Fund For The Benefit of... er... JJS Porting Activities).
Title: Re: AGS engine Android port
Post by: QuestingHero on 23 Jul 2013, 17:23
Can you try this build with experimental mouse/keyboard support? I can only test it in a virtual machine, so I cannot tell how it behaves on a real device. Moving and left/right-click should work as well as most keyboard keys (including ESC and F1-F12). Is the AGS mouse cursor for you offset from the Android cursor? http://jjs.at/temp/AGS_mouse.apk
I was out of town this past weekend, so I didn't see your post until now. Right now I am at work so I can't try it out on the Ouya, BUT, my HTC One has USB OTG and I just tried it out on it (Mouse Only, no extra Keyboards here). Right and Left buttons work perfect, single clicks with both registered as expected. The mouse pointer did move when I moved the mouse, but at a much smaller scale. If I started at the far right side, and moved the mouse pointer all the way to the Left side, the Game Pointer only goes about 1/2 to 2/3 the way across. I would not worry about there being double cursers, DosBox Turbo and ScummVM have the same issue. On a side note about both of those apps, ScummVM keeps both cursers pretty close, DosBox Turbo on the other hand has a Mouse Offset that you can adjust (I think I have it about 35% - 40% if that helps at all).
Title: Re: AGS engine Android port
Post by: QuestingHero on 23 Jul 2013, 17:33
UPDATE: I had both "Relative Mouse Control" and "Dragging with Longclink" checked in the settings. after turning both of them off, mouse movement is PERFECT! there are 2 mouse pointers (System Mouse is on top of Game Mouse), but the game mouse keeps right up with the system mouse. Even when I move the System mouse off the black area of the sides of the game (4x3 game on a 16x9 screen), when I brought the system mouse back to the game area, the game mouse jumped right back to it.

Well Done JJS, I look forward to installing this on my Ouya.

UPDATE 2: Just had a chance to test this on the Ouya and it works great! Just like before I had to make sure those 2 options were unchecked. My Test game was Quest for Glory 2. Everything with the mouse worked flawlessly. I did try out a full size USB Keyboard on the Ouya too, and all the Alpha keys worked. the numb pad worked (when numlock was on). All the supported F1-12 Keys worked. the only thing that didn't (and I don't know if this can even be fixed), is the Ctrl+Alpha keys didn't work. Like in the game you can press Ctrl+S to bring up your stats... but that is not a game breaker as they are duplicated in the menus.

Once again, Amazing work and thank you so much.
Title: Re: AGS engine Android port
Post by: cianty on 24 Jul 2013, 19:04
QuestingHero, you just caused me to get a wireless mouse from Amazon. I can't wait to try this on my OUYA.

I have a few AGS games that I still need to play so I'll use them as test cases. :)

Update: Even without a proper mouse this already works great on OUYA. The mouse movement is perfect and the controller has already left clicks (U) and right clicks (Y) built in. Sweet! Now if only the controller's touchpad was a bit nicer.
Title: Re: AGS engine Android port
Post by: QuestingHero on 24 Jul 2013, 19:28
QuestingHero, you just caused me to get a wireless mouse from Amazon. I can't wait to try this on my OUYA.

I have a few AGS games that I still need to play so I'll use them as test cases. :)

Update: Even without a proper mouse this already works great on OUYA. The mouse movement is perfect and the controller has already left clicks (U) and right clicks (Y) built in. Sweet! Now if only the controller's touchpad was a bit nicer.

:-P Always glad to help a fellow nerd spend money. A wireless mouse (Did you go bluetooth?) is much better then my really long USB Cable. Let me know what mouse you got and how well it works for you.

Also, thank you for telling me about the (U) and (Y) Buttons, did that work on other builds, or just this newest one?
Title: Re: AGS engine Android port
Post by: JJS on 24 Jul 2013, 19:52
Thanks for testing the build! Sounds very promising. Implementing button combinations (Alt-X, etc.) is a bit difficult, so it won't happen too soon I think.

The build also has some sort of gamepad support in that two buttons are mapped to left click and right click, MENU is mapped to the "select" button and ESC to the "start" button. Wiggling the analog stick around should also move the mouse cursor, but that doesn't work right yet.
Title: Re: AGS engine Android port
Post by: QuestingHero on 24 Jul 2013, 19:58
I didn't even try the controller when I was testing (because I was focused on the mouse). this is VERY Promising , and am very excited about it. Any idea what button "start" would be on the ouya controller? looks I'll have something to play with later.

Will these feature be merged in to the normal build? and would it be a check box in the settings to enable?
Title: Re: AGS engine Android port
Post by: JJS on 24 Jul 2013, 20:24
I will push these changes to the repository, so they will be in the normal builds. I guess mouse and joystick support could be always on.

From the looks of it, the OUYA controller does not feature a start or a select button. Strange design decision.
Title: Re: AGS engine Android port
Post by: cianty on 25 Jul 2013, 09:12
@QuestingHero: Yeah, I did go with bluetooth thanks to you. As I have never used one before I didn't want to spend too much on it. Here's the Amazon link (German):
http://www.amazon.de/gp/product/B005ORZDTC/ref=oh_details_o00_s00_i00?ie=UTF8&psc=1

Regarding Start/Select on the OUYA, in the SNES emulator that I have played a lot with recently Select and Start are mapped on the joystick buttons: You can press on the two joysticks to trigger them.

Here's a description of the controller and its buttons:
https://devs.ouya.tv/developers/docs/controllers

UPDATE: So I got my new mouse and it's great! However, true controller support definately be way more convenient as you wouldn't have to switch devices (you can't fully naviagte the OUYA menus with a mouse only). Also I'm having problems with having a proper surface to place the mouse when sitting on the couch. A proper controller where the joystick(s) caused the mouse to move would be way cooler.

Also, would it be possible to have the d-pad trigger the arrow keys? This would mean auto support for all games that have character movement based on arrow keys (in addition to clicking).
Title: Re: AGS engine Android port
Post by: cianty on 27 Jul 2013, 19:09
Ok, I have everything set up and can debug the app directly on the OUYA. Now I wanted to add check e.g. KeyEvent.KEYCODE_DPAD_RIGHT and then pass the respective ARROW_RIGHT key code to the engine. However, I have no idea what value to use here. The idea was to use glue.keyboardEvent() but what value would be right for the arrow keys? I don't quite get where the 0x1000 + 47 mapping for F1 e.g. comes from, either. Do you have any hints for me, JJS?

UPDATE: Nevermind. I have found the keycodes at http://alleg.sourceforge.net/a5docs/refman/keyboard.html. Unfortunately ESC doesn't work though, it is recognized as F1 in the engine. I'll keep looking...
Title: Re: AGS engine Android port
Post by: DazJ on 29 Jul 2013, 17:27
Do we have an update yet on being able to convert our games into APKs ourself? :)
Title: Re: AGS engine Android port
Post by: cianty on 29 Jul 2013, 19:08
I think the question is what "ourself" means here.

If it means that you don't want to install Eclipse/IntelliJ, setup the development environment, create a key to sign your APK - then I don't think there is any way you can get a "yes" here.

I see AGS and the various ports like those cross-platform tools/libraries for web apps such as Cordova/PhoneGap: You can create your entire game in AGS like you would create a web app using web standards (JS, CSS, HTML), and when you want to create "native" applications using this same core then you need the respective development environment to compile for the target OS. There is no way you can ever hope to just dump your AGS game into a pre-existing Android/iOS shell and end up with a mobile app.

The entire point of the Android keys e.g. is to allow backtracking of the APK file to the creator.

What is very well feasible however is to provide the community with an environment that can be easily set-up so that any AGS creator can compile their own APK version of their AGS game. JJS had done tons of work in that direction and it is really not too difficult (even with limited programming knowledge) to fork the GitHub repository, download and install Eclipse with Android SDK and NDK and compile the whole thing. Still there are two necessary things to do first: 1) A single-game-only launcher would be needed instead of the Emulator type of thing which JJS has done and 2) a few more bugs and problems with engine as a whole would need to be solved before giving the entire port a "go" for production. I think because of the latter JJS would be very hesitant to advocate using the port for proper releases yet.

The single-game-launcher is not too difficult. I will probably try myself at that, but currently I am working on a keyboard control that works both with keyboard and the OUYA controller.

If you have a single game that you want to support (and if it doesn't go crazy with "unconventional" stuff like large resolutions e.g.) that I can see it very doable to test and finish off the port for Android AGS games. I wouldn't be surprised to see Wadjet do so in short time (although Blackwell on iOS would probably be way more profitable than tackling Android now).

I wonder what JJS thinks of all this...  :smiley:
Title: Re: AGS engine Android port
Post by: DazJ on 30 Jul 2013, 18:23
Thanks. We've brought this up a few times and we've been told that it's being worked on, that's why I just asked for an update.
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on 01 Aug 2013, 06:41
You are rocking these builds, JJS.  I've got to load one of my games in on the latest version and see how it works now.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 03 Aug 2013, 15:04
Thanks. We've brought this up a few times and we've been told that it's being worked on, that's why I just asked for an update.

Tbe problem with building your APK is that the Android port needs to be re-done a little. And I mean that the interface needs to be reworked to allow that a little. Right now it pulls up a list of games. There would need to be a specialized version of the port that can read the directory where the games files will be stored. Moving on to that issue though... Google only allows up to 50mb for the main file. While several games are under that, there are many that are not. You would need to provide expansion files, which you can have up to 2 expansion files of 2 gb each. While thats nice, it requires a heck of a lot of setup/coding. Obb files in theory are not difficult to create and to code into an app. However, for me anyway, there isn't a lot of documentation that makes using obb files easy. Just so I can explain a little bit about how the OBB expansion files work:

1)For the main APK, you need to sign the file.
2)You need to program into the app to check to see if expansion files exist and if they do:
2b) AGS will need to extract the files into the OBB directory (Which should be done automatically)
2c) AGS would either need to move those extracted files to wherever AGS will load the game from or point the game directory to the OBB directory.
3) You have to get some salt/hash security for the expansion files. So to do that, you would have to:
3b) Upload the android apk and the Expansion files to the google market server and not publish it.
3c) Take down the Salt/Hash code and download location/name.
4) Now, you would have to put some code that would allow access to the OBB file from within AGS. I think this is all done to avoid abusing the system. Whatever.
5) After that you would think you are all set... However, while OBB files should download automatically when you are installing the apps, it doesn't always. Sooooo... You would have to program within AGS to check that the obb files downloaded completely and fully. If they did not, then AGS would have to download it itself. Enter the salt/hash/download name crap.

Now, to integrate this into AGS itself is another issue too. The AGS Editor would have settings and such to take care of that (such as package name, author, etc...). AGS would also have to create the OBB Files itself as well as all they really are are zip files within the obb extension. Thats not the hard part. The hard part is making sure that the developer has the Java SDK and the Android SDK installed properly and with the environment properties set up correctly. The reason for that is so that AGS can package the game files properly into the APK and also so that it can automatically sign the APK for you. That is possible, but its a little extra work I would imagine for whoever is coding the editor. But its doable. Eclipse does it and so does Basic4Android. However, the steps for getting the HASH/Salt/Name from the google server will still be up to the game developer and that can prove to be confusing for a few people.

So it may seem like a simple Shell interface would be needed, but its a lot more complicated than that. While I develop Android Apps, I use Basic4Android and it does not currently support OBB Extensions. If it did, I would be all over making a 3rd party set up system for the APK's. If you all need it urgently, go ahead and post on the Basic4Android forums and request it to be added. Right now the developer does not see a need for it, so maybe if enough ask for it, it will be implemented. I would do this in Java, but I know very very little Java. If someone would want to take a whack at trying to implement this system, here are a few good places to start:

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CDAQFjAA&url=http%3A%2F%2Fdeveloper.android.com%2Fgoogle%2Fplay%2Fexpansion-files.html&ei=DA39UcP3FpW44AOIu4CgCA&usg=AFQjCNGEPm1MCiQTv-aEKoUJeamBR4eHwQ&sig2=_7uMjtYp_lCPxPTkG7uUcA&bvm=bv.50165853,d.dmg

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CDcQFjAB&url=http%3A%2F%2Fankitthakkar90.blogspot.com%2F2013%2F01%2Fapk-expansion-files-in-android-with.html&ei=DA39UcP3FpW44AOIu4CgCA&usg=AFQjCNFNm1VserLL-cIzaL7zRcPv7k3ZVg&sig2=E2JdB-it5adb71NmvLB8ZA&bvm=bv.50165853,d.dmg

http://labs.exoa.fr/tutorial-unity-4-apk-splitting-google-play-obb/


http://stackoverflow.com/questions/11715855/steps-to-create-apk-expansion-file

This was my suggestion thread on Basic4Android if someone wants to pipe in and add to the suggestions:
http://www.basic4ppc.com/android/forum/threads/wishlist-lib-obb-and-expansion-pack-downloads.29827/

Hope this info helps.
Title: Re: AGS engine Android port
Post by: JanetC on 22 Aug 2013, 21:44
I was just looking at the process for porting our games to Android and wow, I found out pretty much what you say, Joseph, only I only got half way there! It looks pretty near impossible to do commercial games on Android :(

I was thinking it'd be as simple as the iOS build (which was basically changing some file names here and there) but it really is not.
Title: Re: AGS engine Android port
Post by: DazJ on 23 Aug 2013, 12:24
So there idea of official Android releases of our products isn't going to possible?

I'm guessing I'd have to hire someone to create the APK for me then.
Title: Re: AGS engine Android port
Post by: Jonathan Wedge on 24 Aug 2013, 06:10
JJS quick question, would it be possible for some to come to you with their game, then you could take that game and the AGS apk and sorta merge it into one APK. the APK from the way I'm thinking of it would be like a zip folder or a burnable CD where the files are stuck inside that APK. Now the way it'd work is that you would change the AGS app to automatically open up that game instead of given the option to choose. Sorry if you find what I said confusing, I'm just really sleepy and I can't process a simpler way of asking my question.
Title: Re: AGS engine Android port
Post by: DazJ on 26 Aug 2013, 12:38
Did you ever manage to find a work around for the stuttering OGV video playback issue? I've tried it on multiple devices and even encoded the video in different resolutions but the issue is still the same unfortunately.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 26 Aug 2013, 12:56
So there idea of official Android releases of our products isn't going to possible?

I'm guessing I'd have to hire someone to create the APK for me then.

No, it is possible. It is very possible. But its a lot of work and it may even take some time. Basic4ppc and Age.seccia.com have it in their apps and they seem to have done it quite nicely. And I can easily create an APK from scratch for games under 42mb. The problem is if the game gets larger. The .OBB files is an issue. But, as it stands right now, you can easily convert the Android launcher port to keep a game under 42mb within it and play it easily. Again, that is assuming you know how to compile for Android in the first place. If JJS could figure a way to factor in OBB files and create a launcher that launches only one game and if one of our windows developers can integrate a  packaging system in the editor, then the whole thing would be possible and would require fewer updates in the future. Then again, it would just be nice if Google allows one file type to be over the limit. That would solve the issue completely.
Title: Re: AGS engine Android port
Post by: DazJ on 26 Aug 2013, 14:47
So there idea of official Android releases of our products isn't going to possible?

I'm guessing I'd have to hire someone to create the APK for me then.

No, it is possible. It is very possible. But its a lot of work and it may even take some time. Basic4ppc and Age.seccia.com have it in their apps and they seem to have done it quite nicely. And I can easily create an APK from scratch for games under 42mb. The problem is if the game gets larger. The .OBB files is an issue. But, as it stands right now, you can easily convert the Android launcher port to keep a game under 42mb within it and play it easily. Again, that is assuming you know how to compile for Android in the first place. If JJS could figure a way to factor in OBB files and create a launcher that launches only one game and if one of our windows developers can integrate a  packaging system in the editor, then the whole thing would be possible and would require fewer updates in the future. Then again, it would just be nice if Google allows one file type to be over the limit. That would solve the issue completely.

Cheers for the information, Joseph.

It would be a great help if we had a simple guide on how to compile our projects as an APK just so we could experiment. Do you know where I could find one?
Title: Re: AGS engine Android port
Post by: Jothie on 01 Sep 2013, 10:07
I'm loving this app on both my tablet and ouya.  Thank you so much for making it. 

Edited: ignore the original request that was edited out as it seems to be a problem with Ouya and usb, not with the app.
Title: Re: AGS engine Android port
Post by: Manul on 01 Sep 2013, 18:06
Just wanted to drop in to say thanks to JJS for this awesome port. I have just installed it on both my Nexus 4 and my Nexus 7 and while I haven't actually played a game on them yet, first impressions are really good.

One small anecdote aside: When I first tried it out on my phone, I found it almost unusable since I couldn't see what was under my finger and thus under the mouse pointer. I thought about possible improvements to the interface and was just about to register here to suggest something - and then I discovered relative mode which was almost exactly what I had come up with. ;)

There's one possible change/addition to it which I'd like to offer for discussion. How about handling single taps in two different ways:
I think this might just work and make gameplay even more convenient. What are your thoughts?
Title: Re: AGS engine Android port
Post by: DazJ on 06 Sep 2013, 09:57
Did you manage to fix the OGV video stuttering issue? They're only 640x480 videos and stutter on all devices I've tried it on. Is it to do with the fact that the video contains audio?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 06 Sep 2013, 10:00
Did you manage to fix the OGV video stuttering issue? They're only 640x480 videos and stutter on all devices I've tried it on. Is it to do with the fact that the video contains audio?
Does it stutter when the game is run on PC? I am interested to know if this is a general behavior, or happens only with Android port.
Title: Re: AGS engine Android port
Post by: DazJ on 06 Sep 2013, 14:20
It runs fine on the PC, even runs fine with the OGVs at 1080p. But any size OGV on Android stutters and crawls its way through. This happens on multiple devices.
Title: Re: AGS engine Android port
Post by: JJS on 06 Sep 2013, 17:16
In the options menu, did you try with different settings for "Drop frames if necessary"? If this is not checked, every frame will be displayed regardless of speed. If checked, frames will be skipped according to the video speed if the processor is too slow to display them all. I had added that option because slow devices might skip all frames of a video because they lag behind from the beginning.

There is also no hardware acceleration for the video decoding, so a large video will not play smoothly.
Title: Re: AGS engine Android port
Post by: DazJ on 07 Sep 2013, 09:24
Yes I've tried all the settings and it makes no difference.
Title: Re: AGS engine Android port
Post by: Manul on 20 Sep 2013, 15:23
There's one possible change/addition to it which I'd like to offer for discussion. How about handling single taps in two different ways:
  • If it's in the general vicinity of the cursor, i.e. in a relatively small circle (maybe make that configurable) around it, treat them as left clicks.
  • Otherwise move the cursor to where the screen was tapped.
I think this might just work and make gameplay even more convenient. What are your thoughts?

I hope it's okay to bring this up again: I have just played through Rebirth, The Reaper and Ben Jordan 1 on my Nexus 7 and must say I think this would actually be very convenient at least on larger screens/tablets. Moving the cursor across the whole screen is a bit tedious.

I had a look at the Android source to see whether I could try it out myself but couldn't figure out where the distinction between the different mouse modes is made in the actual code. Any hints in that direction would be greatly appreciated.

Another thing: Would it be possible to include some more keys in the keys menu? Ben Jordan e.g. uses Ctrl-T to toggle subtitles and I couldn't figure out a way to do that on my Nexus.
Title: Re: AGS engine Android port
Post by: .M.M. on 01 Oct 2013, 14:38
With a great help from JJS, I've made Android game using the AGS engine Android port. For more info, look here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=49077.0
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 01 Oct 2013, 16:11
I purchased the game to give you some support. Will check it out later.
Title: Re: AGS engine Android port
Post by: .M.M. on 02 Oct 2013, 21:56
I purchased the game to give you some support. Will check it out later.
Thanks, I hope you'll like it! Also, I'd be very happy for any feedback - everything, even if this type of game is something people enjoy playing on Android devices: I have an idea for my next RPG and I haven't decided yet whether make it for Android or not.
Title: Re: AGS engine Android port
Post by: sektor666 on 03 Oct 2013, 12:17
i'm having trouble running The Blackwell Legacy and Blackwell Convergence on the AGS android port. the games show on the list, but when i try to run them, i get the 'unable to find main data file' error. i had the same problem with blackwell unbound, but it started working after i renamed the .exe to ac2game.dat. i can't do it with the other two, because they already have ac2game.dat in their directories, apart from the game executable. i'm guessing maybe they were compiled using an unsupported version of the AGS editor. so is there any workaround or any way to recompile them using a newer editor version?
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 03 Oct 2013, 14:23
Try deleting the executable file. Actually, make a backup, then delete it and try running it again. The engine may be confusing which to run first maybe?
Title: Re: AGS engine Android port
Post by: sektor666 on 03 Oct 2013, 15:58
Try deleting the executable file. Actually, make a backup, then delete it and try running it again. The engine may be confusing which to run first maybe?

no joy. deleting the executable makes the game disappear from the games list.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 03 Oct 2013, 16:07
i had the same problem with blackwell unbound, but it started working after i renamed the .exe to ac2game.dat. i can't do it with the other two, because they already have ac2game.dat in their directories, apart from the game executable.
This means one of the files is excessive. You need either EXE, or ac2game.dat. If the launcher expects exe, then delete ac2game.dat instead. Anyway, there's no sense in having both of them there.
This does not explain why engine cannot find the game file... unless their format is corrupted, or similar. Frankly, I have no idea right away.

BTW, which version of AGS Android port are you using (or which date of build)?

i'm guessing maybe they were compiled using an unsupported version of the AGS editor. so is there any workaround or any way to recompile them using a newer editor version?
These games are old, and there were not any other editor versions aside from official ones back then, so I doubt that is a reason.
Title: Re: AGS engine Android port
Post by: sektor666 on 03 Oct 2013, 18:25
okay, so deleting one file makes the game disappear from the list, and deleting the other just makes the same error come up again on launch. i'm using the latest revision of the ags engine (2013-08-25), and the game runs correctly on my pc, so i'm not sure what could be corrupted...
Title: Re: AGS engine Android port
Post by: monkey0506 on 04 Oct 2013, 06:06
What are the respective file sizes of the EXE and DAT files? They shouldn't both be valid unless the games are for some reason storing their own external data in "ac2game.dat". I'm doing a fresh install of both games from Steam, but there's no ac2game.dat file for either in the game's repositories. Obviously that wouldn't indicate if the games are for some reason creating the file. Where did you obtain the games? Perhaps a fresh install (while saving any "agssave.*" files) would resolve the issue?

I'll take a look at running them once I have them downloaded (which will be quite a while).



@JJS: I've heard of multiple reports of Theora videos running slowly across several devices. I know literally nothing about how this works, but is there any way to better determine the reason for this slowdown? I did quite a bit of searching, but I came up basically empty handed. I did read that a conversion from YUV to RGB colorspace is a big bottleneck for Theora, but I wouldn't know where to look to try and do anything about that.
Title: Re: AGS engine Android port
Post by: sektor666 on 04 Oct 2013, 12:26
i can't quite remember when i got each of the games, since they have been sitting on my drive for a while now. iirc i bought legacy directly from wadjet, and then i got the rest from a humble bundle. i'd have to seach through my mail. i think those versions might be different from the steam version.
anyway, the .dat is significantly larger than the .exe (18 mb vs 2 mb), but deleting the .exe doesn't remedy the error. i also tried renaming it to .ags, but it didn't help either.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 04 Oct 2013, 12:32
anyway, the .dat is significantly larger than the .exe (18 mb vs 2 mb), but deleting the .exe doesn't remedy the error. i also tried renaming it to .ags, but it didn't help either.

Hmmm, I am getting an impression that I did not understand situation quite enough, and we were talking of different things.
2 mb is the size of the pure AGS engine, without any game. How this exe was called originally (and where did you get it)?

EDIT: Maybe rename ac2game.dat into Blackwell**whatever.exe instead? If Android port looks for "exe" only, that might do the trick.
EDIT2: Erm... actually ignore what I say here. I might not know very well how Android launcher works.
Looking in its code, it seems that it SHOULD find ac2game.dat too...

By the way, the latest versions of the Windows engine (since April 2013 IIRC) do not require you rename games into ac2game.dat, they may detect games in their original form (something.exe).

Title: Re: AGS engine Android port
Post by: monkey0506 on 04 Oct 2013, 12:58
Is it possible that the original EXEs had some form of DRM or something applied? Of course... whether with or without the Windows executable attached, the Android engine is still capable of finding the games. I'm not sure what else to say, if the game is running on Windows. Hmmm... Maybe if you contact Dave he could shed some light on how these games were compiled?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 04 Oct 2013, 13:15
Is it possible that the original EXEs had some form of DRM or something applied? Of course... whether with or without the Windows executable attached, the Android engine is still capable of finding the games.
Can it? I thought it was looking for PE signature at the file's header?
Look for "isAgsDatafile" in the port's code.
Title: Re: AGS engine Android port
Post by: monkey0506 on 04 Oct 2013, 14:15
Well...without looking at the source code I can tell you that I have been using a hex editor to strip the first ~1.7 MB off of AGS (Windows) EXEs (up to the point where it says "PADDINGXXPADDINGXX...CLIB", leaving the CLIB in-tact). The engine is able to find these files just fine. It was my understanding that this is the Windows engine, plus padding (for alignment, presumably?), and then the game data.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 04 Oct 2013, 14:28
To clarify, is it the launcher or the engine that found them?

Engine efficiently detects if the file contains AGS data, either stand-alone or attached to exe.
I am not sure if Android launcher does the same. I think it checks whether the file contains traces of being originally created as "acwin.exe" (and to check that it requires the file to have PE header).

Thing is, I suspect that in the sektor666's situation the launcher cannot detect the real game data (ac2game.dat) because it had its executable part cut off, and, although it detects another file (2mb exe) and lets to run it, the engine cannot use that file, because it does not actually have a game data inside.
Title: Re: AGS engine Android port
Post by: monkey0506 on 04 Oct 2013, 15:39
Ohhhh. Yes, that makes sense now. ;) My bad. I had assumed (http://www.cad-comic.com/cad/20030306) that the engine library and the launcher app would be detecting game files the same way. Clearly that's not the case. Maybe they could use a hex editor to append (rather, "prepend") acwin.exe onto a copy of ac2game.dat and see if the launcher finds and runs that?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 04 Oct 2013, 17:14
Maybe they could use a hex editor to append (rather, "prepend") acwin.exe onto a copy of ac2game.dat and see if the launcher finds and runs that?
Maybe... the engine does not care what is prepended to file it was pointes to, all it needs is to find certain tags at the beginning or at the end of file.

I do not know why JJS did the launcher this way. Unless Android imposes restrictions on what actions can Java program do with binary files in the game's folder, the better way would be to just do same checks: there must be either "CLIB" at file's start, or "CLIB\x1\x2\x3\x4SIGE" at the end.
(FYI: what is '\x' character in C-string (http://stackoverflow.com/questions/2547349/what-does-x-mean-in-c-c))


PS. In hex :)
Start:  43 4C 49 42
End:    43 4C 49 42 01 02 03 04 53 49 47 45
Title: Re: AGS engine Android port
Post by: sektor666 on 05 Oct 2013, 23:08
okay so... i got them working. i don't know what was the issue exactly, but i suspect that it might've been caused by installing the bundle versions over the retail ones, with some files being redundant. i deleted them completely and reinstalled from the bundle setup, and there are no ac2game.dat files in any of the game directories, just the exes. and now they work correctly (well apart from recurring random crashes, but i understand that's just something i have to deal with when using the android port), so it must've been a messed up installation.
Title: Re: AGS engine Android port
Post by: monkey0506 on 06 Oct 2013, 05:17
recurring random crashes, but i understand that's just something i have to deal with when using the android port

This really shouldn't be the case, but there are a lot of reports of these random crashes on Android. I'm trying to narrow it down, but I'm highly suspicious that it has to do with the OpenGL implementation used by the hardware renderer.
Title: Re: AGS engine Android port
Post by: sektor666 on 06 Oct 2013, 11:29
if it's of any help, they usually happen to me during dialogues, especially if i start skupping characters' slines
Title: Re: AGS engine Android port
Post by: DjCzermino on 06 Oct 2013, 12:35
Hi, sorry but I dont understand the manual in file https://github.com/adventuregamestudio/ags/blob/master/Android/README.md (https://github.com/adventuregamestudio/ags/blob/master/Android/README.md)

There is text:
Adding games to the game list

By default games have to be placed into the external storage device. This is usually the SD-card, but this can vary.
Place the game into the directory

<EXTERN>/ags/<GAME NAME>/

is what will be displayed in the game list.



So, i downloaded compiled AGS engine port for android from here:
http://jjs.at/daily/ (http://jjs.at/daily/)
..and intalled on my Android mobile phone.

But I dont know - what i have to put in my folder sdcard/ags? I have simple testing game "mygame" created in AGS 3.2.1 for Windows.

What I have to put to this folder?  Whole game or compiled EXE ?

Please, can someon specify what to do to run the game on Android step by step? Thank you!
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 06 Oct 2013, 14:17
What I have to put to this folder?  Whole game or compiled EXE ?

Same as with running the game on Windows, you need all relevant files.
If we are speaking about game that you have created, it is usually all files that appear in "Compiled" folder after you command to build the game in the Editor.
If we are speaking about other people's games that you've downloaded: if it was a common archive (zip or else), just copy all the contents of the package; if it was an installation program, install the game, then copy everything from the place where you installed it.
Title: Re: AGS engine Android port
Post by: DjCzermino on 06 Oct 2013, 18:08
What I have to put to this folder?  Whole game or compiled EXE ?

Same as with running the game on Windows, you need all relevant files.
If we are speaking about game that you have created, it is usually all files that appear in "Compiled" folder after you command to build the game in the Editor.
If we are speaking about other people's games that you've downloaded: if it was a common archive (zip or else), just copy all the contents of the package; if it was an installation program, install the game, then copy everything from the place where you installed it.

Thank you for your reply. My game works! :)

I have another question - can I create ONE-PACKAGE-GAME?
I want that somebody can download my "game" for Android in one-package (engine+game) and run it by "one click"?
Title: Re: AGS engine Android port
Post by: monkey0506 on 06 Oct 2013, 20:50
It's definitely possible to create a stand-alone app. There was recently a game released in the Play store that does that. It's also something I'm working on. I'm trying to sort out the cause for some of the major issues with the Android port before I release anything.

If your game is over about 42 MB then you'll have to sort out a way of utilizing the expansion OBB files.
Title: Re: AGS engine Android port
Post by: land.of.adventure on 29 Oct 2013, 15:08
Hi everyone, particularly JJS and co.

My question concerns the 'breath' feature in Gemini Rue.

As this issue has been put forward in the past, I wonder if there has been any resolution for it: Being able to breath during the gunfight sequences.

I have looked at the bug log on mantis bug tracker, listing similar experiences with other users when attempting to play Gemini rue on their respective android devices.

I also took into consideration the following post on this forum by user zdj:
Quote
"Found a work around for those stuck on the gun training part of Gemini Rue due to the ctrl key issue:
1. Open the game menu by pressing back button
2. Press "keyboard" button.
3. reassign breathe action to the '6' key
4. Resume the game and you can now perform breathe by pressing the 'f' key on the on screen keyboard.

I stumbled upon this by accident and have no idea why it works but it does on my Galaxy S3. I don't know if it works on other phones. "

So far, I have attempted this on my Galaxy S4 but no success.
I have also attempted to map the breath key from 'ctrl' to other letters of the alphabet but am experiencing no success.
My last attempt was with a usb keyboard plugged through an otg cable to my S4. No success.

If there has been a resolution, I would love to hear about. If work is pending then great.

Many thanks

LOA

ps: Gemini Rue version 2.0.0.5 from GOG
AGS Apk is AGS_2013-10-24_16-22-13.apk from jjs' site.
Title: Re: AGS engine Android port
Post by: davoker on 29 Oct 2013, 18:42
Hello, I have problems setting games Castilian, Castilian language in WinSetup wear, but when I run it on my tablet, the game always comes out in English;

As I can do to make you change the language, if I have put Castilian default?

Example: Maniac Mansion Deluxe - has multiple languages, select "Castilian" with WinSetup, keep the changes and copy the game to the tablet, I run in and out in English :S

thanks

P.S: translated with google, sorry

Edit:
fixed hehe thx
Title: Re: AGS engine Android port
Post by: land.of.adventure on 31 Oct 2013, 13:04
Well, in response to my own original post on this thread, I would like to state that the suggestion made by user zdj DOES actually work.

I made the error of attempting to breath while ducked behind cover. By the time I had plugged in the keyboard (via otg), the original ctrl settings had booted up (from my earlier gemini rue save)

So, to clarify for anyone else who wishes to 'breath' in Gemini Rue on an android device (mine specifically being a samsung galaxy S4), I suggest using zdj's advice of doing the following (my own additions included)

1. Open the game menu (by hitting the back button
2. Hit the keyboard button in the menu (assuming your copy of Gemini rue has that feature, earlier copies lacked keyboard key remapping)
3. Reassign the 'breath' fuction from ctrl to the number 6
4. Return to the game and when prompted to breath during the game, step out of cover (so that you are now aiming at your target) and tap the 'F' key to breath, not 6!

And that is your (current) solution. So far, I guess neither zdj or myself know the reason why this works.
Additional note: This is confirmed working on zdj's Galaxy S3 and on my Galaxy S4.

Enjoy friends and I look forward to AGS developing further for Android.

LOA

Hi everyone, particularly JJS and co.

My question concerns the 'breath' feature in Gemini Rue.

As this issue has been put forward in the past, I wonder if there has been any resolution for it: Being able to breath during the gunfight sequences.

I have looked at the bug log on mantis bug tracker, listing similar experiences with other users when attempting to play Gemini rue on their respective android devices.

I also took into consideration the following post on this forum by user zdj:
Quote
"Found a work around for those stuck on the gun training part of Gemini Rue due to the ctrl key issue:
1. Open the game menu by pressing back button
2. Press "keyboard" button.
3. reassign breathe action to the '6' key
4. Resume the game and you can now perform breathe by pressing the 'f' key on the on screen keyboard.

I stumbled upon this by accident and have no idea why it works but it does on my Galaxy S3. I don't know if it works on other phones. "

So far, I have attempted this on my Galaxy S4 but no success.
I have also attempted to map the breath key from 'ctrl' to other letters of the alphabet but am experiencing no success.
My last attempt was with a usb keyboard plugged through an otg cable to my S4. No success.

If there has been a resolution, I would love to hear about. If work is pending then great.

Many thanks

LOA

ps: Gemini Rue version 2.0.0.5 from GOG
AGS Apk is AGS_2013-10-24_16-22-13.apk from jjs' site.
Title: Re: AGS engine Android port
Post by: Creator on 18 Nov 2013, 10:04
Sorry to post, again, another "it doesn't work" help requests, but I can not for the life of me get my game to show up.

EDIT - I now get the game to show up, but I get "script link failed: Runtime error: unresolved import 'Character::ChangeRoom^4'. I don't get this error on Windows though.
EDIT 2 - I got another game to work however. I guess there's something in my scripts that makes it stuff up. I do have the keyboard movement module in the first game I tried, maybe that's it?
EDIT 3 - Actually, with all games except one this happens, regardless of how many modules I have. :/

I downloaded the latest engine from the link in the OP and installed it on my phone (Galaxy Note 3). When I put my game (.exe, winsetup and acsetup.cfg) on the SD card (I make a folder in there called ags, then another folder in that which mirrors my game's name) and run the app, it says there's no game installed in "storage/emulated/0/ags". I even created folders mimicking that and can't get the games to show up.
Title: Re: AGS engine Android port
Post by: monkey0506 on 18 Nov 2013, 19:48
AFAIK, "Character::ChangeRoom^4" is from the Draconian build, which adds an extra parameter to Character.ChangeRoom, isn't it?

Games built with the Draconian engine (or probably most any other modified engine) will not work with this engine. I believe there are some plans to include some of Drake's work in the official builds, but you'll have to actually compile the game with either AGS 2.5-3.2.1 or this 3.3.0 engine.
Title: Re: AGS engine Android port
Post by: Creator on 18 Nov 2013, 22:29
Ah, damn. You're 100% correct, monkey. I'm using the draconian edition because I like the black background in code. Oh well, no biggie. I'll get a vanilla version and try it when I'm back on my PC.

EDIT - Yep, as you said. Compiled them with AGS 3.2.1 and it's fine.
Title: Re: AGS engine Android port
Post by: ner0 on 14 Dec 2013, 13:01
Hello, I have problems setting games Castilian, Castilian language in WinSetup wear, but when I run it on my tablet, the game always comes out in English;

As I can do to make you change the language, if I have put Castilian default?

Example: Maniac Mansion Deluxe - has multiple languages, select "Castilian" with WinSetup, keep the changes and copy the game to the tablet, I run in and out in English :S

thanks

P.S: translated with google, sorry

Edit:
fixed hehe thx
You should really read the Readme for this great app: https://github.com/adventuregamestudio/ags/blob/master/Android/README.md
Open AGS on your device and once at the game list, touch and hold (longclick) the game you want to configure then select "Preferences".
In your game preferences just change the "Game language" and you're all set.
Title: Re: AGS engine Android port
Post by: Gribbler on 30 Jan 2014, 19:41
Quote from: Dj Czermino
Hi, sorry but I dont understand the manual in file https://github.com/adventuregamestudio/ags/blob/master/Android/README.md

There is text:
Adding games to the game list

By default games have to be placed into the external storage device. This is usually the SD-card, but this can vary.
Place the game into the directory

<EXTERN>/ags/<GAME NAME>/

is what will be displayed in the game list.


So, i downloaded compiled AGS engine port for android from here:
http://jjs.at/daily/
..and intalled on my Android mobile phone.

But I dont know - what i have to put in my folder sdcard/ags? I have simple testing game "mygame" created in AGS 3.2.1 for Windows.

What I have to put to this folder?  Whole game or compiled EXE ?


I have similar problem. I have a SD Card (named "Card") and created folder named "ags". In it I created various subfolders for a few ags games. Now, when I run AGS app on my Android phone it requires destination folder for a game. So I tried /Card/ags/ but with no luck.
I also tried:

/Card/ags/Gray
/Card/ags/Heroine's Quest
/Card/ags/Samaritan Paradox Demo
/Card/ags/The Bum

Doesn't work either.

Each game folder contains unzipped files or all the files from their "Compiled" folder. What exactly am I doing wrong?

Sorry if those are noob questions but I'm totally new to file managing on mobiles.



Title: Re: AGS engine Android port
Post by: Gribbler on 30 Jan 2014, 20:12
Nevermind previous post, guys. I found the solution :)
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 08 Feb 2014, 19:58
I just tried to compile the engine using the Android NDK and I received the following error:

Code: Adventure Game Studio
  1. "Compile++ arm  : agsengine <= acpland.cpp
  2. jni/../jni/../../../Engine/platform/android/acpland.cpp: In function 'void selec
  3. tLatestSavegame()':
  4. jni/../jni/../../../Engine/platform/android/acpland.cpp:542:37: warning: compari
  5. son between signed and unsigned integer expressions [-Wsign-compare]
  6. jni/../jni/../../../Engine/platform/android/acpland.cpp: In static member functi
  7. on 'static AGSPlatformDriver* AGSPlatformDriver::GetDriver()':
  8. jni/../jni/../../../Engine/platform/android/acpland.cpp:767:31: error: cannot al
  9. locate an object of abstract type 'AGSAndroid'
  10. compilation terminated due to -Wfatal-errors.
  11. make: *** [obj/local/armeabi/objs/agsengine/platform/android/acpland.o] Error 1

Any idea's what's causing this?
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 08 Feb 2014, 20:48
BTW that is with the 3.3.0 release source code.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 08 Feb 2014, 22:49
I just tried to compile the engine using the Android NDK and I received the following error:

Code: Adventure Game Studio
  1. "Compile++ arm  : agsengine <= acpland.cpp
  2. jni/../jni/../../../Engine/platform/android/acpland.cpp: In function 'void selec
  3. tLatestSavegame()':
  4. jni/../jni/../../../Engine/platform/android/acpland.cpp:542:37: warning: compari
  5. son between signed and unsigned integer expressions [-Wsign-compare]
  6. jni/../jni/../../../Engine/platform/android/acpland.cpp: In static member functi
  7. on 'static AGSPlatformDriver* AGSPlatformDriver::GetDriver()':
  8. jni/../jni/../../../Engine/platform/android/acpland.cpp:767:31: error: cannot al
  9. locate an object of abstract type 'AGSAndroid'
  10. compilation terminated due to -Wfatal-errors.
  11. make: *** [obj/local/armeabi/objs/agsengine/platform/android/acpland.o] Error 1

Any idea's what's causing this?

There was a mistake in base class declaration, one function declared as pure virtual, although it should not be. Windows and Linux ports compiled well because they had this function overiden.
Fixed now, should work for other ports too.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 09 Feb 2014, 14:16
Still seems to persist. No rush to fix this though, I am just trying to create a Android packaging tool for AGS and am trying to see if I could compile the latest version. The error seems similar though:

Quote
jni/../jni/../../../Engine/platform/android/acpland.cpp: In function 'void selec
tLatestSavegame()':
jni/../jni/../../../Engine/platform/android/acpland.cpp:542:37: warning: compari
son between signed and unsigned integer expressions [-Wsign-compare]
jni/../jni/../../../Engine/platform/android/acpland.cpp: In function '_jstring*
Java_com_bigbluecup_android_Preferences Activity_readStringConfigValue(JNIEnv*, j
object, jint, jstring)':
jni/../jni/../../../Engine/platform/android/acpland.cpp:302:1: warning: control
reaches end of non-void function [-Wreturn-type]
"Compile arm  : agsengine <= libc.c
jni/../jni/../../../Engine/platform/util/libc.c:22:8: error: conflicting types f
or 'malloc_usable_size'
compilation terminated due to -Wfatal-errors.
make: *** [obj/local/armeabi/objs/agsengine/platform/util/libc.o] Error 1
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 09 Feb 2014, 15:59
Still seems to persist. No rush to fix this though, I am just trying to create a Android packaging tool for AGS and am trying to see if I could compile the latest version. The error seems similar though:

The error is completely different and in different place.
It was:
Quote
jni/../jni/../../../Engine/platform/android/acpland.cpp: In static member functi
on 'static AGSPlatformDriver* AGSPlatformDriver::GetDriver()':
jni/../jni/../../../Engine/platform/android/acpland.cpp:767:31: error: cannot al
locate an object of abstract type 'AGSAndroid'
compilation terminated due to -Wfatal-errors.
make: *** [obj/local/armeabi/objs/agsengine/platform/android/acpland.o] Error 1

It now is:
Quote
"Compile arm  : agsengine <= libc.c
jni/../jni/../../../Engine/platform/util/libc.c:22:8: error: conflicting types f
or 'malloc_usable_size'
compilation terminated due to -Wfatal-errors.
make: *** [obj/local/armeabi/objs/agsengine/platform/util/libc.o] Error 1
Title: Re: AGS engine Android port
Post by: GMD1984 on 10 Feb 2014, 01:54
Hi, I have experiment porting my game to AGS3.3.0 with a custom resolution fix installed.

The game ran properly on both my PC and an Android phone. (4.3 Jellybean btw, I got a warning about version different. But, it still ran on the phone.)

Then I change my game resolution from 640x400 to 1280x800. it still ran well on the PC. But, once I test it on the Android Phone.
I got this message box says

(https://dl.dropboxusercontent.com/u/4472434/Screenshot_2014-02-09-14-05-06.png)

Does it have anything to do with, maybe the AndroidPort have some graphic file/background's dimension limitation? (Maybe 1024*768 is the maximum that allowed? Just my guessing)

Thank you in advanced!
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 10 Feb 2014, 07:14
Running a custom resolutions game with 3.3.0 port won't work, at all.
First, data format has changed (because now it stores custom resolutions), and ports don't know how to read it; that's probably the cause of the error you received.
Secondly, obviously, the 3.3.0 port can't handle any resolution, only the ones defined in 3.3.0 (same as in 3.2.1).

The ports should be compiled with custom resolutions code.
Also, at the moment I don't guarantee that OpenGL driver will work properly in custom resolutions build, and it is used on mobile devices.
Title: Re: AGS engine Android port
Post by: JJS on 16 Feb 2014, 08:43
Still seems to persist. No rush to fix this though, I am just trying to create a Android packaging tool for AGS and am trying to see if I could compile the latest version. The error seems similar though:

Quote
jni/../jni/../../../Engine/platform/android/acpland.cpp: In function 'void selec
tLatestSavegame()':
jni/../jni/../../../Engine/platform/android/acpland.cpp:542:37: warning: compari
son between signed and unsigned integer expressions [-Wsign-compare]
jni/../jni/../../../Engine/platform/android/acpland.cpp: In function '_jstring*
Java_com_bigbluecup_android_Preferences Activity_readStringConfigValue(JNIEnv*, j
object, jint, jstring)':
jni/../jni/../../../Engine/platform/android/acpland.cpp:302:1: warning: control
reaches end of non-void function [-Wreturn-type]
"Compile arm  : agsengine <= libc.c
jni/../jni/../../../Engine/platform/util/libc.c:22:8: error: conflicting types f
or 'malloc_usable_size'
compilation terminated due to -Wfatal-errors.
make: *** [obj/local/armeabi/objs/agsengine/platform/util/libc.o] Error 1

What version of the NDK are you using? The declaration of malloc_usable_size changed with NDK r9 and I adapted the source here accordingly: https://github.com/adventuregamestudio/ags/commit/fe3d87c86b830c5e6d7b7e990de5ec5ef68483e7#diff-84cd350904395d756aa62ee013e17353L22
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 17 Feb 2014, 04:38
I believe I was using R9b. I just installed R9(Original) and it compiled 3.3.1 Development build with no issues. Thanks for the feedback JJS.
Title: Re: AGS engine Android port
Post by: Daeymon on 05 Mar 2014, 13:34
Game Frontends have come to Android in a big way in the last couple of months. There is Nostalgia, Gamesome and XBMC (via either the Advanced Launcher or RCB plugins). Links below if you're interested. Just like PC Frontends need command lines, Android frontends need Action Intents and I was wondering if the Android port of AGS will add these so it too can have games launched directly from a frontend.

Nostalgia - http://ouyaforum.com/showthread.php?4536-Nostalgia-Zamastyle (http://ouyaforum.com/showthread.php?4536-Nostalgia-Zamastyle) (http://ouyaforum.com/showthread.php?4536-Nostalgia-Zamastyle)

Gamesome - http://boards.dingoonity.org/android-devices/%284-0%29%28app%29-gamesome-frontend-the-first-universal-emulator-frontend-for-androi/ (http://boards.dingoonity.org/android-devices/%284-0%29%28app%29-gamesome-frontend-the-first-universal-emulator-frontend-for-androi/) (http://boards.dingoonity.org/android-devices/%284-0%29%28app%29-gamesome-frontend-the-first-universal-emulator-frontend-for-androi/)

XBMC - http://forum.xda-developers.com/showthread.php?t=2578612 (http://forum.xda-developers.com/showthread.php?t=2578612)
Title: Re: AGS engine Android port
Post by: Mehrdad on 24 Mar 2014, 08:33
I tried "The McCarthy Chronicles" By Calin yesterday.I had't stutter sound cut scene even.I run it on my cellphone(Sony Xperia Z1).That was really nice but main problem was mouse handling that wasn't calibrate with my finger.Is this problem for all of games? And isn't any trick for solve it?
Title: Re: AGS engine Android port
Post by: ROOKMAGE on 05 Apr 2014, 02:14
I'm using the AGS engine 3.3.0.1158 and I can't seem to find the apk for it. Does anyone know where the latest APK is?

EDIT: I've been looking through, and it's either that I'm always downloading the wrong file from JJS/daily, or that my android device (kindle fire) isn't supporting the latest editor/files well enough. The error message is:
"This game requires a newer version of AGS (3.3.0.1158). It cannot be run."
"Invalid file format. The file may be corrupt, or from a different version of AGS."

Which, I'm assuming means I have the wrong apk.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 05 Apr 2014, 14:59
JJS has not been on forums lately. Someone else need to make an up-to-date Android build.
Can someone help? I don't know how to do this :embarrassed:.

By the way, can someone Android savvy look at those two questions:
https://github.com/adventuregamestudio/ags/issues/143
https://github.com/adventuregamestudio/ags/issues/144
Title: Re: AGS engine Android port
Post by: ROOKMAGE on 06 Apr 2014, 01:29
JJS has not been on forums lately. Someone else need to make an up-to-date Android build.
Can someone help? I don't know how to do this :embarrassed:.

By the way, can someone Android savvy look at those two questions:
https://github.com/adventuregamestudio/ags/issues/143
https://github.com/adventuregamestudio/ags/issues/144
I'd assume it wouldn't be too hard. Anyone know the major changes in the format between 3.3.0 and 3.3.0.1158?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 06 Apr 2014, 13:35
I'd assume it wouldn't be too hard. Anyone know the major changes in the format between 3.3.0 and 3.3.0.1158?
Do you mean game data? Is knowing exact changes in format is important; isn't it just the matter of making an apk from latest source code? Sorry, I have no idea about this stuff.

The last JJS's daily build is made 24th October 2013, which probably corresponds to version 3.3.0.1146 (Beta 8). I don't know which commit exactly did he use, but maybe somewhere around bfb101bb3ad17a02b3ad45abc9fd788cf99222c 9.

Apart from checking changes in Git history, here's the history of changes as announced on forums:
Beta 9: http://www.adventuregamestudio.co.uk/forums/index.php?topic=47966.msg636471796#msg636471796
Beta 10: http://www.adventuregamestudio.co.uk/forums/index.php?topic=47966.msg636473055#msg636473055
Beta 11: http://www.adventuregamestudio.co.uk/forums/index.php?topic=47966.msg636476377#msg636476377
Beta 12: http://www.adventuregamestudio.co.uk/forums/index.php?topic=47966.msg636477012#msg636477012
Release Candidate: http://www.adventuregamestudio.co.uk/forums/index.php?topic=47966.msg636479503#msg636479503
The rest are just extra fixes.


EDIT: The error message you mentioned could only be shown if you use APK made prior to "game format 3.3.0" was introduced. This happened 26th September 2013. Probably any build later than that could run 1158 games, although there's no guarantee it will run them 100% properly, because aside from data format changes, there were feature additions that could be used (like new script functions).
Title: Re: AGS engine Android port
Post by: ROOKMAGE on 08 Apr 2014, 16:03
EDIT: The error message you mentioned could only be shown if you use APK made prior to "game format 3.3.0" was introduced. This happened 26th September 2013. Probably any build later than that could run 1158 games, although there's no guarantee it will run them 100% properly, because aside from data format changes, there were feature additions that could be used (like new script functions).
That's odd. COuld you link me to the latest APK? I've been searching all over and all of the apk's i've downloaded have errored. I think I'm using an outdated version..?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 08 Apr 2014, 17:55
EDIT: The error message you mentioned could only be shown if you use APK made prior to "game format 3.3.0" was introduced. This happened 26th September 2013. Probably any build later than that could run 1158 games, although there's no guarantee it will run them 100% properly, because aside from data format changes, there were feature additions that could be used (like new script functions).
That's odd. COuld you link me to the latest APK? I've been searching all over and all of the apk's i've downloaded have errored. I think I'm using an outdated version..?

The latest APK I see on jjs/daily is of 24th October 2013: http://jjs.at/daily/AGS_2013-10-24_16-22-13.apk
I cannot tell what program state was it built with, but if it really used the engine from 24th October, then it should be able to run 3.3.0.1158 games (although you will get a different warning message).
Still it will be more correct to create a new apk...
Title: Re: AGS engine Android port
Post by: ROOKMAGE on 08 Apr 2014, 19:59
No luck. The game won't launch :/

Speaking of which, is there any way to easily downgrade the version of AGS your game is currently using?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 08 Apr 2014, 20:08
No luck. The game won't launch :/
IIRC there should be a log file written to the engine's directory. I am not sure how that works on Android, but maybe it's there. If it is, can you check the very first lines of text there (should say something like "Adventure Game Studio Interpreter, ACI version A.B.C.DDDD")? That will be useful to know, if possible, what version of engine this APK actually is.

Speaking of which, is there any way to easily downgrade the version of AGS your game is currently using?
Generally - open in the previous version of the AGS Editor and save project. But this will fail to load automatically, because of slightly different project format. I think it's possible to convert project file (Game.agf) by manual edit (it is plain XML).
By the way, which version of the editor do you use for your game? Is it the official 3.3.0 release, or some "experimental" build?
Title: Re: AGS engine Android port
Post by: ROOKMAGE on 08 Apr 2014, 23:54
It should be the official 3.3.0.1158, I got it from the main page.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 09 Apr 2014, 08:07
There are build instructions for Android on github. I may try to build an up-to-date APK, but this will take some time, because I never did that before.
Title: Re: AGS engine Android port
Post by: ROOKMAGE on 09 Apr 2014, 13:49
Alright. Thanks, wish I knew more about android and AGS engines so I could help :P Good luck!
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 09 Apr 2014, 20:43
If you give me till tomorrow I will make a new build for you.
Title: Re: AGS engine Android port
Post by: ROOKMAGE on 10 Apr 2014, 15:03
Oh, ok. Sweet. Thanks!
Title: Re: AGS engine Android port
Post by: km3k on 15 Apr 2014, 18:47
EDIT: The error message you mentioned could only be shown if you use APK made prior to "game format 3.3.0" was introduced. This happened 26th September 2013. Probably any build later than that could run 1158 games, although there's no guarantee it will run them 100% properly, because aside from data format changes, there were feature additions that could be used (like new script functions).
That's odd. COuld you link me to the latest APK? I've been searching all over and all of the apk's i've downloaded have errored. I think I'm using an outdated version..?

The latest APK I see on jjs/daily is of 24th October 2013: http://jjs.at/daily/AGS_2013-10-24_16-22-13.apk
I cannot tell what program state was it built with, but if it really used the engine from 24th October, then it should be able to run 3.3.0.1158 games (although you will get a different warning message).
Still it will be more correct to create a new apk...

I found a slightly newer apk from JJS that may be the 3.3.0 release. It's from 2013-12-14: http://jjs.at/daily/branches/release-3.3.0/AGS_2013-12-14_10-25-44.apk

Any word on a newer build from anyone else? If I find some time, I may check out the instructions on github to build a new apk.
Title: Re: AGS engine Android port
Post by: ROOKMAGE on 18 Apr 2014, 15:35
That worked, thanks!

Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 27 Apr 2014, 21:55
Give this one a shot: http://www.adventurestockpile.com/ags330.apk and see if that works. It is using the latest repo from 3.3.0 Master.
Title: Re: AGS engine Android port
Post by: monkey0506 on 27 Apr 2014, 22:11
That APK refuses to install on my Galaxy Tab 3 (and yes, I have Unknown Sources checked). Could you upload a signed APK?

Edit: Actually, I was able to confirm that the latest master is fatally bugged for Android anyway. [Android: Failed to find acceptable graphics filter (Undefined) #151 (https://github.com/adventuregamestudio/ags/issues/151)]

I'm looking into it.
Title: Re: AGS engine Android port
Post by: ROOKMAGE on 28 Apr 2014, 12:57
Yeah, getting the same problem on both amazon kindle and Motorola g.
Title: Re: AGS engine Android port
Post by: Liquidje on 30 Apr 2014, 10:21
I am also looking for a newer/better build as I get random crashes in Resonance with the October 2013 release. If people have problems please see this post, as a newer version is hidden:
I found a slightly newer apk from JJS that may be the 3.3.0 release. It's from 2013-12-14: http://jjs.at/daily/branches/release-3.3.0/AGS_2013-12-14_10-25-44.apk

Any word on a newer build from anyone else? If I find some time, I may check out the instructions on github to build a new apk.
It gave me a minor graphics glitch in Resonance, but no crashes (so far!).

Regarding creating a newer build: I looked at Github to build a newer APK but the source files (at least the important ones) do not seem to be updated since the December 2013 build. I am not a great Android developer (or software developer for that matter), but judging by the files it is not that easy to combine the newer ags builds with the Android libraries, effectively just rebuilding the file linked above. So as far as I know there is no point in rebuilding the above.

I am more than prepared to further look into the matter and help wherever I can :)

edit: also, as far as I know, there are some problems with the current build. Enabling logging does not give any useful information for debugging (only notifications of loaded and unloaded rooms).
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 30 Apr 2014, 13:02
Better wait a little for a new build; I was trying to fix the recent fatal problem for mobile devices. Need to hear from monkey_05_06 if my patch works.
Title: Re: AGS engine Android port
Post by: Liquidje on 30 Apr 2014, 13:46
Awesome :) I did not know you fixed the 'fatal' problem, I understand the newest Android build (Dec-2013) did not have the fatal problem, but that the fatal problem occured in the builds after that??

If there is anything that needs testing, I am happy to help (although more debug logging would be nice for the devs). Cool that people still work on this :)   
Title: Re: AGS engine Android port
Post by: monkey0506 on 30 Apr 2014, 15:40
Regarding creating a newer build: I looked at Github to build a newer APK but the source files (at least the important ones) do not seem to be updated since the December 2013 build. I am not a great Android developer (or software developer for that matter), but judging by the files it is not that easy to combine the newer ags builds with the Android libraries, effectively just rebuilding the file linked above. So as far as I know there is no point in rebuilding the above.

The files in the Android folder are the Java-specific library and the launcher app. The actual engine itself is still built against the native C++ source (using the NDK), so these changes wouldn't be reflected in the Android folder.

CW has been working with me to try and get rid of the most recent fatal error, which was caused due to some incorrect code on Android which doesn't support graphics filters. I haven't had a chance to test it just yet, but CW posted a patch here (https://github.com/adventuregamestudio/ags/issues/151#issuecomment-41711259). I will do a full rebuild later today to confirm if this patch resolves the issue. If so, I will upload the APK.
Title: Re: AGS engine Android port
Post by: Liquidje on 30 Apr 2014, 16:17
The files in the Android folder are the Java-specific library and the launcher app. The actual engine itself is still built against the native C++ source (using the NDK), so these changes wouldn't be reflected in the Android folder.
Thanks for the information. Glad I did not try to figure out this stuff for myself, although I am highly intrigued by the process.
Quote
CW has been working with me to try and get rid of the most recent fatal error, which was caused due to some incorrect code on Android which doesn't support graphics filters. I haven't had a chance to test it just yet, but CW posted a patch here (https://github.com/adventuregamestudio/ags/issues/151#issuecomment-41711259). I will do a full rebuild later today to confirm if this patch resolves the issue. If so, I will upload the APK.
Great! Thanks (you too CW!)
Title: Re: AGS engine Android port
Post by: monkey0506 on 01 May 2014, 00:10
It appears that CW's latest patch fixed the most recently introduced bug (incorrect graphics filters). The latest APK is available here (https://bitbucket.org/monkey0506/ags/downloads/AGS_2014-4-30.apk).
Title: Re: AGS engine Android port
Post by: xlynx on 13 May 2014, 06:10
I just tried AGS_2014-4-30.apk on my Samsung Galaxy Note II. For the most part it's working fine. I noticed:
Title: Re: AGS engine Android port
Post by: EctoOne on 24 May 2014, 20:34
Hi, i just found this piece of gold and i'm so happy about it.
But i have one question. Is there a way to change the language of some games?
I'm mostly speaking of Maniac Mansion Deluxe which has a bunch of translation files i can choose form in the Windows Settings.
Title: Re: AGS engine Android port
Post by: ner0 on 24 May 2014, 22:02
Hi, i just found this piece of gold and i'm so happy about it.
But i have one question. Is there a way to change the language of some games?
I'm mostly speaking of Maniac Mansion Deluxe which has a bunch of translation files i can choose form in the Windows Settings.

http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636475697#msg636475697
Title: Re: AGS engine Android port
Post by: MrWood on 26 Jun 2014, 13:10
I really love the app, but I have one problem: I can't save or load my games.

I assume for loading and Saving I have to use they Key Input which is activated by pressing the MENU button.

My problem is: I use a Android Tablet (BigBen Gametab One) on this tablet 4 Buttons are always there BACK, HOME, CURRENT APPS & MAPPING TOOL for the Controller. The MENU button sometimes is in the upper right and sometimes in the lower right corner, apps which dont use the MENU buttons don't have it at all. With AGS I cant find the MENU button.

How can I use the key input with my tablet?
Title: Re: AGS engine Android port
Post by: Iceberg on 16 Jul 2014, 01:02
Hi everyone!  Quick question:

I downloaded AGS Stream from Google Play.  I then replaced the apk file (AGS_2013-02-09_22-16-23.apk) with what appears to be the newest version (AGS_2013-12-14_10-25-44.apk).  I copied this right to the root /sdcard/.  Most games run just fine (everything from the AGDI and IA remakes to the Blackwell games), but Heroine's Quest and Quest for Infamy give me the error message "This game requires a newer version of AGS (3.3.0.1148).  It cannot be run".

Am I doing this correctly?  ???
Title: Re: AGS engine Android port
Post by: davoker on 18 Jul 2014, 02:58
Hello, I have problems setting games Castilian, Castilian language in WinSetup wear, but when I run it on my tablet, the game always comes out in English;

As I can do to make you change the language, if I have put Castilian default?

Example: Maniac Mansion Deluxe - has multiple languages, select "Castilian" with WinSetup, keep the changes and copy the game to the tablet, I run in and out in English :S

thanks

P.S: translated with google, sorry

Edit:
fixed hehe thx
You should really read the Readme for this great app: https://github.com/adventuregamestudio/ags/blob/master/Android/README.md
Open AGS on your device and once at the game list, touch and hold (longclick) the game you want to configure then select "Preferences".
In your game preferences just change the "Game language" and you're all set.
LOL come later, I put it back and forget the option to change language, and I found this post haha

thank you very much!

google translator sorry!
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 18 Jul 2014, 08:39
Hi everyone!  Quick question:

I downloaded AGS Stream from Google Play.  I then replaced the apk file (AGS_2013-02-09_22-16-23.apk) with what appears to be the newest version (AGS_2013-12-14_10-25-44.apk).  I copied this right to the root /sdcard/.  Most games run just fine (everything from the AGDI and IA remakes to the Blackwell games), but Heroine's Quest and Quest for Infamy give me the error message "This game requires a newer version of AGS (3.3.0.1148).  It cannot be run".

Am I doing this correctly?  ???

The problem is that 3.3.0.1148 was a beta version, that had several "updates" somewhere in between 14th November and 24th December. I am not really sure which was used for "Heroine Quest". Depending on that AGS_2013-12-14_10-25-44.apk may be a bit outdated.

The latest build I know was made by monkey_05_06 on 30th April 2014:
https://bitbucket.org/monkey0506/ags/downloads/AGS_2014-4-30.apk
Title: Re: AGS engine Android port
Post by: Iceberg on 18 Jul 2014, 20:29
I tried it but get the same message.  I just realized, too, that's it's a slightly different error message for Quest for Infamy - that one says it needs 3.3.0.1160.

I will wait for a newer build.  Thanks for responding!  :grin:
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 18 Jul 2014, 21:25
Something is wrong here. According to date of build AGS_2014-4-30.apk should be 3.3.0.1162.
Title: Re: AGS engine Android port
Post by: Iceberg on 19 Jul 2014, 01:50
Maybe I'm not doing it correctly?  I deleted the older apk file from /sdcard/ and replaced it with AGS_2014-4-30.apk.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 20 Jul 2014, 01:45
I am not an expert on Android, but I believe you must reinstall the application, not just put new apk it on SD card.
(Also, unless I am mistaken, APK is not needed to run the program and may be removed after installation)

I don't have any Android device at the moment, but I set up Android emulator, installed monkey_05_6's AGS apk, and tried running HQ there, and it worked fine.
Title: Re: AGS engine Android port
Post by: Iceberg on 20 Jul 2014, 03:22
It works!!!  :-D  I've got AGS_2014-4-30.apk installed and both HQ and QFI are working splendidly.  Thanks very much for your help, Crimson Wizard - I really appreciate it!  :-D
Title: Re: AGS engine Android port
Post by: davoker on 26 Jul 2014, 04:33
okay so... i got them working. i don't know what was the issue exactly, but i suspect that it might've been caused by installing the bundle versions over the retail ones, with some files being redundant. i deleted them completely and reinstalled from the bundle setup, and there are no ac2game.dat files in any of the game directories, just the exes. and now they work correctly (well apart from recurring random crashes, but i understand that's just something i have to deal with when using the android port), so it must've been a messed up installation.
I have the same problem with Legacy blackwell and Unbound in android, I get the error "you must first create and save game in the AGS Editor before you can use this engine;

the game has ac2game.dat and EXE, so I can not name the EXE to ac2game.dat: S

With Unbound blackwell equal, it seems problem files "partitioned":

Blackwell Legacy -> Blackwell1.exe - blackwell1.001 and blackwell1.002

Any other game that has partitioned files work well (I mention this because it seems curious, I doubt that's it xD);

As fixed the problem? I feel like I've given money, buy one for my tablet, travel a lot: S

Code: Adventure Game Studio
  1. agsgame.log (log created to run the game in android):
  2.  
  3. Adventure Game Studio v3.3 Interpreter
  4. Copyright (c) 1999-2011 Chris Jones and 2011-2013 others
  5. ACI version 3.3.0.1144
  6.  
  7. ***** ENGINE STARTUP
  8. Reading config file
  9. Initializing allegro
  10. Setting up window
  11. Initializing game data
  12. Game data file could not be found (what?)


I feel my English, google translator xD

P.D: Version AGS android -> AGS_2013-10-24_16-22-13.apk (http://jjs.at/daily/)
I saw this other version  -> http://jjs.at/daily/branches/release-3.3.0/ this is better? solve my problem?

Edit: LOL
the normal structure for games is:
SDCARD/AGS/Zak2
SDCARD / AGS / Gemini Rue

etc etc

with Blackwell Legacy is:

SDCARD / AGS / game files (xD)

Home AGS and go directly to the game, and it works, but I can no longer choose games, game is unique because it has ac2game.dat, you can not remove that file, it goes along with the exe, this is very rare, any solution?
Title: Re: AGS engine Android port
Post by: Creator on 26 Jul 2014, 07:34
I'm unfortunately getting yet another error. This is what happens when I click on a game. (My phone's a Galaxy Note 3.)

(http://s29.postimg.org/asrj1nljn/2014_07_26_16_22_00_1.jpg) (http://postimg.org/image/asrj1nljn/)

I've looked around on my phone and in Windows to see if I can allow write privileges to the card, but I have no idea how to get it to work. There's plenty of space on the card.
I've tried both the latest version at http://jjs.at/daily/ (which is AGS_2013-10-24_16-22-13.apk) and AGS_2014-4-30.apk (found at https://bitbucket.org/monkey0506/ags/downloads/AGS_2014-4-30.apk).

This seemed to start since the latest firmware update.

Edit - The latest update for my phone (4.4.2 - KitKat) actually disables write permissions for 3rd party apps onto the SD Card. I moved the games to device storage and now they work fine. Bit of a pain, but that's Google's fault.
Title: Re: AGS engine Android port
Post by: Blackthorne on 30 Jul 2014, 19:07
Iceberg - you've got QFI running on Android?  Shoot me a PM about that sometime, would ya?


Bt
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 31 Jul 2014, 21:13
I have the same problem with Legacy blackwell and Unbound in android, I get the error "you must first create and save game in the AGS Editor before you can use this engine;

the game has ac2game.dat and EXE, so I can not name the EXE to ac2game.dat: S

<...>

Home AGS and go directly to the game, and it works, but I can no longer choose games, game is unique because it has ac2game.dat, you can not remove that file, it goes along with the exe, this is very rare, any solution?

You need either ac2game.dat or *.exe, but not both.

Most probably ac2game.dat is just a renamed EXE.
This is my guess that exe is actually a raw engine. Please check how large it is. If it is around 2 MB in size, that's probably a Windows runner, not a game itself.
If it is so, then
1. delete EXE
2. rename ac2game.dat into GameName.exe, or GameName.ags (whichever you like better).

EDIT: I just checked my copy of Blackwell Unbound, and, actually, it is like I said. They ship both separate Windows engine (as exe) and separate game data (as ac2game.dat).


Game files must be put into AGS/GameName/ folder either on SD card or file storage.

Partitioned data should work fine (same as on Windows).
Title: Re: AGS engine Android port
Post by: davoker on 31 Jul 2014, 22:45
I have the same problem with Legacy blackwell and Unbound in android, I get the error "you must first create and save game in the AGS Editor before you can use this engine;

the game has ac2game.dat and EXE, so I can not name the EXE to ac2game.dat: S

<...>

Home AGS and go directly to the game, and it works, but I can no longer choose games, game is unique because it has ac2game.dat, you can not remove that file, it goes along with the exe, this is very rare, any solution?

You need either ac2game.dat or *.exe, but not both.

Most probably ac2game.dat is just a renamed EXE.
This is my guess that exe is actually a raw engine. Please check how large it is. If it is around 2 MB in size, that's probably a Windows runner, not a game itself.
If it is so, then
1. delete EXE
2. rename ac2game.dat into GameName.exe, or GameName.ags (whichever you like better).

EDIT: I just checked my copy of Blackwell Unbound, and, actually, it is like I said. They ship both separate Windows engine (as exe) and separate game data (as ac2game.dat).


Game files must be put into AGS/GameName/ folder either on SD card or file storage.

Partitioned data should work fine (same as on Windows).
I'll watch what he says, but he did everything and just works the way you explained above, however'm sure, and will comment as it was, thanks
Title: Re: AGS engine Android port
Post by: MrWood on 04 Aug 2014, 12:22
Do other people have the same problem I have? Is it gonna be fixed?
Title: Re: AGS engine Android port
Post by: Jothie on 13 Aug 2014, 20:01
Any trick to getting HQ to work?  I'm using the 2014-4-30 apk.  QFI works beautifully(occasional crash) but HQ returns the error "Script link failed: Runtime error: unresolved import 'AGSteam.SetAchievementAchieved^1'"  when I try to start it
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 13 Aug 2014, 20:30
Any trick to getting HQ to work? I'm using the 2014-4-30 apk.  QFI works beautifully(occasional crash) but HQ returns the error "Script link failed: Runtime error: unresolved import 'AGSteam.SetAchievementAchieved^1'"  when I try to start it
You need a AGSSteam plugin stub. Frankly I don't know how it works on Android (and whether any plugin work there at all). I hope someone else will comment on this.

Probably it's worth to ask game authors if they have a game version without Steam support.
Title: Re: AGS engine Android port
Post by: Blackthorne on 15 Aug 2014, 05:12
I've found QFI works the best with unthreaded audio. It seems to hang on me when that's on.


Bt
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 15 Aug 2014, 08:44
I've found QFI works the best with unthreaded audio. It seems to hang on me when that's on.
Threaded audio is found to be rather unstable, except for maybe on Windows (I hardly understand why). It caused crashes on particular Linux platforms, and, supposedly, cause problems on mobile ones.
A while ago I started to dig into this issue, but found that a large amount of engine logic should be revised in order to make it work safely. This is still WIP (https://github.com/ivan-mogilko/ags-refactoring/tree/refactor_audio_channel).
Title: Re: AGS engine Android port
Post by: HunterZ on 18 Aug 2014, 03:47
So I'm using monkey's 2014-04-30 build to attept to play AGD's Quest for Glory II VGA remake. It seemed to run perfectly, until I realized that I cannot access the special actions menu (run, character sheet, time of day etc.). In addition, most of the Ctrl+key combinations don't seem to work on either a software or Bluetooth keyboard.

For reference, this is on a first generation Nexus 7 tablet running Android 4.4.4.

Is there anything I can do to fix this? If not, is there any hope of the porters fixing it? I was hoping to avoid having to play the original version of QfG2 on my tablet because parsers are cumbersome on small devices.

Edit: this only seems to be an issue with non-relative mouse control, but I'm not sure that relative mouse control will work well with this game.
Title: Re: AGS engine Android port
Post by: Iceberg on 30 Aug 2014, 23:16
Any trick to getting HQ to work? I'm using the 2014-4-30 apk.  QFI works beautifully(occasional crash) but HQ returns the error "Script link failed: Runtime error: unresolved import 'AGSteam.SetAchievementAchieved^1'"  when I try to start it
You need a AGSSteam plugin stub. Frankly I don't know how it works on Android (and whether any plugin work there at all). I hope someone else will comment on this.

Probably it's worth to ask game authors if they have a game version without Steam support.

I get exactly the same error - but only when trying to run HQ version 1.2.  Version 1.1 runs without any problem for me.
Title: Re: AGS engine Android port
Post by: Radiant on 04 Sep 2014, 19:39
I would also be interested in a technical way of dealing with this. The game runs fine on Windows even when Steam isn't installed, but throws this exception on Android.     
Title: Re: AGS engine Android port
Post by: monkey0506 on 04 Sep 2014, 21:23
The Steam version of the game can still load the plugin (on Windows) even if the Steam client isn't installed or isn't running. The problem here is the lack of a plugin for Android (and/or, a missing/deleted plugin). The plan is for future versions of AGS to allow these plugins to be stubbed for precisely this type of situation. You can read more about that in this thread (http://www.adventuregamestudio.co.uk/forums/index.php?topic=50916.0).
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 08 Sep 2014, 08:33
Can't the existing plugin stub be built for Android? If I understand this right, it should work almost same way as Linux port does?

Just checked the engine code, and it looks like there's support for loading plugins on Android already (same Library class used for Linux, Android and Mac).
Title: Re: AGS engine Android port
Post by: Blackthorne on 11 Sep 2014, 03:37
Yeah - the GoG and Humble versions of QFI will run on Android fine because the steam.api stuff was stripped out of those versions; that's how I did it for now.


Bt
Title: Re: AGS engine Android port
Post by: monkey0506 on 11 Sep 2014, 13:40
Blackthorne, have you tested QFI on Android? I know Himalaya Studios was having issues with their games silently crashing, but I could never reproduce it.
Title: Re: AGS engine Android port
Post by: DjCzermino on 19 Sep 2014, 10:15
At first, thank to all community for AGS ports (Android, Linux, iOS, ...) and new Windows editor 3.3. version - now it supports storing project files in separate files (for GIT/SVN purposes COOOL !!!)

-----------------------

My first question:
How to resolve in game source code, what platform i am running?

I thing, is there some function for example.

if (Envorement.GetPlatform() == Platform.Handheld) {
    // mobile devices, no keyboard, mouse etc..
} else {
   // desktop devices
}

or better: Enviroment.GetPlatformId()
// returns: Android, Windows, Linux, iOS, PSP, other...

For example: in my game i want to server different controls for mobile devices than on desktop etc..

I FOUND only one workaround:

create TXT file: platform.txt and store information about platform in it... :(
Next soulution is ASK user in first game start what type of device he is holding (and store it in global game variable..)

Any other ideas?

-----------------------

Second question:
Will be next release of Android engine? Now IF I compile game in lates AGS 3.3.0.xxxx  i see Error message on Android (game is in newer version of AGS) but after confirming it, game loads well.

Thank you for good job!

-----------------------

Third: BUG report
sometimes, when editing a room script there is no inteli-sense on named objects. For example. object

-----------------------

Thank you!

Title: Re: AGS engine Android port
Post by: Gurok on 19 Sep 2014, 10:28
or better: Enviroment.GetPlatformId()
// returns: Android, Windows, Linux, iOS, PSP, other...

Regarding this, there is System.OperatingSystem, which returns eOSDOS, eOSLinux, eOSWindows or eOSMac. It would probably be a good idea to add Android, PSP System Software and iOS to this enum at some point. I don't know of any way to detect Android specifically at the moment.
Title: Re: AGS engine Android port
Post by: Blackthorne on 22 Sep 2014, 03:55
Monkey,

Yeah - I've tested it on Android; I haven't encountered any problems so far.

Bt
Title: Re: AGS engine Android port
Post by: Iceberg on 25 Sep 2014, 23:34
I've played through the whole Brigand campaign and am currently working on a Rogue.  No problems so far.
Title: Re: AGS engine Android port
Post by: monkey0506 on 26 Sep 2014, 04:26
It's great to hear that the latest APK is working well. I'll pass that along to Himalaya so they can try it out! :-D
Title: Re: AGS engine Android port
Post by: rmonic79 on 03 Nov 2014, 12:54
hello everyone, i've just read all twenty seven pages of post. Me and my friend are making a game and we would like to release it on google play and maybe ios. The game is ready at 20% and i have no android development skills, but we would like to continue use ags because it have all we need to make our retrostyle adventures. I don' t understand if today is possible to convert a game in an standalone apk without rewrite it. if it is, what instrument and what knowledge we need to do it? thanks
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 03 Nov 2014, 23:30
I don' t understand if today is possible to convert a game in an standalone apk without rewrite it. if it is, what instrument and what knowledge we need to do it? thanks
No, you can't make a game a standalone apk yet. You have to use an engine apk, and upload game data to device (or on SD card) separately.

As far as I know, there's a work in progress that would let Editor to build a stand-alone game apk, though. It may be available after some time.
Title: Re: AGS engine Android port
Post by: HappehLemons on 04 Nov 2014, 11:16
Just wanted to say thank for the continued support on the android version. I'm really hoping that we get steam plugin support as it seems that I'm running into games that no longer work because of this! Just tried Heroines Quest and I ran into the AGSteam error. I did drop a message on their forums too but it looks like if AGS is updated that this would be fixed which would be awesome!
Title: Re: AGS engine Android port
Post by: rmonic79 on 04 Nov 2014, 11:59
I don' t understand if today is possible to convert a game in an standalone apk without rewrite it. if it is, what instrument and what knowledge we need to do it? thanks
No, you can't make a game a standalone apk yet. You have to use an engine apk, and upload game data to device (or on SD card) separately.

As far as I know, there's a work in progress that would let Editor to build a stand-alone game apk, though. It may be available after some time.
thanks for the answer, i put this question because i read somewhere in this thread that someone already did it using the engine made by jjs and game like Blackwell and Gemini rue was ported to android and ios. And even thoug it may be difficult, i would like to know where to start and what i need to learn. sorry for my insistance and for my english:)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 04 Nov 2014, 12:16
i put this question because i read somewhere in this thread that someone already did it using the engine made by jjs and game like Blackwell and Gemini rue was ported to android and ios.
I will note just in case (because people got confused by this often), that you may use ANY game on Android and iOS with JJS ports right now. But you will have to have these games as separate files, not part of APK.

Regarding Blackwell games, maybe they did standalone APK somehow... Frankly I don't know that much. Perhaps you could ask monkey_05_06 who, if I am not mistaken, was working with Wadjet Eye to solve some technical issues, or Janet Gilbert, who is Wadjet Eye's programmer.
Title: Re: AGS engine Android port
Post by: rmonic79 on 04 Nov 2014, 12:23
i put this question because i read somewhere in this thread that someone already did it using the engine made by jjs and game like Blackwell and Gemini rue was ported to android and ios.
Hmm, maybe they did somehow... Frankly I don't know that much. Perhaps you could ask monkey_05_06 who, if I am not mistaken, was working with Wadjet Eye to solve some technical issues, or Janet Gilbert, who is Wadjet Eye's programmer.
thanks so much for the information and thanks to everyone involved in the project, i discovered ags three month ago and i make one of my dreams come true, create my own adventure!!! :)
Title: Re: AGS engine Android port
Post by: Radiant on 05 Nov 2014, 07:57
Wasn't there a Stub DLL for AGSteam that could be downloaded to run an AGS game on Android? Because currently it technically works but is crashing on the plugin.
Title: Re: AGS engine Android port
Post by: fischkopf on 06 Nov 2014, 18:26
Could someone provide a link to the most recent build? The most recent I could find is from 2013...
Title: Re: AGS engine Android port
Post by: monkey0506 on 06 Nov 2014, 21:24
There's a build from April (https://bitbucket.org/monkey0506/ags/downloads/AGS_2014-4-30.apk) that I uploaded. Probably high time I do another build -- this was around the time I got preoccupied with adding build targets to the editor. I'm looking into the possibility of building standalone APKs from the editor as well, too, but that's several months away at least to be honest.
Title: Re: AGS engine Android port
Post by: rmonic79 on 06 Nov 2014, 22:40
There's a build from April (https://bitbucket.org/monkey0506/ags/downloads/AGS_2014-4-30.apk) that I uploaded. Probably high time I do another build -- this was around the time I got preoccupied with adding build targets to the editor. I'm looking into the possibility of building standalone APKs from the editor as well, too, but that's several months away at least to be honest.
Thanks!!! now works on LG Optimus 3d. Previous versions doesn't recognize game in folder.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 06 Nov 2014, 22:47
There's a build from April (https://bitbucket.org/monkey0506/ags/downloads/AGS_2014-4-30.apk) that I uploaded. Probably high time I do another build -- this was around the time I got preoccupied with adding build targets to the editor. I'm looking into the possibility of building standalone APKs from the editor as well, too, but that's several months away at least to be honest.

Maybe someone could start a new topic, with the links to most recent builds? Unless JJS returns to forums, the old links are going to be on the first page forever.
(JJS was here in June BTW, perhaps he is too busy...)
Title: Re: AGS engine Android port
Post by: BigMc on 07 Nov 2014, 23:24
Or the builds are put on the homepage, where they belong.
Title: Re: AGS engine Android port
Post by: AGD2 on 10 Nov 2014, 07:35
Blackthorne, have you tested QFI on Android? I know Himalaya Studios was having issues with their games silently crashing, but I could never reproduce it.

Just wanted to post an update that we've been porting Al Emmo to iOS and these random silent crashes still occur on that platform, so whatever the cause, I can confirm that it's not Android-specific.
Title: Re: AGS engine Android port
Post by: monkey0506 on 10 Nov 2014, 09:06
:~( Okay, in that case I'm increasingly convinced that it's either something to do with the audio or the OpenGL graphics driver. :-X
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 10 Nov 2014, 09:16
Just wanted to post an update that we've been porting Al Emmo to iOS and these random silent crashes still occur on that platform, so whatever the cause, I can confirm that it's not Android-specific.
Are you using threaded audio in Al Emmo?

E: There was also a bug I fixed relatively recently:
https://github.com/adventuregamestudio/ags/issues/195
The bug was originally reported on Linux, so I guess it may refer to Android too.
Janet Gilbert once gave me a read access to Gemini Rue crash reports on iOS, and this bug is one of the most frequently occuring one lately (either I did not paid enough attention before, or there's a new version of iOS that is more susceptible to it.

The fix is not in the released version yet, but I was planning another version update after some time (3.3.3).
But it is possible to make a new Android engine APK already.


Getting any debug information on crash could help.
Title: Re: AGS engine Android port
Post by: monkey0506 on 10 Nov 2014, 22:18
I'm downloading the latest NDK right now and then I'll do a build of the current master branch.
Title: Re: AGS engine Android port
Post by: AGD2 on 11 Nov 2014, 12:24
Are you using threaded audio in Al Emmo?

I believe the latest version is using threaded audio, but in the past, I have experienced this crash with the threaded setting set to both 0 and 1.

Also, the iOs and Android ports are using the Software driver (not OpenGL) when the crash occurs. But I think it could crash under either.

Often these silent crashes occur while a character is in the middle of speaking, so I have also wondered whether it might be related to using .pam lip-sync files.
Title: Re: AGS engine Android port
Post by: monkey0506 on 12 Nov 2014, 20:17
Some notes about my attempts to build the latest version:

* NDK Revision 10c removed several functions that the AGSLua plugin relies on (specifically it is mentioning "__srget", but this relies on several other removed functions).
* The master branch (sans AGSLua plugin) builds and runs correctly.
* The develop-3.4.0 branch (AGS 3.4.0.2) (sans AGSLua) builds but hangs with a loading screen before silently crashing...

Looking into it!
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 12 Nov 2014, 20:22
Tadam... https://github.com/adventuregamestudio/ags/issues/198
Title: Re: AGS engine Android port
Post by: Blackthorne on 19 Nov 2014, 15:48
I haven't had QFI crash on Android yet - but I haven't finished it yet.  I know others have, though.


Bt
Title: Re: AGS engine Android port
Post by: AGD2 on 19 Nov 2014, 22:56
Another update. Today, after disabling threaded audio, I was able to play through the entire port of Al Emmo on iOS, without it silently crashing even once. I think this is the first time I've ever been able to accomplish this! (Though, I swear it has crashed in the past on Android with threaded audio disabled).

Either way, the "silent crash" glitch looks like it's almost certainly narrowed down to threaded audio.
Title: Re: AGS engine Android port
Post by: monkey0506 on 19 Nov 2014, 23:46
Sorry it's taken me so long to post this, but here's an AGS 3.3.2 APK (https://bitbucket.org/monkey0506/ags/downloads/AGS-3.3.2.apk). This is based on the master branch of the repository, so should be considered a stable build. This also includes rebuilt Lua libraries, so the APK is notably about 2 MB larger versus previous versions. I'm not sure why the rebuilt libraries are so much larger; I've been investigating how JJS previously built the Lua static libraries (see related issue #211 (https://github.com/adventuregamestudio/ags/issues/211)).

NOTE: I changed the package name for this APK from com.bigbluecup.android.launcher to com.bigbluecup.android.gamelauncher, so it will appear as a new app with the same name. I did this because I would like to start pushing these APKs over the Google Play store but someone has uploaded an unpublished APK with the original name. I have not been able to track down who did this, but if anyone who has access to a Google Play Developer account could just double check, I would like to go back to the original package name.
Title: Re: AGS engine Android port
Post by: HappehLemons on 20 Nov 2014, 18:29
Awesome! Will this fix the steam errors a lot of us were getting?
Title: Re: AGS engine Android port
Post by: monkey0506 on 27 Dec 2014, 09:21
Someone contacted me via PM, and brought up an important issue that will need to be addressed. Android 4.4.2 (Kitkat) removed the ability for an app to write to any folder on the SD card that it does not own. This can easily be resolved by those who have rooted devices (like myself), but we should come up with a more general solution (e.g., take ownership of the /~external-storage/ags folder from the launcher app). I'm also not sure how this will play into virtual storage mounted by standalone apps (e.g., mounted OBB files). This will need to be addressed, as more and more users are on the latest versions of Android.
Title: Re: AGS engine Android port
Post by: ET3D on 31 Dec 2014, 09:33
Sorry it's taken me so long to post this, but here's an AGS 3.3.2 APK (https://bitbucket.org/monkey0506/ags/downloads/AGS-3.3.2.apk).

Tried it, but I can't see the menu button in game, which let me bring up the keyboard in JJS's version. Without it it's impossible to progress in The Blackwell Epiphany. Also, ghosts aren't rendered translucent in your version.

Unfortunately, the game crashes a lot in both this and JJS's last version, so I'm pretty much stuck at the beginning. I guess I'll be forced to play it on Windows.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 31 Dec 2014, 12:20
Sorry it's taken me so long to post this, but here's an AGS 3.3.2 APK (https://bitbucket.org/monkey0506/ags/downloads/AGS-3.3.2.apk).

Tried it, but I can't see the menu button in game, which let me bring up the keyboard in JJS's version. Without it it's impossible to progress in The Blackwell Epiphany. Also, ghosts aren't rendered translucent in your version.

Since I am maintaining general engine code, I am particularily interested in the translucency bug. Can you upload a save game made near these ghosts?
Title: Re: AGS engine Android port
Post by: ET3D on 31 Dec 2014, 14:39
There's no real need for a save. Joey, one of the two playable characters, is a ghost and should be translucent.

If you want a save anyway, I will try uploading one. I'm not sure how the filenames correspond to the game's save names, but I think I'll get it right.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 31 Dec 2014, 14:53
There's no real need for a save. Joey, one of the two playable characters, is a ghost and should be translucent.
I see, that's right. Just tried out 3.3.2 on Windows, but it looks translucent. Might be OpenGL and/or Android issue.
Title: Re: AGS engine Android port
Post by: monkey0506 on 31 Dec 2014, 16:53
I didn't change the way the keyboard is toggled. Unless your device doesn't have a menu button then it should be working. If you don't have physical hardware buttons, well that's something else we need to address, though off the top of my head, I'm not sure what the best approach would be here.
Title: Re: AGS engine Android port
Post by: ChamberOfFear on 31 Dec 2014, 17:36
I didn't change the way the keyboard is toggled. Unless your device doesn't have a menu button then it should be working. If you don't have physical hardware buttons, well that's something else we need to address, though off the top of my head, I'm not sure what the best approach would be here.

As stated by the Android developer they're phasing out physical hardware buttons since Android v3.0, and the conventional replacement would be the action bar http://developer.android.com/guide/topics/ui/menus.html
Title: Re: AGS engine Android port
Post by: monkey0506 on 01 Jan 2015, 08:13
Yes, I'm aware of that, but do you really want that floating over the top of your games? I was referring more to how best to bring up the action bar without interfering with gameplay.
Title: Re: AGS engine Android port
Post by: ET3D on 01 Jan 2015, 08:37
I didn't change the way the keyboard is toggled. Unless your device doesn't have a menu button then it should be working. If you don't have physical hardware buttons, well that's something else we need to address, though off the top of my head, I'm not sure what the best approach would be here.

I'm using a Nexus 7 2012. In the JJS version there's a menu button in the action bar at the bottom, and it's available throughout the game. In your version there's a menu button at the top right on the game selection screen, but that doesn't show during the game. The normal action bar (back, home...) shows. (And the bar always shows. There's an option to hide it which other games have, where you swipe from the top to show it, but in AGS it always shows at the bottom. Not that it's a problem for me.)

By the way, any way for me to help debug the crashes?

I see, that's right. Just tried out 3.3.2 on Windows, but it looks translucent. Might be OpenGL and/or Android issue.

Looks like something which changed in hardware rendering. It works on monkey's version with software rendering but not hardware rendering, and is fine on JJS's version either way. Was there a rendering change over the last year?


Oh, and happy 2015!
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 12 Jan 2015, 09:51
* The develop-3.4.0 branch (AGS 3.4.0.2) (sans AGSLua) builds but hangs with a loading screen before silently crashing...

I made a number of fixes related to graphics init to 3.4.0 version. Please try again now.
Title: Re: AGS engine Android port
Post by: ET3D on 02 Feb 2015, 06:58
I upgraded to a Galaxy Tab S 8.4, and AGS (monkey's version) no longer crashes, at least far as I played. The only thing I can think of it that it may be a memory allocation problem (the Tab S has 3GB RAM compared to 1GB for the Nexus 7).

Menu is still screwed up on the monkey version. The Tab S has physical buttons, unlike the Nexus 7, but following the current Android style there's no menu button. In JJS's version a long press of the 'recents' button brings up the menu when in-game. In monkey's version it doesn't, so like on the Nexus 7 I have no clue how it's possible to get the menu in this version.
Title: Re: AGS engine Android port
Post by: DarkestCrow on 15 Feb 2015, 19:29
So, there is no other way to put into operation arrow keys (for game The Cat Lady), than to buy a keyboard for Android? :sad:
Title: Re: AGS engine Android port
Post by: monkey0506 on 16 Feb 2015, 19:41
I will look into adding a drop-down with a menu button if the user swipes down from near the top of the screen.

As for The Cat Lady, it would be easier to add a D-pad overlay or just replace the control schema, because most Android soft keyboards don't have arrow keys.
Title: Re: AGS engine Android port
Post by: DarkestCrow on 01 Mar 2015, 14:31
Please, can you help me with this?
Title: Re: AGS engine Android port
Post by: ET3D on 10 Mar 2015, 10:18
Looks like AGS does crash on the Galaxy Tab S, so it's not a memory issue. Wish I knew how to overcome it. Looks like both JJS' and monkey's versions crash at the same places, more or less. Would be nice if there was a way to help debug this. (I tried writing the log, but all it shows is room changes, nothing to indicate why the crash happened.)

DarkestCrow, I'd suggest trying the latest version from the first post on the thread. JJS' version has a menu button in games which can bring up the keyboard. Choose an Android keyboard with arrow keys and it should work.

monkey, why can't you use the same menu button code as the JJS version? That worked fine for me on both the Nexus 7 2012 and Galaxy Tab S, and they have completely different menu button management (the Nexus 7 doesn't have physical buttons, and the menu button shows on its action bar, while the Tab S has physical buttons and a long press on the recents button can bring up the menu), so I imagine that it's a generic solution that should work well on a wide range of devices.
Title: Re: AGS engine Android port
Post by: monkey0506 on 11 Mar 2015, 18:17
monkey, why can't you use the same menu button code as the JJS version?

Because I don't recall ever changing it? :-\ I'll try and look back through the changes I made (which are all available as "my" version is the current master branch), but I don't recall changing this and I certainly wouldn't have intentionally broken it.
Title: Re: AGS engine Android port
Post by: ET3D on 12 Apr 2015, 11:53
By the way, I recently finished The Blackwell Epiphany, finally, managing to bypass all the crashes. One of them I managed to bypass by changing from software to hardware rendering.
Title: Re: AGS engine Android port
Post by: nims on 12 Apr 2015, 12:56
Hi,

Could you also port the spritefont plugin? I like it because it improves the text-rendering a lot and it's open source:

http://www.adventuregamestudio.co.uk/forums/index.php?topic=44359.80;topicseen

https://github.com/CalinLeafshade/ags-spritefont

Would be great! :)
Title: Re: AGS engine Android port
Post by: Iceberg on 06 Jun 2015, 18:39
Hi everyone, I have a question.  I hope this is the right place to ask it.

I'm using AGS-3.3.2.apk on my Android phone.  It worked perfectly on my Samsung Galaxy Ace, but I just traded up to a Samsung Galaxy S4 and now it no longer works.  When I try to run AGS I get the error "unable to write to the current directory.  Do not run this game off a network or CD-ROM drive.  Also check drive free space (you need 1 Mb free)".  It can't be a space problem so I'm thinking it's a permissions thing.  Has anyone else encountered this?  (and if so, how did you resolve it?)

Thanks!  :-D
Title: Re: AGS engine Android port
Post by: adeel on 07 Jun 2015, 11:50
Either your Samsung Galaxy Ace was rooted or it had an older version of Android installed on it. Your new phone is not rooted and contains a newer version of Android. Starting from Kit Kat, permissions became more strict. Hence your guess is right.

AFAIK, there's no fix other than rooting your device (as of now).
Title: Re: AGS engine Android port
Post by: Iceberg on 08 Jun 2015, 00:50
I fixed it by copying the games into phone memory and running them from there.  Obviously, I'd rather have them on the external SD card because they take up so much space, but it seems like an OK (if not ideal) workaround for now.  I don't know about trying to root it - I'm not all that techno-savvy and wouldn't want to brick my phone.
Title: Re: AGS engine Android port
Post by: adeel on 08 Jun 2015, 17:50
Hey, that's a nice workaround. Thanks for that tip! :) Just got my first smartphone a few months ago (and still getting used to it). The first thing I tried to do was to try to get the AGS games to run but failed due to same problem. I wouldn't root my phone too due to the same reason: I'm afraid to brick my phone.

I agree with everything you say.
Title: Re: AGS engine Android port
Post by: MrWood on 10 Jun 2015, 17:48
Where Can I get the latest Build? Is there a solution for the devices with no menu button in development?
Title: Re: AGS engine Android port
Post by: Cassiebsg on 28 Jun 2015, 19:21
Wow! Cool! I managed to get my game running on Android! :-D
Now to get some more AGS games to play on my tablet!
Thanks bunch monkey0506!!! (nod)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 07 Jul 2015, 09:32
Where Can I get the latest Build? Is there a solution for the devices with no menu button in development?
Since JJS is not updating this thread anymore, we need a new thread with links to most recent APKs, whoever makes them; as well as most up to date information on possibilities and problems of this port.
There were a lot of discussion in this thread above regarding many aspects of running game on Android, but all the answers are spread around 30 pages.

Would anyone be able to summarize this information?
Title: Re: AGS engine Android port
Post by: pixelincognito on 07 Jul 2015, 15:19
I managed to get our game showing up in the list on my android tablet but get a number of errors (which is what we feared running the game from AGS 3.3.3.0). The first error window reads:
This game requires a newer version of AGS (3.3.3.0). It cannot be run.

Then a second follows it:

Invalid format. The file may be corrupt, or from a different version of AGS. This engine can only run games made with AGS 2.5 or later. I'm assuming the Gemini Rue and other new titles on play store and itunes use a later version of AGS on android and IOS? I'm just curious if there is anyway way we can get our game on these mobile devices or are we barking up the wrong tree?

Any help would be amazing because I'm so lost with this haha.
Mark
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 07 Jul 2015, 15:21
I managed to get our game showing up in the list on my android tablet but get a number of errors (which is what we feared running the game from AGS 3.3.3.0). The first error window reads:
This game requires a newer version of AGS (3.3.3.0). It cannot be run.

You get these errors because you are using outdated APK.
I saw your question asked on another forum section, where you mentioned you got an APK made back in 2012. It will only be able to run games made with AGS 3.2.1 and below.

The latest APK mentioned in this thread is 3.3.2: https://bitbucket.org/monkey0506/ags/downloads/AGS-3.3.2.apk

I am not sure if there is even a person responsible for building up-to-date Android ports... anyway someone should build it from the source.
Title: Re: AGS engine Android port
Post by: pixelincognito on 07 Jul 2015, 15:59
Oh cool, well with that new apk we have it running on the tablet now and it looks beautiful. From there where do we go about packaging or compiling this into something we can distribute. I'm really sorry for all the questions and sounding like an idiot. I'm guessing this apk of AGS is really just an emulator and not something that turns games into android distributable.

Again...any support is really appreciated, so far you've been amazing.
Mark
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 07 Jul 2015, 16:21
I'm guessing this apk of AGS is really just an emulator and not something that turns games into android distributable.

Not sure what you mean by "emulator", it's not an emulator, its a real engine. It does not run Windows exe in itself, it just reads the game data attached to Windows exe, and in all aspects similar to how Windows version works.
I guess the distributable you want is where all game files are in APK too. This is beyond my knowledge, I guess someone will answer in this thread later.
Title: Re: AGS engine Android port
Post by: pixelincognito on 07 Jul 2015, 16:24
That's cool, sorry for being a pest, I'm guessing the Wadjet Eye games are their own apk files that's all...maybe they aren't (I'm not sure, having not bought any myself) but I'm sure someone can shine a light our way :)

Cheers CW
Mark
Title: Re: AGS engine Android port
Post by: Culzean on 12 Jul 2015, 21:07
I'm currently attempting to build a standalone application using the AGS engine library. I have been able to build the library but cannot compile the AGS game Launcher, it's really getting to the point where I have no more hairs left to pull out. Is someone able to offer a few pointers?

The error I have encountered is the AGS Game Launcher in Eclipse cannot find AGS engine library.jar. However the ndk has not build this for me, so I don't understand why this is required. I am using NDK r9c I think. Any help with this would be a big help.

Thanks clz
Title: Re: AGS engine Android port
Post by: Culzean on 13 Jul 2015, 00:25
Oh good, I have actually managed to build a launcher that is working, which is nice. Though it is throwing an error when I attempt to run a trail game.

Problem: DIGMID patch set not found

Guess this means I have missed something from the build, need a bright idea what it might be.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 13 Jul 2015, 01:09
Problem: DIGMID patch set not found
Some information on this error may be found here:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=50452.0
Title: Re: AGS engine Android port
Post by: Culzean on 13 Jul 2015, 23:11
Is there build settings are Android? I see the R.txt file seems to contain something along those lines but I'm not sure how to go about editing it.
For example how do I switch between a portrait and a landscape rendering for the game?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 13 Jul 2015, 23:18
Is there build settings are Android? I see the R.txt file seems to contain something along those lines but I'm not sure how to go about editing it.
For example how do I switch between a portrait and a landscape rendering for the game?
I think there are number of settings in the Launcher. At least, the line "rotation" in "android.cfg" might server this purpose (it should be "rotation=0" or "rotation=1" I think).
Sorry, I did not really use that port myself. Hopefully someone who did will give more precise information.
Title: Re: AGS engine Android port
Post by: pixelincognito on 17 Jul 2015, 08:51
I'm struggling to get it to build correctly, again...I'm an utter noob at this but have Eclipse Juno, Android SDK and Android NDK installed and set up. I know my android NDK and eclipse are set up right as I emulated one of their sample projects correctly. When I import the GameList project I have a number of errors with the files in the 'src' and 'gen' directory which stops the project from building.

I spoke to a coder friend who has a lot of experience with working with cross-platform stuff and had said the game would need to be packed into an obb file being over 50mb. You would then need to write a good bit of Java to get the current version of the AGS Android engine to bypass the start-up game list menu screen, set various graphical options and screen orientation and unpack the game from the .obb. This all sounded great but didn't really get me any closer forward in my personal quest...

I'm guessing that the project actually works fine and I've just imported these files in incorrectly :( lol

Mark
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 17 Jul 2015, 09:16
I spoke to a coder friend who has a lot of experience with working with cross-platform stuff and had said the game would need to be packed into an obb file being over 50mb.
I remember monkey_05_06 was making a program which makes this OBB thing. Try to PM him.

You would then need to write a good bit of Java to get the current version of the AGS Android engine to bypass the start-up game list menu screen, set various graphical options and screen orientation and unpack the game from the .obb.
There is already an Android Launcher for AGS in the same repository. I believe it should do all the user configuration stuff.
Here is an excerpt from the readme.md:
Quote from: https://github.com/adventuregamestudio/ags/blob/master/Android/README.md
Java app

There are two parts to the Java app, one is the engine library in /Android/library and the other one is the launcher app. The default launcher which displays a list of games from the SD-card is in /Android/launcher_list.

The easiest way to build the app is to create an Android project in Eclipse. Choose the "create from existing source" option and point Eclipse to the launcher directory.
Title: Re: AGS engine Android port
Post by: pixelincognito on 17 Jul 2015, 10:12
Ahh thanks for that Crimson, I've stripped out what I was doing and imported in the AGS Engine Library to see if I can build that and had a little more success, I just have two errors that go over my head a little.

From my google searches the first error is something to do with the compile order and the second is a bad directory destination, but neither make much sense to me.

Eclipse error (http://www.dustbowl-adventure.com/images/eclipse/Eclipse_error1.JPG)

Mark.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 17 Jul 2015, 10:44
Hmm, it looks like Engine folder is not present.
I think you need to keep all the folders structure, as it is in the repository.
Well, you do not need all folders, but Android, Common and Engine for certain.
Title: Re: AGS engine Android port
Post by: monkey0506 on 17 Jul 2015, 18:16
When I import the GameList project I have a number of errors with the files in the 'src' and 'gen' directory which stops the project from building.

Make sure that you are also importing the engine and marking it as a library for the GameList project -- they are two separate projects, the latter depending on the engine to build and run.

I spoke to a coder friend who has a lot of experience with working with cross-platform stuff and had said the game would need to be packed into an obb file being over 50mb. You would then need to write a good bit of Java to get the current version of the AGS Android engine to bypass the start-up game list menu screen, set various graphical options and screen orientation and unpack the game from the .obb.

Yes and no on this. To release on the Google Play store the APK itself cannot exceed 50 MB, which is when you would need to pack your game into an OBB file. The Android SDK has a tool for this, but the last time I was looking into this (quite some time ago, actually) the tool was badly bugged and could not pack more than 512 MB into a single OBB file (the particular formatting used in these OBB files should allow at least 2 GB). I wrote a simple fix for it, and I was able to publish standalone APKs with game data packaged in OBB files over the Play store, but none were ever released because there were game-stopping silent crashes in all tests conducted by anyone other than myself.

Regarding reading the OBB file, there's no need to "unpack" it, as it can be mounted as a read-only disk directly, and the engine can be set up quite simply to divert write operations to the appropriate data directory. It's really quite simple to set this part up. I had more difficulty trying to design a decent UI for the downloader in case the OBB file had been corrupted or deleted yet the APK still installed (the code was simple enough, I'm just not a visual design type of person).


I do also realize that I inadvertently changed some code that removed the on-screen menu from the engine, but I have not had time to look into this. This alongside the silent crash issue (reported by Himalaya Studios) were the major issues that prevented many titles being published on the Play store. After the summer I may have more time to look into this again, but right now I am sorely lacking in free time to spend on this.
Title: Re: AGS engine Android port
Post by: Cassiebsg on 24 Jul 2015, 00:42
Hey guys

Just wondering what happened to the keyboard toggle button...
Am using two different versions of the apk, one has it the other not. :(

AGS-3.3.2.apk does not seem to have that extra button to toggle the keyboard, but version AGS_2013-12-14_10-25_44.apk has it... Anyway to get that button on the newer apk?
Just wondering cause the keyboard is needed to some games.

PS - Thanks for developing this apk!! :)

PPS - If anyone know how to turn off auto correction spelling on android, please PM me, before I throw this against the wall!!!
Title: Re: AGS engine Android port
Post by: monkey0506 on 24 Jul 2015, 10:55
Cassie, this is what I was referring to in the last paragraph of my previous post. Probably looming through the history of the Android folder on Github will turn up what I removed, but I don't have time to investigate that right now.
Title: Re: AGS engine Android port
Post by: HappyCat on 27 Jul 2015, 09:20
Just wondering cause the keyboard is needed to some games.
Personally I use Hacker's Keyboard since it can be set to place icon in notifications tray to bring it up in any app. Used it in Technobabylon.
Title: Re: AGS engine Android port
Post by: Cassiebsg on 29 Jul 2015, 21:02
Thanks, I'll check it out. :-D

And no worry monkey0506, when you have the time will be just fine... though, probably better put to use to make the app work with the newest AGS version (3.4?)...  ;)
But I am just glad to be able to play AGS games on my tablet. :-D
Title: Re: AGS engine Android port
Post by: Roy Lazarovich on 25 Sep 2015, 23:14
Hi Guys.

I'm having problems getting MIDI music to work on my tablet.

I'm using version 3.3.2 of the android port
I'm running it on an ASUS Transformer Infinity TF700T tablet running Android version 4.2.1 (Jelly Bean)
I've placed the MIDI patch file in the same folder as android.cfg and my game folders (/storage/emulated/0/AGS/) and named it patches.dat (file size 19MB)
I'm trying out all of the special edition Chzo Mythos games (5 days a stranger etc..) and am unable to get any MIDI music working (works on PC)

Did anyone else encounter this and have found a solution?

Thanks
Title: Re: AGS engine Android port
Post by: sonneveld on 04 Oct 2015, 04:16
I've placed the MIDI patch file in the same folder as android.cfg and my game folders (/storage/emulated/0/AGS/) and named it patches.dat (file size 19MB)
I'm trying out all of the special edition Chzo Mythos games (5 days a stranger etc..) and am unable to get any MIDI music working (works on PC)

I'm seeing this exact same issue with both the Android and PSP builds.

This is the digmid file I downloaded from the recommended site (http://www.eglebbk.dds.nl/program/download/digmid.dat):
Code: Adventure Game Studio
  1. Name:    digmid.dat
  2. Date:    2/10/2015
  3. Size:    19 MB (19,971,986 bytes)
  4. --------
  5. SHA-1:    044fa525b26e7715e80cde24bce0b20e6a306ce4
  6. MD5:      9dd5a6205cdf3af1abe80d1c92c4b857
  7. CRC32:    43f0a36c

It _could_ be related to this commit https://github.com/adventuregamestudio/ags/commit/9b40be2355036db85e113a62e8beb87c8afcdc90 but I suspect it was an issue before but now we get an error message.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 04 Oct 2015, 15:23
I do not see how that commit could be related. Roy Lazarovich sais that his version is 3.3.2, and the commit was added much later.
I am curious, though, why the error message was not displayed earlier. I will investigate this again.
E: Actually, originally error message was displayed only if both of the sound types were requested by player, i.e. BOTH digital sound and midi sound, and driver installation failed. Therefore the error was skipped if any of these two was not requested, regardless of whether there were errors during initialization.


BTW, what is this variable - "psp_midi_enabled":

Code: Adventure Game Studio
  1. if (!psp_midi_enabled)
  2.          usetup.midicard = MIDI_NONE;
  3.  
Is it enabled or disabled?

Also, can you run with log enabled? It may display what is going on in more detail.
Title: Re: AGS engine Android port
Post by: Roy Lazarovich on 04 Oct 2015, 15:44
Crimson Wizard, where can I locate the log file? after turning on debug messages, running the game and then exiting I can't locate any new file created in the AGS folder nor in the game folder, and I'm not sure where else on the SD card to look.

Thanks.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 04 Oct 2015, 16:37
Crimson Wizard, where can I locate the log file? after turning on debug messages, running the game and then exiting I can't locate any new file created in the AGS folder nor in the game folder, and I'm not sure where else on the SD card to look.

Thanks.

Log is turned on in config file
Code: Adventure Game Studio
  1. [misc]
  2. log=1
  3.  
I am not quite sure where the file should be located, but judging by the comments in code, it is "usually "/sdcard/ags".

However this would only be useful in current situation if you use the latest 3.3.5 build (WIP), which writes more detailed info about sound initialization.

E: I think these are latest experimental builds:
http://teamcity.bigbluecup.org/viewType.html?buildTypeId=AdventureGameStudio_EngineAndroid
Click on "Artifacts" link to download the executables.
Title: Re: AGS engine Android port
Post by: Roy Lazarovich on 04 Oct 2015, 17:26
Sure, I'll give it a try
I set the debug messages from the global preferences interface but I'll try to do it from the config file
Title: Re: AGS engine Android port
Post by: Roy Lazarovich on 04 Oct 2015, 20:23
Ok so on the latest debug build I'm getting a dialog box stating "Unable to initialize your audio hardware. [Problem: DIGMID patch set not found]"

I have copies of the file stored in 3 different places named both as the original digmid.dat and as patches.dat

Still wasn't able to get any kind of log outputted
Title: Re: AGS engine Android port
Post by: ManicMatt on 05 Oct 2015, 19:51
I can't get it to find my game! Im using sony xperia M4 and i try the directory SD Card/AGS/ and various other ways and it doesnt find it. I had this running the game on my samsung.. Arghhh!
Title: Re: AGS engine Android port
Post by: HappyCat on 15 Oct 2015, 15:57
I can't get it to find my game! Im using sony xperia M4 and i try the directory SD Card/AGS/ and various other ways and it doesnt find it. I had this running the game on my samsung.. Arghhh!
Do "SD Card/AGS/" even exists on Xpreia M4? I had one of newer Sony phones, if I remember correctly you might want to look for something like /emulated/0/AGS. Best bet would be to use app like ES Explorer to find game manually then insert the path into AGS engine app?
Title: Re: AGS engine Android port
Post by: ManicMatt on 16 Oct 2015, 22:22
In properties from "file commander" that browses files on my phone, the file is stated to be SD Card/AGS/Limbo but nothing! I don't know why it would be emulated?? But that didn't work anyway.
Title: Re: AGS engine Android port
Post by: cstaite on 08 Nov 2015, 11:48
I wanted to play Heroine's Quest on my phone.  I found someone had already made a stub for Steam, but it wasn't included in the APK.  So I set about compiling the APK myself and including the stub in.  It worked!

So two things:

1) If you want a copy of my build (which has the latest version of AGS as of today and the Steam Stub library included) it's available at http://chrisstaite.com/AGS.apk.  This is signed with a self-signed key and hence you will need to permit unknown sources to install it.

2) I can't figure out how to get the patches.dat to be accepted by my build.  The previous builds (from 2013) seem to not ask for them, perhaps they are built in?  It doesn't want to look for them in the "ags" directory.  I'll keep rummaging to see if I can get it to work.  But if anyone has any pointers I'd be happy to hear them.

Thanks.
Title: Re: AGS engine Android port
Post by: ET3D on 08 Nov 2015, 12:02
I wanted to play Heroine's Quest on my phone.  I found someone had already made a stub for Steam, but it wasn't included in the APK.  So I set about compiling the APK myself and including the stub in.  It worked!

Thanks! I've been wanting to play this game for a while, so I'm glad I happened to drop by today. (It's because I bought Resonance at GOG to play on my tablet.)
Title: Re: AGS engine Android port
Post by: Dualnames on 11 Nov 2015, 21:30
Is there a way to make the joystick plugin somehow to be disabled?(stub) when detected, indtead of me disabling it when compiled?
Title: Re: AGS engine Android port
Post by: LGeo inc on 12 Jan 2016, 18:41
;)
Title: Re: AGS engine Android port
Post by: monkey0506 on 02 Feb 2016, 22:28
Latest APK: https://bitbucket.org/monkey0506/ags/downloads/AGS-3.4.0.6.apk
Title: Re: AGS engine Android port
Post by: Cassiebsg on 02 Feb 2016, 22:33
Thanks :)
Hope to install it and test it soon. Maybe it'll fix the constant crashes I keep experiencing while playing "Th Visitor 3" on it.
Title: Re: AGS engine Android port
Post by: Mehrdad on 03 Feb 2016, 05:14
Latest APK: https://bitbucket.org/monkey0506/ags/downloads/AGS-3.4.0.6.apk

Great!!!. Nice job .Android is alive perfectly. I remember you said before that you have plan for add Android port like Linux for AGS . Is it in progress yet? If is not , what can I do for accept Google Play by your apk. Is any way or some tricks?
I'm appreciate for any help   
Title: Re: AGS engine Android port
Post by: monkey0506 on 03 Feb 2016, 06:37
I plan to start working on a two-phase build process for standalone Android apps.

The simplest method for standalone apps is to use the mountObb (http://developer.android.com/reference/android/os/storage/StorageManager.html#mountObb(java.lang.String, java.lang.String, android.os.storage.OnObbStateChangeListener)) function to mount an expansion file as a read-only file system. This allows games up to 2 GB without any modifications to the engine. Packing the game files into the APK would limit the game size to 100 MB at best (Google Play Store limit).

The editor could likely build an appropriate OBB file (opaque binary blob files can be literally anything; mountObb expects a FAT16 file system with the files stored appropriately in its file table), but building, signing, and aligning the APK are a bit beyond a realistic scope for now. However, I have had success in updating the Android project files to Android Studio, so a prefabricated AS project could be supplied. You would change a few lines in the string resource file and update the graphical assets, and then you could export your signed APK from AS, and upload the APK and the OBB file to the Google Play store. This two-phase building is actually rather simple, once the other steps are put in place. I'm finishing reimplementing some steps that I had done a few years back, but then the prefab AS project should be finished. At that point, a three-phase process would be available: 1) build the game data files with AGS 3.4.0, 2) build the Android expansion file using the jobbifier (https://github.com/monkey0506/jobbifier) tool, and 3) build the APK using the Android Studio project.

I intend to publish the Android Studio project files once I have finished implementing the downloader interface for ensuring the expansion file exists.
Title: Re: AGS engine Android port
Post by: Mehrdad on 03 Feb 2016, 12:26
Wow. It's really great news ;-D
It seems every things is ready for fire. Both two your method is perfect . apk + OBB is so professional package for Google Play.
AGS with Android port is best business game making for all. Please don't leave this place.I'm sure there is ready many developers for your port even with pay too.also me.
When did you expect for stick it to AGS 3.4 ? Is any hope for this month?
If it takes too long if you don't mind please lead me step by step for make this package(APK+OBB) as dummies with keystore . Unfortunately I'm not good programmer special for Java and can't any help to you.
 
Title: Re: AGS engine Android port
Post by: Stromvin on 03 Feb 2016, 14:22
Hi there, just wanted to say that i find this pretty awesome. Havin the possibility to get my game on a tablet or Smartphone is pretty cool. And i did realize that for some games it indeed might be the market of the future since almost everyone has such a device.
So keep up the good work, and have a mighty Thank you to all people involved in this ;)
Greez Stromvin
Title: Re: AGS engine Android port
Post by: monkey0506 on 03 Feb 2016, 20:59
If it takes too long if you don't mind please lead me step by step for make this package(APK+OBB) as dummies with keystore . Unfortunately I'm not good programmer special for Java and can't any help to you.

Android Studio actually integrated a keystore tool, so there's a very simple GUI for that when you select "Generate signed APK". I'll post full details later.

Edit: I was able to implement the downloader interface and get it working with this. Turns out that the "library" project that Google supplies is kind of out-of-date! Also, it probably turns out that a lot of my work figuring out how to get these gradle build scripts working with the "experimental" plugin was unnecessary, as I've realized that since I'm invoking the NDK manually, it doesn't really matter about the built-in NDK support! (sorry, implementation details)

The last thing I need to get working is a prompt for downloading the expansion file over cellular (regarding data charges, seems a good idea to prompt the player instead of assuming). Then I can release the source code for this app and design it into a template for general use.

....aaaaand, I got called into work. So.... soon.
Title: Re: AGS engine Android port
Post by: Mehrdad on 04 Feb 2016, 06:28
Thanks so much . I'm waiting for your good news.
Title: Re: AGS engine Android port
Post by: monkey0506 on 04 Feb 2016, 16:38
Source of the Scourge of the Underworld app (https://github.com/monkey0506/osd-scourgeoftheunderworld-as)

This project actually serves well enough as a template for my purposes. It's extremely simple to swap the project files to a new game, a process I've actually done twice this morning already for Scourge DX and Mighty Pirate. I've explained the process in the README, though it will take some time to get everything set up properly the first time (install Android Studio, install gradle 2.10, download prebuilt native libs, setting up the necessary resource files, etc.). That being said, though, it occurred to me that if you are publishing multiple apps on Google Play, that using this git repository as a base, you can check out a branch for your app, make the necessary modifications, and then git will prevent you from having to clone the agsEngineLibrary, google_play_licensing_library, and google_downloader_library libraries multiple times. Since a large portion of the APK code between games is the same, git can keep track of the changes instead of you using multiple project folders. This is what I am doing for the OSD games that I am publishing on Google Play.

At some point I will try to create a separate thread that details, step-by-step, what needs to be done, with images.... at some point.
Title: Re: AGS engine Android port
Post by: Mehrdad on 05 Feb 2016, 06:17
Wow . excellent ;)
I'm try but I can't success yet.Your files and 'read me' is nice as problem is in my knowledge. Maybe I need more clear.(Dummies complete)
Title: Re: AGS engine Android port
Post by: AGD2 on 12 Mar 2016, 15:56
Latest APK: https://bitbucket.org/monkey0506/ags/downloads/AGS-3.4.0.6.apk

I hadn't tested the Android version for a long while, and I downloaded and installed this latest APK build today. For some reason, no matter which AGS game I try to run on my Galaxy S5,it gives me the following error message before quitting and failing to run the game:

Quote
Error
Unable to write to the current directory. Do not run this game off a network or CD-ROM drive. Also check drive free space (you need 1Mb free).

I have all the games stored on a MicroSD card, and I set the game folder accordingly in the preferences (storage/extSdCard/ags). These games all worked in this location with previous versions of the APK that I installed.

Am I overlooking something or is there a new instruction that must be followed to get things working in the latest build?
Title: Re: AGS engine Android port
Post by: monkey0506 on 13 Mar 2016, 04:51
When you were running the previous build, was the device running on KitKat (Android 4.4) or higher? Does that older APK still work? If so, please let me know which APK you were using previously, because there haven't been changes to the app since the last APK I provided, I just rebuilt the engine.

It seems that the issue is this one (http://forums.androidcentral.com/verizon-samsung-galaxy-s4/384648-kitkat-issue-can-t-write-external-sd-card.html), because KitKat removed the ability to write to the SD card except into the app's private data folder.

Just to verify, could you test if Scourge of the Underworld (https://play.google.com/store/apps/details?id=com.monkeymoto.osd.scourge) works on your device? This standalone app explicitly uses its own private data folder as the save location. If this app works, then that pretty much confirms that your issue is that the Android OS is preventing writing anything to the SD card.
Title: Re: AGS engine Android port
Post by: AGD2 on 13 Mar 2016, 10:37
Yeah, I looked through this thread after typing my post above and I came across another report of this causing issues with file permissions after Kit Kat. I was indeed using an earlier OS when I tested the games on Android last time (I believe ICS or Jellybean).

When I moved the game data from my SD card to the phone storage, it did start working again. It'd definitely be good if the game data could still be stored on the SD card, somehow, though.

BTW, I just tested Scourge of the Underworld and it worked fine. Although it installed to my phone's internal storage and couldn't be moved to the SD card via the Application Manager. Can any AGS app explicitly set its own private data folder as the save location?
Title: Re: AGS engine Android port
Post by: AGD2 on 19 Mar 2016, 06:43
Oh, and one other bug is that tinting/light levels on regions and Tint/SetAmbientTint no longer work when using the Software driver.
Title: Re: AGS engine Android port
Post by: gobeye on 21 Mar 2016, 20:17
I've just found this port and disregarding the odd crash it works brilliantly, thanks for the hard work. Couple of questions though:

How do i save? I've found the keys area under menu but pressing the save and restore doesn't do anything? I've also tried pressing the function buttons directly using hacker's keyboard to no avail.

Also I mostly play on my mojo micro console so use a Bluetooth mouse or a controller to control my touchscreen presses. This works ok in AGS other than the android mouse is offset from the in game cursor position which is a bit of a pain. Any ideas on how to fix this? I can probably fudge something with tasker but it would be great to have a native solution.

I'm on the latest build posted.

Cheers
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 02 Jun 2016, 12:53
Can anyone tell, whether is would be acceptable to increase default sprite cache size to 100 MB for Android device? We have a restriction in the Android port code that limits cache size to 20 MB always (even regardless the config), and I do not know why is that so.
Title: Re: AGS engine Android port
Post by: luifer on 21 Jul 2016, 18:41
greetings and congratulations for making it possible that good old games are possible to play them in the current devices, I just found its AGS-3.4.0.6.apk program to play Quest for Glory 2, but I get the following message,

"warning: your video card must support 32-bit color to play this game.
plase run the setup program and make sure that the "downgrade 32-bit graphics to 16-bit option is not checked before playing"


I hope you can help me how to pass this problem? thanks and sorry if not better place even post it, thanks

Title: Re: AGS engine Android port
Post by: Crimson Wizard on 21 Jul 2016, 19:30
"warning: your video card must support 32-bit color to play this game.
plase run the setup program and make sure that the "downgrade 32-bit graphics to 16-bit option is not checked before playing"

I cannot find a message like this in the engine nor Android port itself. Do you get this message right in the game, or before the game could load up?
Title: Re: AGS engine Android port
Post by: luifer on 22 Jul 2016, 23:06
thanks for your answare, the mesage appear just when the game starts the app looks that work fine but in the game its appear when the game starts. the message its from the game not the app.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 22 Jul 2016, 23:35
I'd suggest to ask game developers for clarification in case following won't work, but thinking logically, you may check config file to see if there is "notruecolor = 1" string mentioned anywhere, and if there is, remove that line.
Title: Re: AGS engine Android port
Post by: luifer on 18 Aug 2016, 22:12
Greetings again, I hope not to bother, I could install a new version of AGS.apk which allowed me to run the game without any problem, the game in question is Quest for Glory 2 remake, if you do not mind I would like to know how I can use the arrows of the system keyboard because in this particular game requires using the keyboard arrows, specifically required when the character train with Uhura. Thank you for your attention.
Title: Re: AGS engine Android port
Post by: catafracta on 31 Aug 2016, 21:17
Hello.

Since I see it's difficult to find the .apk files for the latest versions of the Android Engine, I decided to try and compile the code available in Github. I am using Eclipse and I have followed the instructions at https://github.com/adventuregamestudio/ags/tree/master/Android , and managed to compile the Java App and the Native Engine Library. I did not build the Native 3rd party libraries because it says it's not necessary.

I'm using Android 7.0 to make the build, both for AGS Engine Library and AGS Game Launcher. Then, once I manage to build the AGS Game Launcher project using "ant" from Eclipse, I exported the project AGS Game Launcher ( export as "Android application" ) and obtained an .apk file. I can install this apk in my mobile (Samsung Galaxy S5) with no problem, but when I try to run it all I get is an error message "Unfortunately AGS has stopped".

I have set up a virtual Android device, in order to try and debug the code, and I've placed many breakpoints in the different methods of GamesList.java. I can run the emulator and see it working in my screen, but when I select "Debug" on Eclipse, then I see in the emulator the message "AGS has stopped", and the debugger doesn't even stop at any break point.

I would really appreciate your help, some clue on where to look to investigate the problem, because I'm completely stuck now.

Thank you very much
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 31 Aug 2016, 22:16
Since I see it's difficult to find the .apk files for the latest versions of the Android Engine
Hello.
First of all, we have a build server, where you could get the latest APKs:
http://teamcity.bigbluecup.org/viewType.html?buildTypeId=AdventureGameStudio_EngineAndroid
These downloads could be considered "nightlies". I do not use them myself, but I think they should at least be runnable.
You can click login as a guest - that will still let you download output files.
More info about build server:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=52581.0


Regarding running problems, could you clarify which branch you were building (was it master or another)? Mind that master is our development branch now and may not be fully stable (especially for mobile ports which are tested less often). I recommend building from "release-3.3.5" or "release-3.4.0" branches (depending on the version of the games you are going to run).
Title: Re: AGS engine Android port
Post by: catafracta on 03 Sep 2016, 12:09
Thank you very much for the URL of the build serve, that solved my problem.
Regards
Title: Re: AGS engine Android port
Post by: SimSaw on 27 Sep 2016, 19:30
Thank you very much for the link too! However I noticed that the current build for Android seems not to work with translations although translations can be configured and work with older versions. Is here somebody who could fix this in the code and let the build server rebuild?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 30 Sep 2016, 14:20
Thank you very much for the link too! However I noticed that the current build for Android seems not to work with translations although translations can be configured and work with older versions. Is here somebody who could fix this in the code and let the build server rebuild?

SimSaw, I restored some of the older builds on build server. The link is the same (http://teamcity.bigbluecup.org/viewType.html?buildTypeId=AdventureGameStudio_EngineAndroid) but it should now have more selection.
(this won't last long, the build server deletes unused builds after some time!)

Could you try different versions: "master", "release-3.3.5" and "release-3.4.0", - and tell which have translation working for you and which not?
I am trying to understand which version has this bug.
Title: Re: AGS engine Android port
Post by: SimSaw on 30 Sep 2016, 21:31
Thanks for compiling them. Unfortunately both of them are not working with translations.

Maybe this is a builder configuration issue? I have a version 3.4.0.6 from another page in this thread which works with translations.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 30 Sep 2016, 21:59
Thanks for compiling them. Unfortunately both of them are not working with translations.
By "both", which two of the three options I suggested you mean? :)

Maybe this is a builder configuration issue? I have a version 3.4.0.6 from another page in this thread which works with translations.
Knowing that it worked in 3.4.0.6 is useful. As for the reasons, that could be something in the program code that causes this, it is hard to say right away.
Title: Re: AGS engine Android port
Post by: SimSaw on 01 Oct 2016, 07:40
Sorry, I missed master. I mean that I tested the build server's release-3.3.5 and release-3.4.0. Since I had already checked master of which I know it does not work I skipped it. So translations do not work in all three versions.
Title: Re: AGS engine Android port
Post by: guga2112 on 28 Oct 2016, 13:14
Hi there,
I beg your pardon in advance if my question is stupid, it probably is (I surely missed something that will make me die of shame when you tell me) but I'm trying since days to solve this and I thought you all might know better than me how to proceed.

I downloaded the sources (of both ags and lib-allegro) and followed literally the instructions in order to compile the engine with ndk. However, ndk-build tells me that allegro.h can't be found (included by wgt2allg.h in Common/util).

Should I need to set up some kind of include path? How should the whole setup look? Should I be working under Linux or is Windows also OK?

Thanks a lot in advance!
Cheers,
Guga
Title: Re: AGS engine Android port
Post by: guga2112 on 30 Oct 2016, 13:24
Hi everyone,
I managed to compile everything under linux.

I seem to have problems with the mouse cursor, it remains on the left screen edge no matter what I do with my fingers.

Another question is: is there a way to set how textures are scaled? My game is a low-res one and I'd like to have everything with nearest neighbor scaling to preserve the pixely aspect, but everything is blurred and anti-aliased.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 30 Oct 2016, 13:46
Unfortunately I cannot give any advices about building the port, because I never done that myself.

Another question is: is there a way to set how textures are scaled? My game is a low-res one and I'd like to have everything with nearest neighbor scaling to preserve the pixely aspect, but everything is blurred and anti-aliased.
You may look into config file (acsetup.cfg), the available options for latest version are listed here: https://github.com/adventuregamestudio/ags/blob/master/OPTIONS.md
Also, I thought there is a Launcher app for Android that uses its own config, that may have, for example, options related to touchscreen.
Title: Re: AGS engine Android port
Post by: cat on 06 Nov 2016, 09:45
Hi!

I seem to have problems with the mouse cursor, it remains on the left screen edge no matter what I do with my fingers.

I have the same problems, using the nightly master build from here: http://teamcity.bigbluecup.org/viewType.html?buildTypeId=AdventureGameStudio_EngineAndroid (http://teamcity.bigbluecup.org/viewType.html?buildTypeId=AdventureGameStudio_EngineAndroid). I also copied the patches.dat.

I can start the game (3.4.0.6) but I have a serious problem with the cursor:
I can move the cursor only up and down alongside the left screen edge but not in the middle of the screen.

Additionally, the audio is not very smooth and jumps a bit, but the cursor issue is most serious one, of course.

Any ideas?
Title: Re: AGS engine Android port
Post by: cat on 07 Nov 2016, 19:18
Latest APK: https://bitbucket.org/monkey0506/ags/downloads/AGS-3.4.0.6.apk

I tried this version and now the mouse is working! My phone is rather old, so the particle effects are slooooow but still, they are working.

However, now the music problems are really noticable. Even if I don't click anything, the music stutters terribly.
Are there any settings I can change?

I would like to show the game at AdventureX - of course to showcase my game, but also to show AGS' abilities...
Title: Re: AGS engine Android port
Post by: cat on 09 Nov 2016, 20:07
An update on the audio issue: it seems to be related to the mp3 itself.
Originally, it was an mp3 with 256kbps. I converted it to wav and then to ogg using oggrop with 128kbps and now it is working. Mp3 with lower bitrate also seem to be working.
I hope I find a way to easily batch-convert all audio files of the game...

Now I just need to get that credits module to work...

Edit: Audacity (Freeware!) can do batch processing of audio files.

Edit2: Sometimes the music is still stuttering, especially when changing rooms but also sometimes when walking or doing other interactions, but I can live with it for now.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 10 Nov 2016, 08:47
Now I just need to get that credits module to work...
What's wrong with credits module on Android?
Title: Re: AGS engine Android port
Post by: cat on 10 Nov 2016, 09:31
What's wrong with credits module on Android?
Not sure, they just won't show. However, this is not my highest priority.

The most important issue is about the various engine apk floating around the net in questionable conditions. I tried different versions:

What is the best version to use at the moment? The forum thread is also very confusing and the first post seriously outdated...
Title: Re: AGS engine Android port
Post by: AnasAbdin on 10 Nov 2016, 09:37
What is the best version to use at the moment? The forum thread is also very confusing and the first post seriously outdated...

This.
I spent hours deciphering the thread until I managed to get Tardigrades work on a Samsung Galaxy Tab E with midi enabled. Still couldn't do that on the SD Card.

(http://i.imgur.com/gp4mOXO.jpg)
Title: Re: AGS engine Android port
Post by: cat on 10 Nov 2016, 09:42
What version did you use in the end?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 10 Nov 2016, 09:49
The latest version from http://teamcity.bigbluecup.org/viewType.html?buildTypeId=AdventureGameStudio_EngineAndroid (http://teamcity.bigbluecup.org/viewType.html?buildTypeId=AdventureGameStudio_EngineAndroid) seems to have serious issues with the mouse cursor, that makes it unplayable.

We need to bring current version from build server to playable state again. There were certain changes to how mouse works in 3.3.5/latest 3.4.0, which could have affected mobile ports. Sadly, these ports are not actively tested, nor there is an all-time-active dedicated port maintainer, so issues like this could be left unnoticed and unhandled for a long period of time.

I suggest not being shy and post all the troubles you find in latest port version on the bug tracker :).

I was planning to study Android port for a while, hopefully I will be able to find time to do so in the nearby future.
Title: Re: AGS engine Android port
Post by: AnasAbdin on 10 Nov 2016, 09:56
What version did you use in the end?

AGS-3.4.0.6.apk

then got DIGMID.dat, unpacked it with 7zip, renamed the extracted file to patches.dat and moved it to the game's folder.

The game works, the sound in the cut-scenes is is not perfect though :-\ It might be due to the capabilities of the device (Samsung Galaxy Tab E)
Title: Re: AGS engine Android port
Post by: cat on 10 Nov 2016, 10:19
AGS-3.4.0.6.apk
Which one? The one from the bitbucket downloads?

Does you game have midi audio only or do you also use mp3? If mp3, what bitrate?
Title: Re: AGS engine Android port
Post by: AnasAbdin on 10 Nov 2016, 10:25
This is the one I got:

I found a link to monkey's bitbucket repo (https://bitbucket.org/monkey0506/ags/downloads/AGS-3.4.0.6.apk (https://bitbucket.org/monkey0506/ags/downloads/AGS-3.4.0.6.apk)).

The game uses midi for music background and mp3 for sound effects at 128kbps.

Edit: not sure how to get a keyboard so I can name the save games (I can make an in-game gui.. hmmm (nod) )
Title: Re: AGS engine Android port
Post by: Cassiebsg on 12 Nov 2016, 13:36
Think it's problem with that version, the previous version had a button to get the keyboard up.
Title: Re: AGS engine Android port
Post by: AnasAbdin on 12 Nov 2016, 15:33
Think it's problem with that version, the previous version had a button to get the keyboard up.

Which one?
Do you have a link?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 12 Nov 2016, 16:16
I am too curious to know if something from past versions does not work anymore, because as I mentioned, without dedicated port maintainer nor explicit testing/fixing process, it is very difficult to track issues with ports.

I really suggest to open an issue in the bug tracker and post a list of everything that does not work / work worse compared to previous versions.
Title: Re: AGS engine Android port
Post by: Cassiebsg on 12 Nov 2016, 16:45
@AnasAbdin, they are both posted on the same thread... but I'll turn on my tablet and check the version for you.

EDIT: Ermmm.... sorry, but turning on my tablet didn't help. No where can I find the version, and the credits just doesn't show anything at all (blank screen).

EDIT 2: Okay, checking my downloads folder shows I have these two:
AGS_2014-4-30 and AGS_2013-10-24_16-22-13.apk

EDIT 3: And here's the link where I reported the lack of keyboard: http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636517670#msg636517670
Read the next few replies too.
Title: Re: AGS engine Android port
Post by: AnasAbdin on 13 Nov 2016, 03:54
All the AGS_2014-4-30.apk links I tried are dead links :(
Title: Re: AGS engine Android port
Post by: Bhaal87 on 26 Dec 2016, 07:51
I've been trying to use the bitbucket link and the latest apk from jjs, but I get a lot of crashes. It seems to happen on all games, though I've only tried it on wadjet eye games. Blackwell and resonance. The crashes happen often enough that the games are almost unplayable. Is there a more stable version I should be using? Is anyone else experiencing this issue? I'm using a Moto g3 running Android marshmallow, stock unrooted.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 26 Dec 2016, 08:17
Do you get any error messages on those crashes?

By the way, I would not recommend using JJS's apks. It's not only that they are very old and not compatible with the recently released games, but also they have "threaded audio" option hardcoded in enable state, and later we found that threaded audio causes lots of problems on non-Windows systems.
Title: Re: AGS engine Android port
Post by: Cassiebsg on 26 Dec 2016, 10:01
@AnasAbdin: Here I've uploaded it for you: http://www.mediafire.com/file/s3jbztzoi71oei8/AGS_2014-4-30.apk
Title: Re: AGS engine Android port
Post by: Bhaal87 on 26 Dec 2016, 21:25
@Crimson Wizard I am just getting the "Unfortunately AGS has stopped" popup and crash back to the launcher. I have looked for any available log files, but haven't found anything relevant. I don't have a rooted device if that makes a difference. Is there something I can do to get a more verbose output?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 26 Dec 2016, 22:51
First of all, I believe the most recent version should be tested. We cannot debug and support 2014th and earlier versions anymore.
That's a big problem that up-to-date versions are not linked anywhere in this thread. I think we need to address this issue asap.

Meanwhile, I used build server to make the APK which corresponds to the latest official AGS 3.4.0:
http://www.mediafire.com/file/2ull91f9a7a9439/AGS-android-3.4.0-P1.zip

Could you test it instead and tell how it runs for you?
Title: Re: AGS engine Android port
Post by: Bhaal87 on 27 Dec 2016, 02:53
The version you posted has an issue I've seen with all the other nightlies from the build server (that didn't crash immediately) which is that the cursor is stuck on the left hand side of the screen. It can move vertically, but no horizontal movement is possible. Also, it is missing the three dot menu button that allowed toggling of the on-screen keyboard. I believe this is an Android SDK compatibility feature. The stated way to open the keyboard is with the menu button, but most modern devices do not have a menu button.
Title: Re: AGS engine Android port
Post by: cat on 27 Dec 2016, 10:33
http://www.mediafire.com/file/2ull91f9a7a9439/AGS-android-3.4.0-P1.zip

Could you test it instead and tell how it runs for you?

I just tried this version on my Android phone. I can start games, but the mouse cursor is still stuck to the left edge of the screen, I cannot move it anywhere else, so it it absolutely not usable at the moment.

Are there any tests I could do to help narrow down the problem?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 29 Dec 2016, 13:45
I will have more free time in the beginning of January, then I hope to study how Android port works.
Title: Re: AGS engine Android port
Post by: Mehrdad on 29 Dec 2016, 16:43
I will have more free time in the beginning of January, then I hope to study how Android port works.

Great news CW . I'm sure it's a start to generate Android port from editor. Please do it .
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 29 Dec 2016, 17:45
I will have more free time in the beginning of January, then I hope to study how Android port works.

Great news CW . I'm sure it's a start to generate Android port from editor. Please do it .

No, all I want is to find out if I can make 3.4.0 version work on Android. (I was replying to cat's and Bhaal87's reports above) I have no plans concerning the Editor.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 06 Jan 2017, 21:09
Just to report my progress; I am not an Android developer, and did not yet manage to build Android port myself, but I learnt how to launch it on emulator program called BlueStacks (http://www.bluestacks.com/) on my PC.

Running a random game, I found this in the AGS logs:
Quote
Succeeded. Using gfx mode 1 x 1 (32-bit) windowed
   filter dest (0, 0, 0, -1 : 1 x 0), render dest (0, 0, 0, -1 : 1 x 0)

Mouse confined: (0,0)-(0,199) (1x200)
...along with numerous failed attempts to set gfx mode 0 x 0.

I have a feeling this may explain why the mouse is so weird. Well, going to look into this further.


PS. By the way, Android game launcher should be updated to make it work without need of renaming all game files to ac2game.dat. Windows and Linux engines use completely different way of game detection, which should be used everywhere now.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 07 Jan 2017, 01:00
Ok, I think I fixed the mouse issue, please try new APK:
http://www.mediafire.com/file/co45wtuxfa0h232/AGS-android-3.4.0-P1-fix1%282%29.zip
Title: Re: AGS engine Android port
Post by: Mehrdad on 07 Jan 2017, 12:17
Ok, I think I fixed the mouse issue, please try new APK:
http://www.mediafire.com/file/co45wtuxfa0h232/AGS-android-3.4.0-P1-fix1%282%29.zip

Mouse isn't calibrate with finger. maximum distance in corner Up_Left and minimum distance in Down_Right . My mean is corner of Down_Right is OK.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 07 Jan 2017, 13:23
Mouse isn't calibrate with finger. maximum distance in corner Up_Left and minimum distance in Down_Right . My mean is corner of Down_Right is OK.
I do not have any idea of what that even means...

My fix was regarding mouse cursor sticking to the left border of the screen.
I recall there are couple of mouse-behavior settings in the AGS Launcher, could you check them up?
Title: Re: AGS engine Android port
Post by: cat on 07 Jan 2017, 14:42
Thanks for looking into the mouse issue!

I can now now move the mouse, but the position, where I put my finger is not the same as where the mouse cursor is or where the click event is performed.
When I have the finger in the upper-left corner, finger position and mouse cursor match. But the further I move my finger down or right, the more the cursor moves down or right. I guess this is what Mehrdad was trying to say.
When I check the "relative mouse control" option, the behaviour working relative, as expected, but there is still this issue with the finger position affecting the scaling.

I tried a different scaling (i.e. none) and now I have a different behaviour as well. The game is now rather small and centered so I cannot be as precise with my movements. However, when I move the finger to the left or top, there seems to be an invisible border. The cursor can't get past it and is restricted to the area below and right. But I can move it out of the screen on the right bottom border.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 07 Jan 2017, 15:25
but the position, where I put my finger is not the same as where the mouse cursor is or where the click event is performed.
When I have the finger in the upper-left corner, finger position and mouse cursor match. But the further I move my finger down or right, the more the cursor moves down or right. I guess this is what Mehrdad was trying to say.
When I check the "relative mouse control" option, the behaviour working relative, as expected, but there is still this issue with the finger position affecting the scaling.

I tried a different scaling (i.e. none) and now I have a different behaviour as well. The game is now rather small and centered so I cannot be as precise with my movements. However, when I move the finger to the left or top, there seems to be an invisible border. The cursor can't get past it and is restricted to the area below and right. But I can move it out of the screen on the right bottom border.

I can reproduce this behavior when the game is larger than 320x200. I found that Android port is made to report device resolution as 320x200 at all times, regardless of real device size. This means that AGS thinks that game is always stretched to 320x200. Naturally, if the game is 320x200 too, there is no problem, but when games is hi-res, there is mismatches between what AGS thinks is correct (cursor) coordinates and real coordinates.

In other words, drawing coordinates are always thought to be 320x200, but mouse coordinates are probably real...

What is your game resolution, and what happened when you tried same game with older APK?
Title: Re: AGS engine Android port
Post by: cat on 07 Jan 2017, 15:40
The resolution of the game I tried is 640x360.

I tried it with an older version from monkey0506 some time ago (https://bitbucket.org/monkey0506/ags/downloads/AGS-3.4.0.6.apk (https://bitbucket.org/monkey0506/ags/downloads/AGS-3.4.0.6.apk)) and it worked then.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 07 Jan 2017, 17:55
I think I found what was wrong (comments below). Please try another APK:
http://www.mediafire.com/file/dy8cuhctzy1cadg/AGS-android-3.4.0-P1-fix2.zip

Technical commentary follows:

So, the real issue is that when JJS was making these mobile ports, he created a discrepancy. Historically AGS deals with virtual->real coordinates conversion on its own. That is: it calculates how the game's frame should be positioned on real window or fullscreen, and also does mouse cursor position scaling.
However, iOS and Android (not sure about PSP) ports have those conversions done in the backend library (versions of Allegro library, which JJS has written for the ports). This creates an annoying situation when you cannot simply add a new feature or change code related to graphics mode or mouse movement, but have to keep in mind that different ports may apply their own adjustments or report unexpected or useless screen parameters. This also cause duplication of functionality: for example, there is mouse scaling programmed inside AGS engine, and also mouse scaling programmed in Android library. (So I had to turn off mouse scaling inside AGS for Android and iOS to solve this bug).

Ideally, virtual->real coordinate transformation should be done in one place, either core engine code, or back-end library (probably latter is more correct). But current situation is that it's done in one place for one set of engine ports, and in another place for another set of engine ports.
Title: Re: AGS engine Android port
Post by: cat on 08 Jan 2017, 12:56
Now it's working! Thank you so much! Absolute and relative mouse modes work, as well as fullscreen scaling with and without aspect ratio.

Could you update the first post in this thread? I think you can do this as a moderator. The links there are old and the versions outdated. It is very hard for developers to find the most recent working port version here in this thread.
Title: Re: AGS engine Android port
Post by: Cassiebsg on 08 Jan 2017, 13:46
/me claps (nod)

Thanks, I'll look forward to test this... :-D
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 08 Jan 2017, 14:39
Could you update the first post in this thread? I think you can do this as a moderator. The links there are old and the versions outdated. It is very hard for developers to find the most recent working port version here in this thread.
I did, but I think we need to create a new thread, because this is 6 years old, contains many obsolete information and spanning 35 pages now.
I think I will be able to upload Android builds to the same server as Windows ones, if server owners (not sure who are they, AGA or someone else) are okay with that.

BTW, what was that problem with on-screen keyboard mentioned earlier?
I tried to install old JJS's APK on emulator to see if I can spot any differences, but there was some error I could not solve yet.
Title: Re: AGS engine Android port
Post by: Cassiebsg on 08 Jan 2017, 14:55
The old version showed up ... (3 dots) that once clicked would bring up the keyboard. The newer version was missing those 3 dots buttons to bring up the keayboard, makeing it impossible to get the keyboard in a game.

Haven't tried your version yet, but if you can call the keyboard in game, then it should be fine. ;)
Title: Re: AGS engine Android port
Post by: cat on 08 Jan 2017, 14:59
Thanks for updating the first post!

The games that I tried don't use keyboard input, so I can't give any information about it.
Title: Re: AGS engine Android port
Post by: Bhaal87 on 09 Jan 2017, 17:26
I can confirm that this release fixed the mouse cursor issue, but the three dots to bring up the keyboard are still not there. I think this has to do with what version of the Android SDK was used to compile the apk. The three dots are a back compatibility feature for older apps that expect menu button, since modern Android devices have no menu button. I haven't had the chance to test it for long enough to see if it still gets the random crashes like the jjs releases did. Thank you guys for all your hard work!
Title: Re: AGS engine Android port
Post by: Bhaal87 on 10 Jan 2017, 17:01
Looks like this.openOptionsMenu(); needs to be set and set the targetsdk version to < 11.  This stack overflow discussion talks about the issue.

http://stackoverflow.com/questions/8774317/handling-the-missing-menu-button-in-new-versions-of-android-3-x-and-up
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 10 Jan 2017, 22:58
Looks like this.openOptionsMenu(); needs to be set and set the targetsdk version to < 11.  This stack overflow discussion talks about the issue.

http://stackoverflow.com/questions/8774317/handling-the-missing-menu-button-in-new-versions-of-android-3-x-and-up

I can try to look into this, but, as I mentioned before, I am not an Android developer, so I would need to consult with other people who were working on this port (like monkey0506) before changing anything in official version.
Title: Re: AGS engine Android port
Post by: Bhaal87 on 11 Jan 2017, 14:46
Thanks! In the meantime, if anyone is stuck without a keyboard, there is a workaround people have been using. You can download hackers-keyboard from the google play store and configure a permanent notification that allows you to bring up the keyboard. You just swipe down and tap it. It's a little hack-ey but it gets the job done.
Title: Re: AGS engine Android port
Post by: Bhaal87 on 15 Jan 2017, 18:44
I've had some more time to test out the latest build and I'm still getting periodic crashing. Is there a log file I can provide to help the debug process?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 15 Jan 2017, 19:22
I've had some more time to test out the latest build and I'm still getting periodic crashing. Is there a log file I can provide to help the debug process?
The only thing I can recommend is to disable threaded audio. I investigated this a little before, and I came to conclusion that threaded audio is not implemented safely enough.
As for log file, unless Android has its own debug logs, or some analogue for a crash dump, that won't be much use, because our own mostly debugs game startup process.
Title: Re: AGS engine Android port
Post by: Bhaal87 on 18 Jan 2017, 15:14
The only thing I can recommend is to disable threaded audio. I investigated this a little before, and I came to conclusion that threaded audio is not implemented safely enough.
As for log file, unless Android has its own debug logs, or some analogue for a crash dump, that won't be much use, because our own mostly debugs game startup process.

This seems to have done the trick. I've played for about an hour total now and no crashes yet! Should threaded audio be disabled by default after install? I can't remember if turning it on is something I did while playing with settings or if that is the way it started out.

Anyways, thanks! This has made games playable that were not previously. So now the only real issue is the lack of a button to bring up the keyboard.
Title: Re: AGS engine Android port
Post by: Radiant on 23 Jan 2017, 19:23
Ok, I'm feeling really stupid now, I'm trying this out and I cannot figure out how to display a file path on my Android phone. That is, none of the file browsers I've found (e.g. ES and the Samsung internal one) actually display a path name that I can input in the AGS executable. Any suggestions on this please?

(for instance, I see things like /storage/emulated/0/Download which sounds like a fake path and indeed doesn't work...)

(edit) Galaxy A3 running Android 6.0.1, using the AGS-3.4.0.6 posted two pages back.
Title: Re: AGS engine Android port
Post by: NicolaGs on 23 Jan 2017, 21:33
In ES Explorer, you can select a folder (long press) then 3-dots menu ("more") and then "properties"... The path is displayed and you can copy it.
Title: Re: AGS engine Android port
Post by: Radiant on 23 Jan 2017, 21:41
In ES Explorer, you can select a folder (long press) then 3-dots menu ("more") and then "properties"... The path is displayed and you can copy it.

I've tried that, but it didn't work. It shows a fullpath of /storage/1234-5678/ags (or /storage/1234-5678/ags/Gamename, I'm not sure which one is needed) but neither works in AGS 3.4.0.6. There's both an .AGS and a .EXE file in there. Do I need to set folder rights or something?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 23 Jan 2017, 22:14
I've tried that, but it didn't work. It shows a fullpath of /storage/1234-5678/ags (or /storage/1234-5678/ags/Gamename, I'm not sure which one is needed) but neither works in AGS 3.4.0.6. There's both an .AGS and a .EXE file in there. Do I need to set folder rights or something?

Android launcher still uses misleading and incorrect way to search for games: game exe should be renamed to ac2game.dat. I created a ticket about this recently. (https://github.com/adventuregamestudio/ags/issues/379)
Title: Re: AGS engine Android port
Post by: NicolaGs on 23 Jan 2017, 22:19
Do I need to set folder rights or something?
I didn't need to do so and it works for me.
I don't copy all the \Compiled folder, with the .ags. I just copy the folder within (i.e. \Windows) which contains the compiled Windows binaries.

If it doesn't work : is there a restriction in folders access with Android 6 ? IIRC, there was a writing restriction on the SD card in version 5...
Title: Re: AGS engine Android port
Post by: Radiant on 24 Jan 2017, 05:18
Android launcher still uses misleading and incorrect way to search for games: game exe should be renamed to ac2game.dat. I created a ticket about this recently. (https://github.com/adventuregamestudio/ags/issues/379)
Aha, that helps.

Somewhat. Now instead of getting a "no games found" message, I get a big popup "ERROR: Unable to find game data files" and a "no games found" message and AGS crashes. Hmm. I've placed audio.vox in the folder and that didn't help, I wonder what other data files these could be?
Title: Re: AGS engine Android port
Post by: Radiant on 24 Jan 2017, 05:26
Actually, let me retry that on your newest patch build.

I can select the game now and get error "unable to initialize your audio hardware." [Problem: DIGMID patch set not found] This appears to be the same problem I'm getting on Linux: despite using only OGG music, the engine tries to initialize a MIDI library and finds that numerous modern machines don't come with MIDI libraries installed.

Then I get a loading screen and the game hangs.

Retrying, I've now removed audio.vox and acsetup.cfg. I now get the error "unable to write to the current directory". Hmm, ES file manager gave me a similar error, implying that the path /storage/1234-5678 isn't writable but another path with the same target is...

(edit) if acsetup.cfg is in the location, I get that message followed by a crash. If acsetup is not found, it simply exits.
Title: Re: AGS engine Android port
Post by: Radiant on 24 Jan 2017, 05:35
Aha, moving it to internal storage worked  :-D

Yay, I managed to complete Errand on smartphone.
Title: Re: AGS engine Android port
Post by: Radiant on 01 Feb 2017, 13:01
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

Code: Adventure Game Studio
  1. 699 eScriptSystemOSID AGSAndroid::GetSystemOSID() {
  2. 700   return eOS_Win;
  3. 701 }

to
Code: Adventure Game Studio
  1. 699 eScriptSystemOSID AGSAndroid::GetSystemOSID() {
  2. 700   return eOS_Android;
  3. 701 }

and add this value to ags/Editor/AGS.Editor/Resources/agsdefns.sh after line 92
Code: Adventure Game Studio
  1. 88 enum eOperatingSystem {
  2. 89   eOSDOS = 1,
  3. 90   eOSWindows,
  4. 91   eOSLinux,
  5. 92   eOSMacOS
  6. ++  ,eOSAndroid
  7. 93 };

and to ags/Engine/platform/base/agsplatformdriver.h after line 34
Code: Adventure Game Studio
  1. 30 enum eScriptSystemOSID {
  2. 31     eOS_DOS = 1,
  3. 32     eOS_Win = 2,
  4. 33     eOS_Linux = 3,
  5. 34     eOS_Mac = 4
  6. ++     ,eOS_Android = 5
  7. 35 };


Thank you very much!
Title: Re: AGS engine Android port
Post by: Crimson Wizard 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.
Title: Re: AGS engine Android port
Post by: Radiant on 02 Feb 2017, 13:35
Great, thank you very much!
Title: Re: AGS engine Android port
Post by: da1writer 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...
Title: Re: AGS engine Android port
Post by: Crimson Wizard 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
Title: Re: AGS engine Android port
Post by: da1writer 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.
Title: Re: AGS engine Android port
Post by: da1writer 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?
Title: Re: AGS engine Android port
Post by: BlackMageJ 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.
Title: Re: AGS engine Android port
Post by: sawyer 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!!!
Title: Re: AGS engine Android port
Post by: monkey0506 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 (https://bitbucket.org/monkey0506/ags2clientstub). 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 (https://bitbucket.org/monkey0506/ags2clientstub/src/c47709b458874edc702e49b98da7c4507653c046/Solutions/CodeBlocks/agsteamstub.cbp?at=master&fileviewer=file-view-default) may be used for reference (I will try to look into writing a Makefile, I don't have much experience working with them).
Title: Re: AGS engine Android port
Post by: eri0o 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:
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.  
Title: Re: AGS engine Android port
Post by: Crimson Wizard 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).
Title: Re: AGS engine Android port
Post by: eri0o 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 (http://www.adventuregamestudio.co.uk/forums/index.php?topic=54948.msg636578010#msg636578010), but for some reason DragAndDrop from the DragAndDrop module isn't working . :/
Title: Re: AGS engine Android port
Post by: Crimson Wizard 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 (http://www.adventuregamestudio.co.uk/forums/index.php?topic=54948.msg636578010#msg636578010), 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.
Title: Re: AGS engine Android port
Post by: Crimson Wizard 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
Title: Re: AGS engine Android port
Post by: eri0o 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 :/
Title: Re: AGS engine Android port
Post by: sawyer 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 :)
Title: Re: AGS engine Android port
Post by: eri0o 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
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
Title: Re: AGS engine Android port
Post by: Snarky 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.
Title: Re: AGS engine Android port
Post by: Crimson Wizard 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.
Title: Re: AGS engine Android port
Post by: Snarky 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.
Title: Re: AGS engine Android port
Post by: eri0o on 30 Dec 2017, 22:05
You read right Snarky, if I understood, touch needs to be a click but still keep the state of the left mouse button pressed while the finger is pressed on the screen. At least this is how I understand the mouse works in AGS, it emits the mouse click event on click and not on release.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 30 Dec 2017, 22:26
You read right Snarky, if I understood, touch needs to be a click but still keep the state of the left mouse button pressed while the finger is pressed on the screen.

Maybe I did not understand your previous explanations, what is the difference between "longclick" mode set in config and what you want to achieve?
Title: Re: AGS engine Android port
Post by: eri0o on 31 Dec 2017, 00:08
To trigger long click, you have to hold your finger and wait until the device vibrates, and then the longclick is processed. The idea would be that once the screen is touched, the mouse button is already considered down.:/ Also as is, to remove the finger, you have to click with the finger again. CW don't worry. (I really don't like how written text makes me sound like I am ungrateful...)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 31 Dec 2017, 00:40
CW don't worry. (I really don't like how written text makes me sound like I am ungrateful...)
The purpose I am asking is to learn more about Android port, because so far I only used it few times on emulator :).
Title: Re: AGS engine Android port
Post by: sawyer on 04 Jan 2018, 05:07
Having grown up in foster care I realize one thing. Good things are rare and should be treated with care..
This thing that all of you do is a good thing. I'll be 50 in a few days and wanted to reflect the fact that I respect what all you guys do!!
Thank you for allowing me to enjoy :)
sincerely.
Title: Re: AGS engine Android port
Post by: sawyer on 11 Jan 2018, 03:44
:cheesy: P.S.   Think it will ever happen, ya know,
update with no link fail so all games can truly be portable?
easy .apk install for dummies....lol :)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 11 Jan 2018, 22:39
@eri0o, I found why it does not find allegro.h for you.

There were patched allegro sources for Android right in our repository earlier. Nick Sonneveld has removed them and added download & patch script instead. But he did not change instructions in Readme.

You now have to perform "Native 3rd party libraries" step before doing "Native engine library".

Firstly, you need to have "curl" utility installed. (Maybe it is standard, but my Ubuntu did not have it)

Then:
Quote
The scripts require standalone toolchains for all Android platforms and they have to be available on the PATH. See https://developer.android.com/ndk/guides/standalone_toolchain.html for instructions on creating the standalone toolchains.


EDIT
Well, I looked into the NDK/toolchains, and there are already several toolchains created. Problem is that when I run buildall.sh, I get this:

Quote
cd builds/unix; /bin/sh ./configure '--host=arm-linux-androideabi' '--prefix=/home/ikm/git/ags/Android/nativelibs/armeabi' '--without-zlib' '--disable-shared'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking for arm-linux-androideabi-gcc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/ikm/git/ags/Android/buildlibs/armeabi/freetype-2.4.12/builds/unix':
configure: error: C compiler cannot create executables

Not sure what is missing and how to proceed from here.

EDIT2:
I was able to find out that "configure: error: C compiler cannot create executables" was caused by gcc error "Unrecognized command '-mthumb'". That's all I can add at this point.
Title: Re: AGS engine Android port
Post by: sawyer on 03 Feb 2018, 18:37
Hope this works out so everyone can enjoy.
Either way, what each of you do is truly something special.
All the personal time you each put into these games/engines, is something I myself am truly thankful for.
Your selflessness truly lifts my spirits!
So to everyone involved, you are appricated!!  8-)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 06 Feb 2018, 12:57
Continuing....

Well, I looked into the NDK/toolchains, and there are already several toolchains created. Problem is that when I run buildall.sh, I get this:

Quote
cd builds/unix; /bin/sh ./configure '--host=arm-linux-androideabi' '--prefix=/home/ikm/git/ags/Android/nativelibs/armeabi' '--without-zlib' '--disable-shared'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking for arm-linux-androideabi-gcc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/ikm/git/ags/Android/buildlibs/armeabi/freetype-2.4.12/builds/unix':
configure: error: C compiler cannot create executables

Not sure what is missing and how to proceed from here.

EDIT2:
I was able to find out that "configure: error: C compiler cannot create executables" was caused by gcc error "Unrecognized command '-mthumb'". That's all I can add at this point.

Alright, a bit of a progress here.

1) First of all, I managed to create standalone toolchains myself, although I had to modify the script that does that, because the existing one did not work for me. I honestly don't know why, maybe it refers to an old version of NDK.

What I had to do is open Android/buildlibs/makestandalones.sh and in the line -
Code: Bash
  1. $NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch
remove the "--platform=$PLATFORM" part.
Code: Bash
  1. $NDK_HOME/build/tools/make-standalone-toolchain.sh --install-dir=$INSTALL_DIR --arch=$arch
That said, I am not sure whether this was even needed, since some toolchains were already included in NDK distributive.


2) Now, regarding actual library building.
Apparently I misunderstood how the building script works. I thought it somehow refers to the toolchains explicitly, but no, I had to add all the necessary toolchain into PATH. I guess that makes sense (also documentation page (https://developer.android.com/ndk/guides/standalone_toolchain.html) mentioned this, albeit non-explicitly, which I missed).

Straight to the point, each toolchain you are using must be referenced in $PATH.
For example, I created a toolchain in "~/ndk-standalone/android-9/arm". Then I had to add following path to $PATH: "~/ndk-standalone/android-9/arm/bin".
Then, the building process will actually be using a gcc compiler from Android toolchain, rather than the one from your system.

3) After that I was even able to finally launch library compilation. Then it failed while compiling "lua" library (why does it need lua anyway... probably for lua plugin?).

Anyway, at that point I've stumbled into a problem with my virtual machine running out of disk space... which was unexpected. I will continue after fixing that...


UPDATE:

4) Had to install autoconf, automake, cmake, libtool utilities (required to build some of the libs).

5) So far managed to compile freetype, allegro and dumb libraries.
Other libraries: lua and ogg failed with similar errors:
Quote
undefined reference to 'stderr'
undefined reference to 'stdout'
undefined reference to 'signal'
undefined reference to 'rand'
Tremor and theora could not be built without ogg.

Errors may be related to this:
https://github.com/android-ndk/ndk/issues/410
https://github.com/openssl/openssl/issues/445
Title: Re: AGS engine Android port
Post by: eri0o on 07 Feb 2018, 01:54
Hey, I just built love2d for android today, Lua wouldn't build for armeabi because it's support has been dropped, but will build for armeabi-v7a. (in love's case)

I am looking into the project, and for some reason the ndkenv file inside each platform in buildlibs (x86, mips, ...) has the wrong root path. I think first you need to install the toolchains using makestandalones.sh and them use the paths to update ndkenv. Also the project expects Android-9, which is old as hell, I would try with at least 14. Unfortunately, I already spent a lot of time on love2d today, so I will probably only be seriously looking into this tomorrow.  (I felt a lot of pressure from the forums, from 'the future of' discussions, so I had to be away for some time)

Right now I got until (even if I skip armeabi and go directly to armeabi-v7a, so it's not the same case as Lua for love2d apparently)
Code: Adventure Game Studio
  1. lua.o:lua.c:function laction: error: undefined reference to 'signal'
  2. lua.o:lua.c:function l_message: error: undefined reference to 'stderr'
  3. lua.o:lua.c:function l_message: error: undefined reference to 'stderr'
  4. lua.o:lua.c:function pushline: error: undefined reference to 'stdout'
  5. lua.o:lua.c:function pushline: error: undefined reference to 'stdin'
  6. lua.o:lua.c:function docall: error: undefined reference to 'signal'
  7. lua.o:lua.c:function docall: error: undefined reference to 'signal'
  8. lua.o:lua.c:function dotty: error: undefined reference to 'stdout'
  9. lua.o:lua.c:function pmain: error: undefined reference to 'stderr'
  10. liblua.a(lauxlib.o):lauxlib.c:function panic: error: undefined reference to 'stderr'
  11. liblua.a(lauxlib.o):lauxlib.c:function luaL_loadfile: error: undefined reference to 'stdin'
  12. liblua.a(lbaselib.o):lbaselib.c:function luaB_print: error: undefined reference to 'stdout'
  13. liblua.a(ldblib.o):ldblib.c:function db_debug: error: undefined reference to 'stdin'
  14. liblua.a(liolib.o):liolib.c:function luaopen_io: error: undefined reference to 'stdin'
  15. liblua.a(liolib.o):liolib.c:function luaopen_io: error: undefined reference to 'stdout'
  16. liblua.a(lmathlib.o):lmathlib.c:function math_randomseed: error: undefined reference to 'srand'
  17. liblua.a(lmathlib.o):lmathlib.c:function math_random: error: undefined reference to 'rand'
  18. collect2: error: ld returned 1 exit status
  19. make[2]: *** [lua] Error 1
  20. make[2]: Leaving directory `/home/USERNAME/git/ags/Android/buildlibs/armeabi/lua-5.1.5/src'
  21. make[1]: *** [generic] Error 2
  22. make[1]: Leaving directory `/home/USERNAME/git/ags/Android/buildlibs/armeabi/lua-5.1.5/src'
  23. make: *** [generic] Error 2
  24.  
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 07 Feb 2018, 01:57
eri0o, you basically described same thing I mentioned in the previous post :).

E: Unless I am mistaken, I could have actually installed version 14 of NDK.
Title: Re: AGS engine Android port
Post by: eri0o on 07 Feb 2018, 01:58
Sorry Crimson, I had to start somewhere. But hey, I ignored everything you said and eventually felled in the same route, so this must be positive somehow :O
Title: Re: AGS engine Android port
Post by: Chicky on 07 Feb 2018, 03:06
Good work guys, it's exciting seeing your progress even if I don't understand half the stuff :)
Title: Re: AGS engine Android port
Post by: eri0o on 08 Feb 2018, 03:18
Hey CW! The lua thing, following this below appears to solve for lua. Now I hit the same error as below in libogg

Change the Lua patch, in line 23 use:
-CFLAGS= -O2 -Wall $(MYCFLAGS)
+CFLAGS= -O2 -Wall $(MYCFLAGS) -D__ANDROID_API__=$API

ags/Android/patches/liblua.patch
Code: Adventure Game Studio
  1. diff -Naur src/llex.c src/llex.c
  2. --- src/llex.c  2007-12-27 14:02:25.000000000 +0100
  3. +++ src/llex.c  2012-07-30 12:19:06.628478800 +0200
  4. @@ -176,9 +176,8 @@
  5.  
  6.  static void trydecpoint (LexState *ls, SemInfo *seminfo) {
  7.    /* format error: try to update decimal point separator */
  8. -  struct lconv *cv = localeconv();
  9.    char old = ls->decpoint;
  10. -  ls->decpoint = (cv ? cv->decimal_point[0] : '.');
  11. +  ls->decpoint = '.';
  12.   buffreplace(ls, old, ls->decpoint);  /* try updated decimal separator */
  13.    if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
  14.      /* format error with correct decimal point: no more options */
  15. diff -Naur src/Makefile src/Makefile
  16. --- src/Makefile        2008-01-19 20:37:58.000000000 +0100
  17. +++ src/Makefile        2012-07-30 12:10:36.058644700 +0200
  18. @@ -7,17 +7,12 @@
  19.  # Your platform. See PLATS for possible values.
  20.  PLAT= none
  21.  
  22. -CC= gcc
  23. -CFLAGS= -O2 -Wall $(MYCFLAGS)
  24. +CFLAGS= -O2 -Wall $(MYCFLAGS) -D__ANDROID_API__=$API
  25.  AR= ar rcu
  26.  RANLIB= ranlib
  27.  RM= rm -f
  28.  LIBS= -lm $(MYLIBS)
  29.  
  30. -MYCFLAGS=
  31. -MYLDFLAGS=
  32. -MYLIBS=
  33. -
  34.  # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
  35.  
  36.  PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
  37. @@ -93,7 +88,7 @@
  38.         $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
  39.  
  40.  generic:
  41. -       $(MAKE) all MYCFLAGS=
  42. +       $(MAKE) all
  43.  
  44.  linux:
  45.         $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
  46.  


You need to add the same flag (I think) in the ogg.sh script, in the part it passes the CFlags, but I couldn't find out where ogg.sh comes from!

Edit: ok, found a download.sh script that takes libraries from magical machines in Amazon. Edit2: yet it doesn't look that the ogg.sh comes from there...

eri0o@SUPERCOMPUTER:~/git/ags$ find . -iname ogg.sh
./iOS/buildlibs/armv7/ogg.sh
./iOS/buildlibs/x86_64/ogg.sh
./iOS/buildlibs/armv7s/ogg.sh
./iOS/buildlibs/i386/ogg.sh
./iOS/buildlibs/arm64/ogg.sh
./Android/buildlibs/armeabi-v7a/ogg.sh
./Android/buildlibs/armeabi/ogg.sh
./Android/buildlibs/x86/ogg.sh
./Android/buildlibs/mips/ogg.sh
eri0o@SUPERCOMPUTER:~/git/ags$ grep --recursive ogg.sh *
Android/buildlibs/buildall.sh:   ./ogg.sh   
iOS/buildlibs/buildall.sh:   ./ogg.sh


ogg.sh must be like this below (I tested and it works, but I couldn't find a clean way to for it to be like this)
Code: Bash
  1. #!/bin/bash
  2.  
  3. set -e
  4.  
  5. source ./ndkenv
  6.  
  7. SRC_DIR=libogg-1.3.2
  8. rm -rf $SRC_DIR
  9. mkdir $SRC_DIR
  10. tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
  11.  
  12. pushd $SRC_DIR
  13.  
  14. export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
  15. export LDFLAGS="$NDK_LDFLAGS"
  16.  
  17. ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
  18.  
  19. make
  20. make install
  21.  
  22. popd
  23.  
  24. rm -rf $SRC_DIR
  25.  


Edit3: I am not very smart. It come like this from the repository already. I need to modify it directly. (https://github.com/adventuregamestudio/ags/blob/master/Android/buildlibs/armeabi-v7a/ogg.sh)

Edit4: Ok, now for some reason allegro.sh fails on line 17 saying it can't find cmake, but ndk has cmake, so I don't know yet what's wrong...

Edit5: I didn't have cmake, and NDK requires a newer cmake then the offered by Ubuntu repo. Installed newest cmake using pip install cmake . In allegro.sh, I also changed line 31 to use:
  -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake

which points to my correct cmake toolchain for Android. Unfortunately, I now fail with the following

Code: Bash
  1. -- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
  2. CMake Error at CMakeLists.txt:962 (get_target_property):
  3.   get_target_property() called with non-existent target "allegrogl".
  4.  
  5.  
  6. CMake Error at CMakeLists.txt:962 (get_target_property):
  7.   get_target_property() called with non-existent target "loadpng".
  8.  
  9.  
  10. CMake Error at CMakeLists.txt:962 (get_target_property):
  11.   get_target_property() called with non-existent target "logg".
  12.  
  13.  
  14. CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  15. Please set them or make sure they are set and tested correctly in the CMake files:
  16. RT_LIBRARY
  17.     linked by target "allegro" in directory /home/erico/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2
  18.  
  19. -- Configuring incomplete, errors occurred!
  20. See also "/home/erico/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeOutput.log".
  21. See also "/home/erico/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeError.log".
  22.  
  23.  

Edit6: Apparently, cmake looks the missign targets here : ~/Android/Sdk/ndk-bundle/platforms/android-14/arch-arm/usr/lib/ . I am not completely sure if this is true or either if the missing things are libraries. Question : which libpng version should be used with Allegro 4.4.2 ? Trying what is written here: https://stackoverflow.com/questions/14263016/adding-libpng-in-android-ndk-project . Tried. It doesn't change, it still can't find libpng. I removed the compiled libs from the Sdk directories because it doesn't seem to be the correct place. Tried placing in NDK_ADDITIONAL_LIBRARY_PATH but it didn't work too.

Letting full error below, noticed a missing: OSS_COMPILES message too.

Code: Bash
  1. ~/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2$ cmake . -G "Unix Makefiles" -DWANT_TESTS=off -DWANT_EXAMPLES=off -DWANT_TOOLS=off -DWANT_LOGG=off -DWANT_ALLEGROGL=off -DSHARED=off -DCMAKE_C_FLAGS="$NDK_CFLAGS -fsigned-char" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_LD_FLAGS="$NDK_LDFLAGS"   -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DCMAKE_INSTALL_PREFIX=$NDK_ADDITIONAL_LIBRARY_PATH
  2. -- Performing Test ALLEGRO_USE_CONSTRUCTOR
  3. -- Performing Test ALLEGRO_USE_CONSTRUCTOR - Failed
  4. -- Could NOT find OSS (missing: OSS_COMPILES)
  5. -- Checking for module 'alsa'
  6. --   No package 'alsa' found
  7. -- Checking for module 'jack'
  8. --   No package 'jack' found
  9. -- Could NOT find PNG (missing: PNG_PNG_INCLUDE_DIR)
  10. CMake Error at CMakeLists.txt:962 (get_target_property):
  11.   get_target_property() called with non-existent target "allegrogl".
  12.  
  13.  
  14. CMake Error at CMakeLists.txt:962 (get_target_property):
  15.   get_target_property() called with non-existent target "loadpng".
  16.  
  17.  
  18. CMake Error at CMakeLists.txt:962 (get_target_property):
  19.   get_target_property() called with non-existent target "logg".
  20.  
  21.  
  22. CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  23. Please set them or make sure they are set and tested correctly in the CMake files:
  24. RT_LIBRARY
  25.     linked by target "allegro" in directory /home/USERNAME/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2
  26.  
  27. -- Configuring incomplete, errors occurred!
  28. See also "/home/USERNAME/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeOutput.log".
  29. See also "/home/USERNAME/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeError.log".
  30.  
  31.  

Edit7: Re-reading what CW has said, he WAS able to build allegro, so I am doing something wrong, but I don't know what yet...

I am leaving a git diff of my ags git directory to the master at the time I was trying to do this, maybe it's useful in the future. I can't pursue this tomorrow since I need to work on my games too.

Code: Adventure Game Studio
  1. diff --git a/Android/buildlibs/armeabi-v7a/allegro.sh b/Android/buildlibs/armeabi-v7a/allegro.sh
  2. index 2b97658..8b00f1d 100755
  3. --- a/Android/buildlibs/armeabi-v7a/allegro.sh
  4. +++ b/Android/buildlibs/armeabi-v7a/allegro.sh
  5. @@ -14,6 +14,10 @@ pushd $SRC_DIR
  6.  # Platform independent patch
  7.  patch -p0 < ../../../patches/liballegro-4.4.2.patch
  8.  
  9. +echo ${ANDROID_NDK}
  10. +
  11. +echo ""
  12. +
  13.  cmake . -G "Unix Makefiles" \
  14.         -DWANT_TESTS=off \
  15.         -DWANT_EXAMPLES=off \
  16. @@ -24,9 +28,10 @@ cmake . -G "Unix Makefiles" \
  17.         -DCMAKE_C_FLAGS="$NDK_CFLAGS -fsigned-char" \
  18.         -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
  19.         -DCMAKE_LD_FLAGS="$NDK_LDFLAGS" \'
  20. -       -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-android-gcc.cmake \
  21. +  -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake \
  22.         -DCMAKE_INSTALL_PREFIX=$NDK_ADDITIONAL_LIBRARY_PATH
  23.  
  24. +       #-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-android-gcc.cmake \
  25.  make
  26.  make install
  27.  
  28. diff --git a/Android/buildlibs/armeabi-v7a/ndkenv b/Android/buildlibs/armeabi-v7a/ndkenv
  29. index cf9fdfb..f3bf4e3 100644
  30. --- a/Android/buildlibs/armeabi-v7a/ndkenv
  31. +++ b/Android/buildlibs/armeabi-v7a/ndkenv
  32. @@ -5,7 +5,7 @@ get_abs_path() {
  33.  
  34.  unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
  35.  
  36. -export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
  37. +export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/arm
  38.  export NDK_PLATFORM_NAME=armeabi-v7a
  39.  export NDK_HOST_NAME=arm-linux-androideabi
  40.  export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
  41. diff --git a/Android/buildlibs/armeabi-v7a/ogg.sh b/Android/buildlibs/armeabi-v7a/ogg.sh
  42. index 53dd200..8f058f5 100755
  43. --- a/Android/buildlibs/armeabi-v7a/ogg.sh
  44. +++ b/Android/buildlibs/armeabi-v7a/ogg.sh
  45. @@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
  46.  
  47.  pushd $SRC_DIR
  48.  
  49. -export CFLAGS="$NDK_CFLAGS -fsigned-char"
  50. +export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
  51.  export LDFLAGS="$NDK_LDFLAGS"
  52.  
  53.  ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
  54. diff --git a/Android/buildlibs/armeabi/ndkenv b/Android/buildlibs/armeabi/ndkenv
  55. index 0df6781..1a01191 100644
  56. --- a/Android/buildlibs/armeabi/ndkenv
  57. +++ b/Android/buildlibs/armeabi/ndkenv
  58. @@ -5,7 +5,7 @@ get_abs_path() {
  59.  
  60.  unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
  61.  
  62. -export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
  63. +export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/arm
  64.  export NDK_PLATFORM_NAME=armeabi
  65.  export NDK_HOST_NAME=arm-linux-androideabi
  66.  export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
  67. diff --git a/Android/buildlibs/armeabi/ogg.sh b/Android/buildlibs/armeabi/ogg.sh
  68. index 21062a3..56ed267 100755
  69. --- a/Android/buildlibs/armeabi/ogg.sh
  70. +++ b/Android/buildlibs/armeabi/ogg.sh
  71. @@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
  72.  
  73.  pushd $SRC_DIR
  74.  
  75. -export CFLAGS="$NDK_CFLAGS -fsigned-char"
  76. +export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
  77.  export LDFLAGS="$NDK_LDFLAGS"
  78.  
  79.  ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
  80. diff --git a/Android/buildlibs/buildall.sh b/Android/buildlibs/buildall.sh
  81. index b813057..73dec33 100755
  82. --- a/Android/buildlibs/buildall.sh
  83. +++ b/Android/buildlibs/buildall.sh
  84. @@ -6,7 +6,7 @@ pushd ../../libsrc
  85.  ./download.sh
  86.  popd
  87.  
  88. -for arch in armeabi armeabi-v7a x86 mips
  89. +for arch in  armeabi-v7a x86 mips
  90.  do
  91.         rm -rf ../nativelibs/$arch
  92.         mkdir -p ../nativelibs/$arch
  93. diff --git a/Android/buildlibs/makestandalones.sh b/Android/buildlibs/makestandalones.sh
  94. index 7f327cd..65fb734 100755
  95. --- a/Android/buildlibs/makestandalones.sh
  96. +++ b/Android/buildlibs/makestandalones.sh
  97. @@ -5,18 +5,18 @@
  98.  set -e
  99.  
  100.  # Last committed pre-compiled libs were with R8
  101. -NDK_HOME=/opt/android-ndk-r10e
  102. +NDK_HOME=/home/USERNAME/Android/Sdk/ndk-bundle
  103.  
  104.  # android-9 is minimum to support mips and x86
  105. -PLATFORM=android-9
  106. +PLATFORM=android-14
  107.  
  108.  # standalone toolchains cannot share same directory
  109. -NDK_STANDALONE=/opt/android-ndk-r10e-standalone/$PLATFORM
  110. +NDK_STANDALONE=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/$PLATFORM
  111.  
  112.  for arch in arm x86 mips
  113.  do
  114.      INSTALL_DIR=$NDK_STANDALONE/$arch
  115.      mkdir -p $INSTALL_DIR
  116. -    $NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch
  117. +    $NDK_HOME/build/tools/make-standalone-toolchain.sh --install-dir=$INSTALL_DIR --arch=$arch --force
  118.  done
  119.  
  120. diff --git a/Android/buildlibs/mips/ndkenv b/Android/buildlibs/mips/ndkenv
  121. index f1f7c78..9c06777 100644
  122. --- a/Android/buildlibs/mips/ndkenv
  123. +++ b/Android/buildlibs/mips/ndkenv
  124. @@ -5,7 +5,7 @@ get_abs_path() {
  125.  
  126.  unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
  127.  
  128. -export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/mips
  129. +export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/mips
  130.  export NDK_PLATFORM_NAME=mips
  131.  export NDK_HOST_NAME=mipsel-linux-android
  132.  export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
  133. diff --git a/Android/buildlibs/mips/ogg.sh b/Android/buildlibs/mips/ogg.sh
  134. index 53dd200..8f058f5 100755
  135. --- a/Android/buildlibs/mips/ogg.sh
  136. +++ b/Android/buildlibs/mips/ogg.sh
  137. @@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
  138.  
  139.  pushd $SRC_DIR
  140.  
  141. -export CFLAGS="$NDK_CFLAGS -fsigned-char"
  142. +export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
  143.  export LDFLAGS="$NDK_LDFLAGS"
  144.  
  145.  ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
  146. diff --git a/Android/buildlibs/x86/ndkenv b/Android/buildlibs/x86/ndkenv
  147. index d0710f4..2fb380f 100644
  148. --- a/Android/buildlibs/x86/ndkenv
  149. +++ b/Android/buildlibs/x86/ndkenv
  150. @@ -5,7 +5,7 @@ get_abs_path() {
  151.  
  152.  unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
  153.  
  154. -export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/x86
  155. +export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/x86
  156.  export NDK_PLATFORM_NAME=x86
  157.  export NDK_HOST_NAME=i686-linux-android
  158.  export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
  159. diff --git a/Android/buildlibs/x86/ogg.sh b/Android/buildlibs/x86/ogg.sh
  160. index 53dd200..8f058f5 100755
  161. --- a/Android/buildlibs/x86/ogg.sh
  162. +++ b/Android/buildlibs/x86/ogg.sh
  163. @@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
  164.  
  165.  pushd $SRC_DIR
  166.  
  167. -export CFLAGS="$NDK_CFLAGS -fsigned-char"
  168. +export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
  169.  export LDFLAGS="$NDK_LDFLAGS"
  170.  
  171.  ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
  172. diff --git a/Android/patches/liblua.patch b/Android/patches/liblua.patch
  173. index 4d040bc..759ce81 100644
  174. --- a/Android/patches/liblua.patch
  175. +++ b/Android/patches/liblua.patch
  176. @@ -20,7 +20,8 @@ diff -Naur src/Makefile src/Makefile
  177.   PLAT= none
  178.  
  179.  -CC= gcc
  180. - CFLAGS= -O2 -Wall $(MYCFLAGS)
  181. +-CFLAGS= -O2 -Wall $(MYCFLAGS)
  182. ++CFLAGS= -O2 -Wall $(MYCFLAGS) -D__ANDROID_API__=$API
  183.   AR= ar rcu
  184.   RANLIB= ranlib
  185.   RM= rm -f
  186. diff --git a/debian/ags+libraries/hooks/B00_copy_libs.sh b/debian/ags+libraries/hooks/B00_copy_libs.sh
  187. index 7f34e12..c3c3825 100755
  188. --- a/debian/ags+libraries/hooks/B00_copy_libs.sh
  189. +++ b/debian/ags+libraries/hooks/B00_copy_libs.sh
  190. @@ -1,7 +1,7 @@
  191.  #!/bin/sh
  192.  set -e
  193.  
  194. -BINDMOUNT=
  195. +BINDMOUNT=/home/USERNAME/git/ags/ags+libraries
  196.  BIT=32
  197.  
  198.    set +x
  199. diff --git a/debian/changelog b/debian/changelog
  200. index 5fb163c..1bf9500 100644
  201. --- a/debian/changelog
  202. +++ b/debian/changelog
  203. @@ -1,4 +1,4 @@
  204. -ags (3~git-1) UNRELEASED; urgency=low
  205. +ags (3.4.1.7) UNRELEASED; urgency=low
  206.  
  207.    * some release
  208.  
  209.  

edit8: adding link for topic in allegro forums: https://www.allegro.cc/forums/thread/617273/1035262#target

edit9: Nick confirmed the steps are indeed run the Android/buildlibs first, being 1) http://makestandalones.sh  and then 2) http://buildall.sh . so I really don't know why it doesn't build for me. My machine is Ubuntu 16.04 64-bits so if someone ever reads this, this is all the info :/
Title: Re: AGS engine Android port
Post by: eri0o on 14 Feb 2018, 02:26
Ok, I deleted everything, cloned the Repo again, followed the README closely, and did my modifications regarding the lua and ogg. Below are my modifications.

myGitDiff.dif (https://gist.github.com/ericoporto/9a08f6934a499fdea180eab50f30b7cf)
Code: Adventure Game Studio
  1. diff --git a/Android/buildlibs/armeabi-v7a/ndkenv b/Android/buildlibs/armeabi-v7a/ndkenv
  2. index cf9fdfb..6e3d130 100644
  3. --- a/Android/buildlibs/armeabi-v7a/ndkenv
  4. +++ b/Android/buildlibs/armeabi-v7a/ndkenv
  5. @@ -5,7 +5,7 @@ get_abs_path() {
  6.  
  7.  unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
  8.  
  9. -export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
  10. +export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/arm
  11.  export NDK_PLATFORM_NAME=armeabi-v7a
  12.  export NDK_HOST_NAME=arm-linux-androideabi
  13.  export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
  14. @@ -15,3 +15,5 @@ export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal
  15.  
  16.  export NDK_CFLAGS=" -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 "
  17.  export NDK_LDFLAGS=" -march=armv7-a -Wl,--fix-cortex-a8 "
  18. +export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-gcc
  19. +export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-g++
  20. diff --git a/Android/buildlibs/armeabi-v7a/ogg.sh b/Android/buildlibs/armeabi-v7a/ogg.sh
  21. index 53dd200..8f058f5 100755
  22. --- a/Android/buildlibs/armeabi-v7a/ogg.sh
  23. +++ b/Android/buildlibs/armeabi-v7a/ogg.sh
  24. @@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
  25.  
  26.  pushd $SRC_DIR
  27.  
  28. -export CFLAGS="$NDK_CFLAGS -fsigned-char"
  29. +export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
  30.  export LDFLAGS="$NDK_LDFLAGS"
  31.  
  32.  ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
  33. diff --git a/Android/buildlibs/armeabi/ndkenv b/Android/buildlibs/armeabi/ndkenv
  34. index 0df6781..db11d13 100644
  35. --- a/Android/buildlibs/armeabi/ndkenv
  36. +++ b/Android/buildlibs/armeabi/ndkenv
  37. @@ -5,7 +5,7 @@ get_abs_path() {
  38.  
  39.  unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
  40.  
  41. -export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
  42. +export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/arm
  43.  export NDK_PLATFORM_NAME=armeabi
  44.  export NDK_HOST_NAME=arm-linux-androideabi
  45.  export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
  46. @@ -14,3 +14,5 @@ export PKG_CONFIG_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/lib/pkgconfig
  47.  export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal
  48.  
  49.  export NDK_CFLAGS=" -mthumb "
  50. +export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-gcc
  51. +export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-g++  
  52. diff --git a/Android/buildlibs/armeabi/ogg.sh b/Android/buildlibs/armeabi/ogg.sh
  53. index 21062a3..56ed267 100755
  54. --- a/Android/buildlibs/armeabi/ogg.sh
  55. +++ b/Android/buildlibs/armeabi/ogg.sh
  56. @@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
  57.  
  58.  pushd $SRC_DIR
  59.  
  60. -export CFLAGS="$NDK_CFLAGS -fsigned-char"
  61. +export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
  62.  export LDFLAGS="$NDK_LDFLAGS"
  63.  
  64.  ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
  65. diff --git a/Android/buildlibs/makestandalones.sh b/Android/buildlibs/makestandalones.sh
  66. index 7f327cd..d4ecd64 100755
  67. --- a/Android/buildlibs/makestandalones.sh
  68. +++ b/Android/buildlibs/makestandalones.sh
  69. @@ -5,18 +5,18 @@
  70.  set -e
  71.  
  72.  # Last committed pre-compiled libs were with R8
  73. -NDK_HOME=/opt/android-ndk-r10e
  74. +NDK_HOME=~/Android/Sdk/ndk-bundle
  75.  
  76.  # android-9 is minimum to support mips and x86
  77. -PLATFORM=android-9
  78. +PLATFORM=android-14
  79.  
  80.  # standalone toolchains cannot share same directory
  81. -NDK_STANDALONE=/opt/android-ndk-r10e-standalone/$PLATFORM
  82. +NDK_STANDALONE=~/Android/Sdk/ndk-bundle/platforms/$PLATFORM
  83.  
  84.  for arch in arm x86 mips
  85.  do
  86.      INSTALL_DIR=$NDK_STANDALONE/$arch
  87.      mkdir -p $INSTALL_DIR
  88. -    $NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch
  89. +    $NDK_HOME/build/tools/make-standalone-toolchain.sh  --force --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch
  90.  done
  91.  
  92. diff --git a/Android/buildlibs/mips/ndkenv b/Android/buildlibs/mips/ndkenv
  93. index f1f7c78..8156536 100644
  94. --- a/Android/buildlibs/mips/ndkenv
  95. +++ b/Android/buildlibs/mips/ndkenv
  96. @@ -5,7 +5,7 @@ get_abs_path() {
  97.  
  98.  unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
  99.  
  100. -export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/mips
  101. +export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/mips
  102.  export NDK_PLATFORM_NAME=mips
  103.  export NDK_HOST_NAME=mipsel-linux-android
  104.  export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
  105. @@ -15,3 +15,5 @@ export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal
  106.  
  107.  # NDK before R8b turns on "-mno-shared" in MIPS toolchain which disables -fpic
  108.  export NDK_CFLAGS=" -fpic "
  109. +export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/mips/bin/mipsel-linux-android-gcc
  110. +export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/mips/bin/mipsel-linux-android-g++  
  111. diff --git a/Android/buildlibs/mips/ogg.sh b/Android/buildlibs/mips/ogg.sh
  112. index 53dd200..8f058f5 100755
  113. --- a/Android/buildlibs/mips/ogg.sh
  114. +++ b/Android/buildlibs/mips/ogg.sh
  115. @@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
  116.  
  117.  pushd $SRC_DIR
  118.  
  119. -export CFLAGS="$NDK_CFLAGS -fsigned-char"
  120. +export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
  121.  export LDFLAGS="$NDK_LDFLAGS"
  122.  
  123.  ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
  124. diff --git a/Android/buildlibs/x86/ndkenv b/Android/buildlibs/x86/ndkenv
  125. index d0710f4..ea2176f 100644
  126. --- a/Android/buildlibs/x86/ndkenv
  127. +++ b/Android/buildlibs/x86/ndkenv
  128. @@ -5,10 +5,14 @@ get_abs_path() {
  129.  
  130.  unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
  131.  
  132. -export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/x86
  133. +export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/x86
  134.  export NDK_PLATFORM_NAME=x86
  135.  export NDK_HOST_NAME=i686-linux-android
  136.  export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
  137.  export PATH=$NDK_PLATFORM_ROOT/bin:$PATH
  138.  export PKG_CONFIG_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/lib/pkgconfig
  139.  export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal
  140. +
  141. +
  142. +export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/x86/bin/i686-linux-android-gcc
  143. +export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/x86/bin/i686-linux-android-g++  
  144. diff --git a/Android/buildlibs/x86/ogg.sh b/Android/buildlibs/x86/ogg.sh
  145. index 53dd200..8f058f5 100755
  146. --- a/Android/buildlibs/x86/ogg.sh
  147. +++ b/Android/buildlibs/x86/ogg.sh
  148. @@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR
  149.  
  150.  pushd $SRC_DIR
  151.  
  152. -export CFLAGS="$NDK_CFLAGS -fsigned-char"
  153. +export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
  154.  export LDFLAGS="$NDK_LDFLAGS"
  155.  
  156.  ./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
  157. diff --git a/Android/patches/liblua.patch b/Android/patches/liblua.patch
  158. index 4d040bc..e717f0d 100644
  159. --- a/Android/patches/liblua.patch
  160. +++ b/Android/patches/liblua.patch
  161. @@ -20,7 +20,8 @@ diff -Naur src/Makefile src/Makefile
  162.   PLAT= none
  163.  
  164.  -CC= gcc
  165. - CFLAGS= -O2 -Wall $(MYCFLAGS)
  166. +-CFLAGS= -O2 -Wall $(MYCFLAGS)
  167. ++CFLAGS= -O2 -Wall $(MYCFLAGS) -D__ANDROID_API__=$AP
  168.   AR= ar rcu
  169.   RANLIB= ranlib
  170.   RM= rm -f
  171.  
Note: I think you can git apply (https://stackoverflow.com/questions/12320863/how-do-you-take-a-git-diff-file-and-apply-it-to-a-local-branch-that-is-a-copy-o) my diff as a patch, but I haven't never actually tried. Since my experience with taking patches from html pages is poor, I also linked above a link to a copy of the diff in my github gist.

After applying the modifications in all files, you need to build things

Code: Bash
  1. export PATH=$PATH:~/Android/Sdk/ndk-bundle/
  2. cd git/ags/Android/buildlibs/
  3. ./makestandalones.sh
  4. ./buildall.sh
  5. cd ../library/
  6. ndk-build
  7.  

notice that doing that PATH export is very important. My environment is Ubuntu 16.04 and I used the Android Sdk and ndk installed through Android Studio 3.0.1

details of my Android Studio :
Android Studio 3.0.1
Build #AI-171.4443003, built on November 9, 2017
JRE: 1.8.0_152-release-915-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.13.0-32-generic


Finally, I was able to fail at the right spot

(https://i.imgur.com/EAazYhB.png)

Now it appears what is needed, is to add those OpenGL defines, which was said here http://www.adventuregamestudio.co.uk/forums/index.php?topic=55681.msg636579076#msg636579076 and is pointed in the github issue here (https://github.com/adventuregamestudio/ags/issues/420). I need to sleep now, and have no idea how to do that, but at least, now things build as they should.


Title: Re: AGS engine Android port
Post by: Crimson Wizard on 14 Feb 2018, 02:46
eri0o, could you make a pull request of the changes you made to building Android libs? just a patch file will also work.

Quote
Now it appears what is needed, is to add those OpenGL defines, which was said here http://www.adventuregamestudio.co.uk/forums/index.php?topic=55681.msg636579076#msg636579076 and is pointed in the github issue here. I need to sleep now, and have no idea how to do that

Same way as other functions are connected through macros, there should be awhole bunch of these already.

I will probably be able to check this out tomorrow.
Title: Re: AGS engine Android port
Post by: eri0o on 14 Feb 2018, 03:06
Hey CW! Created the pull request here! (https://github.com/adventuregamestudio/ags/pull/429).

This is my first pull request in a public project, so please check if I did any mistake! (nod)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 14 Feb 2018, 06:22
Hey CW! Created the pull request here! (https://github.com/adventuregamestudio/ags/pull/429).

This is my first pull request in a public project, so please check if I did any mistake! (nod)

Ouch, I forgot to mention, could you do that in "release-3.4.1" branch? Because master already has some differences, and I'd like to be able to make a compilable 3.4.1 Android port.
Title: Re: AGS engine Android port
Post by: eri0o on 14 Feb 2018, 11:25
Hey CW! Did a new pull request here (https://github.com/adventuregamestudio/ags/pull/430)!

I tested and it failed at the same lines.

Code: Bash
  1. jni/../jni/../../../Engine/game/savegame.cpp:537:30: note: place parentheses around the '&&'
  2.       expression to silence this warning
  3.             crossFading <= 0 && !channels[SCHAN_MUSIC])
  4.                              ^
  5.             (                                         )
  6. 6 warnings generated.
  7. [armeabi] Compile++ arm  : agsengine <= ali3dogl.cpp
  8. warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
  9. warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
  10. In file included from jni/../jni/../../../Engine/gfx/ali3dogl.cpp:19:
  11. In file included from jni/../jni/../../../Engine/gfx/ali3dogl.h:24:
  12. In file included from jni/../jni/../../../Common/gfx/bitmap.h:49:
  13. jni/../jni/../../../Common/gfx/allegrobitmap.h:84:17: warning: 'this' pointer cannot be null in
  14.       well-defined C++ code; pointer may be assumed to always convert to true
  15.       [-Wundefined-bool-conversion]
  16.         return !this || !_alBitmap;
  17.                ~^~~~
  18. In file included from jni/../jni/../../../Engine/gfx/ali3dogl.cpp:23:
  19. In file included from jni/../jni/../../../Engine/platform/base/agsplatformdriver.h:24:
  20. In file included from jni/../jni/../../../Engine/ac/datetime.h:21:
  21. In file included from jni/../jni/../../../Engine/ac/dynobj/scriptdatetime.h:21:
  22. In file included from jni/../jni/../../../Engine/ac/dynobj/cc_agsdynamicobject.h:18:
  23. In file included from jni/../jni/../../../Engine/ac/dynobj/cc_dynamicobject.h:23:
  24. In file included from jni/../jni/../../../Engine/script/runtimescriptvalue.h:21:
  25. In file included from jni/../jni/../../../Engine/script/script_api.h:24:
  26. jni/../jni/../../../Engine/ac/runtime_defines.h:135:9: warning: 'HWND' macro redefined
  27.       [-Wmacro-redefined]
  28. #define HWND long
  29.         ^
  30. jni/../jni/../../../Engine/gfx/ogl_headers.h:45:9: note: previous definition is here
  31. #define HWND void*
  32.         ^
  33. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:466:7: fatal error: use of undeclared identifier
  34.       'glSwapIntervalEXT'
  35.   if (glSwapIntervalEXT)
  36.       ^
  37. 4 warnings and 1 error generated.
  38. make: *** [obj/local/armeabi/objs/agsengine/gfx/ali3dogl.o] Error 1
  39.  
  40.  

---- below this line I don't know what I am doing ----

Edit1: The failing is atually related to SwapInterval and the fact that you can't (apparently) control V-Sync in Android. Below is a modification of ali3dogl.cpp that actually fails in glCreateShader. I just removed things related to V-Sync with if !defined (ANDROID_VERSION) so I am not sure this won't break anything.

ags/Engine/gfx/ali3dogl.cpp (https://gist.github.com/ericoporto/2d5577c661ca0a6099a8c0837d76050f)

Where this version fails:
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:621:8: fatal error: use of undeclared identifier
      'glCreateShader'
  if (!glCreateShader)


Edit2: Right below the first if defined (ANDROID_VERSION) I added (idea came from here (https://github.com/googlesamples/android-ndk/blob/master/hello-gl2/app/src/main/cpp/gl_code.cpp)):
#include <GLES2/gl2.h>

In the project.properties, I modified the target from 16 to 14.
# Project target.
target=android-14


And then it failed with a lot of things.

Code: Bash
  1. ...
  2. [armeabi] Compile arm    : agsengine <= aautil.c
  3. warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
  4. 1 warning generated.
  5. [armeabi] Compile arm    : agsengine <= midi.c
  6. warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
  7. 1 warning generated.
  8. [armeabi] SharedLibrary  : libagsengine.so
  9.  
  10. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:717: error: undefined reference to 'glCreateShader'
  11. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:718: error: undefined reference to 'glShaderSource'
  12. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:719: error: undefined reference to 'glCompileShader'
  13. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:721: error: undefined reference to 'glGetShaderiv'
  14. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:729: error: undefined reference to 'glCreateProgram'
  15. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:730: error: undefined reference to 'glAttachShader'
  16. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:731: error: undefined reference to 'glLinkProgram'
  17. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:734: error: undefined reference to 'glGetProgramiv'
  18. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:742: error: undefined reference to 'glDetachShader'
  19. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:743: error: undefined reference to 'glDeleteShader'
  20. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:746: error: undefined reference to 'glGetUniformLocation'
  21. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:747: error: undefined reference to 'glGetUniformLocation'
  22. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:748: error: undefined reference to 'glGetUniformLocation'
  23. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:738: error: undefined reference to 'glDeleteProgram'
  24. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:738: error: undefined reference to 'glDeleteShader'
  25. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:762: error: undefined reference to 'glGetShaderiv'
  26. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:764: error: undefined reference to 'glGetProgramiv'
  27. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:767: error: undefined reference to 'glGetShaderInfoLog'
  28. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:769: error: undefined reference to 'glGetProgramInfoLog'
  29. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:754: error: undefined reference to 'glDeleteProgram'
  30. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:754: error: undefined reference to 'glDeleteProgram'
  31. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:754: error: undefined reference to 'glDeleteProgram'
  32. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1092: error: undefined reference to 'glUseProgram'
  33. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1127: error: undefined reference to 'glUseProgram'
  34. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1119: error: undefined reference to 'glUniform1i'
  35. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1120: error: undefined reference to 'glUniform3f'
  36. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1121: error: undefined reference to 'glUniform3f'
  37. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1150: error: undefined reference to 'glUniform1i'
  38. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1151: error: undefined reference to 'glUniform1f'
  39. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1152: error: undefined reference to 'glUniform1f'
  40. jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1264: error: undefined reference to 'glUseProgram'
  41. /home/USERNAME/git/ags/Android/buildlibs/armeabi/allegro-4.4.2/src/allegro.c:619: error: undefined reference to 'stderr'
  42. /home/USERNAME/git/ags/Android/buildlibs/armeabi/allegro-4.4.2/src/allegro.c:503: error: undefined reference to 'stdout'
  43. /home/USERNAME/git/ags/Android/buildlibs/armeabi/allegro-4.4.2/src/unicode.c:2294: error: undefined reference to 'atof'
  44. jni/../jni/../../nativelibs/armeabi/lib/libdumb.a(rendsig.o):rendsig.c:function duh_sigrenderer_set_callback: error: undefined reference to 'stderr'
  45. jni/../jni/../../nativelibs/armeabi/lib/libdumb.a(rendsig.o):rendsig.c:function duh_sigrenderer_set_analyser_callback: error: undefined reference to 'stderr'
  46. jni/../jni/../../nativelibs/armeabi/lib/libdumb.a(itread.o):itread.c:function it_load_sigdata: error: undefined reference to 'stderr'
  47. clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  48. make: *** [obj/local/armeabi/libagsengine.so] Error 1
  49.  
  50.  

CW, I will wait you do this correctly, since I have no idea how to do this.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 15 Feb 2018, 00:27
Quote
Edit2: Right below the first if defined (ANDROID_VERSION) I added
#include <GLES2/gl2.h>

This header should be included in ogl_headers.h, where <GLES/gl.h> is.

Firstly we need to find out whether gl2.h is enough, secondly if there are still functions that have different names (if there are) should be remapped using defines, similar to how other GL functions are remapped, e.g.
Code: C++
  1. #define glGenFramebuffersEXT glGenFramebuffersOES
  2. #define glDeleteFramebuffersEXT glDeleteFramebuffersOES
  3.  
IDK if that is needed, so just mentioning FYI.


But not sure if that would be enough.
I was going to try that out after I am able to build it.

Right now I am very concerned about changing platform versions, from platform-9 to 14 in library scripts, and the one you mentioned later in project-properties, because I have no idea how that work and what could be broken by doing that.
E: I found platform version history here: https://en.wikipedia.org/wiki/Android_version_history
E2: Also some similar discussion, for reference: https://github.com/koreader/koreader-base/issues/332


What bothers me also is whether these shader functions are supported on all Android devices or not. And what will happen if we demand it inclusion into program. For instance, Windows version works with function pointers which it first tries to get from OpenGL's DLL. If it fails, it can simply check for that and skip some code during drawing.

There's an alternative solution, when the functions that are not found right now will be declared as ints = 0, and similarily skipped during drawing. This will disable tinting on mobile devices (at least with OpenGL means), but at least won't break anything that already exists.

PS. Ideally the OpenGL renderer should be rewritten, having some generic OpenGL API exposed, and the inner workings hidden in implementations, one for each platform. But that will take some time to do.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 15 Feb 2018, 01:07
Ok, I just realized that you had "undefined reference" error, not "undefined symbol", meaning its a linker error.

The reason could be that Android port links to GLES v1:
https://github.com/adventuregamestudio/ags/blob/master/Android/library/jni/Android.mk


Right now I wanted to split the issue, because all this is becoming bit disorganized.

1) First, compiling Android port without rising platform version.

2) Second, finding a solution for shader problem. Frankly I do not want to discuss it right here in this thread, because it makes it messy.

TBH, personally I would not want to delve too deep into this, because I do not know Android, and cannot predict consequences of my actions.

As a quick fix we could just disable tinting at all for now. Maybe look for a way to fallback to software tinting if hardware one is not supported.

Then, maybe we would need to check for ES version and find out if there is a way to get these functions dynamically, just like Windows port does, to make sure the port supports devices without GLES2.
(Then again, maybe GLES2 is a standard for Android now, and should be available everywhere?)


EDIT: found an example of getting OpenGL functions dynamically:
https://stackoverflow.com/questions/17902243/opengl-es-3-0-in-android-ndk-r9
I keep forgetting Android is just a Linux, so the standard C library linking functions should work.
NOTE: we have a generic wrapper over library linking, class called AGS::Engine::Library.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 16 Feb 2018, 20:42
Alright, I decided to begin anew, reset all the changes I did to my repositories and started following solution eri0o found step by step.

So, what is confirmed is that newest NDKs dropped support for building for Android platforms lower than v 14. Here's some discussions I found:
https://groups.google.com/forum/#!topic/android-ndk/qqRVhXwSN4Y
https://stackoverflow.com/questions/45685227/android-ndk-support-version-limited

History of Android devices:
https://en.wikipedia.org/wiki/Android_version_history


I opened the issue on github regarding this, and couple of accompanying problems: https://github.com/adventuregamestudio/ags/issues/431


Trying to sum up, there are following problems that need to be decided now:
1) Updating building scripts for native libraries, where we need to decide if supporting Android API 9 (Gingerbread and Honeycomb) devices is a must, or we should move to minimal support of API 14 (Ice Cream Sandwich).

Personally, I am not Android user, and have no idea whether these old devices are still in use (the port was originally developed in 2011-2012 when they were still very new).

2) Another thing is how we are going to support GLES2 on Android, for OpenGL shaders (currently uses GLES1). Should we demand it and explicitly link to GLES2 library, or handle it as an option, similarily to Windows version, by loading shader-related functions from the corresponding .so and using them only if they exist.
Note, that unlike Windows version, Android has only OpenGL renderer and cannot change to anything else. Therefore if it fails, the game won't be able to run.

I am trying to find information about GLES2 support on Android devices now.

UPDATE: found super useful statistics page:
https://developer.android.com/about/dashboards/index.html

Notably, it mentions number of devices with given API and GLES support.

From the looks of it, GLES 2 should be supported on 99+% devices. Also I read somewhere that its support was introduced in API level 8, which is below API 14 we may switch to.


PS. Regarding iOS compilation, since there does not seem to be any iOS developer available right now, I would rather simply declare the shader functions as integer constants equal to 0, which would prevent AGS from calling them (or maybe defining empty function stubs).



Title: Re: AGS engine Android port
Post by: eri0o on 16 Feb 2018, 21:58
Quote
Should we demand it and explicitly link to GLES2 library, or handle it as an option, similarily to Windows version, by loading functions from the corresponding .so and using them only if they exist.

Quote
Note, that unlike Windows version, Android has only OpenGL renderer and cannot change to anything else. Therefore if it fails, the game won't be able to run.

I feel that from the last sentence, there is no point in per function loading. :/
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 16 Feb 2018, 22:01
Quote
Should we demand it and explicitly link to GLES2 library, or handle it as an option, similarily to Windows version, by loading functions from the corresponding .so and using them only if they exist.

Quote
Note, that unlike Windows version, Android has only OpenGL renderer and cannot change to anything else. Therefore if it fails, the game won't be able to run.

I feel that from the last sentence, there is no point in per function loading. :/

Hmm, perhaps I was not clear enough, because I meant opposite.
I was speaking about function loading for optional features (tinting shaders), because then renderer will work even where they are not supported. Which may be important, because unlike Windows version, where you may change to Direct3D or Software renderer, on Android you have to use OpenGL.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 18 Feb 2018, 22:03
I was able to compile AGS port for Android, almost (see note below), using following two changes:

1. Changes to native libs building scripts (practically identical to ones we have in pull request (https://github.com/adventuregamestudio/ags/pull/430))
https://www.dropbox.com/s/yp3x3vpcfxh3qsu/0001-Android-updated-nativelibs-building-script.patch?dl=0

2. Changes to the Android port itself:
https://www.dropbox.com/s/btiq0tr0py8w93m/0002-Android-fixed-compilation-of-OpenGL-renderer.patch?dl=0

I solved the SwapInterval problem slightly differently, but that's not important. Most important was to add -lGLESv2 to Android.mk makefile, which resolves shader-related functions.

Native engine's .so object was linked, but then it failed on lua plugin, saying something about "no rule to make".

UPDATE I completely forgot that lua plugin is added as submodule! Had to do "git submodule update --init --recursive". Run ndk-build again, everything builds now!
Title: Re: AGS engine Android port
Post by: Chicky on 19 Feb 2018, 12:05
everything builds now!

Woo! Nice work guys ;-D Thank you both for your hard work with this. Exciting!

There are a lot of people who would benefit from this, keep it up :)
Title: Re: AGS engine Android port
Post by: Mehrdad on 19 Feb 2018, 15:23
Thanks a lot CW. So is there final apk for 3.4.1? And is any simple guide for making final apk signed with OBB (or without OBB) for Google play?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 19 Feb 2018, 15:42
Thanks a lot CW. So is there final apk for 3.4.1? And is any simple guide for making final apk signed with OBB (or without OBB) for Google play?

No APK yet, and I do not know anything about OBB. I heard you need to use monkey0506's plugin or instructions to make one?
Like eri0o explained here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=55681.0
I guess you may try that later when we have newest APK.

PS. I am currently trying to make APK, need to install Android SDK and hope instructions will work.
Title: Re: AGS engine Android port
Post by: Mehrdad on 19 Feb 2018, 15:51
Yes, But seems Monke0506 give up it. I sent some PM to him and wasn't any answer.
OK. Thanks.I'm waiting for final APK. But adventure games need to OBB too as they are more than 100MB often.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 19 Feb 2018, 18:29
Alright... I really spent too much time on this.

First of all, recent version of Android SDK no longer has "ant" tool in it, which is required for automated building. Searching a little, I found an advice to download the tools pack from the previous version:
https://stackoverflow.com/questions/42912824/the-ant-folder-is-suddenly-missing-from-android-sdk-did-google-remove-it
For example, for linux it is: https://dl.google.com/android/repository/tools_r25.2.5-linux.zip
Simply unpacking and merging this into "tools" dir in the SDK (skipping existing files of course) seemed to work.

( Related, I noticed monkey0506 has a WIP branch where he was updating Android port to build from Android Studio, which may be a way to go. But idk what state his work is in )


After that I finally managed to create Android APK for AGS 3.4.1:
https://www.dropbox.com/s/kwns9ao6yctlvlu/AGS-3.4.1-unsigned.apk?dl=0


Now, I am looking for anyone to try this out with any 3.4.1 game, just to make sure it works. I will test this on emulator, but later, when I remember how it works (or use one from Android Studio, since I have it installed on my Linux vm anyway).
I am probably off for today.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 19 Feb 2018, 19:11
Yes, But seems Monke0506 give up it. I sent some PM to him and wasn't any answer.
OK. Thanks.I'm waiting for final APK. But adventure games need to OBB too as they are more than 100MB often.

The plugin should still work as long as the ags engine library dll is precompiled. In theory. Once Cw can confirm that the android port is a functional port, I can see if I can find time to make monkeys plugin still work.
Title: Re: AGS engine Android port
Post by: Chicky on 19 Feb 2018, 19:26

After that I finally managed to create Android APK for AGS 3.4.1:
https://www.dropbox.com/s/kwns9ao6yctlvlu/AGS-3.4.1-unsigned.apk?dl=0

Getting 'App not installed. The package appears to be corrupt.' when installing the .apk on my phone, can anyone else confirm this is a problem with the apk and not just me doing something wrong?

--

Also, that sounds great Joseph DiPerla! ;-D
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 19 Feb 2018, 21:16

After that I finally managed to create Android APK for AGS 3.4.1:
https://www.dropbox.com/s/kwns9ao6yctlvlu/AGS-3.4.1-unsigned.apk?dl=0

Getting 'App not installed. The package appears to be corrupt.' when installing the .apk on my phone, can anyone else confirm this is a problem with the apk and not just me doing something wrong?

--

Also, that sounds great Joseph DiPerla! ;-D

LOL. Hold your applause until I actually achieve something ;-)
Title: Re: AGS engine Android port
Post by: eri0o on 20 Feb 2018, 01:51
Uhm. For me the apk complains about corrupt too. I tried to upload to Google Play (where there is a analyser) and it complained it wasn't zipaligned. I zipaligned but my phone still think it's corrupt.

I decided to just extract the libs, place in my Android Studio project and try to build, but it got me a new error : Loading game failed with error: Main game file not found. . I did had rebuilt my game with 3.4.1 (it was 3.4.0) and regenerated the obb file.

Code: Adventure Game Studio
  1. 02-19 22:13:33.581 24301-24301/? I/art: Late-enabling -Xcheck:jni
  2. 02-19 22:13:33.900 24301-24301/com.mythsuntold.dungeonhands I/InstantRun: starting instant run server: is main process
  3. 02-19 22:13:33.906 24301-24301/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
  4. 02-19 22:13:33.908 24301-24301/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
  5. 02-19 22:13:33.940 24301-24301/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
  6. 02-19 22:13:33.941 24301-24301/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
  7. 02-19 22:13:33.958 24301-24301/com.mythsuntold.dungeonhands D/STORAGE_MNT: SUCCESSFULLY QUEUED
  8. 02-19 22:13:33.992 24301-24322/com.mythsuntold.dungeonhands I/Adreno: QUALCOMM build                   : dfab96b, I762e720a6a
  9.                                                                       Build Date                       : 01/31/17
  10.                                                                       OpenGL ES Shader Compiler Version: XE031.09.00.04
  11.                                                                       Local Branch                     :
  12.                                                                       Remote Branch                    :
  13.                                                                       Remote Branch                    :
  14.                                                                       Reconstruct Branch               :
  15. 02-19 22:13:33.998 24301-24322/com.mythsuntold.dungeonhands I/OpenGLRenderer: Initialized EGL, version 1.4
  16. 02-19 22:13:33.999 24301-24322/com.mythsuntold.dungeonhands D/OpenGLRenderer: Swap behavior 1
  17. 02-19 22:13:34.052 24301-24301/com.mythsuntold.dungeonhands D/PATH =: /storage/emulated/0/Android/data/com.mythsuntold.dungeonhands/files/main.3.com.mythsuntold.dungeonhands.obb
  18. 02-19 22:13:34.052 24301-24301/com.mythsuntold.dungeonhands D/STATE =: 1
  19. 02-19 22:13:34.055 24301-24301/com.mythsuntold.dungeonhands D/STORAGE: -->MOUNTED
  20. 02-19 22:13:34.097 24301-24301/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
  21. 02-19 22:13:34.097 24301-24301/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
  22. 02-19 22:13:34.178 24301-24338/com.mythsuntold.dungeonhands D/AudioTrack: Client defaulted notificationFrames to 1365 for frameCount 4096
  23. 02-19 22:13:34.195 24301-24338/com.mythsuntold.dungeonhands D/AGSNative: Unable to initialize your audio hardware.
  24.                                                                          [Problem: DIGMID patch set not found]
  25. 02-19 22:13:34.232 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[])
  26. 02-19 22:13:34.232 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease()
  27. 02-19 22:13:34.232 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: mAcquireTouchFunc method = public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent,android.util.DisplayMetrics,int,int[])
  28. 02-19 22:13:34.233 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String)
  29. 02-19 22:13:34.233 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop()
  30. 02-19 22:13:34.236 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@745309a
  31. 02-19 22:13:34.236 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@e60cdcb
  32. 02-19 22:13:38.102 24301-24338/com.mythsuntold.dungeonhands D/AGSNative: Loading game failed with error:
  33.                                                                          Main game file not found.
  34.                                                                          
  35.                                                                          The game files may be incomplete, corrupt or from unsupported version of AGS.
  36. 02-19 22:13:38.125 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@99b3831
  37. 02-19 22:13:38.125 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@91c0b16
  38.  
  39.  

As a comparison, below is the output of the normal game package (that runs, uses 3.4.0)

Code: Adventure Game Studio
  1. 02-19 22:30:07.675 26836-26836/? I/art: Late-enabling -Xcheck:jni
  2. 02-19 22:30:07.801 26836-26836/com.mythsuntold.dungeonhands W/ActivityThread: Application com.mythsuntold.dungeonhands is waiting for the debugger on port 8100...
  3. 02-19 22:30:07.832 26836-26836/com.mythsuntold.dungeonhands I/System.out: Sending WAIT chunk
  4. 02-19 22:30:08.784 26836-26844/com.mythsuntold.dungeonhands I/art: Debugger is active
  5. 02-19 22:30:08.834 26836-26836/com.mythsuntold.dungeonhands I/System.out: Debugger has connected
  6. 02-19 22:30:08.834 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
  7. 02-19 22:30:09.034 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
  8. 02-19 22:30:09.235 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
  9. 02-19 22:30:09.435 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
  10. 02-19 22:30:09.636 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
  11. 02-19 22:30:09.836 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
  12. 02-19 22:30:10.037 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
  13. 02-19 22:30:10.237 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
  14. 02-19 22:30:10.438 26836-26836/com.mythsuntold.dungeonhands I/System.out: debugger has settled (1407)
  15. 02-19 22:30:10.912 26836-26836/com.mythsuntold.dungeonhands I/InstantRun: starting instant run server: is main process
  16. 02-19 22:30:10.922 26836-26836/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
  17. 02-19 22:30:10.931 26836-26836/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
  18. 02-19 22:30:11.030 26836-26836/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
  19. 02-19 22:30:11.031 26836-26836/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
  20. 02-19 22:30:11.089 26836-26836/com.mythsuntold.dungeonhands D/STORAGE_MNT: SUCCESSFULLY QUEUED
  21. 02-19 22:30:11.227 26836-26996/com.mythsuntold.dungeonhands I/Adreno: QUALCOMM build                   : dfab96b, I762e720a6a
  22.                                                                       Build Date                       : 01/31/17
  23.                                                                       OpenGL ES Shader Compiler Version: XE031.09.00.04
  24.                                                                       Local Branch                     :
  25.                                                                       Remote Branch                    :
  26.                                                                       Remote Branch                    :
  27.                                                                       Reconstruct Branch               :
  28. 02-19 22:30:11.309 26836-26996/com.mythsuntold.dungeonhands I/OpenGLRenderer: Initialized EGL, version 1.4
  29. 02-19 22:30:11.309 26836-26996/com.mythsuntold.dungeonhands D/OpenGLRenderer: Swap behavior 1
  30. 02-19 22:30:11.441 26836-26836/com.mythsuntold.dungeonhands D/PATH =: /storage/emulated/0/Android/data/com.mythsuntold.dungeonhands/files/main.3.com.mythsuntold.dungeonhands.obb
  31. 02-19 22:30:11.441 26836-26836/com.mythsuntold.dungeonhands D/STATE =: 1
  32. 02-19 22:30:11.445 26836-26836/com.mythsuntold.dungeonhands D/STORAGE: -->MOUNTED
  33. 02-19 22:30:11.541 26836-26836/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
  34. 02-19 22:30:11.541 26836-26836/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
  35. 02-19 22:30:11.799 26836-27023/com.mythsuntold.dungeonhands D/AudioTrack: Client defaulted notificationFrames to 1365 for frameCount 4096
  36. 02-19 22:30:11.845 26836-27023/com.mythsuntold.dungeonhands D/AGSNative: Unable to initialize your audio hardware.
  37.                                                                          [Problem: DIGMID patch set not found]
  38. 02-19 22:30:11.942 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[])
  39. 02-19 22:30:11.943 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease()
  40. 02-19 22:30:11.944 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: mAcquireTouchFunc method = public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent,android.util.DisplayMetrics,int,int[])
  41. 02-19 22:30:11.945 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String)
  42. 02-19 22:30:11.945 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop()
  43. 02-19 22:30:11.959 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@99fed60
  44. 02-19 22:30:11.960 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@bab8219
  45. 02-19 22:30:13.442 26836-26842/com.mythsuntold.dungeonhands I/art: Do partial code cache collection, code=27KB, data=28KB
  46. 02-19 22:30:13.443 26836-26842/com.mythsuntold.dungeonhands I/art: After code cache collection, code=27KB, data=27KB
  47. 02-19 22:30:13.443 26836-26842/com.mythsuntold.dungeonhands I/art: Increasing code cache capacity to 128KB
  48. 02-19 22:30:18.464 26836-26842/com.mythsuntold.dungeonhands I/art: Do partial code cache collection, code=50KB, data=62KB
  49. 02-19 22:30:18.464 26836-26842/com.mythsuntold.dungeonhands I/art: After code cache collection, code=50KB, data=62KB
  50. 02-19 22:30:18.464 26836-26842/com.mythsuntold.dungeonhands I/art: Increasing code cache capacity to 256KB
  51.  
  52.  

I don't know yet what's happening. :/
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 20 Feb 2018, 01:56
Alright, so there are two issues: first that the APK is not built correctly for some reason; here I have no idea what to look for, need to investigate and experiment using emulator, I guess.

By the way, did you tried to build APK yourself? You need to use latest release-3.4.1 branch and this patch applied: https://www.dropbox.com/s/btiq0tr0py8w93m/0002-Android-fixed-compilation-of-OpenGL-renderer.patch?dl=0

The second issue is that the AGS engine itself does not find a game or cannot read it. Question: can you run your game if you place pure acwin.exe from 3.4.1 Windows engine in the folder with game files and run it?
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 20 Feb 2018, 03:37
I haven't looked at the source in a while, but the game has to be located in a directory called "AGS". The game itself can not be in a zip. Must be fully extracted in it's own sub-directory under "AGS" and it has to have the main .EXE file in that sub-directory to work. The NDK only compiles the AGS engine into a loadable library. The Java files create a loader which allows you to choose all the games found under the "AGS" directory and then makes a call to the AGS Engine Library to run the selected game. Now I can't recall if the "AGS" directory has to be on the device root or the SD Card root directory. But I will look at the code later on. Hope this helps in some way.

EDIT

I believe the game sub directory needs to be in the external storage. Found this here: ags/Android/launcher_list/src/com/bigbluecup/android/launcher/GamesList.java

Line 60: baseDirectory = settings.getString("baseDirectory", Environment.getExternalStorageDirectory() + "/ags");

I recently switched to iOS so I haven't fired up my old Android device yet. But how far are you getting? Can you try creating a directory called AGS in SD Card Root and see how far you get with that?

However, I believe this directory can be changed via the preferences. And if the directory doesn't exist, by default the GameLister should create it automatically. After you select a game, Line 176 should execute the function that starts the game(Line 196). I get the feeling the loader is just not picking up on the right directory. Does this make any sense?

EDIT #2
Seems I misunderstood the problem. But if my suggestions above help anyone else, great!
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 23 Feb 2018, 16:07
How can you run an APK on emulator in Android Studio on Linux? I know literally nothing about this, don't even know where to start, and fear that it will cost too much time for me than necessary.

Tried to launch Android Studio and choose "Debug APK". Selected the APK I previously built with ant scripts. I do Run -> Debug, it shows a dialog where I need to configure some settings. There I set "Deployment target" to Emulator. The "preferred device" list is empty for some reason.
Also it displays an error : "Please select Android SDK". Where do I select it?

E: frankly I just want to stop at this point. I made the native code compile again, the rest is for Android developers, which I am not.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on 23 Feb 2018, 16:17
When i get home tonight I will take a look if the kids let me have some me time.
Title: Re: AGS engine Android port
Post by: eri0o on 28 Feb 2018, 02:08
Just a question... In ags/Engine/platform/android/acpland.cpp, when the engine is called with main(1, &psp_game_file_name_pointer), the variable psp_game_file_name_pointer actually has the folder where the GameName.ags is located (in my case, in the device it mounted the obb to a random folder like /mnt/obb/1175cb392d70c5744bffa846b85c5467/ ).I get the error: Main game file not found. The game files may be incomplete, corrupt or from unsupported version of AGS. Now, I couldn't find where it looks for .ags files in the folder, apparently the exception "Main game file not found" is thrown by main_game_file.cpp, in the function OpenMainGameFile and in the function OpenMainGameFileFromDefaultAsset. I couldn't confirm which function is actually being called, or which filename is being looked for. I know only that OpenMainGameFileFromDefaultAsset looks for either game28.dta or ac2game.dta. This is really weird for me because gitblame doesn't show many changes in the android port in 6 years, and I am positive that the prebuilt 3.4.0 finds my game files built for 3.4.0 . :/

So, given a folder, which files does the AGS Engine looks for in the directory?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 28 Feb 2018, 02:12
So, given a folder, which files does the AGS Engine looks for in the directory?

It searches through all files, looking for the ones that have AGS data package format signatures.
game28.dta and ac2game.dta are names of internal assets, not package files themselves.

Could you just add some log output to see which files it tries?
Title: Re: AGS engine Android port
Post by: eri0o on 28 Feb 2018, 02:24
Ok, I have the same error using acwin.exe from 3.4.12 in a folder with the GameName.ags I got from the Compiled/Data folder... I will try to obb the .exe file and see if it works...
Title: Re: AGS engine Android port
Post by: Crimson Wizard on 28 Feb 2018, 02:27
Ok, I have the same error using acwin.exe from 3.4.12 in a folder with the GameName.ags I got from the Compiled/Data folder...

Now, this is most interesting. This means there is a general engine and/or Editor issue.
Is this *ags produced by same version of an Editor (if not, which one)?
I will try to debug this out on desktop system bit later today.
Title: Re: AGS engine Android port
Post by: eri0o on 28 Feb 2018, 02:49
Hey CW! It's the version AGS Editor .NET (Build 3.4.1.12) - v3.4.1, January 2018. Now this is really weird. The DungeonHands.exe (my game name) didn't work too with android. The .ags game file from Compiled/Data wasn't actually from Compiled/Data... I got it from there, placed it in a obb file using :

Code: Bash</