Adventure Game Studio

AGS Development => Engine Development => Topic started by: JJS on Thu 03/11/2011 20:18:29

Title: [OLD-1] AGS engine Android port
Post by: JJS on Thu 03/11/2011 20:18:29
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 Thu 03/11/2011 20:36:36
Where can I find the 'like' button...

oh here it is  :=
Title: Re: AGS engine Android port
Post by: Dualnames on Thu 03/11/2011 20:44:43
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 Thu 03/11/2011 20:51:27
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 Thu 03/11/2011 21:03:26
Quote from: Dualnames on Thu 03/11/2011 20:44:43
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 Thu 03/11/2011 21:15:08
Quote from: JJS on Thu 03/11/2011 21:03:26
Quote from: Dualnames on Thu 03/11/2011 20:44:43
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: Icey on Thu 03/11/2011 21:19:20
yes! I hope this works on my phone.
Title: Re: AGS engine Android port
Post by: Calin Leafshade on Thu 03/11/2011 21:26:00
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 Thu 03/11/2011 21:34:29
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 Thu 03/11/2011 21:38:39
I was able to rotate. It's not like the application freezes.
Title: Re: AGS engine Android port
Post by: Calin Leafshade on Thu 03/11/2011 21:44:07
yes, ditto. The white texture resizes on rotate and the app doesnt crash
Title: Re: AGS engine Android port
Post by: Icey on Thu 03/11/2011 21:45:20
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 Thu 03/11/2011 22:09:06
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 Thu 03/11/2011 22:29:19
Quote from: JJS on Thu 03/11/2011 22:09:06
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 Thu 03/11/2011 22:53:53
Quote from: JJS on Thu 03/11/2011 22:09:06
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 Thu 03/11/2011 23:13:15
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 Fri 04/11/2011 02:32:15
I get the white screen on my Galaxy Tab 10.1 and Galaxy S.
Title: Re: AGS engine Android port
Post by: Gilbert on Fri 04/11/2011 02:56:04
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 Fri 04/11/2011 03:36:43
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 Fri 04/11/2011 07:03:40
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 Fri 04/11/2011 07:21:58
Ok, as I cannot reproduce the problem it might take a bit of time to get this sorted out. But it will work eventually  ;)

Quote from: abstauber on Fri 04/11/2011 07:03:40
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.

Quote from: Iceboty V7000a on Fri 04/11/2011 02:56:04
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.

Quote from: Calin Leafshade on Thu 03/11/2011 23:13:15
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.

Quote from: S3 on Thu 03/11/2011 21:45:20
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 Fri 04/11/2011 08:31:16
Quote from: JJS on Fri 04/11/2011 07:21:58
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 Fri 04/11/2011 10:31:01
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 Fri 04/11/2011 10:50:56
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 Fri 04/11/2011 14:42:27
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


//pseudo

if (Game.OS == eOSAndroid) {
mouse.visible = false;

}



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 Fri 04/11/2011 14:55:14
Quote from: JJS on Thu 03/11/2011 20:18:29
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 Fri 04/11/2011 15:00:33
QuoteOh, 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 Fri 04/11/2011 15:04:56
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 Fri 04/11/2011 16:18:35
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 Fri 04/11/2011 17:22:38
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 Fri 04/11/2011 17:31:25
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 Fri 04/11/2011 17:47:49
Quote from: Calin Leafshade on Fri 04/11/2011 17:31:25
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 Fri 04/11/2011 19:00:41
=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 Fri 04/11/2011 19:37:42
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 Fri 04/11/2011 19:53:05
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 Fri 04/11/2011 20:01:40
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 Fri 04/11/2011 20:13:30
QuoteAlso 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 Fri 04/11/2011 20:16:47
Quote from: JJS on Fri 04/11/2011 20:01:40
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 Fri 04/11/2011 20:41:24
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 Fri 04/11/2011 21:08:23
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 Fri 04/11/2011 22:08:58
well.. the mouse 'works' but its essentially impossible to accurately control.
Title: Re: AGS engine Android port
Post by: Dualnames on Fri 04/11/2011 23:10:03
What Calin, said. I also confirm that it works now.
Title: Re: AGS engine Android port
Post by: Icey on Sat 05/11/2011 01:25:01
I keep getting that error.

Script link failed: Runtime error: unresolved import 'Menu'
Title: Re: AGS engine Android port
Post by: Calin Leafshade on Sat 05/11/2011 01:32:51
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 Sat 05/11/2011 02:15:56
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 Sat 05/11/2011 03:06:00
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 Sat 05/11/2011 15:07:05
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 Sat 05/11/2011 18:16:10
Test AGS_2.apk-Robo-Quest

http://www.youtube.com/watch?v=BloABYhnh-o
Title: Re: AGS engine Android port
Post by: Bòógieman on Sat 05/11/2011 21:01:33
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 Sun 06/11/2011 13:10:49
Pocket Quest - Android port
Do not display properly color; Do not switch the cursor and do not take things
http://www.youtube.com/watch?v=S-5BwV_Ur_w

R`n`B Quest - Android port.mpg
http://www.youtube.com/watch?v=ibFZUhcsvPU

The City Adventure - Android port.mpg
http://www.youtube.com/watch?v=qIQYz_-iYxc
Title: Re: AGS engine Android port
Post by: mjomble on Sun 06/11/2011 17:34:23
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 Mon 07/11/2011 01:17:27
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 Mon 07/11/2011 04:41:33
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 Mon 07/11/2011 20:59:54
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 Tue 08/11/2011 03:59:09
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 Tue 08/11/2011 13:17:52
Quote from: Calin Leafshade on Sat 05/11/2011 01:32:51I 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 Tue 08/11/2011 21:17:40
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 Tue 08/11/2011 21:27:40
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 Tue 08/11/2011 23:04:47
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 Wed 09/11/2011 12:43:02
Quote from: JJS on Tue 08/11/2011 21:27:40
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 Thu 10/11/2011 10:45:05
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 Thu 24/11/2011 00:36:42
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 Thu 24/11/2011 07:49:57
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 Sat 26/11/2011 04:13:31
You are amazing
Title: Re: AGS engine Android port
Post by: Shane 'ProgZmax' Stevens on Wed 30/11/2011 17:46:38
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 Mon 05/12/2011 19:56:45
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 Mon 05/12/2011 20:00:59
Quote from: ProgZmax on Wed 30/11/2011 17:46:38
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 Thu 08/12/2011 12:33:21
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 Thu 08/12/2011 16:26:41
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 Sat 10/12/2011 21:03:57
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 Sat 10/12/2011 21:30:04
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 Sat 10/12/2011 21:37:55
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 Sat 10/12/2011 22:03:32
That's it. No more opinions allowed.


;D
Title: Re: AGS engine Android port
Post by: Gilbert on Sun 11/12/2011 15:42:38
Right. Stop that off-topic drama. :P
Title: Re: AGS engine Android port
Post by: AGA on Sun 11/12/2011 20:37:22
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 Tue 27/12/2011 16:43:48
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 Wed 28/12/2011 11:24:34
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 Fri 30/12/2011 12:42:36
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 Sun 01/01/2012 00:19:57
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 Tue 03/01/2012 05:41:01
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 Tue 03/01/2012 05:51:08
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 Tue 03/01/2012 07:52:37
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 Tue 03/01/2012 13:02:36
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 Tue 03/01/2012 13:21:12
Just checked, and SQ2VGA runs great at 960x600.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on Thu 05/01/2012 20:04:55
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 Thu 05/01/2012 20:52:20
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 Fri 06/01/2012 09:48:09
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 Wed 11/01/2012 00:17:12
Would an iOS port in the future be possible?
Title: Re: AGS engine Android port
Post by: David_OSU on Mon 16/01/2012 18:16:38
-->  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 Mon 16/01/2012 19:11:56
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 Mon 16/01/2012 19:28:42
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 Mon 16/01/2012 21:08:05
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 Tue 17/01/2012 17:53:28
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 Tue 17/01/2012 19:22:56
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 Tue 17/01/2012 19:36:54
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 Tue 17/01/2012 20:08:20
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 Tue 17/01/2012 20:39:54
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 Tue 17/01/2012 22:25:36
"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 Tue 17/01/2012 22:39:32
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 Wed 18/01/2012 08:08:36
Quote from: cianty on Tue 17/01/2012 22:25:36How 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 Wed 18/01/2012 20:18:35
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 Thu 19/01/2012 04:11:41
Quote from: JJS on Wed 18/01/2012 08:08:36
Quote from: cianty on Tue 17/01/2012 22:25:36How 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 Thu 19/01/2012 10:13:50
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 Thu 19/01/2012 14:47:06
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 Thu 19/01/2012 17:41:07
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 Thu 19/01/2012 19:20:56
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 Thu 19/01/2012 19:22:10
Maybe make it an option.
Title: Re: AGS engine Android port
Post by: JJS on Thu 19/01/2012 19:37:46
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 Sat 21/01/2012 14:56:20
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 Sat 21/01/2012 16:04:40
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 Sat 21/01/2012 19:21:53
Quote from: JJS on Sat 21/01/2012 16:04:40
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 Sat 21/01/2012 22:53:26
Quote from: uswin on Sat 21/01/2012 19:21: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 Sun 22/01/2012 00:17:57
Quote from: JJS on Sat 21/01/2012 16:04:40
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 Mon 23/01/2012 07:31:54
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 Mon 23/01/2012 14:40:35
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 Mon 23/01/2012 22:33:18
Yay! *downloading*
Title: Re: AGS engine Android port
Post by: Trapezoid on Mon 23/01/2012 23:19:16
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 Mon 23/01/2012 23:47:14
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 Tue 24/01/2012 04:32:20
Quote from: JJS on Mon 23/01/2012 07:31:54
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 Tue 24/01/2012 08:13:11
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 Wed 25/01/2012 00:21:01
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 Wed 25/01/2012 01:39:42
Quote from: JJS on Tue 24/01/2012 08:13:11
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: Icey on Sat 28/01/2012 07:58:43
Just curious can this play AGS 3.2 games yet?
Title: Re: AGS engine Android port
Post by: JJS on Sat 28/01/2012 08:03:48
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: Icey on Sat 28/01/2012 08:07:48
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 Sat 28/01/2012 08:11:19
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: Icey on Sat 28/01/2012 18:10:23
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 Sun 29/01/2012 04:20:02
Quote from: JJS on Tue 24/01/2012 08:13:11
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 Thu 02/02/2012 05:14:07
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 Thu 02/02/2012 08:38:12
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 Thu 02/02/2012 13:05:30
Quote from: JJS on Thu 02/02/2012 08:38:12
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 Thu 02/02/2012 19:38:08
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: http://www.youtube.com/watch?v=LKnjadDc0M0

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 Fri 03/02/2012 04:31:49
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 Fri 03/02/2012 04:37:46
Quote from: R4L on Fri 03/02/2012 04:31:49
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 Fri 03/02/2012 09:33:15
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.PreferencesAcivity

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 Fri 03/02/2012 10:02:53
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 Fri 03/02/2012 19:47:32
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 Sat 04/02/2012 11:42:20
Quote from: GMoney on Fri 03/02/2012 19:47:32Gemini 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 Mon 06/02/2012 22:27:38
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: Icey on Mon 06/02/2012 22:31:57
It's not just you phone. My sidekick does the same thing which sucks.
Title: Re: AGS engine Android port
Post by: uswin on Tue 07/02/2012 01:44:43
Quote from: cianty on Mon 06/02/2012 22:27:38
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 Tue 07/02/2012 17:55:43
Quote from: JJS on Thu 02/02/2012 08:38:12
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 Sat 11/02/2012 10:10:40
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: Icey on Sun 12/02/2012 06:46:12
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 Sun 12/02/2012 07:37:23
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: Icey on Sun 12/02/2012 18:36:53
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 Mon 13/02/2012 17:48:50
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 Tue 14/02/2012 01:40:07
Quote from: JJS on Mon 13/02/2012 17:48:50
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 Tue 14/02/2012 09:22:00
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 Tue 14/02/2012 15:36:03
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 Tue 14/02/2012 16:11:33
QuoteHas 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.

QuoteDoes 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.

QuoteWill 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 Tue 14/02/2012 16:27:38
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 Tue 14/02/2012 21:19:43
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: Icey on Tue 14/02/2012 22:00:52
What you could do is get the Android emulator or a PSP emulator.
Title: Re: AGS engine Android port
Post by: RoliX on Tue 14/02/2012 23:54:39
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 Wed 15/02/2012 07:28:59
QuoteI 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.

QuoteI 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 Wed 15/02/2012 10:01:04
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 Thu 16/02/2012 08:52:35
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 Thu 16/02/2012 09:48:58
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 Sun 19/02/2012 19:27:37
Is there a way to load games compiled to single exe?
Title: Re: AGS engine Android port
Post by: JJS on Mon 20/02/2012 11:54:00
Quote from: Joseph DiPerla on Sun 19/02/2012 19:27:37
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 Mon 20/02/2012 12:30:21
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 Mon 20/02/2012 12:33:45
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: Icey on Mon 20/02/2012 12:56:53
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 Mon 20/02/2012 15:09:25
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 Mon 20/02/2012 19:19:53
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 Mon 20/02/2012 20:10:30
You know, something like Nexus/Nimbus for Android would be the bomb. Nice.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on Wed 22/02/2012 02:50:54
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 Fri 24/02/2012 15:57:46
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 Fri 24/02/2012 18:02:26
Quote from: JJS on Fri 24/02/2012 15:57:46
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 Sat 25/02/2012 09:45:29
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 Sat 25/02/2012 10:55:13
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 Sat 25/02/2012 13:45:00
Quote from: JJS on Sat 25/02/2012 09:45:29
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 Sat 25/02/2012 14:28:49
Great job as always JJS.
Title: Re: AGS engine Android port
Post by: JJS on Tue 28/02/2012 20:07:26
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 Fri 16/03/2012 19:38:30
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 Sat 17/03/2012 12:07:05
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: Icey on Sat 17/03/2012 16:08:32
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 Fri 23/03/2012 12:42:52
Quote from: JJS on Fri 16/03/2012 19:38:30

- 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 Tue 27/03/2012 22:07:54
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 Thu 29/03/2012 00:33:39
QuoteHey, 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 Fri 06/04/2012 23:07:32
Quote from: jannar85 on Tue 27/03/2012 22:07:54
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 Sat 07/04/2012 04:24:59
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 Thu 12/04/2012 09:38:20
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 Fri 13/04/2012 01:31:49
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 Fri 13/04/2012 08:18:52
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 Fri 13/04/2012 08:22:50
Quote from: JJS on Thu 12/04/2012 09:38:20
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 Fri 13/04/2012 12:27:38
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 Fri 13/04/2012 12:48:33
Quote from: JJS on Fri 13/04/2012 12:27:38
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 Fri 13/04/2012 13:02:32
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 Fri 13/04/2012 13:09:42
Quote from: JJS on Fri 13/04/2012 13:02:32
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 Fri 13/04/2012 19:03:43
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 Sun 15/04/2012 08:19:29
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 Sun 15/04/2012 18:25:43
Quote from: Neole on Sun 15/04/2012 08:19:29
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 Sun 15/04/2012 20:53:42
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 Sun 15/04/2012 21:03:25
QuoteI 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 Sun 15/04/2012 22:50:13
Hehe. Should be a few months before it will be where I want it.
Title: Re: AGS engine Android port
Post by: DazJ on Mon 16/04/2012 08:05:22
That's brilliant news :)
Title: Re: AGS engine Android port
Post by: Neole on Tue 17/04/2012 19:24:09
"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 Tue 17/04/2012 21:24:42
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 Wed 18/04/2012 03:19:51
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 Wed 18/04/2012 08:30:03
Oh of course! I didn't mean any disrespect :)
Title: Re: AGS engine Android port
Post by: JJS on Tue 24/04/2012 11:16:14
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 Thu 26/04/2012 13:13:08
works just fine!  :-*  :)
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on Fri 27/04/2012 19:41:17
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 Tue 01/05/2012 05:13: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 Tue 08/05/2012 23:07:24
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
QuoteWARNING: 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 Wed 09/05/2012 18:05:09
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 Thu 10/05/2012 12:37:12
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 Mon 14/05/2012 01:00:24
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 Mon 14/05/2012 01:06: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 Mon 14/05/2012 03:27:01
Quote from: Joseph DiPerla on Mon 14/05/2012 01:06: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.

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 Mon 14/05/2012 12:33:11
They'd still need to download the additional files from your server, surely?
Title: Re: AGS engine Android port
Post by: Nixxon on Tue 15/05/2012 01:07:29
Quote from: Joseph DiPerla on Mon 14/05/2012 01:06: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.

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 Tue 15/05/2012 02:02:41
Quote from: Nixxon on Tue 15/05/2012 01:07:29Now 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 Tue 15/05/2012 02:31:01
Quote from: Eric on Tue 15/05/2012 02:02:41
Quote from: Nixxon on Tue 15/05/2012 01:07:29Now 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 Tue 15/05/2012 03:42:59
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 Tue 15/05/2012 09:04:02
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 Tue 15/05/2012 09:25:11
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 Tue 15/05/2012 21:42:35
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 Wed 16/05/2012 15:52:15
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 Wed 16/05/2012 17:05:42
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 Wed 16/05/2012 17:46:38
It's the modified engine so I guess that's the reason why?
Title: Re: AGS engine Android port
Post by: JJS on Wed 16/05/2012 18:17:14
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 Thu 17/05/2012 00:00:19
No problem, thanks for letting me know. Is it something you are considering implementing?
Title: Re: AGS engine Android port
Post by: jannar85 on Sun 10/06/2012 13:07:11
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 Sun 10/06/2012 18:10:19
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 Sun 10/06/2012 18:32:59
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: EchosofNezhyt on Sun 10/06/2012 19:08:53
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 Sun 10/06/2012 19:30:58
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: EchosofNezhyt on Sun 10/06/2012 21:47:31
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 Mon 11/06/2012 14:05:19
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 Thu 21/06/2012 21:06:34
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 Mon 25/06/2012 16:21:35
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 Fri 29/06/2012 23:12:28
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 Sat 30/06/2012 13:26:57
The "back" hardware button acts as the ESC key.
Title: Re: AGS engine Android port
Post by: unicronic on Thu 05/07/2012 12:10:55
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 Sun 15/07/2012 15:07:18
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: EchosofNezhyt on Tue 17/07/2012 07:59:13
I forgot about that, Yes that would be very awesome :D!
QuoteIsn'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 Tue 17/07/2012 15:13:08
Quote from: Frito Master on Tue 17/07/2012 07:59:13
I forgot about that, Yes that would be very awesome :D!
QuoteIsn'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: EchosofNezhyt on Wed 18/07/2012 04:59:49
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 Fri 20/07/2012 19:30:41
Quote from: Blackthorne on Sun 15/07/2012 15:07:18
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 Wed 25/07/2012 11:44:31
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 Fri 27/07/2012 09:21:23
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 Mon 30/07/2012 05:47:26
Quote from: DazJ on Wed 16/05/2012 15:52:15
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 Mon 30/07/2012 21:59:57
Are king quest remakes supported by latest version of AGS Android Port?
Title: Re: AGS engine Android port
Post by: QuestingHero on Tue 07/08/2012 16:05:05
Quote from: lukas2288 on Mon 30/07/2012 21:59:57
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 Sat 11/08/2012 08:22:49
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 Sat 11/08/2012 18:44:37
You should probably mention the old and new versions of what was updated.
Title: Re: AGS engine Android port
Post by: JJS on Sun 12/08/2012 20:37:34
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 Mon 13/08/2012 17:04:10
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 Fri 17/08/2012 22:29:01
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 Fri 17/08/2012 22:32:28
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 Sat 18/08/2012 18:57:01
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 Sat 18/08/2012 19:47:51
Quote from: Calin Leafshade on Fri 17/08/2012 22:32:28In 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.


Quote from: giom on Sat 18/08/2012 18:57:01I 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.

Quote from: giom on Sat 18/08/2012 18:57:01With 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 Sun 19/08/2012 00:39:52
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 Sun 19/08/2012 09:28:55
Quote from: JJS on Sat 18/08/2012 19:47:51
Quote from: giom on Sat 18/08/2012 18:57:01I 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 Sun 19/08/2012 10:46:35
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 Sun 19/08/2012 11:35:27
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 Sun 19/08/2012 12:07:30
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 Sun 19/08/2012 15:57:30
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 Sun 19/08/2012 17:13:27
public domain is fine.
Title: Re: AGS engine Android port
Post by: BigMc on Sun 19/08/2012 18:09:39
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 Sun 19/08/2012 19:12:29
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 Sun 19/08/2012 19:37:21
I changed the license to CC0.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Sun 19/08/2012 20:05:55
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 Sun 19/08/2012 20:52:08
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 Thu 23/08/2012 18:16:21
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 Thu 23/08/2012 18:34:23
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 Sat 25/08/2012 11:44:27
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 Sat 25/08/2012 21:34:11
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 Thu 30/08/2012 11:58:01
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 Thu 30/08/2012 12:39:23
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 Thu 30/08/2012 14:55:27
Brilliant, I'll give that a go! :-D
Title: Re: AGS engine Android port
Post by: SKYY on Sat 01/09/2012 03:42:10
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 Sat 01/09/2012 06:58:43
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 Sat 01/09/2012 11:15:13
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 Sat 01/09/2012 15:56:48
QuoteIn 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 Mon 24/09/2012 08:06:53
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 Mon 24/09/2012 10:07:41
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 Sun 25/11/2012 09:01:25
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 Sun 25/11/2012 10:39:09
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 Sun 25/11/2012 10:50:47
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 Sun 25/11/2012 13:48:55
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 Sun 25/11/2012 19:17:32
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 Thu 29/11/2012 10:37:40
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 Thu 29/11/2012 17:41:04
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 Thu 29/11/2012 17:48:41
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 Sat 01/12/2012 00:14:00
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 Sat 01/12/2012 01:20:19
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 Sat 01/12/2012 07:46:04

Quote from: BigMc on Sat 01/12/2012 01:20:19
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 Sat 01/12/2012 10:20:00
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 Sun 02/12/2012 07:35:56
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 Sun 02/12/2012 09:43:48
Longpressing the "menu" button does not bring up the software keyboard?
Title: Re: AGS engine Android port
Post by: TinaMaria on Sun 02/12/2012 18:21:32
Quote from: JJS on Sun 02/12/2012 09:43:48
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 Wed 05/12/2012 15:06:54
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 Fri 07/12/2012 13:02:44
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 Sat 08/12/2012 00:25:22
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 Sat 08/12/2012 09:29:15
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 Sat 08/12/2012 09:35:41
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 Sun 09/12/2012 14:48:49
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 Sun 09/12/2012 16:12:37
It is a port problem and it seems related to a recent change in the script interpreter. We will look into it.

Quote from: davros on Sat 08/12/2012 09:35:41if 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 Sun 09/12/2012 18:00:53
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 Sun 09/12/2012 22:26:09
Quote from: davros on Sun 09/12/2012 14:48:49
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 Sun 09/12/2012 23:42:07
I uploaded new daily builds.
Title: Re: AGS engine Android port
Post by: davros on Sat 15/12/2012 23:54:22
:thumbs up: does the trick, thank you
Title: Re: AGS engine Android port
Post by: ArmyMage on Tue 18/12/2012 07:27:16
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 Mon 14/01/2013 11:31:26
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 Thu 17/01/2013 03:30:21
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 Sat 19/01/2013 05:32:58
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 Tue 22/01/2013 17:19: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 Tue 22/01/2013 17:41:50
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 Wed 23/01/2013 15:28:36
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 Sun 27/01/2013 18:00:39
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 Mon 28/01/2013 18:43:48
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%20001.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 Mon 28/01/2013 22:07:02
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 Mon 28/01/2013 23:48:10
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 Tue 29/01/2013 08:04:21
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 Fri 01/02/2013 23:08:30
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 Fri 01/02/2013 23:43:18
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 Sat 02/02/2013 03:41:05
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 Sat 02/02/2013 16:47:16
Quote from: AGD2 on Mon 28/01/2013 23:48:10
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 Sat 02/02/2013 17:08:25
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 (AGS) Select
private void showPreferences(int position)
{
Intent intent = new Intent(this, PreferencesActivity.class);
Bundle b = new Bundle();
b.putString("name", (position < 0) ? "" : folderList.get(position));
b.putString("filename", (position < 0) ? null : filenameList.get(position));
b.putString("directory", baseDirectory);
intent.putExtras(b);
startActivity(intent);
}


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 Sat 02/02/2013 22:43:02
Quote from: Crimson Wizard on Sat 02/02/2013 16:47:16
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 Sun 03/02/2013 01:59:30
OK, I got your package :)
Quote from: AGD2 on Sat 02/02/2013 03:41:05
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 Sun 03/02/2013 13:07:27
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.

Quote from: AGD2 on Sat 02/02/2013 22:43:02The 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.


Quote from: AGD2 on Mon 28/01/2013 18:43:483) 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.



Quote from: Joseph DiPerla on Sat 02/02/2013 17:08:25Hey 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 (AGS) Select

name = "5 Days A Stranger" // Is displayed at the top of the preferences, can be anything
OR
name = "" // Indicates that the global preferences should be shown

filename = "/sdcard/ags/5days/5days.exe" // Full path to the game exe
directory = "/sdcard/ags" // Path to the "root" ags directory


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


Title: Re: AGS engine Android port
Post by: Joseph DiPerla on Sun 03/02/2013 14:29:17
Awesome! Thanks JJS.
Title: Re: AGS engine Android port
Post by: AGD2 on Sun 03/02/2013 23:50:06
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: JJSI 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 Tue 05/02/2013 05:52:31
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 Tue 05/02/2013 06:59:20
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 Fri 08/02/2013 14:06:08
Quote from: JJS on Tue 05/02/2013 06:59:20
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 Sat 09/02/2013 13:58:30
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.PreferencesActivity:

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 Sun 10/02/2013 04:51:58
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 Sun 10/02/2013 19:47:56
Hey JJS, looking through the code for PreferencesActivity...

Should line 71 read:

Code (AGS) Select
public void onCreate(Bundle bundle)

rather than be protected?

And on lines 47 to 49, it reads:

Code (AGS) Select
gameName = getIntent().getExtras().getString("name");
gameFilename = getIntent().getExtras().getString("filename");
baseDirectory = getIntent().getExtras().getString("directory");


Would this make it a difference:


Code (AGS) Select
String gameName = getIntent().getExtras().getString("name");
String gameFilename = getIntent().getExtras().getString("filename");
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 Tue 12/02/2013 17:02:18
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 Wed 13/02/2013 17:33:27
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 Fri 15/02/2013 16:02:40
This is exellent emulator! 5/5
works great on LG Optimus
Title: Re: AGS engine Android port
Post by: Schwiney on Tue 19/02/2013 03:12:45
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 Tue 19/02/2013 03:54:18
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 Tue 19/02/2013 16:10:38
Quote from: Schwiney on Tue 19/02/2013 03:12:45
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 Sun 24/02/2013 01:36:12
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 Sun 24/02/2013 09:59:07
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 Sun 24/02/2013 12:49:22
Yeah the SO files I believe :)
Title: Re: AGS engine Android port
Post by: JJS on Sun 24/02/2013 17:39:43
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 Sun 24/02/2013 17:55:59
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 Sun 10/03/2013 14:31:09
Quote from: R4L on Sun 10/02/2013 04:51:58
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 Wed 13/03/2013 17:55:38
Thanks for the fix JJS. I owe you a coffee or a brew haha.
Title: Re: AGS engine Android port
Post by: Giskard on Tue 19/03/2013 12:31:02
Trying to play Time Gentlemen Please on my Nexus 7 I get the following error at startup:

QuoteScript 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 Tue 19/03/2013 12:37:41
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 Tue 19/03/2013 12:39:28
I've thought the same thing but that:

Quotetrying built-in plugins...

was giving me some hope..
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 19/03/2013 12:41:59
Quote from: Giskard on Tue 19/03/2013 12:39:28
I've thought the same thing but that:

Quotetrying 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 Tue 26/03/2013 11:30:48
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 Tue 26/03/2013 11:58:45
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 Wed 27/03/2013 14:33:14
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 Sat 30/03/2013 05:34:44
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 Sat 30/03/2013 05:45:29
Nevermind. I was able to compile the latest build. ;)
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on Sat 30/03/2013 16:00:16
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 Wed 03/04/2013 08:41:34
Quote from: Joseph DiPerla on Sat 30/03/2013 16:00:16
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 Wed 03/04/2013 16:20:17
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 Thu 11/04/2013 12:40:15
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 Fri 12/04/2013 14:08:01
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 Fri 12/04/2013 14:19:15
Previous Android build was... 10th March? Quite a lot changed in between :-/.
Title: Re: AGS engine Android port
Post by: JJS on Fri 12/04/2013 14:58:38
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 Sat 13/04/2013 07:54:52
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 Sat 13/04/2013 16:27:36
Quote from: MrProsser on Sat 13/04/2013 07:54:52
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 Mon 15/04/2013 00:53:02
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 Mon 15/04/2013 01:04:13
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 Mon 15/04/2013 03:05:16
Quote from: MrProsser on Mon 15/04/2013 01:04:13
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 Mon 15/04/2013 05:41:09
I deleted the obj directory and started again. I ran ndk-build in ags/Android/library. This ran nicely, but once again failed:
QuoteSharedLibrary  : 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 Mon 15/04/2013 07:00:21
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 (shell) Select
git submodule init
git submodule update
Title: Re: AGS engine Android port
Post by: MrProsser on Mon 15/04/2013 07:29:20
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:
Quotejni/../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 Mon 15/04/2013 07:44:35
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 Mon 15/04/2013 07:50:47
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 Tue 16/04/2013 04:10:12
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 Wed 17/04/2013 16:28:19
Quote from: sunerune on Tue 16/04/2013 04:10:12
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 Thu 25/04/2013 02:59:39
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 Thu 25/04/2013 04:26:17
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 (AGS) Select
if ((key == KeyEvent.KEYCODE_BACK) && ((ev.getFlags() & 0x80) > 0)) // FLAG_LONG_PRESS
{
ignoreNextActionUp_Back = true;
openOptionsMenu();
}


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 Wed 01/05/2013 18:48:46
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 Thu 02/05/2013 11:52:42
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 Thu 02/05/2013 11:55:15
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 Thu 02/05/2013 12:00:13
Quote from: DoorKnobHandle on Thu 02/05/2013 11:55:15
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 Mon 06/05/2013 22:45:37
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 Wed 08/05/2013 22:38:48
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 Wed 08/05/2013 23:08:12
Quote from: fischkopf on Wed 08/05/2013 22:38:48
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?

Quote from: fischkopf on Wed 08/05/2013 22:38:48
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 Thu 09/05/2013 12:30:03
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 Thu 09/05/2013 14:59:51
Quote from: Joseph DiPerla on Thu 25/04/2013 04:26:17
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.

Quote from: Joseph DiPerla on Thu 25/04/2013 04:26:17
EDIT:

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

Code (AGS) Select
if ((key == KeyEvent.KEYCODE_BACK) && ((ev.getFlags() & 0x80) > 0)) // FLAG_LONG_PRESS
{
ignoreNextActionUp_Back = true;
openOptionsMenu();
}


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 (AGS) Select
// requestWindowFeature(Window.FEATURE_NO_TITLE);


And add these lines just before and after the setContentView
Code (AGS) Select

getWindow().requestFeature(Window.FEATURE_ACTION_BAR);

setContentView(R.layout.loading);

displayActionBar();


Method displayActionBar:

Code (AGS) Select

@TargetApi(11)
private void displayActionBar() {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
final ActionBar actionBar = getActionBar();
        actionBar.setDisplayShowHomeEnabled(true);
}
}


Finally, in ingame.xml, add the following to the three menu items (@+id/toggle_keyboard, @+id/keys, @+id/exitgame)
Code (AGS) Select

android:showAsAction="always"


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 Thu 09/05/2013 16:02:28
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 Thu 09/05/2013 17:18:12
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 Fri 10/05/2013 16:34:27
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 Fri 10/05/2013 19:53:02
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 Sat 11/05/2013 00:29:11
Quote from: Cubbie on Fri 10/05/2013 19:53:02
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 Sat 11/05/2013 09:02:19
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 Sat 11/05/2013 13:58:23
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 Thu 16/05/2013 06:55:42
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 Mon 08/07/2013 10:58:31
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 Sun 14/07/2013 19:52:40
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 Mon 15/07/2013 08:49:51
Quote from: deee on Mon 08/07/2013 10:58:31Actually 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.

Quote from: cianty on Sun 14/07/2013 19:52:40I 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 Tue 16/07/2013 00:03:32
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 Wed 17/07/2013 21:07:23
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 Fri 19/07/2013 07:27:53
Quote from: QuestingHero on Tue 16/07/2013 00:03:32
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 Fri 19/07/2013 14:09:49
Jumping into testing) Gonna give this build a try too.
Title: Re: AGS engine Android port
Post by: StarkRG on Mon 22/07/2013 20:06:59
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 Tue 23/07/2013 17:23:59
Quote from: JJS on Fri 19/07/2013 07:27:53
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 Tue 23/07/2013 17:33:04
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 Wed 24/07/2013 19:04:15
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 Wed 24/07/2013 19:28:25
Quote from: cianty on Wed 24/07/2013 19:04:15
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 Wed 24/07/2013 19:52:20
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 Wed 24/07/2013 19:58:43
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 Wed 24/07/2013 20:24:13
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 Thu 25/07/2013 09:12:37
@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 Sat 27/07/2013 19:09:50
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 Mon 29/07/2013 17:27:38
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 Mon 29/07/2013 19:08:35
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 Tue 30/07/2013 18:23:09
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 Thu 01/08/2013 06:41:49
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 Sat 03/08/2013 15:04:09
Quote from: DazJ on Tue 30/07/2013 18:23:09
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 Thu 22/08/2013 21:44:38
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 Fri 23/08/2013 12:24:30
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: Icey on Sat 24/08/2013 06:10:34
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 Mon 26/08/2013 12:38:57
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 Mon 26/08/2013 12:56:28
Quote from: DazJ on Fri 23/08/2013 12:24:30
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 Mon 26/08/2013 14:47:14
Quote from: Joseph DiPerla on Mon 26/08/2013 12:56:28
Quote from: DazJ on Fri 23/08/2013 12:24:30
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 Sun 01/09/2013 10:07:14
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 Sun 01/09/2013 18:06:23
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 Fri 06/09/2013 09:57:15
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 Fri 06/09/2013 10:00:44
Quote from: DazJ on Fri 06/09/2013 09:57:15
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 Fri 06/09/2013 14:20:51
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 Fri 06/09/2013 17:16:45
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 Sat 07/09/2013 09:24:19
Yes I've tried all the settings and it makes no difference.
Title: Re: AGS engine Android port
Post by: Manul on Fri 20/09/2013 15:23:46
Quote from: Manul on Sun 01/09/2013 18:06: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 Tue 01/10/2013 14:38:53
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 Tue 01/10/2013 16:11:10
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 Wed 02/10/2013 21:56:41
Quote from: Joseph DiPerla on Tue 01/10/2013 16:11:10
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 Thu 03/10/2013 12:17:40
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 Thu 03/10/2013 14:23:22
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 Thu 03/10/2013 15:58:04
Quote from: Joseph DiPerla on Thu 03/10/2013 14:23:22
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 Thu 03/10/2013 16:07:51
Quote from: sektor666 on Thu 03/10/2013 12:17:40i 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)?

Quote from: sektor666 on Thu 03/10/2013 12:17:40
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 Thu 03/10/2013 18:25:22
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 Fri 04/10/2013 06:06:30
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 Fri 04/10/2013 12:26:08
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 Fri 04/10/2013 12:32:04
Quote from: sektor666 on Fri 04/10/2013 12:26:08
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 Fri 04/10/2013 12:58:41
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 Fri 04/10/2013 13:15:26
Quote from: monkey_05_06 on Fri 04/10/2013 12:58:41
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 Fri 04/10/2013 14:15:59
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 Fri 04/10/2013 14:28:11
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 Fri 04/10/2013 15:39:25
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 Fri 04/10/2013 17:14:16
Quote from: monkey_05_06 on Fri 04/10/2013 15:39:25
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 Sat 05/10/2013 23:08:36
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 Sun 06/10/2013 05:17:40
Quote from: sektor666 on Sat 05/10/2013 23:08:36recurring 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 Sun 06/10/2013 11:29:10
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 Sun 06/10/2013 12:35:18
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 Sun 06/10/2013 14:17:37
Quote from: DjCzermino on Sun 06/10/2013 12:35:18
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 Sun 06/10/2013 18:08:44
Quote from: Crimson Wizard on Sun 06/10/2013 14:17:37
Quote from: DjCzermino on Sun 06/10/2013 12:35:18
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 Sun 06/10/2013 20:50:38
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 Tue 29/10/2013 15:08:44
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 Tue 29/10/2013 18:42:35
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 Thu 31/10/2013 13:04:28
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

Quote from: land.of.adventure on Tue 29/10/2013 15:08:44
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 Mon 18/11/2013 10:04:25
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 Mon 18/11/2013 19:48:22
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 Mon 18/11/2013 22:29:27
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 Sat 14/12/2013 13:01:22
Quote from: davoker on Tue 29/10/2013 18:42:35
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 Thu 30/01/2014 19:41:59
Quote from: Dj CzerminoHi, 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 Thu 30/01/2014 20:12:08
Nevermind previous post, guys. I found the solution :)
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on Sat 08/02/2014 19:58:36
I just tried to compile the engine using the Android NDK and I received the following error:

"Compile++ arm  : agsengine <= acpland.cpp
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 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


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

"Compile++ arm  : agsengine <= acpland.cpp
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 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


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 Sun 09/02/2014 14:16:42
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:

Quotejni/../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_PreferencesActivity_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 Sun 09/02/2014 15:59:33
Quote from: Joseph DiPerla on Sun 09/02/2014 14:16:42
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 Mon 10/02/2014 01:54:44
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 Mon 10/02/2014 07:14:52
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 Sun 16/02/2014 08:43:08
Quote from: Joseph DiPerla on Sun 09/02/2014 14:16:42
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:

Quotejni/../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_PreferencesActivity_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 Mon 17/02/2014 04:38:49
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 Wed 05/03/2014 13:34:04
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 Mon 24/03/2014 08:33:02
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 Sat 05/04/2014 02:14:33
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 Sat 05/04/2014 14:59:02
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 Sun 06/04/2014 01:29:04
Quote from: Crimson Wizard on Sat 05/04/2014 14:59:02
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 Sun 06/04/2014 13:35:20
Quote from: ROOKMAGE on Sun 06/04/2014 01:29:04
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 bfb101bb3ad17a02b3ad45abc9fd788cf99222c9.

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 Tue 08/04/2014 16:03:40
Quote from: Crimson Wizard on Sun 06/04/2014 13:35:20
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 Tue 08/04/2014 17:55:53
Quote from: ROOKMAGE on Tue 08/04/2014 16:03:40
Quote from: Crimson Wizard on Sun 06/04/2014 13:35:20
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 Tue 08/04/2014 19:59:22
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 Tue 08/04/2014 20:08:20
Quote from: ROOKMAGE on Tue 08/04/2014 19:59:22
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.

Quote from: ROOKMAGE on Tue 08/04/2014 19:59:22
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 Tue 08/04/2014 23:54:58
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 Wed 09/04/2014 08:07:24
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 Wed 09/04/2014 13:49:03
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 Wed 09/04/2014 20:43:00
If you give me till tomorrow I will make a new build for you.
Title: Re: AGS engine Android port
Post by: ROOKMAGE on Thu 10/04/2014 15:03:28
Oh, ok. Sweet. Thanks!
Title: Re: AGS engine Android port
Post by: km3k on Tue 15/04/2014 18:47:40
Quote from: Crimson Wizard on Tue 08/04/2014 17:55:53
Quote from: ROOKMAGE on Tue 08/04/2014 16:03:40
Quote from: Crimson Wizard on Sun 06/04/2014 13:35:20
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 Fri 18/04/2014 15:35:07
That worked, thanks!

Title: Re: AGS engine Android port
Post by: Joseph DiPerla on Sun 27/04/2014 21:55:56
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 Sun 27/04/2014 22:11:08
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 Mon 28/04/2014 12:57:26
Yeah, getting the same problem on both amazon kindle and Motorola g.
Title: Re: AGS engine Android port
Post by: Liquidje on Wed 30/04/2014 10:21:13
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:
Quote from: Crimson Wizard on Tue 08/04/2014 17:55:53
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 Wed 30/04/2014 13:02:40
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 Wed 30/04/2014 13:46:38
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 Wed 30/04/2014 15:40:35
Quote from: Liquidje on Wed 30/04/2014 10:21:13Regarding 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 Wed 30/04/2014 16:17:24
Quote from: monkey_05_06 on Wed 30/04/2014 15:40:35
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 Thu 01/05/2014 00:10:14
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 Tue 13/05/2014 06:10:00
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 Sat 24/05/2014 20:34:40
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 Sat 24/05/2014 22:02:03
Quote from: EctoOne on Sat 24/05/2014 20:34:40
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 Thu 26/06/2014 13:10:12
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 Wed 16/07/2014 01:02:59
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 Fri 18/07/2014 02:58:57
Quote from: ner0 on Sat 14/12/2013 13:01:22
Quote from: davoker on Tue 29/10/2013 18:42:35
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 Fri 18/07/2014 08:39:20
Quote from: Iceberg on Wed 16/07/2014 01:02:59
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 Fri 18/07/2014 20:29:14
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 Fri 18/07/2014 21:25:07
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 Sat 19/07/2014 01:50:54
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 Sun 20/07/2014 01:45:52
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 Sun 20/07/2014 03:22:17
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 Sat 26/07/2014 04:33:24
Quote from: sektor666 on Sat 05/10/2013 23:08:36
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 (ags) Select
agsgame.log (log created to run the game in android):

Adventure Game Studio v3.3 Interpreter
Copyright (c) 1999-2011 Chris Jones and 2011-2013 others
ACI version 3.3.0.1144

***** ENGINE STARTUP
Reading config file
Initializing allegro
Setting up window
Initializing game data
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 Sat 26/07/2014 07:34:57
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 Wed 30/07/2014 19:07:28
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 Thu 31/07/2014 21:13:47
Quote from: davoker on Sat 26/07/2014 04:33:24
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 Thu 31/07/2014 22:45:17
Quote from: Crimson Wizard on Thu 31/07/2014 21:13:47
Quote from: davoker on Sat 26/07/2014 04:33:24
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 Mon 04/08/2014 12:22:53
Do other people have the same problem I have? Is it gonna be fixed?
Title: Re: AGS engine Android port
Post by: Jothie on Wed 13/08/2014 20:01:59
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 Wed 13/08/2014 20:30:34
Quote from: Jothie on Wed 13/08/2014 20:01:59
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 Fri 15/08/2014 05:12:16
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 Fri 15/08/2014 08:44:04
Quote from: Blackthorne on Fri 15/08/2014 05:12:16
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 Mon 18/08/2014 03:47:19
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 Sat 30/08/2014 23:16:03
Quote from: Crimson Wizard on Wed 13/08/2014 20:30:34
Quote from: Jothie on Wed 13/08/2014 20:01:59
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 Thu 04/09/2014 19:39:01
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 Thu 04/09/2014 21:23:14
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 Mon 08/09/2014 08:33:10
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 Thu 11/09/2014 03:37:34
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 Thu 11/09/2014 13:40:22
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 Fri 19/09/2014 10:15:11
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
Title: Re: AGS engine Android port
Post by: Gurok on Fri 19/09/2014 10:28:12
Quote from: DjCzermino on Fri 19/09/2014 10:15:11
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 Mon 22/09/2014 03:55:00
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 Thu 25/09/2014 23:34:39
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 Fri 26/09/2014 04:26:16
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 Mon 03/11/2014 12:54:00
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 Mon 03/11/2014 23:30:53
Quote from: rmonic79 on Mon 03/11/2014 12:54:00I 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 Tue 04/11/2014 11:16:58
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 Tue 04/11/2014 11:59:06
Quote from: Crimson Wizard on Mon 03/11/2014 23:30:53
Quote from: rmonic79 on Mon 03/11/2014 12:54:00I 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 Tue 04/11/2014 12:16:24
Quote from: rmonic79 on Tue 04/11/2014 11:59:06i 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 Tue 04/11/2014 12:23:55
Quote from: Crimson Wizard on Tue 04/11/2014 12:16:24
Quote from: rmonic79 on Tue 04/11/2014 11:59:06i 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 Wed 05/11/2014 07:57:22
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 Thu 06/11/2014 18:26:44
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 Thu 06/11/2014 21:24:48
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 Thu 06/11/2014 22:40:06
Quote from: monkey_05_06 on Thu 06/11/2014 21:24:48
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 Thu 06/11/2014 22:47:43
Quote from: monkey_05_06 on Thu 06/11/2014 21:24:48
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 Fri 07/11/2014 23:24:45
Or the builds are put on the homepage, where they belong.
Title: Re: AGS engine Android port
Post by: AGD2 on Mon 10/11/2014 07:35:23
Quote from: monkey_05_06 on Thu 11/09/2014 13:40:22
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 Mon 10/11/2014 09:06:07
:~( 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 Mon 10/11/2014 09:16:24
Quote from: AGD2 on Mon 10/11/2014 07:35:23
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 Mon 10/11/2014 22:18:53
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 Tue 11/11/2014 12:24:49
Quote from: Crimson Wizard on Mon 10/11/2014 09:16: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 Wed 12/11/2014 20:17:40
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 Wed 12/11/2014 20:22:50
Tadam... https://github.com/adventuregamestudio/ags/issues/198
Title: Re: AGS engine Android port
Post by: Blackthorne on Wed 19/11/2014 15:48:51
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 Wed 19/11/2014 22:56:26
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 Wed 19/11/2014 23:46:45
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 Thu 20/11/2014 18:29:42
Awesome! Will this fix the steam errors a lot of us were getting?
Title: Re: AGS engine Android port
Post by: monkey0506 on Sat 27/12/2014 09:21:27
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 Wed 31/12/2014 09:33:53
Quote from: monkey_05_06 on Wed 19/11/2014 23:46:45
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 Wed 31/12/2014 12:20:18
Quote from: ET3D on Wed 31/12/2014 09:33:53
Quote from: monkey_05_06 on Wed 19/11/2014 23:46:45
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 Wed 31/12/2014 14:39:48
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 Wed 31/12/2014 14:53:45
Quote from: ET3D on Wed 31/12/2014 14:39:48
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 Wed 31/12/2014 16:53:29
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 Wed 31/12/2014 17:36:55
Quote from: monkey_05_06 on Wed 31/12/2014 16:53:29
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 Thu 01/01/2015 08:13:00
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 Thu 01/01/2015 08:37:23
Quote from: monkey_05_06 on Wed 31/12/2014 16:53:29
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?

Quote from: Crimson Wizard on Wed 31/12/2014 14:53:45
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 Mon 12/01/2015 09:51:17
Quote from: monkey_05_06 on Wed 12/11/2014 20:17:40
* 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 Mon 02/02/2015 06:58:21
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 Sun 15/02/2015 19:29:26
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 Mon 16/02/2015 19:41:27
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 Sun 01/03/2015 14:31:57
Please, can you help me with this?
Title: Re: AGS engine Android port
Post by: ET3D on Tue 10/03/2015 10:18:12
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 Wed 11/03/2015 18:17:57
Quote from: ET3D on Tue 10/03/2015 10:18:12monkey, 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 Sun 12/04/2015 11:53:19
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 Sun 12/04/2015 12:56:39
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 Sat 06/06/2015 18:39:49
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 Sun 07/06/2015 11:50:30
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 Mon 08/06/2015 00:50:56
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 Mon 08/06/2015 17:50:42
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 Wed 10/06/2015 17:48:39
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 Sun 28/06/2015 19:21:53
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 Tue 07/07/2015 09:32:24
Quote from: MrWood on Wed 10/06/2015 17:48:39
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 Tue 07/07/2015 15:19:37
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 Tue 07/07/2015 15:21:27
Quote from: pixelincognito on Tue 07/07/2015 15:19:37
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 Tue 07/07/2015 15:59:32
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 Tue 07/07/2015 16:21:57
Quote from: pixelincognito on Tue 07/07/2015 15:59:32I'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 Tue 07/07/2015 16:24:47
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 Sun 12/07/2015 21:07:44
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 Mon 13/07/2015 00:25:54
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 Mon 13/07/2015 01:09:13
Quote from: Culzean on Mon 13/07/2015 00:25:54
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 Mon 13/07/2015 23:11:30
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 Mon 13/07/2015 23:18:28
Quote from: Culzean on Mon 13/07/2015 23:11:30
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 Fri 17/07/2015 08:51:57
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 Fri 17/07/2015 09:16:06
Quote from: pixelincognito on Fri 17/07/2015 08:51:57
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.

Quote from: pixelincognito on Fri 17/07/2015 08:51:57
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 Fri 17/07/2015 10:12:47
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 Fri 17/07/2015 10:44:12
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 Fri 17/07/2015 18:16:00
Quote from: pixelincognito on Fri 17/07/2015 08:51:57When 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.

Quote from: pixelincognito on Fri 17/07/2015 08:51:57I 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 Fri 24/07/2015 00:42:51
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 Fri 24/07/2015 10:55:18
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 Mon 27/07/2015 09:20:24
Quote from: Cassiebsg on Fri 24/07/2015 00:42:51
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 Wed 29/07/2015 21:02:03
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 Fri 25/09/2015 23:14:55
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 Sun 04/10/2015 04:16:22
Quote from: Roy Lazarovich on Fri 25/09/2015 23:14:55
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 (ags) Select
Name:    digmid.dat
Date:    2/10/2015
Size:    19 MB (19,971,986 bytes)
--------
SHA-1:    044fa525b26e7715e80cde24bce0b20e6a306ce4
MD5:      9dd5a6205cdf3af1abe80d1c92c4b857
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 Sun 04/10/2015 15:23:56
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 (ags) Select

if (!psp_midi_enabled)
         usetup.midicard = MIDI_NONE;

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 Sun 04/10/2015 15:44:31
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 Sun 04/10/2015 16:37:30
Quote from: Roy Lazarovich on Sun 04/10/2015 15:44:31
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 (ags) Select

[misc]
log=1

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 Sun 04/10/2015 17:26:16
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 Sun 04/10/2015 20:23:16
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 Mon 05/10/2015 19:51:29
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 Thu 15/10/2015 15:57:07
Quote from: ManicMatt on Mon 05/10/2015 19:51:29
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 Fri 16/10/2015 22:22:10
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 Sun 08/11/2015 11:48:04
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 Sun 08/11/2015 12:02:24
Quote from: cstaite on Sun 08/11/2015 11:48:04
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 Wed 11/11/2015 21:30:27
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 Tue 12/01/2016 18:41:57
;)
Title: Re: AGS engine Android port
Post by: monkey0506 on Tue 02/02/2016 22:28:57
Latest APK: https://bitbucket.org/monkey0506/ags/downloads/AGS-3.4.0.6.apk
Title: Re: AGS engine Android port
Post by: Cassiebsg on Tue 02/02/2016 22:33:31
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 Wed 03/02/2016 05:14:17
Quote from: monkey0506 on Tue 02/02/2016 22:28:57
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 Wed 03/02/2016 06:37:19
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,%20java.lang.String,%20android.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 Wed 03/02/2016 12:26:56
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 Wed 03/02/2016 14:22:00
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 Wed 03/02/2016 20:59:33
Quote from: Mehrdad on Wed 03/02/2016 12:26:56If 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 Thu 04/02/2016 06:28:11
Thanks so much . I'm waiting for your good news.
Title: Re: AGS engine Android port
Post by: monkey0506 on Thu 04/02/2016 16:38:55
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 Fri 05/02/2016 06:17:59
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 Sat 12/03/2016 15:56:30
Quote from: monkey0506 on Tue 02/02/2016 22:28:57
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 Sun 13/03/2016 04:51:05
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 Sun 13/03/2016 10:37:05
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 Sat 19/03/2016 06:43:45
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 Mon 21/03/2016 20:17:53
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 Thu 02/06/2016 12:53:31
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 Thu 21/07/2016 18:41:20
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 Thu 21/07/2016 19:30:15
Quote from: luifer on Thu 21/07/2016 18:41:20
"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 Fri 22/07/2016 23:06:40
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 Fri 22/07/2016 23:35:45
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 Thu 18/08/2016 22:12:36
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 Wed 31/08/2016 21:17:48
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 Wed 31/08/2016 22:16:12
Quote from: catafracta on Wed 31/08/2016 21:17:48
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 Sat 03/09/2016 12:09:40
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 Tue 27/09/2016 19:30:57
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 Fri 30/09/2016 14:20:15
Quote from: SimSaw on Tue 27/09/2016 19:30:57
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 Fri 30/09/2016 21:31:43
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 Fri 30/09/2016 21:59:40
Quote from: SimSaw on Fri 30/09/2016 21:31:43
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? :)

Quote from: SimSaw on Fri 30/09/2016 21:31:43
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 Sat 01/10/2016 07:40:20
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 Fri 28/10/2016 13:14:57
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 Sun 30/10/2016 13:24:51
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 Sun 30/10/2016 13:46:57
Unfortunately I cannot give any advices about building the port, because I never done that myself.

Quote from: guga2112 on Sun 30/10/2016 13:24:51
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 Sun 06/11/2016 09:45:21
Hi!

Quote from: guga2112 on Sun 30/10/2016 13:24:51
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 Mon 07/11/2016 19:18:48
Quote from: monkey0506 on Tue 02/02/2016 22:28:57
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 Wed 09/11/2016 20:07:48
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 Thu 10/11/2016 08:47:25
Quote from: cat on Wed 09/11/2016 20:07:48
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 Thu 10/11/2016 09:31:35
Quote from: Crimson Wizard on Thu 10/11/2016 08:47:25
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 Thu 10/11/2016 09:37:46
Quote from: cat on Thu 10/11/2016 09:31:35
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.

Spoiler
(http://i.imgur.com/gp4mOXO.jpg)
[close]
Title: Re: AGS engine Android port
Post by: cat on Thu 10/11/2016 09:42:37
What version did you use in the end?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Thu 10/11/2016 09:49:16
Quote from: cat on Thu 10/11/2016 09:31:35
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 Thu 10/11/2016 09:56:48
Quote from: cat on Thu 10/11/2016 09:42:37
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 Thu 10/11/2016 10:19:32
Quote from: AnasAbdin on Thu 10/11/2016 09:56:48
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 Thu 10/11/2016 10:25:42
This is the one I got:

Quote from: cat on Thu 10/11/2016 09:31:35
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 Sat 12/11/2016 13:36:37
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 Sat 12/11/2016 15:33:21
Quote from: Cassiebsg on Sat 12/11/2016 13:36:37
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 Sat 12/11/2016 16:16:33
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 Sat 12/11/2016 16:45:12
@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 Sun 13/11/2016 03:54:35
All the AGS_2014-4-30.apk links I tried are dead links :(
Title: Re: AGS engine Android port
Post by: Bhaal87 on Mon 26/12/2016 07:51:34
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 Mon 26/12/2016 08:17:05
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 Mon 26/12/2016 10:01:49
@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 Mon 26/12/2016 21:25:49
@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 Mon 26/12/2016 22:51:13
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 Tue 27/12/2016 02:53:01
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 Tue 27/12/2016 10:33:56
Quote from: Crimson Wizard on Mon 26/12/2016 22:51:13
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 Thu 29/12/2016 13:45:58
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 Thu 29/12/2016 16:43:13
Quote from: Crimson Wizard on Thu 29/12/2016 13:45:58
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 Thu 29/12/2016 17:45:56
Quote from: Mehrdad on Thu 29/12/2016 16:43:13
Quote from: Crimson Wizard on Thu 29/12/2016 13:45:58
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 Fri 06/01/2017 21:09:14
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 Sat 07/01/2017 01:00:21
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 Sat 07/01/2017 12:17:20
Quote from: Crimson Wizard on Sat 07/01/2017 01:00:21
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 Sat 07/01/2017 13:23:28
Quote from: Mehrdad on Sat 07/01/2017 12:17:20
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 Sat 07/01/2017 14:42:24
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 Sat 07/01/2017 15:25:20
Quote from: cat on Sat 07/01/2017 14:42:24
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 Sat 07/01/2017 15:40:21
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 Sat 07/01/2017 17:55:06
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 Sun 08/01/2017 12:56:14
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 Sun 08/01/2017 13:46:20
/me claps (nod)

Thanks, I'll look forward to test this... :-D
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Sun 08/01/2017 14:39:17
Quote from: cat on Sun 08/01/2017 12:56:14
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 Sun 08/01/2017 14:55:12
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 Sun 08/01/2017 14:59:45
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 Mon 09/01/2017 17:26:18
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 Tue 10/01/2017 17:01:36
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 Tue 10/01/2017 22:58:48
Quote from: Bhaal87 on Tue 10/01/2017 17:01:36
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 Wed 11/01/2017 14:46:28
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 Sun 15/01/2017 18:44:49
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 Sun 15/01/2017 19:22:24
Quote from: Bhaal87 on Sun 15/01/2017 18:44:49
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 Wed 18/01/2017 15:14:39
Quote from: Crimson Wizard on Sun 15/01/2017 19:22:24
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 Mon 23/01/2017 19:23:58
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 Mon 23/01/2017 21:33:55
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 Mon 23/01/2017 21:41:30
Quote from: Nicolas on Mon 23/01/2017 21:33:55
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 Mon 23/01/2017 22:14:49
Quote from: Radiant on Mon 23/01/2017 21:41:30
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 Mon 23/01/2017 22:19:45
Quote from: Radiant on Mon 23/01/2017 21:41:30
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 Tue 24/01/2017 05:18:33
Quote from: Crimson Wizard on Mon 23/01/2017 22:14:49
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 Tue 24/01/2017 05:26:59
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 Tue 24/01/2017 05:35:40
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 Wed 01/02/2017 13:01:20
To facilitate further android development, could someone with GIT access please take five minutes to alter ags/Engine/platform/android/acpland.cpp to change line 700 from


699 eScriptSystemOSID AGSAndroid::GetSystemOSID() {
700   return eOS_Win;
701 }


to

699 eScriptSystemOSID AGSAndroid::GetSystemOSID() {
700   return eOS_Android;
701 }


and add this value to ags/Editor/AGS.Editor/Resources/agsdefns.sh after line 92

88 enum eOperatingSystem {
89   eOSDOS = 1,
90   eOSWindows,
91   eOSLinux,
92   eOSMacOS
++  ,eOSAndroid
93 };


and to ags/Engine/platform/base/agsplatformdriver.h after line 34

30 enum eScriptSystemOSID {
31     eOS_DOS = 1,
32     eOS_Win = 2,
33     eOS_Linux = 3,
34     eOS_Mac = 4
++     ,eOS_Android = 5
35 };



Thank you very much!
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Thu 02/02/2017 08:21:01
Quote from: Radiant on Wed 01/02/2017 13:01:20
To facilitate further android development, could someone with GIT access please take five minutes to alter ags/Engine/platform/android/acpland.cpp to change line 700 from
I already did this in the branch "release-3.4.0". This is last branch which was tested to work on Android.
https://github.com/adventuregamestudio/ags/commit/a78a6431a715c7a91df61594437e8da454c11dc9

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

Also, honestly, one does not have to have our git write access, anyone can freely clone repository to their account and then make a merge request of their changes via the github page, this is how most of our contributors work when they want to suggest particular code changes.
Title: Re: AGS engine Android port
Post by: Radiant on Thu 02/02/2017 13:35:53
Great, thank you very much!
Title: Re: AGS engine Android port
Post by: da1writer on Sun 23/04/2017 01:35:19
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 Sun 23/04/2017 02:20:44
Quote from: da1writer on Sun 23/04/2017 01:35:19
On PC, the music plays fine but for Android, only the sound effects are heard. Try for yourselves if you like. The Special Editions even have the midi files, which if you try to load up the game with the Midi Enabled, you get "Digmid Patch" errors.

Have you tried the digmid patches? You need to download and unpack them, as explained in this readme:
https://github.com/adventuregamestudio/ags/blob/master/Android/README.md#midi-playback
Title: Re: AGS engine Android port
Post by: da1writer on Sun 23/04/2017 05:16:37
Quote from: Crimson Wizard on Sun 23/04/2017 02:20:44
Quote from: da1writer on Sun 23/04/2017 01:35:19
On PC, the music plays fine but for Android, only the sound effects are heard. Try for yourselves if you like. The Special Editions even have the midi files, which if you try to load up the game with the Midi Enabled, you get "Digmid Patch" errors.

Have you tried the digmid patches? You need to download and unpack them, as explained in this readme:
https://github.com/adventuregamestudio/ags/blob/master/Android/README.md#midi-playback
It wasn't renamed to patches.dat I come to find out. My mistake, thanks for the help.
Title: Re: AGS engine Android port
Post by: da1writer on Sun 23/04/2017 22:44:47
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 Tue 02/05/2017 00:00:27
Did anyone ever find a way to get games with Steam/GOG Galaxy achievements working in the Android player? I've looked around the forums and there's several mentions of a stub plugin for AGS2Steam/AGS2Client, but I can't tell if a solution was ever released.
Title: Re: AGS engine Android port
Post by: sawyer on Tue 23/05/2017 02:25:15
Quote from: BlackMageJ on Tue 02/05/2017 00:00:27
Did anyone ever find a way to get games with Steam/GOG Galaxy achievements working in the Android player? I've looked around the forums and there's several mentions of a stub plugin for AGS2Steam/AGS2Client, but I can't tell if a solution was ever released.


Problem with Al Emmo and the Lost Dutchman's Mine, Tales and Chronicle of Innsmouth on android. Hope new android ags is coming that runs without script link fail.Thanks to all who make this happen...Truly thank you!!!
Title: Re: AGS engine Android port
Post by: monkey0506 on Mon 26/06/2017 13:46:44
Quote from: BlackMageJ on Tue 02/05/2017 00:00:27
Did anyone ever find a way to get games with Steam/GOG Galaxy achievements working in the Android player? I've looked around the forums and there's several mentions of a stub plugin for AGS2Steam/AGS2Client, but I can't tell if a solution was ever released.

Source of the stub may be found here (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 Tue 26/12/2017 23:21:42
How does one build this?

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

But I get the error:

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


full output:
Spoiler
Code (ags) Select
~/Android/Sdk/ndk-bundle/ndk-build
Android NDK: Found platform level in jni/../project.properties. Setting APP_PLATFORM to android-16.   
Android NDK: WARNING: APP_PLATFORM android-16 is higher than android:minSdkVersion 9 in jni/../AndroidManifest.xml. NDK binaries will *not* be comptible with devices older than android-16. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.   
/home/erico/Android/Sdk/ndk-bundle/build/core/setup-app.mk:81: Android NDK: Application targets deprecated ABI(s): armeabi mips   
/home/erico/Android/Sdk/ndk-bundle/build/core/setup-app.mk:82: Android NDK: Support for these ABIs will be removed in a future NDK release.   
Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb   
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES   
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the   
Android NDK:     current module   
Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua   
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES   
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the   
Android NDK:     current module   
Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb   
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES   
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the   
Android NDK:     current module   
Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua   
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES   
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the   
Android NDK:     current module   
Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb   
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES   
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the   
Android NDK:     current module   
Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua   
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES   
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the   
Android NDK:     current module   
Android NDK: WARNING:jni/../jni/Android.mk:agsengine: non-system libraries in linker flags: -lalleg -lfreetype -lvorbisidec -ltheora -logg -laldmb -ldumb   
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES   
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the   
Android NDK:     current module   
Android NDK: WARNING:jni/../jni/Android.mk:agslua: non-system libraries in linker flags: -llua   
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES   
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the   
Android NDK:     current module   
[armeabi] Compile++ arm  : agsengine <= audiochannel.cpp
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
In file included from jni/../jni/../../../Engine/ac/audiochannel.cpp:16:
In file included from jni/../jni/../../../Common/ac/roomstruct.h:25:
jni/../jni/../../../Common/util/wgt2allg.h:29:10: fatal error: 'allegro.h' file not found
#include "allegro.h"
         ^~~~~~~~~~~
2 warnings and 1 error generated.
make: *** [obj/local/armeabi/objs/agsengine/ac/audiochannel.o] Error 1
[close]
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 27/12/2017 00:04:17
Maybe try building from 3.4.0.16 tag? You won't be able to build it from master right now anyway, because of this: https://github.com/adventuregamestudio/ags/issues/420
There is already a built APK for 3.4.0 linked here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=54631.0

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

I have a bad feeling Nick Sonneveld changed something in the Android building process without ammending readme. I may try contact him for some details (unless someone else knows).
Title: Re: AGS engine Android port
Post by: eri0o on Wed 27/12/2017 00:15:22
Uhm... Thanks Crimson Wizard! I will try later to see if this solves my currently bug! I was able to build an APK here (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 Wed 27/12/2017 00:22:43
Quote from: eri0o on Wed 27/12/2017 00:15:22
Uhm... Thanks Crimson Wizard! I will try later to see if this solves my currently bug! I was able to build an APK here (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 Thu 28/12/2017 10:34:28
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 Thu 28/12/2017 16:12:25
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 Thu 28/12/2017 20:37:53
Quote from: Crimson Wizard on Wed 27/12/2017 00:04:17
Maybe try building from 3.4.0.16 tag? You won't be able to build it from master right now anyway, because of this: https://github.com/adventuregamestudio/ags/issues/420
There is already a built APK for 3.4.0 linked here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=54631.0

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

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




Thank you very much for your time :)
Title: Re: AGS engine Android port
Post by: eri0o on Thu 28/12/2017 21:54:49
Just a small update, the android config file is named android.cfg, it's options are actually a little different (it's below, in spoiler tag), and I couldn't trace from source exactly where it should be place, but I think it's the /data/data/packagename folder.

android.cfg
Spoiler
Code (ags) Select

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

Edit: in android studio, placing the android.cfg file in the assets folder places the config file in the correct place. Unfortunately, it's useless for my case. In the ags project, the file Android/library/src/com/bigbluecup/android/AgsEngine.java deals with the touch to mouse click. I will need to modify the method dispatchTouchEvent so that touch is a click and releasing touch is a mouse release, and edit Android/library/src/com/bigbluecup/android/EngineGlue.java to provide a method for both click and release - now there is only a method for click. I will not do this soon, since I have another game to make and I still seem to get a weird missing allegro.h when building... Maybe in 2018. :P
Title: Re: AGS engine Android port
Post by: Snarky on Fri 29/12/2017 00:01:52
It's usual in UI libraries to have events for MouseDown, MouseUp and MouseClick (a MouseDown followed by a MouseUp). The way AGS does this always seemed a little broken to me. Of course, you can check Mouse.IsButtonDown() to detect when a button is released.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Fri 29/12/2017 00:33:46
Quote from: Snarky on Fri 29/12/2017 00:01:52
It's usual in UI libraries to have events for MouseDown, MouseUp and MouseClick (a MouseDown followed by a MouseUp). The way AGS does this always seemed a little broken to me. Of course, you can check Mouse.IsButtonDown() to detect when a button is released.

It's not about how AGS script functions work, it's about how Android port translates touch state into AGS "mouse" state.
I never explored that myself, from what I see there are some specific config options that control that, but they may not be enough.
Title: Re: AGS engine Android port
Post by: Snarky on Sat 30/12/2017 17:20:42
OK. I took eri0o's comment:

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

... to be related to the similar implementation in AGS, but maybe he's just making the same mistake independently.
Title: Re: AGS engine Android port
Post by: eri0o on Sat 30/12/2017 22:05:07
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 Sat 30/12/2017 22:26:14
Quote from: eri0o on Sat 30/12/2017 22:05:07
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 Sun 31/12/2017 00:08:23
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 Sun 31/12/2017 00:40:59
Quote from: eri0o on Sun 31/12/2017 00:08:23CW 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 Thu 04/01/2018 05:07:18
:=
Title: Re: AGS engine Android port
Post by: sawyer on Thu 11/01/2018 03:44:15
:confused:
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Thu 11/01/2018 22:39:59
@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:
QuoteThe 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 Sat 03/02/2018 18:37:41
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 Tue 06/02/2018 12:57:40
Continuing....

Quote from: Crimson Wizard on Thu 11/01/2018 22:39:59
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) Select
$NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch
remove the "--platform=$PLATFORM" part.
Code (bash) Select
$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 Wed 07/02/2018 01:54:19
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)
Spoiler
Code (ags) Select

lua.o:lua.c:function laction: error: undefined reference to 'signal'
lua.o:lua.c:function l_message: error: undefined reference to 'stderr'
lua.o:lua.c:function l_message: error: undefined reference to 'stderr'
lua.o:lua.c:function pushline: error: undefined reference to 'stdout'
lua.o:lua.c:function pushline: error: undefined reference to 'stdin'
lua.o:lua.c:function docall: error: undefined reference to 'signal'
lua.o:lua.c:function docall: error: undefined reference to 'signal'
lua.o:lua.c:function dotty: error: undefined reference to 'stdout'
lua.o:lua.c:function pmain: error: undefined reference to 'stderr'
liblua.a(lauxlib.o):lauxlib.c:function panic: error: undefined reference to 'stderr'
liblua.a(lauxlib.o):lauxlib.c:function luaL_loadfile: error: undefined reference to 'stdin'
liblua.a(lbaselib.o):lbaselib.c:function luaB_print: error: undefined reference to 'stdout'
liblua.a(ldblib.o):ldblib.c:function db_debug: error: undefined reference to 'stdin'
liblua.a(liolib.o):liolib.c:function luaopen_io: error: undefined reference to 'stdin'
liblua.a(liolib.o):liolib.c:function luaopen_io: error: undefined reference to 'stdout'
liblua.a(lmathlib.o):lmathlib.c:function math_randomseed: error: undefined reference to 'srand'
liblua.a(lmathlib.o):lmathlib.c:function math_random: error: undefined reference to 'rand'
collect2: error: ld returned 1 exit status
make[2]: *** [lua] Error 1
make[2]: Leaving directory `/home/USERNAME/git/ags/Android/buildlibs/armeabi/lua-5.1.5/src'
make[1]: *** [generic] Error 2
make[1]: Leaving directory `/home/USERNAME/git/ags/Android/buildlibs/armeabi/lua-5.1.5/src'
make: *** [generic] Error 2
[close]
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 07/02/2018 01:57:03
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 Wed 07/02/2018 01:58:30
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 Wed 07/02/2018 03:06:29
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 Thu 08/02/2018 03:18:31
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
Spoiler
Code (patch) Select

diff -Naur src/llex.c src/llex.c
--- src/llex.c 2007-12-27 14:02:25.000000000 +0100
+++ src/llex.c 2012-07-30 12:19:06.628478800 +0200
@@ -176,9 +176,8 @@

static void trydecpoint (LexState *ls, SemInfo *seminfo) {
   /* format error: try to update decimal point separator */
-  struct lconv *cv = localeconv();
   char old = ls->decpoint;
-  ls->decpoint = (cv ? cv->decimal_point[0] : '.');
+  ls->decpoint = '.';
   buffreplace(ls, old, ls->decpoint);  /* try updated decimal separator */
   if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
     /* format error with correct decimal point: no more options */
diff -Naur src/Makefile src/Makefile
--- src/Makefile 2008-01-19 20:37:58.000000000 +0100
+++ src/Makefile 2012-07-30 12:10:36.058644700 +0200
@@ -7,17 +7,12 @@
# Your platform. See PLATS for possible values.
PLAT= none

-CC= gcc
-CFLAGS= -O2 -Wall $(MYCFLAGS)
+CFLAGS= -O2 -Wall $(MYCFLAGS) -D__ANDROID_API__=$API
AR= ar rcu
RANLIB= ranlib
RM= rm -f
LIBS= -lm $(MYLIBS)

-MYCFLAGS=
-MYLDFLAGS=
-MYLIBS=
-
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========

PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
@@ -93,7 +88,7 @@
$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"

generic:
- $(MAKE) all MYCFLAGS=
+ $(MAKE) all

linux:
$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
[close]


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...

Spoiler

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

[close]

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)
Spoiler
Code (bash) Select

#!/bin/bash

set -e

source ./ndkenv

SRC_DIR=libogg-1.3.2
rm -rf $SRC_DIR
mkdir $SRC_DIR
tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR

pushd $SRC_DIR

export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
export LDFLAGS="$NDK_LDFLAGS"

./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared

make
make install

popd

rm -rf $SRC_DIR
[close]


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

Spoiler
Code (bash) Select

-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "allegrogl".


CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "loadpng".


CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "logg".


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
RT_LIBRARY
    linked by target "allegro" in directory /home/erico/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2

-- Configuring incomplete, errors occurred!
See also "/home/erico/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeOutput.log".
See also "/home/erico/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeError.log".

[close]

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.

Spoiler
Code (bash) Select

~/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
-- Performing Test ALLEGRO_USE_CONSTRUCTOR
-- Performing Test ALLEGRO_USE_CONSTRUCTOR - Failed
-- Could NOT find OSS (missing: OSS_COMPILES)
-- Checking for module 'alsa'
--   No package 'alsa' found
-- Checking for module 'jack'
--   No package 'jack' found
-- Could NOT find PNG (missing: PNG_PNG_INCLUDE_DIR)
CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "allegrogl".


CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "loadpng".


CMake Error at CMakeLists.txt:962 (get_target_property):
  get_target_property() called with non-existent target "logg".


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
RT_LIBRARY
    linked by target "allegro" in directory /home/USERNAME/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2

-- Configuring incomplete, errors occurred!
See also "/home/USERNAME/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeOutput.log".
See also "/home/USERNAME/git/ags/Android/buildlibs/armeabi-v7a/allegro-4.4.2/CMakeFiles/CMakeError.log".


[close]

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.

Spoiler
Code (dif) Select

diff --git a/Android/buildlibs/armeabi-v7a/allegro.sh b/Android/buildlibs/armeabi-v7a/allegro.sh
index 2b97658..8b00f1d 100755
--- a/Android/buildlibs/armeabi-v7a/allegro.sh
+++ b/Android/buildlibs/armeabi-v7a/allegro.sh
@@ -14,6 +14,10 @@ pushd $SRC_DIR
# Platform independent patch
patch -p0 < ../../../patches/liballegro-4.4.2.patch

+echo ${ANDROID_NDK}
+
+echo ""
+
cmake . -G "Unix Makefiles" \
-DWANT_TESTS=off \
-DWANT_EXAMPLES=off \
@@ -24,9 +28,10 @@ cmake . -G "Unix Makefiles" \
-DCMAKE_C_FLAGS="$NDK_CFLAGS -fsigned-char" \
-DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DCMAKE_LD_FLAGS="$NDK_LDFLAGS" \'
- -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-android-gcc.cmake \
+  -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake \
-DCMAKE_INSTALL_PREFIX=$NDK_ADDITIONAL_LIBRARY_PATH

+ #-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-android-gcc.cmake \
make
make install

diff --git a/Android/buildlibs/armeabi-v7a/ndkenv b/Android/buildlibs/armeabi-v7a/ndkenv
index cf9fdfb..f3bf4e3 100644
--- a/Android/buildlibs/armeabi-v7a/ndkenv
+++ b/Android/buildlibs/armeabi-v7a/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {

unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS

-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
+export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/arm
export NDK_PLATFORM_NAME=armeabi-v7a
export NDK_HOST_NAME=arm-linux-androideabi
export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
diff --git a/Android/buildlibs/armeabi-v7a/ogg.sh b/Android/buildlibs/armeabi-v7a/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/armeabi-v7a/ogg.sh
+++ b/Android/buildlibs/armeabi-v7a/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR

pushd $SRC_DIR

-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
export LDFLAGS="$NDK_LDFLAGS"

./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/armeabi/ndkenv b/Android/buildlibs/armeabi/ndkenv
index 0df6781..1a01191 100644
--- a/Android/buildlibs/armeabi/ndkenv
+++ b/Android/buildlibs/armeabi/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {

unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS

-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
+export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/arm
export NDK_PLATFORM_NAME=armeabi
export NDK_HOST_NAME=arm-linux-androideabi
export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
diff --git a/Android/buildlibs/armeabi/ogg.sh b/Android/buildlibs/armeabi/ogg.sh
index 21062a3..56ed267 100755
--- a/Android/buildlibs/armeabi/ogg.sh
+++ b/Android/buildlibs/armeabi/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR

pushd $SRC_DIR

-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
export LDFLAGS="$NDK_LDFLAGS"

./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/buildall.sh b/Android/buildlibs/buildall.sh
index b813057..73dec33 100755
--- a/Android/buildlibs/buildall.sh
+++ b/Android/buildlibs/buildall.sh
@@ -6,7 +6,7 @@ pushd ../../libsrc
./download.sh
popd

-for arch in armeabi armeabi-v7a x86 mips
+for arch in  armeabi-v7a x86 mips
do
rm -rf ../nativelibs/$arch
mkdir -p ../nativelibs/$arch
diff --git a/Android/buildlibs/makestandalones.sh b/Android/buildlibs/makestandalones.sh
index 7f327cd..65fb734 100755
--- a/Android/buildlibs/makestandalones.sh
+++ b/Android/buildlibs/makestandalones.sh
@@ -5,18 +5,18 @@
set -e

# Last committed pre-compiled libs were with R8
-NDK_HOME=/opt/android-ndk-r10e
+NDK_HOME=/home/USERNAME/Android/Sdk/ndk-bundle

# android-9 is minimum to support mips and x86
-PLATFORM=android-9
+PLATFORM=android-14

# standalone toolchains cannot share same directory
-NDK_STANDALONE=/opt/android-ndk-r10e-standalone/$PLATFORM
+NDK_STANDALONE=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/$PLATFORM

for arch in arm x86 mips
do
     INSTALL_DIR=$NDK_STANDALONE/$arch
     mkdir -p $INSTALL_DIR
-    $NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch
+    $NDK_HOME/build/tools/make-standalone-toolchain.sh --install-dir=$INSTALL_DIR --arch=$arch --force
done

diff --git a/Android/buildlibs/mips/ndkenv b/Android/buildlibs/mips/ndkenv
index f1f7c78..9c06777 100644
--- a/Android/buildlibs/mips/ndkenv
+++ b/Android/buildlibs/mips/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {

unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS

-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/mips
+export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/mips
export NDK_PLATFORM_NAME=mips
export NDK_HOST_NAME=mipsel-linux-android
export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
diff --git a/Android/buildlibs/mips/ogg.sh b/Android/buildlibs/mips/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/mips/ogg.sh
+++ b/Android/buildlibs/mips/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR

pushd $SRC_DIR

-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
export LDFLAGS="$NDK_LDFLAGS"

./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/x86/ndkenv b/Android/buildlibs/x86/ndkenv
index d0710f4..2fb380f 100644
--- a/Android/buildlibs/x86/ndkenv
+++ b/Android/buildlibs/x86/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {

unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS

-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/x86
+export NDK_PLATFORM_ROOT=/home/USERNAME/Android/Sdk/ndk-bundle/platforms/android-14/x86
export NDK_PLATFORM_NAME=x86
export NDK_HOST_NAME=i686-linux-android
export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
diff --git a/Android/buildlibs/x86/ogg.sh b/Android/buildlibs/x86/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/x86/ogg.sh
+++ b/Android/buildlibs/x86/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR

pushd $SRC_DIR

-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
export LDFLAGS="$NDK_LDFLAGS"

./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/patches/liblua.patch b/Android/patches/liblua.patch
index 4d040bc..759ce81 100644
--- a/Android/patches/liblua.patch
+++ b/Android/patches/liblua.patch
@@ -20,7 +20,8 @@ diff -Naur src/Makefile src/Makefile
  PLAT= none
 
-CC= gcc
- CFLAGS= -O2 -Wall $(MYCFLAGS)
+-CFLAGS= -O2 -Wall $(MYCFLAGS)
++CFLAGS= -O2 -Wall $(MYCFLAGS) -D__ANDROID_API__=$API
  AR= ar rcu
  RANLIB= ranlib
  RM= rm -f
diff --git a/debian/ags+libraries/hooks/B00_copy_libs.sh b/debian/ags+libraries/hooks/B00_copy_libs.sh
index 7f34e12..c3c3825 100755
--- a/debian/ags+libraries/hooks/B00_copy_libs.sh
+++ b/debian/ags+libraries/hooks/B00_copy_libs.sh
@@ -1,7 +1,7 @@
#!/bin/sh
set -e

-BINDMOUNT=
+BINDMOUNT=/home/USERNAME/git/ags/ags+libraries
BIT=32

   set +x
diff --git a/debian/changelog b/debian/changelog
index 5fb163c..1bf9500 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-ags (3~git-1) UNRELEASED; urgency=low
+ags (3.4.1.7) UNRELEASED; urgency=low

   * some release

[close]

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 Wed 14/02/2018 02:26:57
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)
Spoiler
Code (ags) Select

diff --git a/Android/buildlibs/armeabi-v7a/ndkenv b/Android/buildlibs/armeabi-v7a/ndkenv
index cf9fdfb..6e3d130 100644
--- a/Android/buildlibs/armeabi-v7a/ndkenv
+++ b/Android/buildlibs/armeabi-v7a/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {

unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS

-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
+export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/arm
export NDK_PLATFORM_NAME=armeabi-v7a
export NDK_HOST_NAME=arm-linux-androideabi
export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
@@ -15,3 +15,5 @@ export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal

export NDK_CFLAGS=" -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 "
export NDK_LDFLAGS=" -march=armv7-a -Wl,--fix-cortex-a8 "
+export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-gcc
+export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-g++
diff --git a/Android/buildlibs/armeabi-v7a/ogg.sh b/Android/buildlibs/armeabi-v7a/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/armeabi-v7a/ogg.sh
+++ b/Android/buildlibs/armeabi-v7a/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR

pushd $SRC_DIR

-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
export LDFLAGS="$NDK_LDFLAGS"

./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/armeabi/ndkenv b/Android/buildlibs/armeabi/ndkenv
index 0df6781..db11d13 100644
--- a/Android/buildlibs/armeabi/ndkenv
+++ b/Android/buildlibs/armeabi/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {

unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS

-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/arm
+export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/arm
export NDK_PLATFORM_NAME=armeabi
export NDK_HOST_NAME=arm-linux-androideabi
export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
@@ -14,3 +14,5 @@ export PKG_CONFIG_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/lib/pkgconfig
export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal

export NDK_CFLAGS=" -mthumb "
+export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-gcc
+export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/arm/bin/arm-linux-androideabi-g++ 
diff --git a/Android/buildlibs/armeabi/ogg.sh b/Android/buildlibs/armeabi/ogg.sh
index 21062a3..56ed267 100755
--- a/Android/buildlibs/armeabi/ogg.sh
+++ b/Android/buildlibs/armeabi/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR

pushd $SRC_DIR

-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
export LDFLAGS="$NDK_LDFLAGS"

./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/makestandalones.sh b/Android/buildlibs/makestandalones.sh
index 7f327cd..d4ecd64 100755
--- a/Android/buildlibs/makestandalones.sh
+++ b/Android/buildlibs/makestandalones.sh
@@ -5,18 +5,18 @@
set -e

# Last committed pre-compiled libs were with R8
-NDK_HOME=/opt/android-ndk-r10e
+NDK_HOME=~/Android/Sdk/ndk-bundle

# android-9 is minimum to support mips and x86
-PLATFORM=android-9
+PLATFORM=android-14

# standalone toolchains cannot share same directory
-NDK_STANDALONE=/opt/android-ndk-r10e-standalone/$PLATFORM
+NDK_STANDALONE=~/Android/Sdk/ndk-bundle/platforms/$PLATFORM

for arch in arm x86 mips
do
     INSTALL_DIR=$NDK_STANDALONE/$arch
     mkdir -p $INSTALL_DIR
-    $NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch
+    $NDK_HOME/build/tools/make-standalone-toolchain.sh  --force --platform=$PLATFORM --install-dir=$INSTALL_DIR --arch=$arch
done

diff --git a/Android/buildlibs/mips/ndkenv b/Android/buildlibs/mips/ndkenv
index f1f7c78..8156536 100644
--- a/Android/buildlibs/mips/ndkenv
+++ b/Android/buildlibs/mips/ndkenv
@@ -5,7 +5,7 @@ get_abs_path() {

unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS

-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/mips
+export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/mips
export NDK_PLATFORM_NAME=mips
export NDK_HOST_NAME=mipsel-linux-android
export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
@@ -15,3 +15,5 @@ export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal

# NDK before R8b turns on "-mno-shared" in MIPS toolchain which disables -fpic
export NDK_CFLAGS=" -fpic "
+export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/mips/bin/mipsel-linux-android-gcc
+export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/mips/bin/mipsel-linux-android-g++ 
diff --git a/Android/buildlibs/mips/ogg.sh b/Android/buildlibs/mips/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/mips/ogg.sh
+++ b/Android/buildlibs/mips/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR

pushd $SRC_DIR

-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
export LDFLAGS="$NDK_LDFLAGS"

./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/buildlibs/x86/ndkenv b/Android/buildlibs/x86/ndkenv
index d0710f4..ea2176f 100644
--- a/Android/buildlibs/x86/ndkenv
+++ b/Android/buildlibs/x86/ndkenv
@@ -5,10 +5,14 @@ get_abs_path() {

unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS

-export NDK_PLATFORM_ROOT=/opt/android-ndk-r10e-standalone/android-9/x86
+export NDK_PLATFORM_ROOT=~/Android/Sdk/ndk-bundle/platforms/android-14/x86
export NDK_PLATFORM_NAME=x86
export NDK_HOST_NAME=i686-linux-android
export NDK_ADDITIONAL_LIBRARY_PATH=$(get_abs_path "../../nativelibs/$NDK_PLATFORM_NAME")
export PATH=$NDK_PLATFORM_ROOT/bin:$PATH
export PKG_CONFIG_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/lib/pkgconfig
export ACLOCAL_PATH=$NDK_ADDITIONAL_LIBRARY_PATH/share/aclocal
+
+
+export CC=~/Android/Sdk/ndk-bundle/platforms/android-14/x86/bin/i686-linux-android-gcc
+export CXX=~/Android/Sdk/ndk-bundle/platforms/android-14/x86/bin/i686-linux-android-g++ 
diff --git a/Android/buildlibs/x86/ogg.sh b/Android/buildlibs/x86/ogg.sh
index 53dd200..8f058f5 100755
--- a/Android/buildlibs/x86/ogg.sh
+++ b/Android/buildlibs/x86/ogg.sh
@@ -11,7 +11,7 @@ tar xf ../../../libsrc/libogg-1.3.2.tar.gz --strip-components=1 -C $SRC_DIR

pushd $SRC_DIR

-export CFLAGS="$NDK_CFLAGS -fsigned-char"
+export CFLAGS="$NDK_CFLAGS -fsigned-char -D__ANDROID_API__=\$API"
export LDFLAGS="$NDK_LDFLAGS"

./configure --host=$NDK_HOST_NAME --prefix=$NDK_ADDITIONAL_LIBRARY_PATH --disable-shared
diff --git a/Android/patches/liblua.patch b/Android/patches/liblua.patch
index 4d040bc..e717f0d 100644
--- a/Android/patches/liblua.patch
+++ b/Android/patches/liblua.patch
@@ -20,7 +20,8 @@ diff -Naur src/Makefile src/Makefile
  PLAT= none
 
-CC= gcc
- CFLAGS= -O2 -Wall $(MYCFLAGS)
+-CFLAGS= -O2 -Wall $(MYCFLAGS)
++CFLAGS= -O2 -Wall $(MYCFLAGS) -D__ANDROID_API__=$AP
  AR= ar rcu
  RANLIB= ranlib
  RM= rm -f
[close]
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) Select

export PATH=$PATH:~/Android/Sdk/ndk-bundle/
cd git/ags/Android/buildlibs/
./makestandalones.sh
./buildall.sh
cd ../library/
ndk-build


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 Wed 14/02/2018 02:46:27
eri0o, could you make a pull request of the changes you made to building Android libs? just a patch file will also work.

QuoteNow 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 Wed 14/02/2018 03:06:03
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 Wed 14/02/2018 06:22:23
Quote from: eri0o on Wed 14/02/2018 03:06:03
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 Wed 14/02/2018 11:25:54
Hey CW! Did a new pull request here (https://github.com/adventuregamestudio/ags/pull/430)!

I tested and it failed at the same lines.

Spoiler
Code (bash) Select

jni/../jni/../../../Engine/game/savegame.cpp:537:30: note: place parentheses around the '&&'
      expression to silence this warning
            crossFading <= 0 && !channels[SCHAN_MUSIC])
                             ^
            (                                         )
6 warnings generated.
[armeabi] Compile++ arm  : agsengine <= ali3dogl.cpp
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
In file included from jni/../jni/../../../Engine/gfx/ali3dogl.cpp:19:
In file included from jni/../jni/../../../Engine/gfx/ali3dogl.h:24:
In file included from jni/../jni/../../../Common/gfx/bitmap.h:49:
jni/../jni/../../../Common/gfx/allegrobitmap.h:84:17: warning: 'this' pointer cannot be null in
      well-defined C++ code; pointer may be assumed to always convert to true
      [-Wundefined-bool-conversion]
        return !this || !_alBitmap;
               ~^~~~
In file included from jni/../jni/../../../Engine/gfx/ali3dogl.cpp:23:
In file included from jni/../jni/../../../Engine/platform/base/agsplatformdriver.h:24:
In file included from jni/../jni/../../../Engine/ac/datetime.h:21:
In file included from jni/../jni/../../../Engine/ac/dynobj/scriptdatetime.h:21:
In file included from jni/../jni/../../../Engine/ac/dynobj/cc_agsdynamicobject.h:18:
In file included from jni/../jni/../../../Engine/ac/dynobj/cc_dynamicobject.h:23:
In file included from jni/../jni/../../../Engine/script/runtimescriptvalue.h:21:
In file included from jni/../jni/../../../Engine/script/script_api.h:24:
jni/../jni/../../../Engine/ac/runtime_defines.h:135:9: warning: 'HWND' macro redefined
      [-Wmacro-redefined]
#define HWND long
        ^
jni/../jni/../../../Engine/gfx/ogl_headers.h:45:9: note: previous definition is here
#define HWND void*
        ^
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:466:7: fatal error: use of undeclared identifier
      'glSwapIntervalEXT'
  if (glSwapIntervalEXT)
      ^
4 warnings and 1 error generated.
make: *** [obj/local/armeabi/objs/agsengine/gfx/ali3dogl.o] Error 1

[close]

---- 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.

Spoiler
Code (bash) Select

...
[armeabi] Compile arm    : agsengine <= aautil.c
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
1 warning generated.
[armeabi] Compile arm    : agsengine <= midi.c
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
1 warning generated.
[armeabi] SharedLibrary  : libagsengine.so

jni/../jni/../../../Engine/gfx/ali3dogl.cpp:717: error: undefined reference to 'glCreateShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:718: error: undefined reference to 'glShaderSource'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:719: error: undefined reference to 'glCompileShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:721: error: undefined reference to 'glGetShaderiv'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:729: error: undefined reference to 'glCreateProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:730: error: undefined reference to 'glAttachShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:731: error: undefined reference to 'glLinkProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:734: error: undefined reference to 'glGetProgramiv'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:742: error: undefined reference to 'glDetachShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:743: error: undefined reference to 'glDeleteShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:746: error: undefined reference to 'glGetUniformLocation'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:747: error: undefined reference to 'glGetUniformLocation'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:748: error: undefined reference to 'glGetUniformLocation'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:738: error: undefined reference to 'glDeleteProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:738: error: undefined reference to 'glDeleteShader'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:762: error: undefined reference to 'glGetShaderiv'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:764: error: undefined reference to 'glGetProgramiv'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:767: error: undefined reference to 'glGetShaderInfoLog'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:769: error: undefined reference to 'glGetProgramInfoLog'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:754: error: undefined reference to 'glDeleteProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:754: error: undefined reference to 'glDeleteProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:754: error: undefined reference to 'glDeleteProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1092: error: undefined reference to 'glUseProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1127: error: undefined reference to 'glUseProgram'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1119: error: undefined reference to 'glUniform1i'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1120: error: undefined reference to 'glUniform3f'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1121: error: undefined reference to 'glUniform3f'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1150: error: undefined reference to 'glUniform1i'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1151: error: undefined reference to 'glUniform1f'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1152: error: undefined reference to 'glUniform1f'
jni/../jni/../../../Engine/gfx/ali3dogl.cpp:1264: error: undefined reference to 'glUseProgram'
/home/USERNAME/git/ags/Android/buildlibs/armeabi/allegro-4.4.2/src/allegro.c:619: error: undefined reference to 'stderr'
/home/USERNAME/git/ags/Android/buildlibs/armeabi/allegro-4.4.2/src/allegro.c:503: error: undefined reference to 'stdout'
/home/USERNAME/git/ags/Android/buildlibs/armeabi/allegro-4.4.2/src/unicode.c:2294: error: undefined reference to 'atof'
jni/../jni/../../nativelibs/armeabi/lib/libdumb.a(rendsig.o):rendsig.c:function duh_sigrenderer_set_callback: error: undefined reference to 'stderr'
jni/../jni/../../nativelibs/armeabi/lib/libdumb.a(rendsig.o):rendsig.c:function duh_sigrenderer_set_analyser_callback: error: undefined reference to 'stderr'
jni/../jni/../../nativelibs/armeabi/lib/libdumb.a(itread.o):itread.c:function it_load_sigdata: error: undefined reference to 'stderr'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi/libagsengine.so] Error 1

[close]

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 Thu 15/02/2018 00:27:07
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 (cpp) Select

#define glGenFramebuffersEXT glGenFramebuffersOES
#define glDeleteFramebuffersEXT glDeleteFramebuffersOES

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 Thu 15/02/2018 01:07:48
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 Fri 16/02/2018 20:42:19
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 Fri 16/02/2018 21:58:13
QuoteShould 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.

QuoteNote, 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 Fri 16/02/2018 22:01:15
Quote from: eri0o on Fri 16/02/2018 21:58:13
QuoteShould 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.

QuoteNote, 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 Sun 18/02/2018 22:03:26
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 Mon 19/02/2018 12:05:39
Quote from: Crimson Wizard on Sun 18/02/2018 22:03:26
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 Mon 19/02/2018 15:23:13
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 Mon 19/02/2018 15:42:33
Quote from: Mehrdad on Mon 19/02/2018 15:23:13
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 Mon 19/02/2018 15:51:01
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 Mon 19/02/2018 18:29:00
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 Mon 19/02/2018 19:11:17
Quote from: Mehrdad on Mon 19/02/2018 15:51:01
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 Mon 19/02/2018 19:26:07
Quote from: Crimson Wizard on Mon 19/02/2018 18:29:00

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 Mon 19/02/2018 21:16:45
Quote from: Chicky on Mon 19/02/2018 19:26:07
Quote from: Crimson Wizard on Mon 19/02/2018 18:29:00

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 Tue 20/02/2018 01:51:04
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.

Spoiler
Code (adb) Select

02-19 22:13:33.581 24301-24301/? I/art: Late-enabling -Xcheck:jni
02-19 22:13:33.900 24301-24301/com.mythsuntold.dungeonhands I/InstantRun: starting instant run server: is main process
02-19 22:13:33.906 24301-24301/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
02-19 22:13:33.908 24301-24301/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
02-19 22:13:33.940 24301-24301/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
02-19 22:13:33.941 24301-24301/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
02-19 22:13:33.958 24301-24301/com.mythsuntold.dungeonhands D/STORAGE_MNT: SUCCESSFULLY QUEUED
02-19 22:13:33.992 24301-24322/com.mythsuntold.dungeonhands I/Adreno: QUALCOMM build                   : dfab96b, I762e720a6a
                                                                      Build Date                       : 01/31/17
                                                                      OpenGL ES Shader Compiler Version: XE031.09.00.04
                                                                      Local Branch                     :
                                                                      Remote Branch                    :
                                                                      Remote Branch                    :
                                                                      Reconstruct Branch               :
02-19 22:13:33.998 24301-24322/com.mythsuntold.dungeonhands I/OpenGLRenderer: Initialized EGL, version 1.4
02-19 22:13:33.999 24301-24322/com.mythsuntold.dungeonhands D/OpenGLRenderer: Swap behavior 1
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
02-19 22:13:34.052 24301-24301/com.mythsuntold.dungeonhands D/STATE =: 1
02-19 22:13:34.055 24301-24301/com.mythsuntold.dungeonhands D/STORAGE: -->MOUNTED
02-19 22:13:34.097 24301-24301/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
02-19 22:13:34.097 24301-24301/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
02-19 22:13:34.178 24301-24338/com.mythsuntold.dungeonhands D/AudioTrack: Client defaulted notificationFrames to 1365 for frameCount 4096
02-19 22:13:34.195 24301-24338/com.mythsuntold.dungeonhands D/AGSNative: Unable to initialize your audio hardware.
                                                                         [Problem: DIGMID patch set not found]
02-19 22:13:34.232 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[])
02-19 22:13:34.232 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease()
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[])
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)
02-19 22:13:34.233 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop()
02-19 22:13:34.236 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@745309a
02-19 22:13:34.236 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@e60cdcb
02-19 22:13:38.102 24301-24338/com.mythsuntold.dungeonhands D/AGSNative: Loading game failed with error:
                                                                         Main game file not found.
                                                                         
                                                                         The game files may be incomplete, corrupt or from unsupported version of AGS.
02-19 22:13:38.125 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@99b3831
02-19 22:13:38.125 24301-24301/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@91c0b16

[close]

As a comparison, below is the output of the normal game package (that runs, uses 3.4.0)

Spoiler
Code (adb) Select

02-19 22:30:07.675 26836-26836/? I/art: Late-enabling -Xcheck:jni
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...
02-19 22:30:07.832 26836-26836/com.mythsuntold.dungeonhands I/System.out: Sending WAIT chunk
02-19 22:30:08.784 26836-26844/com.mythsuntold.dungeonhands I/art: Debugger is active
02-19 22:30:08.834 26836-26836/com.mythsuntold.dungeonhands I/System.out: Debugger has connected
02-19 22:30:08.834 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
02-19 22:30:09.034 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
02-19 22:30:09.235 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
02-19 22:30:09.435 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
02-19 22:30:09.636 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
02-19 22:30:09.836 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
02-19 22:30:10.037 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
02-19 22:30:10.237 26836-26836/com.mythsuntold.dungeonhands I/System.out: waiting for debugger to settle...
02-19 22:30:10.438 26836-26836/com.mythsuntold.dungeonhands I/System.out: debugger has settled (1407)
02-19 22:30:10.912 26836-26836/com.mythsuntold.dungeonhands I/InstantRun: starting instant run server: is main process
02-19 22:30:10.922 26836-26836/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
02-19 22:30:10.931 26836-26836/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
02-19 22:30:11.030 26836-26836/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
02-19 22:30:11.031 26836-26836/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
02-19 22:30:11.089 26836-26836/com.mythsuntold.dungeonhands D/STORAGE_MNT: SUCCESSFULLY QUEUED
02-19 22:30:11.227 26836-26996/com.mythsuntold.dungeonhands I/Adreno: QUALCOMM build                   : dfab96b, I762e720a6a
                                                                      Build Date                       : 01/31/17
                                                                      OpenGL ES Shader Compiler Version: XE031.09.00.04
                                                                      Local Branch                     :
                                                                      Remote Branch                    :
                                                                      Remote Branch                    :
                                                                      Reconstruct Branch               :
02-19 22:30:11.309 26836-26996/com.mythsuntold.dungeonhands I/OpenGLRenderer: Initialized EGL, version 1.4
02-19 22:30:11.309 26836-26996/com.mythsuntold.dungeonhands D/OpenGLRenderer: Swap behavior 1
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
02-19 22:30:11.441 26836-26836/com.mythsuntold.dungeonhands D/STATE =: 1
02-19 22:30:11.445 26836-26836/com.mythsuntold.dungeonhands D/STORAGE: -->MOUNTED
02-19 22:30:11.541 26836-26836/com.mythsuntold.dungeonhands V/Monotype: SetAppTypeFace- try to flip, app = com.mythsuntold.dungeonhands
02-19 22:30:11.541 26836-26836/com.mythsuntold.dungeonhands V/Monotype:     Typeface getFontPathFlipFont - systemFont = default#default
02-19 22:30:11.799 26836-27023/com.mythsuntold.dungeonhands D/AudioTrack: Client defaulted notificationFrames to 1365 for frameCount 4096
02-19 22:30:11.845 26836-27023/com.mythsuntold.dungeonhands D/AGSNative: Unable to initialize your audio hardware.
                                                                         [Problem: DIGMID patch set not found]
02-19 22:30:11.942 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[])
02-19 22:30:11.943 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease()
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[])
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)
02-19 22:30:11.945 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop()
02-19 22:30:11.959 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@99fed60
02-19 22:30:11.960 26836-26836/com.mythsuntold.dungeonhands V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@bab8219
02-19 22:30:13.442 26836-26842/com.mythsuntold.dungeonhands I/art: Do partial code cache collection, code=27KB, data=28KB
02-19 22:30:13.443 26836-26842/com.mythsuntold.dungeonhands I/art: After code cache collection, code=27KB, data=27KB
02-19 22:30:13.443 26836-26842/com.mythsuntold.dungeonhands I/art: Increasing code cache capacity to 128KB
02-19 22:30:18.464 26836-26842/com.mythsuntold.dungeonhands I/art: Do partial code cache collection, code=50KB, data=62KB
02-19 22:30:18.464 26836-26842/com.mythsuntold.dungeonhands I/art: After code cache collection, code=50KB, data=62KB
02-19 22:30:18.464 26836-26842/com.mythsuntold.dungeonhands I/art: Increasing code cache capacity to 256KB

[close]

I don't know yet what's happening. :/
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 20/02/2018 01:56:44
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 Tue 20/02/2018 03:37:41
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 Fri 23/02/2018 16:07:34
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 Fri 23/02/2018 16:17:02
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 Wed 28/02/2018 02:08:24
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 Wed 28/02/2018 02:12:23
Quote from: eri0o on Wed 28/02/2018 02:08:24
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 Wed 28/02/2018 02:24:09
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 Wed 28/02/2018 02:27:16
Quote from: eri0o on Wed 28/02/2018 02:24:09
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 Wed 28/02/2018 02:49:50
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) Select
cd Compiled
mkdir obb
cp Data/DungeonHands.ags obb/
~/Android/Sdk/tools/bin/jobb -d ./obb/ -o main.3.com.mythsuntold.dungeonhands.obb -pn com.mythsuntold.dungeonhands -pv 3


And later I dumped the content of the obb.

Code (bash) Select
~/Android/Sdk/tools/bin/jobb -dump main.3.com.mythsuntold.dungeonhands.obb -d out/

Aaaand.. Get this... The md5sum of the file isn't the same.

Text files remain unaltered by the jobb tool. But binary, be .ags or .exe, are modified by it. I don't know yet what's modified though. I will later test with 3.4.0 if acwin can read unobbed ags files.

Edit: No it can't too... It gives a different error though. By running the dumped exe from the obb with acwin.exe it gives the error:
This game requires a different version of AGS (16.0.0.0). It cannot be run.

If it worked I would guess something... Since it doesn't, my next idea is to try the jobb tool from Monkey.... But this is weird because it does work with the prebuilt Ags Androd 3.4.0 ... I guess my next shot is trying to build 3.4.0 to see if my binary is the same as the prebuilt ones - it probably won't be...

Edit2: looking online I can find posts until 2017 of people complaining Google Jobb tool generates corrupted obb files for random combination of files...

Edit3: Ok, I will try to first load a game without using obb, and later test some alternatives jobb tools. I will only do this tomorrow... For some reason I am currently unable to generate non corrupted obb files with google jobb tool :/
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 28/02/2018 14:13:22
Quote from: eri0o on Wed 28/02/2018 02:49:50
Edit3: Ok, I will try to first load a game without using obb, and later test some alternatives jobb tools. I will only do this tomorrow... For some reason I am currently unable to generate non corrupted obb files with google jobb tool :/

This is a very good idea, and should have been the first to try. There are too many variables here. If it is possible we need to cut some out, like don't use obb tool for starters and test engine APK against a "raw" Game.ags.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on Thu 01/03/2018 01:57:34
Would Monkey's updated Jobbifier work for your needs? https://github.com/monkey0506/jobbifier
Title: Re: AGS engine Android port
Post by: Nemethon on Fri 09/03/2018 00:36:48

Hi,
I have a project to make a game on android galaxy S8 phone. I do not understand how to run the game on Android. I thank you for the answers.

Need to download something? What is the process?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Fri 09/03/2018 00:58:54
Quote from: Nemethon on Fri 09/03/2018 00:36:48
I have a project to make a game on android galaxy S8 phone. I do not understand how to run the game on Android. I thank you for the answers.

Need to download something? What is the process?

What version of AGS do you use? Currently latest version that supports running games on Android is AGS 3.4.0. We are in process of making AGS 3.4.1 support running games on Android too, but it's not done yet.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 13/03/2018 15:37:44
So, is there any progress here?

I still could not understand whether it is possible work with Android studio's emulator without create a studio project.
So, I tried to install my own APK on BlueStacks emulator. The error I got is : INSTALL_PARSE_FAILED_NO_CERTIFICATES.
So, apparently, the problem is that APK is not signed properly?
Right now I am searching for possible reasons and solutions.

@eri0o, you said that you managed to somehow build and install APK on your own (with Android Studio?). Is there a raw APK (without game data) in the output at some point? If so, could you maybe upload it here for other people to try?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 13/03/2018 17:48:11
Okay, I made a little change to the APK and managed to install it on the BlueStacks emulator without errors. Did not test it with game yet, when running it sais that I do not have any games on sdcard, although I have few, but that also may be that I did something wrong or forgot to config something, so I will continue experimenting.


The download link: https://www.dropbox.com/s/9in2vn3cci11294/AGS-3.4.1-unsigned.apk?dl=0

Could someone try if that at least installs on their device?

What did I change:
I noticed that in AndroidManifest it still sais "minSdkVersion=9", although we changed platform to "14" when building native code. So I changed minSdkVersion to 14 in the manifests too.
Additionally, I increased "versionCode" for the "library" project (which is an internal index of a program version") by 1. Not sure if that means anything in current situation.


UPDATE:
* fixed situation with games not found, now I can actually launch a game. I can know that engine begins working, because it reports classic error about DIGMID patches not found and audio not initialized.
* however, then it sais that it cannot find main game file, same error as eri0o reported before. :/

UPDATE2:
Well, this is becoming ridiculous.
1. AGS 3.4.0 APK can run games on android emulator.
2. AGS 3.4.1 APK cannot run the same games in the exactly same enviroment, saying that it cannot find the main game file.
The error it gives means that it cannot find an internal resource inside the game package for some reason. What could be the causes? Either there is a logical error or package gets corrupted somehow... But the latter is probably not the case, since 3.4.0 APK runs same games without such issue.
3. At the same time, Windows version of 3.4.1 can run these games, using exactly same data I provided for Android (game file renamed into ac2game.dat etc).
So... the problem now is in finding what causes different behavior between Windows version and Android version. That could be also difference in command line arguments. If I managed to understand java part of the android port correctly, it passes the path to ac2game.dat to the engine, not the folder.

Additional notes:
1. Android launcher has that annoying issue that it only detects ac2game.dat files AND they must be Windows EXE files renamed into ac2game.dat. You cannot use raw game data files and rename them to ac2game.dat. This is because launcher literally checks for Windows executable header in the file, or something like that. IIRC I've already opened a ticket about this on github years ago.
2. Problem with logging. In the current version the log file only begins writing when the game format is confirmed. Until then engine only prints to stdout. I know Android has "logcat" logs, but IDK if it's possible to reroute stdout into logcat. That could help.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 13/03/2018 19:51:52
Ok, I found the error in the engine. There is a logical error which makes engine skip the important step of initializing game package before using it.
It was introduced somewhere during the development of AGS 3.4.1.

To be brief, prior to 3.4.1 this step was explicit, now it is done as a part of finding configuration files. But there is a flag called 'psp_ignore_acsetup_cfg_file' which forces engine to ignore default config files, and it is always 'true' on mobile ports, thus this step is skipped.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 14/03/2018 00:41:59
Alright, here is an updated APK: https://www.dropbox.com/s/edvkqlkny9aut4w/AGS-3.4.1-unsigned.apk?dl=0

Now it actually runs the game.

There is some other problem: it does not display anything. I suspect there may be some problem with applying new display config.
Also, when I run my racing game, it just crashes.

Now fixed.

One positive thing is that it writes log (in /sdcard/ags/ directory) if you have "log=1" in "[misc]" config category. So you can at least see how far it goes.

Will update this post if I make more fixes.

UPDATE: OpenGL shaders fail to compile on Android GLES system. Well.. one good thing engine at least manages to log compilation output, so it's "kindof" working.
This is something I was worried about, because I've recently read that GLES shaders have "stricter" syntax. Idk what would be best way to proceed: have separate sets of shaders for each port, or try to find syntax that works everywhere (if that's possible), or maybe even supply compiled shader file (Idk if that would be compatible with every system, and how to even distribute it with engine).
At least this issue is easy to observe, and in theory only consequence will be that tinting won't work on Android (but it did not work before either).

UPDATE2:
Well, damn, this was so far the stupidest bug: https://github.com/adventuregamestudio/ags/commit/41189699126447351f95d4fe3fbc0ff136e03947
Now game is running and display is working (download link is same, see beginning of the post).

New problem: the game is drawn in the small rectangular bottom-left corner of the screen. At least there is some idea where to look.

UPDATE3:
The reason is that apparently when on Android, the engine does not receive proper display resolution until certain moment. So it initializes with 320x200, but then Java side sends correct size, to which it should react. Unfortunately this is not implemented as a proper callback, but in a silly way: OpenGL renderer simply tests for some global variable in "render" function and reacts. When I was updating OpenGL, this probably got broken.

Also, I noticed that colors are broken for some reason too. Don't know if it's related or separate bug. The games I tried include 32-bit ones, but they also have that issue.
Title: Re: AGS engine Android port
Post by: Chicky on Thu 15/03/2018 14:54:36
Hey CW, sounds like you're making good progress. Just thought I'd mention that the link doesn't work atm.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Thu 15/03/2018 15:47:04
Quote from: Chicky on Thu 15/03/2018 14:54:36
Hey CW, sounds like you're making good progress. Just thought I'd mention that the link doesn't work atm.

New link: https://www.dropbox.com/s/edvkqlkny9aut4w/AGS-3.4.1-unsigned.apk?dl=0

To remind, there are still two issues: the game is displayed in a small rectangle in the screen corner (depends on device resolution, I guess), and colors are screwed for some reason.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 19/03/2018 23:53:22
I made another build, but it is not final work, just for the test: https://www.dropbox.com/s/f62oqlis9a7zgho/AGS-3.4.1-debug.apk?dl=0

I tried to double check my fix to the certificate error I was having when installing the APK. So I built APK without fixes, and it still installed without errors. This means that the problem was more complicated or related to something different.

I found that even 3.4.0 APK causes installation error if you install it on device with 3.4.1 APK installed. If you uninstall AGS, then install new APK, it works. So maybe it was it. Maybe this error was happening because of installing an APK with the same name which had certain changes in it, unacceptable for "upgrade".

But since no one said whether new APK installs for them, I do not know this for sure.

So, in case latest APK I linked above does not install, you may try this slightly older one and see what happens: https://www.dropbox.com/s/edvkqlkny9aut4w/AGS-3.4.1-unsigned.apk?dl=0



Known issues.

The biggest visible issue right now is that the colors are broken. I have absolutely no idea what could cause this. So, will have to keep comparing with the 3.4.0 code.

Besides that, the App Preferences are partially not applied. Can't tell when it got broken, maybe in 3.4.1, or maybe earlier.
Notably does not work:
- Select renderer (always set to "Software", but software renderer does not work, so it switches to OpenGL in game)
- Scaling (always set to "stretch to whole screen").
and maybe something else.

Title: Re: AGS engine Android port
Post by: Privateer Puddin' on Tue 20/03/2018 00:27:32
Installing the new (14th March) APK (having never installed a previous one) worked fine on my Android phone (Essential phone) as far as I can tell (didn't run actual game - don't have external storage)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 20/03/2018 00:34:33
Quote from: Privateer Puddin' on Tue 20/03/2018 00:27:32
Installing the new (14th March) APK (having never installed a previous one)

14th March? No, that's the old one, the new one is from 20th March.
Title: Re: AGS engine Android port
Post by: morganw on Tue 20/03/2018 00:45:04
Quote from: Crimson Wizard on Mon 19/03/2018 23:53:22
I made another build, but it is not final work, just for the test: https://www.dropbox.com/s/f62oqlis9a7zgho/AGS-3.4.1-debug.apk?dl=0

I've tried this one and didn't have any colour issues, only problem was being unable to start games where graphics filter is 'undefined'. This didn't happen with every game though, so might be related to some settings not being read correctly?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 20/03/2018 00:51:38
Quote from: morganw on Tue 20/03/2018 00:45:04
I've tried this one and didn't have any colour issues, only problem was being unable to start games where graphics filter is 'undefined'. This didn't happen with every game though, so might be related to some settings not being read correctly?

Weird... color is broken in every game I tried, including 32-bit ones.

Which games did you run?
Also, could you post your config file?
Title: Re: AGS engine Android port
Post by: Privateer Puddin' on Tue 20/03/2018 00:53:40
Quote from: Crimson Wizard on Tue 20/03/2018 00:34:33
Quote from: Privateer Puddin' on Tue 20/03/2018 00:27:32
Installing the new (14th March) APK (having never installed a previous one)

14th March? No, that's the old one, the new one is from 20th March.

I was mainly just referring to:

QuoteBut since no one said whether new APK installs for them, I do not know this for sure.

Which is the one I thought you meant, since it was the most recent before your latest post. Anyway, I installed the 14th March one before the 20th one was posted - do you want me to try installing that too?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 20/03/2018 01:12:28
Quote from: Privateer Puddin' on Tue 20/03/2018 00:53:40
Which is the one I thought you meant, since it was the most recent before your latest post. Anyway, I installed the 14th March one before the 20th one was posted - do you want me to try installing that too?

Yes, it would be good to know to compare how they work.
Title: Re: AGS engine Android port
Post by: Chicky on Tue 20/03/2018 01:22:46
Quote from: Crimson Wizard on Mon 19/03/2018 23:53:22
I made another build, but it is not final work, just for the test: https://www.dropbox.com/s/f62oqlis9a7zgho/AGS-3.4.1-debug.apk?dl=0

I'm able to install this one and the app finds my game folder, however when I run the game I get the error: 'Unable to initialize your audio hardware error', followed by 'Unable to write in the savegame directory.'. The app then crashes.

I've checked permissions on the app and it has write access. I only have 1gb free on my internal storage but I would imagine this is enough?

Can we confirm what the steps are needed for putting the game files onto the phone? I'm using the following process (not sure if I'm doing something wrong):

copy game files (no need for winsetup) to folder on internal storage
use ES File Explorer android app to get game folder path
Open ags app and in preferences set the file path of the folder which contains the game folder (for me it's SD card - AGS)
GuardDuty folder now shows in the app.


My acsetup.cfg has 'driver=OGL' listed under [graphics], is that correct? Is there a specific setup you need in the cfg?


Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 20/03/2018 01:34:38
Quote from: Chicky on Tue 20/03/2018 01:22:46
My acsetup.cfg has 'driver=OGL' listed under [graphics], is that correct? Is there a specific setup you need in the cfg?
Android port overrides much of the graphic setup, and supposed to take one from other config, set up in App Preferences (although it is limited now, as I mentioned in a post above).


Quote from: Chicky on Tue 20/03/2018 01:22:46
Can we confirm what the steps are needed for putting the game files onto the phone? I'm using the following process (not sure if I'm doing something wrong):
Yes, it should be about like that.

Game launcher requires a windows version of game exe, renamed to ac2game.dat to detect a folder.
Title: Re: AGS engine Android port
Post by: Joseph DiPerla on Tue 20/03/2018 01:37:13
Quote from: Chicky on Tue 20/03/2018 01:22:46
Quote from: Crimson Wizard on Mon 19/03/2018 23:53:22
I made another build, but it is not final work, just for the test: https://www.dropbox.com/s/f62oqlis9a7zgho/AGS-3.4.1-debug.apk?dl=0

I'm able to install this one and the app finds my game folder, however when I run the game I get the error: 'Unable to initialize your audio hardware error', followed by 'Unable to write in the savegame directory.'. The app then crashes.

I've checked permissions on the app and it has write access. I only have 1gb free on my internal storage but I would imagine this is enough?

Can we confirm what the steps are needed for putting the game files onto the phone? I'm using the following process (not sure if I'm doing something wrong):

copy game files (no need for winsetup) to folder on internal storage
use ES File Explorer android app to get game folder path
Open ags app and in preferences set the file path of the folder which contains the game folder (for me it's SD card - AGS)
GuardDuty folder now shows in the app.


My acsetup.cfg has 'driver=OGL' listed under [graphics], is that correct? Is there a specific setup you need in the cfg?




I believe each game has to be in its own subfolder in a main ags game directory. Eg: AgsGames/indianajones
Title: Re: AGS engine Android port
Post by: Chicky on Tue 20/03/2018 01:38:58
Quote from: Joseph DiPerla on Tue 20/03/2018 01:37:13

I believe each game has to be in its own subfolder in a main ags game directory. Eg: AgsGames/indianajones

Cool, that's how I've got it setup. With the app pointing to the main AGS game directory.

Quote from: Crimson Wizard on Tue 20/03/2018 01:34:38
Game launcher requires a windows version of game exe, renamed to ac2game.dat to detect a folder.

I found that doing this stopped the app from being able to see the game, I had to do that when I tried the old emulator (Monkey's version) but this time I had to keep it as it's original exe name (with the .exe extension) for the app to be able to see the game.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 20/03/2018 01:48:48
Quote from: Chicky on Tue 20/03/2018 01:38:58
Quote from: Crimson Wizard on Tue 20/03/2018 01:34:38
Game launcher requires a windows version of game exe, renamed to ac2game.dat to detect a folder.

I found that doing this stopped the app from being able to see the game, I had to do that when I tried the old emulator (Monkey's version) but this time I had to keep it as it's original exe name (with the .exe extension) for the app to be able to see the game.

Well, I don't have exe files in my game folders, but ac2game.dat files. So don't know what is going on. Either way, it is still wrong that it requires actual windows exe there.

Regarding audio problem, this is not error, but warning, and it usually indicates that MIDI is not supported. Try setting "midiid=0" in config to disable MIDI.
For games using MIDI you would need to install DIGMID patches.
It may be also a good thing to silent this error and make it write to the log instead of exploding into player's face.
Title: Re: AGS engine Android port
Post by: Privateer Puddin' on Tue 20/03/2018 02:38:39
AGS seemed to see games whether it was the original .exe, or renamed to ac2game.dat

I've tried both 14th and 20th versions (20th version installed fine, without removing previous version)

I get a black screen upon starting my game, whether it's a 3.4.0 version or 3.4.1. Is the log file any use?

Which games have been used to test? Is it worth me checking one to see if it displays properly versus my game?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 20/03/2018 02:41:56
Quote from: Privateer Puddin' on Tue 20/03/2018 02:38:39
Which games have been used to test? Is it worth me checking one to see if it displays properly versus my game?

Some random games I had there, "All pigs deserve to burn in hell", "Donna: Avenger of Blood", "Last & Furious" (my own game).

You may add "log=1" under "[misc]" in config file, log will probably get created in sdcard/ags.
Title: Re: AGS engine Android port
Post by: Privateer Puddin' on Tue 20/03/2018 03:10:50
Tried Last & Furious - got the same black screen. Here's the log from trying to run my game:

http://tom-simpson.com/ags.log
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 20/03/2018 15:08:25
Updated the build, but do not think there is any change (just tidied some code): https://www.dropbox.com/s/a8iib4gbov26lgn/AGS-3.4.1-debug.apk?dl=0


I found that Java side of the engine explicitly creates GLES1 context, while AGS now needs GLES2. Need to find out how to setup GLES2 properly.
Of course this means that Java code needs to be changed, and I do not even know how to debug it in case something is wrong.


EDIT: Alright, this does not look like something that may be done as a quick hack. One needs to actually rewrite the thing, import different java libraries, use different classes etc. Which means a person needs to know what to do.
Wish I knew how to compile and debug Java application. Do you need to use Android Studio for that?
I see no better solution than to hire an actual Android developer to help fix this. This is stupid and very inefficient to keep spending time on something I am not skilled with.

Title: Re: AGS engine Android port
Post by: morganw on Tue 20/03/2018 18:24:09
I think some of the games I was testing were 16 bit, so that might explain why some were working. I'll have a look at it once I'm done with a couple of other things. I've not looked at Java in a long time, but there is a developer guide that uses GLES2 in a tutorial here (https://developer.android.com/training/graphics/opengl/environment.html) and I've got one device that I could try it on.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 20/03/2018 18:43:56
Quote from: morganw on Tue 20/03/2018 18:24:09
I think some of the games I was testing were 16 bit, so that might explain why some were working.

I tried 16-bit game and it had correct colors. So, 32-bit games have incorrect colors for some reason.

Also, that is true that *.exe is also detected by launcher.

UPD: Did some extra logging, only to make it clear that all gfx are converted to 32-bit regardless. Yes, the engine always runs in 32-bit mode, but for some reason when 16-bit games are converted to 32-bit they look okay, and when 32-bit games are run their colors are broken.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 30/04/2018 14:56:51
Alright, it's been too long since last update, but I finally did version that correctly handles all Android graphic preferences (renderer type, scaling), and fixed issue with incorrect mouse coordinates handling:

https://www.dropbox.com/s/qww9leoj643ltwr/AGS-3.4.1-debug.apk?dl=0

Code is not in main repo yet, you may find latest commits here: https://github.com/ivan-mogilko/ags-refactoring/tree/release-3.4.1--android-fix


At the moment, the only problem that I still observe is this:
Quote from: Crimson Wizard on Tue 20/03/2018 18:43:56
the engine always runs in 32-bit mode, but for some reason when 16-bit games are converted to 32-bit they look okay, and when 32-bit games are run their colors are broken.
Note, that this happens only with Hardware renderer. Software renderer always has correct colors, which narrows possible area in code that may affect this.


Can someone else test this and tell if they see same, or any other problems?

NOTE: it's a known thing that if you have AGS 3.4.0 APK installed, Android may refuse to install the new one, saying something about bad certificate. For me it worked when I first properly uninstalled previous APK.
Title: Re: AGS engine Android port
Post by: morganw on Mon 30/04/2018 22:37:30
I see the same, 32 bit games + hardware renderer causes the colours to be wrong.
In the game I'm testing with, red is being converted to blue, but green is correct; I guess it could just be the byte order is reversed for some reason (BGRA instead of RGBA).
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 01/05/2018 01:28:22
Alright, I got colors fixed.
https://www.dropbox.com/s/qww9leoj643ltwr/AGS-3.4.1-debug.apk?dl=0

The fix was trivial (https://github.com/ivan-mogilko/ags-refactoring/commit/068a663a77d8ccefbe7a4f351efb5b07793016c7), but spent a long time trying to figure out why it worked in 3.4.0, and what has changed... yet failed.

This is really a mystery to me. This 32-bit RGB->BGR conversion look completely unnecessary for Android, and for any others sans PSP, which iirc had BGR-based graphic output.

(Actually, most of that initialization code looks mostly unnecessary, because it repeats itself, just variables are set in different order, so it kinda looks different)

So how did it work with 3.4.0? The only thing that comes to mind: it's a case when multiple mistakes combined produce desired output. Because I was cleaning up code when writing OpenGL support for Windows, I could shift the balance to one side...



Anyhow, I tried running 8-bit game on Android. It works with Software renderer (except couple of minor glitches), but Hardware makes it crash silently. Not sure what's wrong, but that's a little priority for me now, because Hardware renderer is not much suitable for 8-bit games currently anyway.
Title: Re: AGS engine Android port
Post by: Privateer Puddin' on Tue 01/05/2018 02:45:10
Woo! It works, top work Crimson.

(http://www.tom-simpson.com/phone.jpg)

A couple of things! (Sorry if either are to do with the Android port in general, rather than this specific version, since it's the first I have up and running my game)

I noticed this speech colour being different on Android:

(http://www.tom-simpson.com/AGSdroid.png)

Also, the mouse click is somewhat to the left of where I tap, making some things hard to tap on (having to tap to the right of what you want to click on), and anything to the far right of the screen impossible to tap on. Dunnno if this is just my game, going to test with some others.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 01/05/2018 03:01:15
Hmmm, no. As I was suspecting, my latest changes have broken colors in 16-bit Software mode. Looks like this is not the end.


Quote from: Privateer Puddin' on Tue 01/05/2018 02:45:10
Also, the mouse click is somewhat to the left of where I tap, making some things hard to tap on (having to tap to the right of what you want to click on), and anything to the far right of the screen impossible to tap on. Dunnno if this is just my game, going to test with some others.

There was similar issue earlier on emulator, but now it's supposed to be fixed.
On other hand, I think there was some report about such thing even before 3.4.1, earlier in this thread.
Title: Re: AGS engine Android port
Post by: Privateer Puddin' on Tue 01/05/2018 03:13:07
Quote from: Crimson Wizard on Tue 01/05/2018 03:01:15


Quote from: Privateer Puddin' on Tue 01/05/2018 02:45:10
Also, the mouse click is somewhat to the left of where I tap, making some things hard to tap on (having to tap to the right of what you want to click on), and anything to the far right of the screen impossible to tap on. Dunnno if this is just my game, going to test with some others.

There was similar issue earlier on emulator, but now it's supposed to be fixed.
On other hand, I think there was some report about such thing even before 3.4.1, earlier in this thread.

Tested on another phone, and it works fine. I think it's because the phone where I have the issue has a camera notch:

(https://www.91-img.com/pictures/essential-ph-1-mobile-phone-large-1.jpg)

and maybe something is trying to compensate for that. I can move the mouse by dragging it into position fine, but then can't click on it.
Title: Re: AGS engine Android port
Post by: NicolaGs on Tue 01/05/2018 10:51:09
I had an issue with the mouse cursor being "trapped" in the left of the screen when using hardware Renderer (and hardware pixel perfect renderer too).
The cursor moves but only on a horizontal line (y = 30, maybe) and on a distance of about 50 pixel (?) whereas the game resolution is 320x200.

With software renderer, it works fine.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 01/05/2018 10:57:44
Quote from: NicolaGs on Tue 01/05/2018 10:51:09
I had an issue with the mouse cursor being "trapped" in the left of the screen when using hardware Renderer (and hardware pixel perfect renderer too).
The cursor moves but only on a horizontal line (y = 30, maybe) and on a distance of about 50 pixel (?) whereas the game resolution is 320x200.

Is it with the recent APK?
Title: Re: AGS engine Android port
Post by: NicolaGs on Tue 01/05/2018 11:59:53
Oh, sorry... yes! The very last link you provided...
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 01/05/2018 12:08:10
Can you put

[misc]
log=1

to the acsetup.cfg in your game folder, run the game, and then paste contents of "ags.log" that should appear in the parent "ags" folder?
Title: Re: AGS engine Android port
Post by: Chicky on Tue 01/05/2018 13:37:36
Just thought I'd chime in to say that Guard Duty is up and running in the latest .apk you posted CW. So far I've only noticed an issue with font colour (as mentioned by custard), other than that everything else seems to be working perfectly. I haven't had any crashes after about 20 minutes of playing and I've yet to find anything behaving unexpectedly.

I'm running on a Galaxy S7 Edge and had to move the game folder over to internal storage (was previously on SD) to get it to run, when it was on the SD card I was getting the error 'Unable to write in the savegame directory.'.

Really impressive stuff, thank you again for your work CW. It's such a nice feeling playing through the game on mobile. The screen is ever so slightly soft, but it actually feels closer to playing on an old CRT so I'm not complaining!

Does this mean we might be able to build to apk sometime in the future? 8-0

*edit: One 'bug' I did notice: AGS lowers background audio when speech is playing (as intended) but when running on android the background audio does not return to it's normal volume after speech has finished.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 01/05/2018 13:48:05
Quote from: Chicky on Tue 01/05/2018 13:37:36
Does this mean we might be able to build to apk sometime in the future? 8-0
There was this plugin made by monkey0506: http://www.adventuregamestudio.co.uk/forums/index.php?topic=53910.0
You can also do this manually with the instructions eri0o wrote: http://www.adventuregamestudio.co.uk/forums/index.php?topic=55681.0
After glancing quickly, it looks like all you need is to replace native engine libraries to version 3.4.1. Which means that we probably need to deploy both APK, for quick-testing, and these libraries for building your own APK.
Also, afaik you could extract these libraries from existing APK.


Quote from: Chicky on Tue 01/05/2018 13:37:36
*edit: One 'bug' I did notice: AGS lowers background audio when speech is playing (as intended) but when running on android the background audio does not return to it's normal volume after speech has finished.

Well... I guess we will need to open an actual bug tracker for these reports. And start a new Android thread, because this one becomes too long and unmanageable.
Maybe after I fix most outstanding bugs known atm.
Title: Re: AGS engine Android port
Post by: eri0o on Tue 01/05/2018 17:10:03
Hey CW!

I tested my game on your latest apk! Here is the video (https://streamable.com/uhtyw)!

It's working great! :-D (except for the part that I have to rethink the touch areas for fingers instead of... pen input...)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Sun 06/05/2018 22:23:38
Quote from: Privateer Puddin' on Tue 01/05/2018 02:45:10
I noticed this speech colour being different on Android:
Quote from: Chicky on Tue 01/05/2018 13:37:36So far I've only noticed an issue with font colour (as mentioned by custard)

Question: could you double check what renderer you were running? Below I post results of my own tests, and for me it looks like the issue is only with Software renderer.


I made additional testing to clarify the differences between 3.4.0, previous 3.4.1 and latest 3.4.1 with color fix, and the latest APK build by JJS himself (very old one).


The old APK by JJS:
Software renderer: all color games are okay.
Hardware renderer: 32 and 16 bit games are okay, 8-bit games cause engine to close or crash without a message.

3.4.0:
Software renderer: sadly, it looks like in 3.4.0 Android port was broken and could not apply chosen options, so software renderer was always disabled, and only hardware one active.
Hardware renderer: 32 and 16 bit games are okay, 8-bit games cause engine to close or crash without a message.

3.4.1 (before color fix):
Software renderer: all color games are okay.
There is one issue in 8-bit games with black text color treated as transparent. I do not know if old JJS's port had same problem, because only game where this bug was noticed is made with higher version of AGS.

Hardware renderer: 32-bit games have Red and Blue components swapped, except for the text. My test was limited, but it seems at least speech text and text on GUI buttons worked alright, contrary to the rest of the game.
16-bit: ok.
8-bit: crashes without message.

3.4.1 (after color fix):
Software renderer: 32-bit games are okay, except for the text, which has Red and Blue components swapped.
16-bit games have Red and Blue components swapped, including the text.
8-bit games: looks okay.

Hardware renderer: 32 and 16-bit games are okay.
8-bit games: crashes without message.


Summing up:
Something has changed between 3.4.0 and 3.4.1, that causes R<->B color component swap when running 32-bit games with hardware renderer.
But if that gets fixed (or "fixed"), then same error occurs for 16-bit games run with software renderer.



It is worth noting, that before 3.4.1 both Software and hardware OpenGL renderer had run 16-bit games in 16-bit native mode (although for hardware renderer bitmaps were converted to 32-bit ones before being applied to textures). For 3.4.1 I made both Direct3D and OpenGL run only in 32-bit mode, because otherwise they were loosing some color precision in 16-bit games. Later I also made Software renderer choosing 32-bit display mode for 16-bit games too, for couple of reasons.
That could maybe explain why software renderer has 16-bit games screwed after the fix, but still idk if has anything to do with 32-bit games screwed earlier.

Another thing that should be noted again, on Android "Software" renderer actually works as a mixed renderer. After it builds all game image using software drawing functions, the Allegro library patched by JJS takes that final image and draws it using OpenGL again.
And the important thing is, that unlike OpenGL built in AGS, the OpenGL renderer in Allegro does not convert 16-bit game bitmaps to 32-bit - then draws them on 32-bit texture, but instead copies them to 16-bit textures (GL_UNSIGNED_SHORT_5_6_5).



Anyway, I did another test, and made 16-bit games run in 16-bit mode with Software renderer.
That fixed biggest problem (16-bit games had all colors swapped), but the issue with 32-bit games having text color swapped remained (obviously).


Right now I am bit confused, not sure how to proceed.
The whole thing is just screwed up, there are two OpenGL renderers, one in Allegro and another in AGS, and they do not work exactly same way, and I do not even know what was the need to create 2 of them. If JJS even explained it, I've never seen that explanation.
Maybe it would be possible to change color shift setup depending on whether it is software or hardware renderer running. If only I could understand how these color shifts work. It is perfectly possible that they are simply not used correctly in some case.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 07/05/2018 00:16:48
In addition to above, if you look into the liballegro-4.4.2.patch for Android, you would see that when it updates opengl texture contents from native bitmap, it does so without any conversion:

Code (c) Select

glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, android_screen_width, android_screen_height, GL_RGBA, GL_UNSIGNED_BYTE, displayed_video_bitmap->line[0]);

meaning that native bitmap is expected to have pixel format corresponding to GL_RGBA (R at shift 0, G at shift 8 and so on).

However, in AGS, it does explicit conversion from native bitmap, using the supplied shifts, e.g.:
Code (cpp) Select

memPtrLong[x] = D3DCOLOR_RGBA(algetr32(*srcData), algetg32(*srcData), algetb32(*srcData), algeta32(*srcData));


D3DCOLOR_RGBA is always the same for all versions:
Code (cpp) Select

#define D3DCOLOR_RGBA(r,g,b,a) \
  (((((a)&0xff)<<24)|(((b)&0xff)<<16)|(((g)&0xff)<<8)|((r)&0xff)))

Which seem to correspond to GL_RGBA.
algetr32 and similar functions are declared as:
Code (cpp) Select

#define algetr32(xx) ((xx >> _rgb_r_shift_32) & 0xFF)

And for Android _rgb_r_shift_32 is set as (this was before my "fix"):
Code (cpp) Select

_rgb_r_shift_32 = 0;
_rgb_g_shift_32 = 8;
_rgb_b_shift_32 = 16;


Which means that native bitmap is supposed to have same pixel format as final OpenGL texture. In other words, result of bitmap->texture conversion in both Allegro renderer and AGS renderer must be the same! But for some reason it's not!
What I am missing here?!......
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 07/05/2018 00:53:02
Oh shoot! I may have found what is the difference between 3.4.0 and 3.4.1.

Android has a compilation flag AGS_INVERTED_COLOR_ORDER, which does this at some point, when the sprite gets loaded from game resources:
Code (cpp) Select

    if ((bmp_col_depth == 32) && (sys_col_depth == 32))
    {
#if defined (AGS_INVERTED_COLOR_ORDER)
        // PSP: Convert to BGR color order.
        if (software_driver)
            new_bitmap = convert_32_to_32bgr(bitmap);
#endif
    }

This perhaps explains how bitmaps end up with OpenGL-compatibe format for the Software renderer.

The thing is that the "if (software_driver)" condition appeared only in 3.4.1. Before that this conversion was performed regardless.


This... may explain everything. At least I hope it will, because my mind is close to get boggling.
Going to try and restore this old behavior.


A MINUTE OF RANT: But clearly all of this won't be neccessary if there were some proper comments left around this code, just to make us know why the colors need to be inverted. When I checked this code a while ago, I was left assured that all this refers only to PSP (as the only comment tells), and related to how its own graphics driver works.
Apparently same technique is used in mobile ports to prepare bitmaps matching OpenGL pixel conversion, which is nowhere near obvious. :(
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 07/05/2018 02:01:17
Uhhhhhhh!

I think it is finally working with both renderers and all color modes, and text also seem to have proper color.
Please, test again:
https://www.dropbox.com/s/qww9leoj643ltwr/AGS-3.4.1-debug.apk?dl=0
Title: Re: AGS engine Android port
Post by: Privateer Puddin' on Mon 07/05/2018 02:03:02
Quote from: Crimson Wizard on Sun 06/05/2018 22:23:38
Question: could you double check what renderer you were running? Below I post results of my own tests, and for me it looks like the issue is only with Software renderer.

32 bit game with the Software renderer (neither Hardware options work on my two phones; the game plays (I hear sound) but just get a black screen)

I'll test again with the new file!

Edit: New version, 32 bit game with the Software renderer: dialog colours are correct
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 07/05/2018 02:37:11
Quote from: Privateer Puddin' on Mon 07/05/2018 02:03:02
32 bit game with the Software renderer (neither Hardware options work on my two phones; the game plays (I hear sound) but just get a black screen)

If you have some spare time, could you check the old 3.4.0 APK with any compatible game, to see if there is any difference? It may be found here: http://www.adventuregamestudio.co.uk/releases/finals/AGS-3.4.0-P4/Android.3.4.0.16.APK.zip
Title: Re: AGS engine Android port
Post by: Privateer Puddin' on Mon 07/05/2018 03:32:43
Tested using Memories Fade: http://www.adventuregamestudio.co.uk/site/games/game/2127/

3.4.0.16: Works in Software, Hardware, and Hardware (Pixel Perfect)
3.4.1-debug: Works in Software only (same as my game)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 07/05/2018 09:13:17
Can you put

[misc]
log=1

to the acsetup.cfg in your game folder, run the game, and then paste contents of "ags.log" that should appear in the parent "ags" folder?
Title: Re: AGS engine Android port
Post by: Privateer Puddin' on Mon 07/05/2018 09:33:50
Adventure Game Studio v3.4 Interpreter
Copyright (c) 1999-2011 Chris Jones and 2011-2018 others
ACI version 3.4.1.12

Initializing allegro
Initializing game data
Looking for the game data file
Located game data file: /storage/emulated/0/ags/feria/Feria d'Arles.exe
Opened game data file: game28.dta
Game data version: 49
Compiled with: 3.4.1.11
Setting up game configuration
Setting up window
Initializing TTF renderer
Initializing mouse: number of buttons reported is 3
Checking memory
Data directory: /storage/emulated/0/ags/feria
Initializing audio vox
Audio vox found and initialized.
Initializing keyboard
Install timer
Initialize sound drivers
Sound settings: digital driver ID: 'Auto' (0xffffffff), MIDI driver ID: 'Auto' (0xffffffff)
Installed digital driver ID: 'ANDS' (0x414e4453), MIDI driver ID: 'None' (0x0)
Install exit handler
Initialize path finder library
Load game data
Game GUI version: 118
Requested script API: v3.4.1 (5), compat level: v3.4.0 (4)
Game title: 'Feria d'Arles'
Checking for disk space
Initializing MOD/XM player
Initializing resolution settings
Game native resolution: 320 x 180 (32 bit)
Device display resolution: 320 x 200
Game settings: windowed = no, screen def: max, screen size: 0 x 0, match device ratio: yes, game scale: proportional
Using graphics factory: OGL
Created graphics driver: OpenGL
Attempt to switch gfx mode to 320 x 180 (32-bit) fullscreen
Running OpenGL: OpenGL ES-CM 1.1
WARNING: OpenGL 3.0 or higher is required for tinting shader.
ERROR: OpenGL: Tinting program's fragment shader failed to compile:
----------------------------------------
ERROR: Invalid #version

----------------------------------------
ERROR: OpenGL: Lighting program's fragment shader failed to compile:
----------------------------------------
ERROR: Invalid #version

----------------------------------------
Succeeded. Using gfx mode 320 x 200 (32-bit) fullscreen
Render frame set, render dest (0, 10, 319, 189 : 320 x 180)
Requested gfx filter: StdScale
Graphics filter set: 'StdScale', filter dest (0, 10, 319, 189 : 320 x 180)
Using gfx filter: StdScale
Mouse control: off, base: 1.000000, speed: 1.000000
Mouse confined: (0,10)-(319,189) (320x180)
Check for preload image
Initialize sprites
Initialize game settings
Cannot open translation: default.tra
Prepare to start game
Audio thread started
Checking replay status
Engine initialization complete
Starting game
OGL: notified of device screen updated to 1312 x 2272, resizing viewport
Render frame set, render dest (0, 767, 1311, 1504 : 1312 x 738)
Mouse confined: (0,767)-(1311,1504) (1312x738)
***** ENGINE HAS SHUTDOWN
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 09/05/2018 20:36:48
@Privateer Puddin', this annoys me greatly, but at the moment I do not know what could be the cause there. I tried that other game you mentioned on emulator, and it worked well with hardware renderer too. There might be another small difference in versions that I did not notice yet but do not know where to start looking.
Hopefully eventually someone gets an idea.
E: except one dumb thing, are you running game in vertical mode? Render surface is 1312 x 2272. Is there a way to try horizontal mode instead?


On a side note, here is a slightly updated Android port, fixed running FLIC movies:
https://www.dropbox.com/s/qww9leoj643ltwr/AGS-3.4.1-debug.apk?dl=0


Probably will release a new patch to 3.4.1 later this week, that will include Android port.
Title: Re: AGS engine Android port
Post by: Mehrdad on Thu 10/05/2018 06:25:52
Quote from: Crimson Wizard on Wed 09/05/2018 20:36:48
Probably will release a new patch to 3.4.1 later this week, that will include Android port.

Is Android port in AGS editor? ? ? ? ? ? ?
Title: Re: AGS engine Android port
Post by: Privateer Puddin' on Thu 10/05/2018 06:47:45
Quote from: Crimson Wizard on Wed 09/05/2018 20:36:48
@Privateer Puddin', this annoys me greatly, but at the moment I do not know what could be the cause there. I tried that other game you mentioned on emulator, and it worked well with hardware renderer too. There might be another small difference in versions that I did not notice yet but do not know where to start looking.
Hopefully eventually someone gets an idea.
E: except one dumb thing, are you running game in vertical mode? Render surface is 1312 x 2272. Is there a way to try horizontal mode instead?

Same black screen starting/staying in horizontal, same starting in vertical and rotating to horizontal etc. (which works in software), can post up the log again if that's any help.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Thu 10/05/2018 10:28:04
Quote from: Mehrdad on Thu 10/05/2018 06:25:52
Is Android port in AGS editor? ? ? ? ? ? ?

No. I am not integrating building for Android in the Editor, I was fixing Android port itself.

You need to use monkey's plugin for that: http://www.adventuregamestudio.co.uk/forums/index.php?topic=53910.0
Or those instructions from eri0o: http://www.adventuregamestudio.co.uk/forums/index.php?topic=55681.0

BUT, since most people cannot build necessary Android files for these methods, we would need to post download links for them, that work with 3.4.1.

Title: Re: AGS engine Android port
Post by: Mehrdad on Thu 10/05/2018 12:21:05
Oh.OK. you are amazing. Nice job CW and eri0o!!!. I'll try it as soon as possible
Title: Re: AGS engine Android port
Post by: eri0o on Fri 11/05/2018 05:08:39
I didn't do anything, it was all CW, my part was mainly getting him annoyed. (laugh)
Title: Re: AGS engine Android port
Post by: mim2011 on Thu 21/06/2018 09:44:42
Hi devs,

very nice port (3.4.1)! Thank you!
I tried to play Kong Quest 1 VGA from AGD Interactive on a tablet and it is really nice.
Only one problem. Not all tablets have a menu button, only the back button.
It will be possible to switch the Actions between Back an Menu buttons? In this way on a tablet without menu button it will be easy to play. Now, when the menu button is pressed it shows a menu with contains an exit point as well. The back button works only like a shortcut for exit. It is not possible to get the virtual keyboard without a menu button.
Thank you
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Sat 07/07/2018 15:29:19
Hello, I updated Android engine recently with some gfx related changes. That should not have break anything in theory, but still could some people test it out to see if it works same as before?

https://www.dropbox.com/s/nkoe0to8ceqziib/AGS-3.4.1-p3prepare.apk?dl=0


Quote from: mim2011 on Thu 21/06/2018 09:44:42
It will be possible to switch the Actions between Back an Menu buttons? In this way on a tablet without menu button it will be easy to play. Now, when the menu button is pressed it shows a menu with contains an exit point as well. The back button works only like a shortcut for exit. It is not possible to get the virtual keyboard without a menu button.

Only to give some reply, I wish someone who knows how to program Android apps looked into this, but right now we do not have the right person around.
Title: Re: AGS engine Android port
Post by: mim2011 on Mon 09/07/2018 09:17:41
Quote from: Crimson Wizard on Sat 07/07/2018 15:29:19
Hello, I updated Android engine recently with some gfx related changes. That should not have break anything in theory, but still could some people test it out to see if it works same as before?

https://www.dropbox.com/s/nkoe0to8ceqziib/AGS-3.4.1-p3prepare.apk?dl=0


Quote from: mim2011 on Thu 21/06/2018 09:44:42
It will be possible to switch the Actions between Back an Menu buttons? In this way on a tablet without menu button it will be easy to play. Now, when the menu button is pressed it shows a menu with contains an exit point as well. The back button works only like a shortcut for exit. It is not possible to get the virtual keyboard without a menu button.

Only to give some reply, I wish someone who knows how to program Android apps looked into this, but right now we do not have the right person around.

Hi Crimson Wizard,

thank you for reply.
Unfortunately I am not able to build the part myself, I think that you are using an older ndk/sdk with ant.
The change that I propose is minimal, only one line of code in a java file, :

Code (ags) Select

in /Android/library/src/com/bigbluecup/android/AgsEngine.java

                public void onBackKeyPressed(AgsEngine engine, boolean longPress)
                {
                        if (longPress) engine.showExitConfirmation();
-                       else engine.keyboardEvent(KeyCode.KeyBackHardKey);
+                       //else engine.keyboardEvent(KeyCode.KeyBackHardKey);
+                       else engine.showInGameMenu();
                }


It will only switch the result of pressing the back button, from prompting to exit to showing the in game menu. (line taken from the previous method onMenuKeyPressed).

I am not very familiar with open source development processes and with pull requests on github, I hope that I am not against the forum rules to post it here.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 09/07/2018 09:31:23
Quote from: mim2011 on Mon 09/07/2018 09:17:41
It will only switch the result of pressing the back button, from prompting to exit to showing the in game menu. (line taken from the previous method onMenuKeyPressed).

I think I see what you mean, but this probably would require some setting, to keep KeyCode.KeyBackHardKey action for devices that have both menu and back keys?
Are you able to access Preferences when running AGS engine on Android (it's where you setup renderer, scaling, and so on)? If so, we could probably add an option like "Back key works as Menu key".

Quote from: mim2011 on Mon 09/07/2018 09:17:41
Unfortunately I am not able to build the part myself, I think that you are using an older ndk/sdk with ant.

Not an expert in this, but I thought we've recently switched to using new NDK. Eri0o was testing, perhaps he could confirm (or not).
Could you tell what github branch you are building, and which errors you get?
Title: Re: AGS engine Android port
Post by: mim2011 on Mon 09/07/2018 10:18:53
I can access Preferences on the launcher, not in game
I tried to build master before branching the 3.4.1

Code (ags) Select

[ launcher_list]$ ant
Buildfile: <HOME>/ags/Android/launcher_list/build.xml

BUILD FAILED
/ags/Android/launcher_list/build.xml:90: Cannot find <HOME>/android/sdk/tools/ant/build.xml imported from <HOME>/ags/Android/launcher_list/build.xml

Total time: 0 seconds


I am using NDK r15c (not the newest but ant was removed before)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 09/07/2018 10:27:31
Quote from: mim2011 on Mon 09/07/2018 10:18:53
I can access Preferences on the launcher, not in game
Yes, these ones. We'd need to try adding a new option there for the Back key to work like Menu.

Quote from: mim2011 on Mon 09/07/2018 10:18:53
I tried to build master before branching the 3.4.1
Yes, master is in wip state right now, better use stable release tag.

Quote from: mim2011 on Mon 09/07/2018 10:18:53/ags/Android/launcher_list/build.xml:90: Cannot find <HOME>/android/sdk/tools/ant/build.xml imported from <HOME>/ags/Android/launcher_list/build.xml

I am using NDK r15c (not the newest but ant was removed before)

Oh right, looks like I forgot to mention this in the Readme. You need to download older SDK, then copy ant to the tools folder:
https://stackoverflow.com/questions/42912824/the-ant-folder-is-suddenly-missing-from-android-sdk-did-google-remove-it
Title: Re: AGS engine Android port
Post by: mim2011 on Tue 10/07/2018 07:22:04
Quote from: Crimson Wizard on Mon 09/07/2018 10:27:31
Quote from: mim2011 on Mon 09/07/2018 10:18:53
I can access Preferences on the launcher, not in game
Yes, these ones. We'd need to try adding a new option there for the Back key to work like Menu.

Quote from: mim2011 on Mon 09/07/2018 10:18:53
I tried to build master before branching the 3.4.1
Yes, master is in wip state right now, better use stable release tag.

Quote from: mim2011 on Mon 09/07/2018 10:18:53/ags/Android/launcher_list/build.xml:90: Cannot find <HOME>/android/sdk/tools/ant/build.xml imported from <HOME>/ags/Android/launcher_list/build.xml

I am using NDK r15c (not the newest but ant was removed before)

Oh right, looks like I forgot to mention this in the Readme. You need to download older SDK, then copy ant to the tools folder:
https://stackoverflow.com/questions/42912824/the-ant-folder-is-suddenly-missing-from-android-sdk-did-google-remove-it

ok, after copying ant folder to <SDK>/tools I get othe errors
Code (ags) Select

[ launcher_list]$ ant debug
Buildfile: <HOME>/ags/Android/launcher_list/build.xml
  [taskdef] Could not load definitions from resource anttasks.properties. It could not be found.
  [taskdef] Could not load definitions from resource emma_ant.properties. It could not be found.

-set-mode-check:

-set-debug-files:

-check-env:

BUILD FAILED
<HOME>/android/sdk/tools/ant/build.xml:396: Problem: failed to create task or type checkenv
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.


Total time: 0 seconds


I will try later to look into the problem
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 10/07/2018 10:22:23
@mim2011, have you set up ANDROID_HOME enviroment variable before running ant?

This is from the README:
Quote
e.g. (assuming the SDK is installed in /opt)

$ export ANDROID_HOME=/opt/android-sdk-linux
(If your SDK is installed in different place, of course set your own path.)
Title: Re: AGS engine Android port
Post by: mim2011 on Thu 12/07/2018 16:10:19
Quote from: Crimson Wizard on Tue 10/07/2018 10:22:23
@mim2011, have you set up ANDROID_HOME enviroment variable before running ant?

This is from the README:
Quote
e.g. (assuming the SDK is installed in /opt)

$ export ANDROID_HOME=/opt/android-sdk-linux
(If your SDK is installed in different place, of course set your own path.)
hi,

yes I have defined ANDROID_HOME, it works with other projects.
I don't think that the hack with copying the ant folder into a newer ndk works.
I am able to build the external libraries and the ags libraries, but for the last step, the launcher, no chance
I even tried to convert it to a gradle project for Android Studio but still nothing...

Title: Re: AGS engine Android port
Post by: Crimson Wizard on Thu 12/07/2018 16:14:05
Quote from: mim2011 on Thu 12/07/2018 16:10:19
I don't think that the hack with copying the ant folder into a newer ndk works.

But this is what I and eri0o did. IIRC eri0o has installed modern Android Studio and built from there.
Could you tell what version of NDK are you using? I might try to retrace all the steps from pointer zero again.
Title: Re: AGS engine Android port
Post by: eri0o on Thu 12/07/2018 23:42:20
I am lost in this thread. @mim2011, what exactly you did ? Which Android Studio? Which operating system? Which java file in which repository are you proposing the change?

What is showInGameMenu ? I am unfamiliar with this function.

I used very recent Android Studio and at the time I tested this on Ubuntu 16.04. I think CW did it on Windows 10 (guessing). On Android Studio just install any required tools. I just looked and I have SDK Platforms for Android 4.1, 6.0, 7.0 installed. SDK Tools 26.1.1, NDK 16.1.4479499 .
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Fri 13/07/2018 00:04:35
Quote from: eri0o on Thu 12/07/2018 23:42:20Which java file in which repository are you proposing the change?

What is showInGameMenu ? I am unfamiliar with this function.

It's only few posts above.

The explanation of original problem:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636588597#msg636588597
The explanation of proposed changes:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636589972#msg636589972

But that problem is not related to problem of building launcher, which mim2011 currently has.

Quote from: eri0o on Thu 12/07/2018 23:42:20I think CW did it on Windows 10 (guessing).

I used Ubuntu.

Also, I'd wish we were discussing this on github issue tracker (https://github.com/adventuregamestudio/ags/issues) instead. This old thread should be locked, and new one created instead, with up-to-date information.
Title: Re: AGS engine Android port
Post by: eri0o on Fri 13/07/2018 02:38:56
created an issue on the github tracker (https://github.com/adventuregamestudio/ags/issues/474)

I wasn't making sense of anything since I didn't know either there was a menu or the possibility of showing the keyboard. On my phone pressing the home button just goes to my Android Home, and back exits, so both buttons do exit the game. I haven't played a game that requires the keyboard, so I didn't noticed it.

I still don't understand why @mim2011 wasn't able to build the port, but I can't created an environment to try to reproduce.

Edit: Also, there is one thing being mixed here! Building the libags*.so /libpe.so files and building the App. I never did this in one step. The NDK is for compiling the AGS libs and the Android Studio makes Android app that can use libs - like the AGS Android App. I see the Android port and the Android App as two different things, because the last is for playing games made for pc on Android and the first for making actual Android games from an AGS game.

What I mean is that this modification can reuse already built libs since it's only the app and this should be easier.
Title: Re: AGS engine Android port
Post by: mim2011 on Fri 13/07/2018 08:16:26
Quote from: eri0o on Fri 13/07/2018 02:38:56
created an issue on the github tracker (https://github.com/adventuregamestudio/ags/issues/474)

I wasn't making sense of anything since I didn't know either there was a menu or the possibility of showing the keyboard. On my phone pressing the home button just goes to my Android Home, and back exits, so both buttons do exit the game. I haven't played a game that requires the keyboard, so I didn't noticed it.

I still don't understand why @mim2011 wasn't able to build the port, but I can't created an environment to try to reproduce.

Edit: Also, there is one thing being mixed here! Building the libags*.so /libpe.so files and building the App. I never did this in one step. The NDK is for compiling the AGS libs and the Android Studio makes Android app that can use libs - like the AGS Android App. I see the Android port and the Android App as two different things, because the last is for playing games made for pc on Android and the first for making actual Android games from an AGS game.

What I mean is that this modification can reuse already built libs since it's only the app and this should be easier.

hi eri0o

as I already said, I am able to build the libraries (libags*.so /libpe.so) but not the App.
I tried to follow the Readme.me file:

Quote## Java app

There are two parts to the Java app, one is the engine library in <SOURCE>/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 <SOURCE>/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.

To build from the command line, you can use the tool 'ant'.

e.g. (assuming the SDK is installed in /opt)

    $ export ANDROID_HOME=/opt/android-sdk-linux
    $ cd <SOURCE>/Android/launcher_list
    $ ant debug
    $ ant release # for release build

but it did not helped :-) I tried only the command line path, maybe I should try to install Eclipse...
I use NDK r15c and last version from Android Studio. My OS is Fedora 28, 64 bits.
Title: Re: AGS engine Android port
Post by: eri0o on Tue 07/08/2018 20:09:31
Hey, are the Android libs here the latest ones? (Native engine libraries, for making your own signed APKs (http://www.adventuregamestudio.co.uk/releases/finals/AGS-3.4.1-P3/ags-3.4.1.14-android-libs.zip))

In android.cfg, after setting renderer = 1 under [graphics], do I need to do something else to use the hardware render? Does the Android version also requires the acsetup.cfg file?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 07/08/2018 21:10:40
Quote from: eri0o on Tue 07/08/2018 20:09:31
Hey, are the Android libs here the latest ones? (Native engine libraries, for making your own signed APKs (http://www.adventuregamestudio.co.uk/releases/finals/AGS-3.4.1-P3/ags-3.4.1.14-android-libs.zip))

They should be unless I messed something up (did only quick test).

Quote from: eri0o on Tue 07/08/2018 20:09:31
In android.cfg, after setting renderer = 1 under [graphics], do I need to do something else to use the hardware render? Does the Android version also requires the acsetup.cfg file?

Android port uses "android.cfg" to override acsetup.cfg, I think only few extra options are read from acsetup.cfg.
Title: Re: AGS engine Android port
Post by: eri0o on Tue 07/08/2018 21:52:51
Ah, ok. I seem to have the same error as Privateer Puddin' that I get black screen when using the hardware renderer, so I was wondering if the problem was in the config files.

here are both my working acsetup.cfg and android.cfg (using Software Renderer)
Spoiler

acsetup.cfg
Code (ags) Select

[sound]
digiid=-1
midiid=-1
digiwin=-1
midiwin=-1
digiindx=0
midiindx=0
digiwinindx=0
midiwinindx=0
[misc]
game_width=320
game_height=180
gamecolordepth=32
titletext=FutureFlashback Setup
antialias=0
notruecolor=0
cachemax=131072
user_data_dir=
shared_data_dir=
[graphics]
defaultdriver=D3D9
driver=OGL
windowed=0
screen_def=max
game_scale_fs=proportional
game_scale_win=max_round
filter=stdscale
vsync=1
render_at_screenres=0
[language]
translation=
[mouse]
auto_lock=0
speed=1


android.cfg
Code (ags) Select

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



[close]
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 07/08/2018 21:57:54
Quote from: eri0o on Tue 07/08/2018 21:52:51
Ah, ok. I seem to have the same error as Privateer Puddin' that I get black screen when using the hardware renderer, so I was wondering if the problem was in the config files.

Something has to be done with this, hardware renderer seemed to work correctly with 3.4.0 APK. Both "software" and "hardware" ones use OpenGL in the end. In the first case it is initialized by Allegro's android code and only final game image is converted onto texture, in the second case OpenGL is created by the code inside AGS and every object sprite is converted to separate texture. The issue's reason should be in some of these differences.

Unfortunately I have only Android emulator, and it works well with all renderers and settings.
Title: Re: AGS engine Android port
Post by: eri0o on Tue 07/08/2018 22:18:41
I don't know if this helps, but I caught this right before the black screen:

08-07 18:03:29.732 24951-25105/com.mythsuntold.futureflashback I/Adreno: ERROR: Invalid #version
08-07 18:03:29.733 24951-25105/com.mythsuntold.futureflashback I/Adreno: ERROR: Invalid #version

Spoiler

(i this related to this comment on Engine/gfx/ali3dogl.cpp (https://github.com/adventuregamestudio/ags/blob/release-3.4.1/Engine/gfx/ali3dogl.cpp) ?)
Code (ags) Select

...
void OGLGraphicsDriver::FirstTimeInit()
{
  // It was told that GL_VERSION is supposed to begin with digits and may have
  // custom string after, but mobile version of OpenGL seem to have different
  // version string format.
  String ogl_v_str = (const char*)glGetString(GL_VERSION);
  String digits = "1234567890";
...
[close]
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 07/08/2018 22:24:42
I think that's rather shader compilation failing (https://github.com/adventuregamestudio/ags/blob/master/Engine/gfx/ali3dogl.cpp#L652), because apparently tinting/lighting shaders are written in non-compatible syntax.

May you try to disable shader compilation and see if renderer works then? I thought it will simply skip shader if it failed to compile, but maybe there are more serious consequences.

Regarding shaders, I am not sure what is best way to deal with them: either have them precompiled or have separate scripts for mobile.
Title: Re: AGS engine Android port
Post by: eri0o on Tue 07/08/2018 23:00:22
Ok, I assume I have to comment/remove things and rebuild the libs for this test correct? I pointed the release 3.4.1 branch and you pointed the master branch. Which has the correct Android port to run a game built with the latest release of the editor? (AGS 3.4.1.14)

Also, a guess... Should the string version be #version 130 es\n\ instead of #version 130\n\  for EGL on Android?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 07/08/2018 23:06:49
Quote from: eri0o on Tue 07/08/2018 23:00:22
Ok, I assume I have to comment/remove things and rebuild the libs for this test correct? I pointed the release 3.4.1 branch and you pointed the master branch. Which has the correct Android port to run a game built with the latest release of the editor? (AGS 3.4.1.14)

Correct is at the release-3.4.1.

Quote from: eri0o on Tue 07/08/2018 23:00:22
Also, a guess... Should the string version be #version 130 es\n\ instead of #version 130\n\  for EGL on Android?

When I was testing, it did not like "version" keyword.
Title: Re: AGS engine Android port
Post by: eri0o on Wed 08/08/2018 00:45:37
I commented both // CreateShaderProgram(, and I have no more #version errors. But I still have a black screen. Unfortunately no more errors on console... :-\

Title: Re: AGS engine Android port
Post by: ET3D on Sun 02/09/2018 13:33:49
Quote from: eri0o on Tue 07/08/2018 23:00:22Also, a guess... Should the string version be #version 130 es\n\ instead of #version 130\n\  for EGL on Android?

Should be '#version 100 es' for OpenGL ES 2.0 (and '#version 300 es' for 3.0, '#version 310 es' for 3.1, but I'm guessing we want 2.0 here).
Title: Re: AGS engine Android port
Post by: The creature on Wed 31/10/2018 10:02:44
I have managed to get my little game working on android, but I have a few questions. Is there a way to set the scaling method to nearest neighbour and perhaps any of the other options: like fullscreen scale and window scale that can be found in winsetup? I've had a look through the ags library files in the Android SDK for any clues but haven't found any.

Any help would be amazing.
C
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 31/10/2018 10:40:29
Quote from: The creature on Wed 31/10/2018 10:02:44
I have managed to get my little game working on android, but I have a few questions. Is there a way to set the scaling method to nearest neighbour and perhaps any of the other options: like fullscreen scale and window scale that can be found in winsetup? I've had a look through the ags library files in the Android SDK for any clues but haven't found any.

There should be scaling options in the app preferences menu, under the "Graphics" section, they are slightly different from winsetup. They include - renderer type, scaling method, linear interpolation checkbox, and some others.
Title: Re: AGS engine Android port
Post by: The creature on Wed 31/10/2018 11:01:49
Ahh thats great, can you remember where abouts I can find the app preferences menu? This all sounds exactly like what I need.

Kind Regards
C
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 31/10/2018 11:11:59
Quote from: The creature on Wed 31/10/2018 11:01:49
Ahh thats great, can you remember where abouts I can find the app preferences menu? This all sounds exactly like what I need.

Well, I only have an Android emulator, not the actual device, and on this emulator when I run AGS launcher there is a "3-dots" button on the top-right, which I click and bring the preferences on screen. But thinking about it, if you've made a sole game APK it probably won't have such thing? I do not know how people were solving this issue before. Cannot think of any proper way except for integrating related parts of launcher code in the game's java side somehow.
Other than that, you could also modify android.cfg if you are able to edit files on your Android.
Title: Re: AGS engine Android port
Post by: The creature on Wed 31/10/2018 11:35:37
Ahh yeah, I did think that would be the case if you were running it through the Android emulator. This is, indeed a stand alone, sole APK. I just thought there might have been an xml somewhere in the Android SDK project that contained the display prefs.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 31/10/2018 11:41:45
Quote from: The creature on Wed 31/10/2018 11:35:37
I just thought there might have been an xml somewhere in the Android SDK project that contained the display prefs.

Hmm, no, there is only the external "android.cfg" file that should be read by the engine APK. It is supposed to be simply INI format. Its contents are not documented, but may be learnt from this code:
https://github.com/adventuregamestudio/ags/blob/ags3/Engine/platform/android/acpland.cpp#L609

PS. Maybe this is worth creating a suggestion in the github tracker. Also that would be interesting to know how other people who ported their games to Android were solving this.
Title: Re: AGS engine Android port
Post by: The creature on Wed 31/10/2018 12:26:46
Ahh thanks for your patience and help. I searched my phone for the android.cfg but failed. Besides, it's something that would have to get included with the apk for distribution, so when the obb is embedded and the apk is created. I'll need to have a play around once I'm at my other computer and see what I can find :/

Kind Regards.
C
Title: Re: AGS engine Android port
Post by: The creature on Mon 05/11/2018 10:55:34
Hi, just a quick question. I've ran my ags game using the emulator, just to see the kind of effects it has in the preferences for scaling and sampling (out of curiosity). It looks great with the Linear Filtering off and the Screen scaling set to Fullscreen(ignore AR). After I ran the game through the emulator it did create an Android.cfg file with the various options set.

I'm curious (I cant do it here as I'm at work) but if I included the android.cfg file with my ags files inside an the .obb when making my standalone apk would it then use the android.cfg file as it's default preferences?

C
Title: Re: AGS engine Android port
Post by: eri0o on Mon 05/11/2018 19:17:32
Yes, I think you need to create a folder with your game name and place the android.cfg there but I am not sure.
Title: Re: AGS engine Android port
Post by: The creature on Mon 05/11/2018 19:52:15
Thanks for the response Enrico.

Sadly placing the android.cfg in a folder alongside the the main .ags and .vox files didn't make any difference. :( I also tried creating a folder of the game title and dumped everything in that but when I tried to run the app it gave me an error saying it had failed to locate the game files.

I was hoping for an easy result haha.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 05/11/2018 20:14:28
As far as I know the android.cfg should be placed in the root AGS folder (e.g. sdcard/ags), at least this is where the AGS Launcher reads and writes it.
I am currently having doubts how to predict where the standalone APK will look for it, I've never tested one.

EDIT: Also, actually engine should read generic acsetup.cfg file too, which contents are composed according to this specification: link (https://github.com/adventuregamestudio/ags/blob/ags3/OPTIONS.md#configuration-file-options).
Again, I am not sure where the file should be placed relative to standalone APK. When run from the Launcher, engine finds them in particular game's folder (where all the game data is).

Quote from: The creature on Mon 05/11/2018 19:52:15
I was hoping for an easy result haha.

This MUST be easy. The fact that it's not is a terrible shame, because the port is existing for years, and we still do not have a clear specification of how it works.
Title: Re: AGS engine Android port
Post by: The creature on Mon 05/11/2018 21:35:43
I totally understand, and I understand the frustration with trying to help. It really is just an issue with making standalone APK files. But I'll try the acsetup.cfg and see if that makes any difference.

Obb creator batch file. (https://drive.google.com/open?id=1zQkwIqlfi3X4Q4qAK3OHqxGSwwy5J0rI)

Here is my simple tool for making obb files. Just a batch file that uses the AndroidSDK jobb tool. It works pretty well. If you create a directory in C:\ called obb then place any files you wish to zip and run the batch. The batch file assumes that the AndroidSDK is installed in it's default location: C:\Users\Dave\AppData\Local\Android\Sdk\tools\bin\jobb

I'll let you know if I have any luck with this anyway.

======
Just gave the acsetup.cfg a go and it was ignored.


Cheers.
C
Title: Re: AGS engine Android port
Post by: eri0o on Tue 06/11/2018 01:53:02
On your game General Settings, there is a config called "Save games folder name", and I suppose you have a folder name set there. In your obb root, create a folder with that same name - something like my_game_name . Now throw your acsetup.cfg and android.cfg in there.

(I may be wrong, but I see I have this very suspect folder inside my obb target directory :P )
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 06/11/2018 09:20:22
I will find time during this week to test this out, because it is not normal and we need to write a very clear guidelines.
Title: Re: AGS engine Android port
Post by: The creature on Tue 06/11/2018 13:59:42
That would be amazing, I've followed Enrico's instructions but it still displays the game at it's default.

In my obb root it has this structure:

<Root dir>
    game.ags
    audio.vox
        ¬   
        <Game> (which is the same folder name as what's in my 'General Settings' for save folders.
            acsetup.cfg (which has my desired display settings, made from winsetup)
            android.cfg (which has prefs set when I ran the game through the emulator, with prefered settings.)

I run my batch which packs everything in an obb folder into a .OBB. I upload it to my internal test branch in the Google Play Console - adding in a build comment so I know it's the right version I'm testing. I then download the app from the unreleased app page and it's still using default settings. I cant wait to see your results Crimson and if you find anything different.

Maybe I didn't quite understand you Enrico and my file structure is wrong in the root.

Kind Regards
C
Title: Re: AGS engine Android port
Post by: eri0o on Wed 07/11/2018 22:44:21
Well on a closer look I apparently just stopped once things worked correctly ¯\_(ãÆ'„)_/¯

Code (ags) Select

~/git/futureflashback/Compiled/obb$ pwd
/home/e/git/futureflashback/Compiled/obb
e@e-host:~/git/futureflashback/Compiled/obb$ tree
.
â”Å"â”â,¬Ã¢â€â,¬ acsetup.cfg
â”Å"â”â,¬Ã¢â€â,¬ android.cfg
â”Å"â”â,¬Ã¢â€â,¬ FutureFlashback
│   â”Å"â”â,¬Ã¢â€â,¬ acsetup.cfg
│   â””â”â,¬Ã¢â€â,¬ android.cfg
â””â”â,¬Ã¢â€â,¬ futureflashback.exe

1 directory, 5 files
Title: Re: AGS engine Android port
Post by: The creature on Thu 08/11/2018 19:03:46
Thanks for the reply Enrico.

Sadly its not working for me, I've now tried so may different combinations of cfg files in directories, out of directories, cfg files everywhere! Nothing.

This is my acsetup cfg
Code (ags) Select
[sound]
digiid=-1
midiid=-1
digiwin=-1
midiwin=-1
digiindx=0
midiindx=0
digiwinindx=0
midiwinindx=0
[misc]
game_width=320
game_height=240
gamecolordepth=16
antialias=0
notruecolor=0
cachemax=131072
user_data_dir=
shared_data_dir=
titletext=Agony Setup
[graphics]
driver=D3D9
windowed=0
screen_def=max
game_scale_fs=proportional
game_scale_win=max_round
filter=stdscale
vsync=0
render_at_screenres=0
[language]
translation=
[mouse]
auto_lock=0
speed=1


This is my android cfg
Code (ags) Select
[misc]
config_enabled = 0
rotation = 2
translation = default
[controls]
mouse_method = 0
mouse_longclick = 1
[compatibility]
clear_cache_on_room_change = 0
[sound]
samplerate = 44100
enabled = 1
threaded = 1
cache_size = 10
[midi]
enabled = 0
preload_patches = 0
[video]
framedrop = 0
[graphics]
renderer = 0
smoothing = 0
scaling = 2
super_sampling = 1
smooth_sprites = 1
[debug]
show_fps = 0
logging = 0


I'll have to wait and see what Crimson finds, hopefully a solution to my problem :( This is pretty silly, but I appreciate your help!

Kind regards
C
Title: Re: AGS engine Android port
Post by: eri0o on Fri 09/11/2018 16:05:47
Out of curiosity, what does "config_enabled = 0", in your android.cfg, means?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Fri 09/11/2018 16:54:01
Quote from: eri0o on Fri 09/11/2018 16:05:47
Out of curiosity, what does "config_enabled = 0", in your android.cfg, means?

Hm. It means that the contents of the config will be ignored, except for translation. I have no idea why such option is there. The Android library code may hold an answer.
Title: Re: AGS engine Android port
Post by: The creature on Fri 09/11/2018 18:51:10
That's pretty incredible, setting that flag to 1 fixed the issue! I'd have never seen that I'd it hadn't been pointed out. Thankyou all so, so much!!

It's looking incredible now 😊
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Fri 09/11/2018 19:30:59
@The creature, could you experiment a little more and find out which location exactly does it read the config from?

Now what remains is to find out why do we need this flag at all, and how it is normally set/removed...
Title: Re: AGS engine Android port
Post by: The creature on Fri 09/11/2018 20:59:07
Sure, I'll do some more tests and see where the config files need to exactly be.

Cheers.
Title: Re: AGS engine Android port
Post by: The creature on Fri 09/11/2018 21:43:34
OK.

In my obb root I just have:
GAME.EXE
acsetup.cfg
android.cfg

With the config_enabled set to '1' it seems to use the settings defined by me. So I have no other directories in my obb. This couldn't have been possible without any of your help and especially your patience - especially Enrico and his original 'Let's Build an android release' post. This was amazing. I found I did have to rebuild the ags libs as there seemed to be an issue with them, but once that was done things started working fine. For those looking at doing this, you will need to sign up over on the google play console and pay the fee to set up a new app pretty early on.

I dont think you can get very far without having an RSA_public_key. This is a "license key" which can be found in the google Play Console under Development tools -> Services & API, a Base64-encoded RSA public key that you must copy and paste into the RSA public key in 'private.xml'

But it all seems to be working. Good timing really as I'm flying away next week to a funeral :(

I've never released anything to mobile, so it will be an interesting test for sure. Thank you again, if you need any more help though, I'll see what I can do.
C
Title: Re: AGS engine Android port
Post by: arabow on Wed 12/12/2018 03:21:58
Has anyone figured out a way to open a keyboard on Amazon Fire HD 10 (or any Android device for that matter)? It is impossible to play Sierra style adventure games without being able to use the save function. Why is it not possible to put a small button on the upper left corner of the screen (as in ScummVM) that when pressed opens a keyboard? :undecided:                
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 12/12/2018 09:47:31
There is no one around who would know how to program for Android and be willing to help.

Right now I am very busy with something, after that is complete I will buy a real Android device because emulator works a little different, and see if I am able to fix anything here.
Title: Re: AGS engine Android port
Post by: JanetC on Thu 13/12/2018 20:15:23
Is the AGS Android port used in any commercial games?
Title: Re: AGS engine Android port
Post by: Mehrdad on Fri 14/12/2018 05:30:22
Kathy Rain
https://play.google.com/store/apps/details?id=com.rawfury.kathy&hl=en (https://play.google.com/store/apps/details?id=com.rawfury.kathy&hl=en)

Title: Re: AGS engine Android port
Post by: arabow on Sat 15/12/2018 23:26:35
If anyone's interested, I've found a workaround. Install an app called "Hacker's Keyboard" and pin it to the notification area (from the app settings). Then just swipe down the notification area and open the keyboard whenever you need it.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Sat 26/01/2019 20:54:13
I finally was able to actually look and test buttons on real Android device (yep, I now have one...).

Here's an APK built for AGS 3.5.0 with the change to device buttons as suggested by user:
https://www.dropbox.com/s/hq3a5ibzhos4x48/AGS-3.5.0-menu-on-backbtn.apk?dl=0

Here long press on "Back" button no longer displays exit confirmation, but instead displays in-game menu, which also has an option to display on-screen keyboard.

Since I now have real device it became more obvious to me why all this was necessary, and which problems Android users face. It's really a shame and pity that this issue was not addressed earlier.

The change will probably be included into upcoming version, as well as one extra 3.4.1 patch I was preparing.
Title: Re: AGS engine Android port
Post by: Mehrdad on Sun 27/01/2019 05:22:38
Great!!. Nice job CW!
I wish you can or others integrate Android port to AGS. It's the only reason that I don't make a game with AGS till now. In our country, (Iran) we haven't a desktop ports market. Only mobile.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Sun 27/01/2019 19:55:53
Updated APK with different way to handle longclicks on "Back" and "Menu" buttons (the old way was not compatible with some newer devices it seems):
https://www.dropbox.com/s/rq5ys1iqg9m1dt5/AGS-3.5.0-buttonstest7.apk?dl=0

Quote from: Mehrdad on Sun 27/01/2019 05:22:38
I wish you can or others integrate Android port to AGS.

Sorry, I wish I could, but I cannot give any promises now. Definitely I won't be able to do that before final AGS 3.5.0 version is out because all my free time is taken.

UPDATE
By the way, here's an example that AGS game can make it to Google Play for Android (made by eri0o): 
https://play.google.com/store/apps/details?id=com.vacaroxa.hellspuppy

Like said before, it's all possible, just may require some manual work with Android Studio.
Title: Re: AGS engine Android port
Post by: Mehrdad on Mon 28/01/2019 12:48:04
Quote from: Crimson Wizard on Sun 27/01/2019 19:55:53

Sorry, I wish I could, but I cannot give any promises now. Definitely I won't be able to do that before final AGS 3.5.0 version is out because all my free time is taken.


OK. So there are some hopes for strat Android port after the stable version of AGS 3.5.0


Quote from: Crimson Wizard on Sun 27/01/2019 19:55:53
UPDATE
By the way, here's an example that AGS game can make it to Google Play for Android (made by eri0o): 
https://play.google.com/store/apps/details?id=com.vacaroxa.hellspuppy

Like said before, it's all possible, just may require some manual work with Android Studio.

Cool game!. Actually I'll contact with EriOo about it
Title: Re: AGS engine Android port
Post by: eri0o on Thu 31/01/2019 00:12:32
@Mehrdad I added the Android Studio Project here (https://github.com/ericoporto/vacaroxa_hellspuppy)!
Title: Re: AGS engine Android port
Post by: Mehrdad on Thu 31/01/2019 05:55:16
Quote from: eri0o on Thu 31/01/2019 00:12:32
@Mehrdad I added the Android Studio Project here (https://github.com/ericoporto/vacaroxa_hellspuppy)!

Awesome!!. Thanks a lot, @eriOo. Your guides are great and amazing. Please let me try and there was any question let you know.
Title: Re: AGS engine Android port
Post by: Mehrdad on Sun 03/02/2019 05:38:25
@eriOo
Great!!!!. It works perfectly for me. Thanks a lot. I made an apk for "Black morph" game.
(http://uupload.ir/files/9ir_agss_thumb.jpg) (http://uupload.ir/view/9ir_agss.jpg)
The image is fictitious

I'm waiting for your video tutorials. I hope for fix sound noise too.
Title: Re: AGS engine Android port
Post by: Mike2000 on Thu 28/02/2019 14:56:59
Hi, I'm new to these forums, and I'm not sure if this is the right spot to post this, but I'm having a technical difficulty on AGS for Android on both my Android Phone and my Kindle Fire Tablet. Basically, when I attempt to run any AGS game from my SD Card, I get the following message:

QuoteError

Unable to write in the savegame directory
Make sure you have write permissions, and also check the disk's free space.

I checked the app's permissions in app settings, and AGS is approved for everything it asks for. Also, there are gigabytes of extra space on my SD cards, so I don't think that the error message is being very helpful. The games still work when loaded from internal memory, but I'm running low on internal storage so it would be useful to load games from my SD card. Is there anything I can or should do?
Title: Re: AGS engine Android port
Post by: eri0o on Sun 03/03/2019 17:41:37
Out of curiosity, from where did you install an AGS app?
Title: Re: AGS engine Android port
Post by: Mike2000 on Mon 04/03/2019 03:14:21
I installed it from this thread: https://www.adventuregamestudio.co.uk/forums/index.php?topic=56887.0 (https://www.adventuregamestudio.co.uk/forums/index.php?topic=56887.0)

I'm guessing that's the most up to date version of the app?
Title: Re: AGS engine Android port
Post by: flamming_python on Sun 31/03/2019 22:09:14
Hi everyone  :)

Does the Android AGS port have support for intents? So that you can launch games running on it from a frontend such as Hyperspin?

If not then are there any plans to add such?
I know a lot of people would appreciate such a functionality.
Title: Re: AGS engine Android port
Post by: vrokolos on Tue 16/04/2019 08:43:31
Unavowed doesn't work for me. Tried both steam and gog versions. It stops at startup with a message about achievements. Is there a workaround to this? Using latest 3.4 version
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 16/04/2019 11:49:11
Quote from: vrokolos on Tue 16/04/2019 08:43:31
Unavowed doesn't work for me. Tried both steam and gog versions. It stops at startup with a message about achievements. Is there a workaround to this? Using latest 3.4 version

Please, in cases like this include actual error message. But I will make a guess it is "script link error" because Android port does not include steam/gog plugin.

If that's the case, then perhaps first solution is to build and include steam/gog stub plugin into APK along with others.
In the past Monkey0506 also suggested embedding plugin placeholders for steam/gog client into the engine, but I did not realize why it may be necessary at first.

These are two ways, I believe either may be tried. I'd try building separate plugin stub and including into APK first, because that does involve modifying engine code. If that won't work for some reason, then try another one.

PS. That said, I have to make a formal warning that running the game on its own does not guarantee it will be playable on touch-screen device. If it's not then probably waiting for Wadjet Eye to produce a mobile version of their game would be better (idk if they are planning).

PPS. We are currently trying to work this problem out.
Title: Re: AGS engine Android port
Post by: vrokolos on Tue 16/04/2019 20:37:39
Quote from: Crimson Wizard on Tue 16/04/2019 11:49:11
PPS. We are currently trying to work this problem out.

Awesome!!!

Another feature request.  Kathy rain on play store has a function that shows all available interactive hotspots on the scene when you longtouch which is very handy on android. Can we have something like this in the options for every game?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 16/04/2019 22:10:03
Quote from: vrokolos on Tue 16/04/2019 20:37:39
Another feature request.  Kathy rain on play store has a function that shows all available interactive hotspots on the scene when you longtouch which is very handy on android. Can we have something like this in the options for every game?

I believe that may be theoretically possible to do, but this is something that has to be devised and coded from scratch. In existing games this is done with scripting, which we cannot replicate in the engine as-is.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Fri 28/06/2019 12:16:24
Quote from: Crimson Wizard on Tue 16/04/2019 11:49:11
Quote from: vrokolos on Tue 16/04/2019 08:43:31
Unavowed doesn't work for me. Tried both steam and gog versions. It stops at startup with a message about achievements. Is there a workaround to this? Using latest 3.4 version

Please, in cases like this include actual error message. But I will make a guess it is "script link error" because Android port does not include steam/gog plugin.

If that's the case, then perhaps first solution is to build and include steam/gog stub plugin into APK along with others.
In the past Monkey0506 also suggested embedding plugin placeholders for steam/gog client into the engine, but I did not realize why it may be necessary at first.

These are two ways, I believe either may be tried. I'd try building separate plugin stub and including into APK first, because that does involve modifying engine code. If that won't work for some reason, then try another one.

PS. That said, I have to make a formal warning that running the game on its own does not guarantee it will be playable on touch-screen device. If it's not then probably waiting for Wadjet Eye to produce a mobile version of their game would be better (idk if they are planning).

PPS. We are currently trying to work this problem out.

Hi!

How is 'working that out' going along?
Which one is the newest version for android?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Fri 28/06/2019 15:12:08
Quote from: Jinx1337 on Fri 28/06/2019 12:16:24
How is 'working that out' going along?
Which one is the newest version for android?

It's done in code, but I forgot to upload new APK.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Tue 02/07/2019 23:26:05
Quote from: Crimson Wizard on Fri 28/06/2019 15:12:08
Quote from: Jinx1337 on Fri 28/06/2019 12:16:24
How is 'working that out' going along?
Which one is the newest version for android?

It's done in code, but I forgot to upload new APK.

Can I kindly ask you to upload it? :)
There's plenty more games we could take on the run, but are unable to run because of this bug (Unovowed, last version of Heroine's Quest, Mage's Initiation).
Title: Re: AGS engine Android port
Post by: Jinx1337 on Wed 03/07/2019 00:27:41
Also - anyone got problems with TECHNOBABYLON randomly crashing? :(

I am using the GOG version on a SNAPDRAGON 855 device (Samsung S10+) so should be more than enough.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 03/07/2019 21:37:14
Here: https://www.dropbox.com/s/pem2q8fdyojks4h/ags-3.4.4.apk?dl=0


But I haven't tested myself yet.

There will be a 3.4.4 update, primarily for non-Windows (linux & android ports).

I am hoping for automatic building in the future so that I don't have to do this by hand every time.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Thu 04/07/2019 05:56:57
Thank you!

All the games start now!
That said, I am having some issues with some of them.

1) As mentioned previously in this thread, only software mode actually renders any graphics. Hardware mode equals a black screen.
2) Technobabylon / Unawoved randomly crashing without an error. Seems completely random too (some sort of cache/buffer overflow?). Other than that, they're running perfectly without any hitches. What might be the issue?
3) Would it be possible to add a RELATIVE MOUSE sensitivity setting? I only play games with relative mouse, to the point of actually choosing running games through AGS rather than their native android ports (I hate point and click on a the phone).

Thanks for your great work.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Thu 04/07/2019 09:06:17
Small update:

tried messing with cache settings, disabled multithreading, checked the empty cache on room change in ini - same thing. Completely random app exits. Sometimes it works for 25 min, other times it quits in 5.

Tried Quest for Glory 2 VGA - doesnt have this issue and is completely playable using Hackers Keyboard set to transparent and with FN pressed for NUMPAD (tho the keys are mismatched - you need to map them to numerics manually in the game options).
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Thu 04/07/2019 13:37:41
We have an issue tracker here: https://github.com/adventuregamestudio/ags/issues

Please post your problems there, because in this thread they will likely be missed and forgotten. Also there's no active Android port maintainer at the moment, so it may take time before these will be actually adressed.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Thu 04/07/2019 17:09:48
Done (I can't however add proper labels?).

It's sad that there's no active maintainer :(
I have been using AGS since the PSP port... would love to see it get some Android love.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Wed 10/07/2019 02:09:21
CrimsonWizard - I have been testing various AGS games on ANDROID now, and I have a little request (it that ain't too much to ask for).

Could you be so kind and compile the last version of AGS known for having HARDWARE mode working, with the steam/gog achievments stubb plugin fix that youv'e made for the recent version?

I want to see if the crashes are somehow tied to SOFTWARE mode, since I am also getting them with other games (such as the KQ remakes), also completely random.
I do not think I am observing these with the previous version, but I need the achievment fix to see some more demanding games (Unawoved etc.).
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 10/07/2019 15:02:58
Quote from: Jinx1337 on Wed 10/07/2019 02:09:21
Could you be so kind and compile the last version of AGS known for having HARDWARE mode working, with the steam/gog achievments stubb plugin fix that youv'e made for the recent version?

This is an APK for latest 3.5.0 beta: https://www.dropbox.com/s/t5qcscn803j5kyk/AGS-3.5.0.14.apk?dl=0

It probably has same issues with hardware mode though: works on some devices and does not work on others.
Title: Re: AGS engine Android port
Post by: cat on Wed 07/08/2019 19:34:15
I want to make a game and run it on a tablet or phone as well as PC. I don't need to bundle it for play store, just launch AGS on the phone and then select the game there.
Which version of AGS and the Android engine should I use? i.e., which is currently the best/most stable combination?
Should I go with 3.5.0.14 for both?

And what is the recommended resolution for a mobile device?
Title: Re: AGS engine Android port
Post by: eri0o on Wed 07/08/2019 22:55:14
Are you doing this for a museum or interactive exposition?

For non Google Play Android, the latest is fine. For now, it's best to disable threaded audio.

Resolution depends of style. Do you mean aspect ratio?
Title: Re: AGS engine Android port
Post by: cat on Thu 08/08/2019 08:10:01
I'm doing this for my toddler ;)

The game is probably going to be high-res, so yes, what aspect ratio is recommended for phones?

And where do I get the latest AGS apk? Is it the one CW linked a few posts above?
Title: Re: AGS engine Android port
Post by: eri0o on Sat 10/08/2019 04:34:48
Hey cat! That's cool! If you want to try with the apk, you just get it on your phone and place the game there. Probably what CW linked there works fine.

For your case I think you should go with the phone you have. I have dipped my toes in two vertical games and made them 180x320. They are linked in my signature.

Some recent phones are coming with even more elongated screens - my phone 18.5:9. But I still think 16:9 is fine.

If you want to build your own .apk, I have released every Android Studio project I used on GitHub. I couldn't figure out how to write well the README though, so everyone who tried did hit a rock at some point and messaged me, so any hit just write me up or hit an issue button on GitHub.
Title: Re: AGS engine Android port
Post by: cat on Sat 10/08/2019 09:05:46
Quote from: Crimson Wizard on Wed 10/07/2019 15:02:58
This is an APK for latest 3.5.0 beta: https://www.dropbox.com/s/t5qcscn803j5kyk/AGS-3.5.0.14.apk?dl=0

It probably has same issues with hardware mode though: works on some devices and does not work on others.
I downloaded the package and installed it on my phone. I was able to start it and play a 3.5.0.14 built game, but weirdly, the app does not show up in my app-list (the one you get when swiping up on home screen, yalp store shows it, I don't have or use the Google store). Is there a setting or something to make an app show there?


@eri0o: My partner suggested to use 1280x720 because this will work on most phones (going for hi-res). I'll use that for now.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Thu 12/09/2019 22:59:44
AGs for Android still crashing... :(
Was there any new SVN version I might check and see whether these issues have been improved? :(
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Thu 12/09/2019 23:13:31
Quote from: Jinx1337 on Thu 12/09/2019 22:59:44
Was there any new SVN version I might check and see whether these issues have been improved? :(

Not sure what you refer to as "svn version", but there were no updates specific to Android code recently.

We do not have any developer who would know how to work with android well enough afaik.
Personally I am currently focused on releasing AGS 3.5.0 generally on Windows/Linux.

As soon as I get a spare time I may build a new APK, but cannot say if it's going to be any better.
Title: Re: AGS engine Android port
Post by: HappyCat on Sat 26/10/2019 11:06:25
"- Plugin support including AGSBlend and open-source recreations of the Snow/Rain and Flashlight plugin"
How do I use specific plugins with Android port? Should I plut them into specific directory?
Title: Re: AGS engine Android port
Post by: eri0o on Sat 26/10/2019 11:24:14
Plugins are built with native code, the supported ones are already placed along with the AGS Engine in the Android port.
Title: Re: AGS engine Android port
Post by: HappyCat on Sat 02/11/2019 12:32:34
Thanks. Am I correct that in order to make stub for Steam or AGS2Client I would have to make it manually in Android branch? That would help me with some commercial releases, let's see if I can find some time for it on holiday season.
Title: Re: AGS engine Android port
Post by: eri0o on Sat 02/11/2019 14:13:46
If you manage to build ags for Android native libraries you can check how it builds the plug-ins currently. There's a new Android project in the works that will enable doing it directly from Android Studio (cmake + gradle), but I can't say when it will be ready.

Alternatively you can ask the guys from Clifftop Games since they have a working jni plug-in for actual achievements under Google Play - I have never seen the code though, only played their games from Google Play.
Title: Re: AGS engine Android port
Post by: HappyCat on Wed 06/11/2019 11:59:09
Thanks for the tips. Seems like a lot to dig through.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Tue 18/08/2020 20:45:19
Has there been any new development or build for android in the recent year?

It is such a shame that the version currently available is perfect, aside from random crashing...
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 18/08/2020 21:49:54
Quote from: Jinx1337 on Tue 18/08/2020 20:45:19
Has there been any new development or build for android in the recent year?

Android build is present in all the recent releases, e.g. here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=58350.0
also available at our github releases: https://github.com/adventuregamestudio/ags/releases/tag/v.3.5.0.26

There's unsigned Launcher APK for running any games, and libraries for building your own game APK.

Quote from: Jinx1337 on Tue 18/08/2020 20:45:19
It is such a shame that the version currently available is perfect, aside from random crashing...

There were reports about crashes in the past, but not enough information to do diagnose the problem, and we do not have a dedicated developer who would know how to get such information.
Title: Re: AGS engine Android port
Post by: Olleh19 on Mon 05/10/2020 16:22:54
Dumb question, do you need a SD card, or can you reset the directory? i have tried, but i've failed "main storage" "internal storage" etc, hope you understand my question.
I have a samsung galaxy s7 if anybody knows the correct path /if it works, then please let me know.

I could save a couple of bucks not buying a SD card then! (laugh)
Title: Re: AGS engine Android port
Post by: eri0o on Wed 07/10/2020 03:33:12
I think Android uses the word SDCARD to define it's internal memory that you have write access

1. If you are using the Launcher that is released along with ags, the folder it looks into is configurable in it. You should access the menu on top right (three vertical dots), then click in Select Game Folder and type the folder. The address you need to type here is unfortunately manufactures dependent, so I will show what's the folder I configured in my phone.

Spoiler
(https://i.imgur.com/EYmw4pK.jpg)
[close]

2. A modal dialog should pop up and you can type the folder name. Mine is /storage/emulated/0/ags .

Spoiler
(https://i.imgur.com/hsnErbC.jpg)
[close]

3. Make sure this folder does exist in your phone, use your favorite file explorer (I am using the default one from Samsung).

In my phone, using the file explorer, the same folder is named differently, Internal Storage > ags

Spoiler
(https://i.imgur.com/NVRm11T.jpg)
[close]

4. In this folder, you just create one folder for each game with their .exe or .ags games and all their needed .vox or other files in this same directory.

Spoiler
(https://i.imgur.com/1SlvQ1d.jpg)
[close]
Title: Re: AGS engine Android port
Post by: Olleh19 on Wed 07/10/2020 16:54:50
Quote from: eri0o on Wed 07/10/2020 03:33:12
I think Android uses the word SDCARD to define it's internal memory that you have write access

1. If you are using the Launcher that is released along with ags, the folder it looks into is configurable in it. You should access the menu on top right (three vertical dots), then click in Select Game Folder and type the folder. The address you need to type here is unfortunately manufactures dependent, so I will show what's the folder I configured in my phone.

Spoiler
(https://i.imgur.com/EYmw4pK.jpg)
[close]

2. A modal dialog should pop up and you can type the folder name. Mine is /storage/emulated/0/ags .

Spoiler
(https://i.imgur.com/hsnErbC.jpg)
[close]

3. Make sure this folder does exist in your phone, use your favorite file explorer (I am using the default one from Samsung).

In my phone, using the file explorer, the same folder is named differently, Internal Storage > ags

Spoiler
(https://i.imgur.com/NVRm11T.jpg)
[close]

4. In this folder, you just create one folder for each game with their .exe or .ags games and all their needed .vox or other files in this same directory.

Spoiler
(https://i.imgur.com/1SlvQ1d.jpg)
[close]


Unfortunaly this is not enough Eri0o. Now i get a "Unable to find game data". At least i'm one step closer! I've renamed the exe, is it still the way to go or should the game exe work just fine as it is?
Like the internet joke goes "instructions unclear" and then some silly line  (laugh)

Files look like this in my game folder in the ags folder.

Ags/max/

ac2game.dat, OR max.exe (neither have worked, so far).

acsetup.cfg           (tried deleting it, didn't change a thing),

audio.vox,


winsetup.exe

Swedish.tra

Edit: Turns out i've managed to change from Internal Storage to SDCard now, but still no success. The games show up, but data error. Same outcome.

Edit2: Shit, i just realised i'm transfering the files via windows/usb cable maybe that fucks it up. I have to try dropbox or online service. !

Edit3: Edit2, no difference. :(

Edit4: Added game.ags, no difference


Maybe i am missing something..I have installed the Ags apk that gives me the bluecup icon, i enter in that app...and now i've fixed the directory, so the games show up, and now data error shows up. That's all i've done so far.

I think i must be missing something obvious

Title: Re: AGS engine Android port
Post by: eri0o on Wed 07/10/2020 17:52:37
Not sure if the case, but make sure that read and write access is given in App Permissions

Spoiler
(https://i.imgur.com/AB4hckf.jpg)
[close]
Title: Re: AGS engine Android port
Post by: Olleh19 on Wed 07/10/2020 17:59:26
Quote from: eri0o on Wed 07/10/2020 17:52:37
Not sure if the case, but make sure that read and write access is given in App Permissions

Spoiler
(https://i.imgur.com/AB4hckf.jpg)
[close]

Yes, that is clicked on yes.
Title: Re: AGS engine Android port
Post by: Olleh19 on Wed 07/10/2020 18:00:54
Maybe it's important to say. Samsung Galaxy S7, i am going to bring up my old S6 see if i get it running there. As if s7 isn't old, but yeah you understand what i mean.........
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 07/10/2020 18:14:46
Quote from: Olleh19 on Wed 07/10/2020 16:54:50
Maybe i am missing something..I have installed the Ags apk that gives me the bluecup icon, i enter in that app...and now i've fixed the directory, so the games show up, and now data error shows up. That's all i've done so far.

I'd like to clarify: you see the game selection in the app launcher, but when you try to start any game, there's error, is this correct? Could you tell what exactly error is again?
Title: Re: AGS engine Android port
Post by: Olleh19 on Wed 07/10/2020 18:18:42
Quote from: Crimson Wizard on Wed 07/10/2020 18:14:46
Quote from: Olleh19 on Wed 07/10/2020 16:54:50
Maybe i am missing something..I have installed the Ags apk that gives me the bluecup icon, i enter in that app...and now i've fixed the directory, so the games show up, and now data error shows up. That's all i've done so far.

I'd like to clarify: you see the game selection in the app launcher, but when you try to start any game, there's error, is this correct? Could you tell what exactly error is again?

Edit: I've used AGS 3.5.0 for the game, if that is an issue and it does not work, i am sorry. I haven't read 46 pages!

OK, I OPEN AGS launcher, i see "windows" THEN i click windows and now i get  Error: "ERROR: Unable to find game data files

IN WINDOWS the files are as following:


Acsetup.cfg

audio.vox

game.agf

max fury.exe

swedish.tra

winsetup.exe


I am loading my S6 phone so i will get back with you, if it is just the phone that has issue. If so i'll let you aware of it's exact model. Since it may be some setting inside the OS of the phone. I do NOT have a custom OS. However i do believe the previous owner have played with custom OS. If that matters, i do not know. But i've updated and downloaded the original OS for the phone model.

Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 07/10/2020 18:36:22
game.agf - this is your game project file for the AGS editor, you do not need to distribute it.

This whole thread is a great mess, and should be locked and new one created with up to date information. I could perhaps do this after I deal with current issues.

I dont think this has anything to do with device model, it's probably that Launcher program has some inconveniencies.
I keep forgetting what the game file should be named to make this work, I must test this with emulator first.

Title: Re: AGS engine Android port
Post by: Olleh19 on Wed 07/10/2020 18:40:21
Quote from: Crimson Wizard on Wed 07/10/2020 18:36:22
game.agf - this is your game project file for the AGS editor, you do not need to distribute it.

This whole thread is a great mess, and should be locked and reopened with up to date information. I could perhaps do this after I deal with current issues.

I dont think this has anything to do with device model, it's probably that Launcher program has some inconveniencies.
I keep forgetting what the game file should be named to make this work, I must test this with emulator first.

You did see that i tried rename the file right? So that did not work, unfortunaly. I tried with the exe left in the folder, and without. Same outcome.

And YES you are absolutely right. I Wanted to try to build a APK turns out all this does is "play the game on the phone" which is FINE by me. I want to be able to TRY it, but i also would like to try and BUILD a game that works as an APK.
Such information would be REALLY cool to find on here, if there is such information.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 07/10/2020 18:48:21
Quote from: Olleh19 on Wed 07/10/2020 18:18:42
OK, I OPEN AGS launcher, i see "windows" THEN i click windows and now i get  Error: "ERROR: Unable to find game data files

Sorry, but could you double check that this is the error message? I need exact wording to find it in the engine.

Also, where did you download AGS Launcher APK from?


E: Building your own APK is also possible, but that's done completely differently.
Title: Re: AGS engine Android port
Post by: Olleh19 on Wed 07/10/2020 19:13:17
Quote from: Crimson Wizard on Wed 07/10/2020 18:48:21
Quote from: Olleh19 on Wed 07/10/2020 18:18:42
OK, I OPEN AGS launcher, i see "windows" THEN i click windows and now i get  Error: "ERROR: Unable to find game data files

Sorry, but could you double check that this is the error message? I need exact wording to find it in the engine.

Also, where did you download AGS Launcher APK from?


E: Building your own APK is also possible, but that's done completely differently.

Thanks for your replies. By accident i thought i would visit ags homepage and download a new launcher, turns out there was a new one released just recently.
It's working fine now on S7 phone. Maybe write in the new thread to ALWAYS use the LATEST version of the launcher.

HOWEVER in my s6 phone it crashes with the same apk latest launcher! If you want the error message for that here is that error:

I click the language i want in my game and then it crashes cause of a object animation. This is the exact message (same game but different phone).

Error: Unable to create local script: Runtime error: unresolved import 'Object::Animate'6'
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 07/10/2020 19:22:24
Quote from: Olleh19 on Wed 07/10/2020 19:13:17
Error: Unable to create local script: Runtime error: unresolved import 'Object::Animate'6'

This is not an android error, but may mean that game was compiled with newer editor than the engine is.

The latest APK (at this date) should be on this page: https://www.adventuregamestudio.co.uk/forums/index.php?topic=58466.0
Title: Re: AGS engine Android port
Post by: Olleh19 on Wed 07/10/2020 19:56:04
Quote from: Crimson Wizard on Wed 07/10/2020 19:22:24
Quote from: Olleh19 on Wed 07/10/2020 19:13:17
Error: Unable to create local script: Runtime error: unresolved import 'Object::Animate'6'

This is not an android error, but may mean that game was compiled with newer editor than the engine is.

The latest APK (at this date) should be on this page: https://www.adventuregamestudio.co.uk/forums/index.php?topic=58466.0

Thank you very much!
Title: Re: AGS engine Android port
Post by: Iceberg on Sun 06/12/2020 02:17:46
Hey all,

Is there a solution yet for the error "Script link failed: Runtime error: unresolved import 'AGSteam::SetAchievementAchieved^1' when trying to run certain AGS games?

I'm trying to run Heroine's Quest v1.2 or higher and am using the last stable build (can't remember the number, but I got it from the link a few posts up.

Thanks!
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Sun 06/12/2020 02:28:58
Quote from: Iceberg on Sun 06/12/2020 02:17:46
Is there a solution yet for the error "Script link failed: Runtime error: unresolved import 'AGSteam::SetAchievementAchieved^1' when trying to run certain AGS games?

This was supposed to be fixed in 3.5.0 ports.

If it does not work, I'd need to investigate the game contents. Is it the one from steam?
Maybe it was using steam plugin of older versions which had different name or something.
Title: Re: AGS engine Android port
Post by: Iceberg on Sun 06/12/2020 03:06:32
I'm using the previous build.  When I try clicking on Android Launcher for 3.5 in the link referenced above, nothing happens.  Could the link be broken?

EDIT:  I figured it out!  And it works!  Thanks!  :)
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Thu 10/12/2020 05:18:59
I would like to open a new thread for Android port, because this one goes on for many years and contains too much outdated information. Plus the first post contains links that are also outdated and would be difficult to keep up to date all the time anyway (and I don't have perms to edit it at the moment).

I'll notify again when I'm done writing a head post (will find spare time later today).
Title: Re: AGS engine Android port
Post by: Vulpes on Fri 15/01/2021 00:13:19
is there any "clear way" to compile my game as .apk ? :shocked: :shocked:
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Fri 15/01/2021 00:16:31
Quote from: Vulpes on Fri 15/01/2021 00:13:19
is there any "clear way" to compile my game as .apk ? :shocked: :shocked:

I think this is most recent thread explaining a method: https://www.adventuregamestudio.co.uk/forums/index.php?topic=55681.0

The engine libs for APK mentioned in that post may be found in any recent release post, under "for Android" spoiler: https://www.adventuregamestudio.co.uk/forums/index.php?topic=58747.0

But yes, we need to make a proper explanation somewhere (like in the manual) when someone gets spare time for that  :embarrassed:
Title: Re: AGS engine Android port
Post by: Vulpes on Sat 16/01/2021 20:54:58
thanks pal. You dont know me but u helped me a lot for weeks. cheers xd
Title: Re: AGS engine Android port
Post by: Jinx1337 on Sat 23/01/2021 17:03:56
Just tried the newest port of 3.5.0

Several games crashing the App on startup (KQ1, KQ2, A Tale f Two Kingdoms etc.), newer ones launching OK.

Checking for the usual android crashes, will report back later.

Edit: crashes earlier than before. Random crash without auto saving. I would seriously consider paying someone to make AGs playable on Android. It has almost been over two years now...
Title: Re: AGS engine Android port
Post by: eri0o on Sat 23/01/2021 17:32:12
Can you test this super early app here? >> app-debug.apk (https://drive.google.com/file/d/1cC-cpjUJR_Gl2vbN-1scO6y_EgU6Phuv/view?usp=sharing) <<

The preferences Menu is not working yet - I am still writing that code. MIDI is also not working, so don't expect any MIDI to run correctly. It's using the SDL2 Backend. Also load last save is not working yet - I haven't yet wired that option. Once I finish writin the preferences there is still a lot of work on the mouse.

I haven't yet tested on anything except Android 10 though because it's super early in development.

I also accept money, since these devices are expensive.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Sat 23/01/2021 17:47:04
PM me your PayPal/Revolut and I will donate what I can after the 10th of Feb; living in a third world country, so please don't except much - would love to help however I can tho.

Testing it now, but it doesnt find my games?
Path is Sdcard/AGS
Going for storage/emulated/0/AGS doesnt work either.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Sat 23/01/2021 18:09:44
(ok, had to manually give the App file access permission since it did not ask - testing severely now, will report back later)
Title: Re: AGS engine Android port
Post by: eri0o on Sat 23/01/2021 18:52:44
I fixed the Storage permission request and updated the file on Google Drive.

I thought about showing the file manager to set the directory but I don't know how to test if the phone has a file manager - some phones apparently ship without one. I am still trying to make settings work with the newest model.

Edit: Settings should be working now, but some settings are not implemented yet - even though they show on the menu.

Edit2: Fix settings per game were incorrect, now it correctly sets the android.cfg per game if you use the context menu with long click on a game.

Edit3: Set to ignore acsetup.cfg and use android.cfg in place.

Edit4: Did a bunch of other little fixes but I have two issues I haven't been able to figure out, so I will sleep and try again tomorrow. I have a null on opendir if I try to loadLastSave, resulting in it being skipped, and I have an assertion error on SDL_DestroyTexture_REAL when using the new SDL "Software" renderer, but I don't know why yet.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Sun 24/01/2021 09:11:45
Yeah, Unawoved throws up the SDL_DestroyTexture_REAL  error (tho it hasnt in the first version you posted).

Settings show up but do not work, other than that it seems super stable? Didn't get a single crash, but have yet to test Unawoved which was the one to crash the most (tho eventually every game crashed randomly on the regular, official ver.).

I think if you manage to make settings work, make a slight delay before the touch registers as a LMB in the relative mouse mode (whenever you try movong the cursor, it registers as left click on the initial touch), and maybe bind the androids Back button to ESC, we might have a proper winner here! I shall test Unawoved on the older version some more and report.

One suggestion for a setting that the official AGS port lacked - mouse sensitivity for relative mouse mode.

A thousand thank yous for your work, please send me your do nation address through PM.

Edit:
Oh, and something minor - your version does not auto-rotate the screen on phone devices. You need to put your device in portrait mode while in AGS menu, before launching the game, otherwise it will remain in vertical mode.
Title: Re: AGS engine Android port
Post by: eri0o on Sun 24/01/2021 13:52:43
I updated the build but not with the specific fixes yet. For now the goal is to mirror the original port as faithful as possible ( sans crashes  (laugh))
(but I do plan to improve things in the future...)


Quotebind the androids Back button to ESC

The previous port had back to show a menu with options like showing the keyboard, using fn functions and exiting the game - or at least it should according to it's code, but this actually didn't work at my phone last time I tested.... So I have been thinking a lot on what to do with the Back button.

QuoteYeah, Unawoved throws up the SDL_DestroyTexture_REAL  error (tho it hasnt in the first version you posted).

selecting the Hardware Renderer should work - I can't yet fix the Software Renderer, it won't crash now, but it will be super tiny... I think the first version simply ignored and always used the non-Software renderer, this is why it didn't crash.

QuoteA thousand thank yous for your work, please send me your do nation address through PM

I also live in a third world country too, but I am fine now, I actually reflected and I don't need money, but testing and bug reports are much more valuable to me at this time, since if you test things it offloads from me having to test  ;) So just keep reporting bugs!

QuoteOh, and something minor - your version does not auto-rotate the screen on phone devices. You need to put your device in portrait mode while in AGS menu, before launching the game, otherwise it will remain in vertical mode.

I think it will need one more mode, something like "guess the right orientation and fix it (I think 0 is working like this...), auto-rotate along with the screen, and fixed portrait and and fixed landscape. It's possible to fix landscape but allow changing between both orientation, as fixing portrait but allowing for the phone to be upside down, I don't know yet which modes are best.

QuoteOne suggestion for a setting that the official AGS port lacked - mouse sensitivity for relative mouse mode.

I need to check, but I think the Engine already supports this, it's just a matter of exposing in the options menu.

Also, again, thanks for reporting bugs in the Android, there are waaaay too many different devices, I managed to get a Android 7 and Android 8 device here for testing.

Ah, this is useless but was fun to implement, if you change your device between dark and light modes, the app theme should follow along.

Edit:

Ah, the list view of games as soon as you open the App I made up since the previous App used an actual list view component, which has been deprecated in Android. If you have ideas for things/information that would be useful to show per game, I can try to figure a way to add there. I also want to add a button instead of relying on long click for the context menu but I couldn't figure the right way to add this per game - like, design wise what won't look terrible as a button there.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Sun 24/01/2021 14:20:44
Thanks a lot for your work on that thing; I adore playing ScummVM/DOSBOX adventure games on my S10+ device, AGS has been the only one that left me begging for it to work.

Have you updated the build? It won't install now and only weights 7.5MB - something with compiling?

I can run unrooted logcat and paste logs once I encounter a crash (which I hopefully won't).
Title: Re: AGS engine Android port
Post by: eri0o on Sun 24/01/2021 23:38:46
Sorry, I must have sent a file wrongly or closed the window before Google Drive finished uploading

>> app-debug.apk (https://drive.google.com/file/d/1cC-cpjUJR_Gl2vbN-1scO6y_EgU6Phuv/view?usp=sharing) <<

>> app-debug-cpprelease.apk (https://drive.google.com/file/d/1eEDAplIzCvbvujz6lkZDItf5dDRZvqqp/view?usp=sharing) <<

I have a new version that has a bit more fixes reggarding screen orientation. I also managed to fix the software renderer errors, at least it appears to work on my phones.

I also added above a version that has the AGS Engine, which is written in C++, built for release with some optimizations and the rest of the app that has Java parts is built for debug, this is kinda non recommended but allows to get more performance and test something more representative of the final app. In my tests the release build of the native part was 5 times faster then it's debug version.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Mon 25/01/2021 09:59:38
Great! Thanks!

From the initial testing:

Unawoved, 15 minutes without crashing - so far, so good :)
Kings Quest III Redux - for some reason, the game now launches in a miniature window in the upper left corner?

Settings aren't always working - cannot set some games to run with a relative mouse mode - Unawoved i.e. starts with touch controls, A Tale of Two Kingdoms starts with relative mouse - no matter the settings.

Ignore aspect ratio doesn't seem to work (I like my games stretched for full-screen, regardless of the proper aspect ratio).

Will test some more.
Title: Re: AGS engine Android port
Post by: eri0o on Mon 25/01/2021 11:29:55
Sorry, I uploaded the wrong binaries - ton of folders with the same names... Now I uploaded the correct binaries and settings and other things should work, including King's Quest.  8-)

Edit: Stretching will only work with Hardware rendering. I need to figure out how to do this with the software renderer on Android.

Edit2: I still need to figure out how to deal with relative mouse control, regular ags already supports it through an acsetup.cfg flag called control_enabled = 1, but I don't know yet how to properly map this, it seems that the old Android port did this through a different way for some reason I don't know yet. For now, I believe this specific setting doesn't do anything.

I also haven't wired longclick yet, trying to think if there's a different way to do right click.

Edit3: Full HD videos can be slow in the pure debug build but should run better in the cpprelease version. I don't know why yet it isn't better.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Mon 25/01/2021 12:19:38
Long click could be made through double clicking and holding On a second click. I map it like that in Magic Dosbox for some games. Or just activating on a long click without moving around after a second.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Mon 25/01/2021 19:22:24
Tested some more:

Unawoved
Shardlight
Kings Quest I, II, III, III Redux
Quest for Infamy
A Tale of Two Kingdoms
Mages Initiation
The Order of the Thorne

Flawlessly so far.

1) However, as mentioned before - relative mouse setting doesnt work, games choose mouse mode seemingly at random.

2) Stretching (ignoring aspect ratio) only works with Hardware Pixel Perfect mode, meaning you cannot use filtering.

3) Left Mouse Button click activates immediately on touch, no room for moving the cursor in relative mode; either the client should differentiate *move* from *click*, or there should be half a second delay before a *click* activates. Or activating *click* once you let go of the screen? Right click doesnt seem to be working in some games either (the ones which launch in relative mode by themselves).

4) Rotate only works in AGs menu, as mentioned before.

5) Making use of the back button.

Personally, fixing 1) and 3) would make this client perfect.

As to the additional info in games list you mentioned before, a thumbnail would be perfect, but I guess that is off the limits as we only have some metadata to choose from. I dont really know, producer/developer name i. e.?
Title: Re: AGS engine Android port
Post by: Jinx1337 on Tue 26/01/2021 14:02:46
If there is anything in particular you would like me to test, feel free. Any AGS game too.
Title: Re: AGS engine Android port
Post by: eri0o on Wed 27/01/2021 11:34:50
Sorry for disappearing on you, I was taking my time to figure out how to build it on the cloud. I still need to figure out better though since it's not installing on my phone - the cloud built app, it appears to be a conflict with play protect, but not sure yet.

I will work on the other issues next, just need to figure out if my signing is proper and other new rules on Android! Thanks for making me a list!  :-D

I will leave the link for the cloud built artifact here in case you have any ideas - but again, for me it didn't installed. The website is terrible on mobile though and it has a super confusing web interface, so I also added direct links. Again, those didn't install on my devices.

Spoiler
(https://i.imgur.com/LWQwg7k.jpg)
[close]

Title: Re: AGS engine Android port
Post by: Jinx1337 on Wed 27/01/2021 15:35:39
No worries; I know you're doing it for free in your past time, so no rush - I am happy you are working on it at all.

Weird, the direct links worked for me and I 've installed the apps (third party apps allowed in DEV settings of my device and PlayProtect security bypassed by allowing on prompt).

I take it there has been no changes yet? Or is there anything you'd like me to try out?

edit:

One more thing that came to my mind, it is mostly cosmetic, but still - since I have been playing lots of old games through Magic Dosbox / ScummVM on my device:
If we could try making the cursor screen-refresh rate smooth and not move in a jittery motion (relative mouse mode), it could be a little more helpful for pixel hunting in games.

Magic Dosbox and ScummVM emulates the cursor moves smoothly, whereas AGS moves at half the refresh rate :)
Title: Re: AGS engine Android port
Post by: eri0o on Wed 27/01/2021 16:40:47
No no changes, I have been trying to figure out why it doesn't install for a ton of hours.  >:(

Now that you told me that you managed to install it must be something on my phones. I will go on with this then and just install through adb for now until I can understand what's happening. I think it's related to my security configuration on Play Protect on the device then. Thank you so much! I would be locked trying to understand for a ton of time if you hadn't told me!!!  :)

In AGS I think the cursor is locked to being rendered along with the screen, and for some reason I don't know a lot of AGS games are made set to use 40fps. This may be possible to change in the future, but it would have to be done in a way that works on all platforms. I can look on it, but it will be in the future and not solely related to Android.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 27/01/2021 16:49:38
Quote from: eri0o on Wed 27/01/2021 16:40:47
In AGS I think the cursor is locked to being rendered along with the screen, and for some reason I don't know a lot of AGS games are made set to use 40fps. This may be possible to change in the future, but it would have to be done in a way that works on all platforms.

The point is in making update and render calls independent in time, where mouse cursor position will be updated along with render. Then engine will have  separate "ups" (updates per second) and "fps" (frames per second).

This will solve other problems too, such as vsync causing game animations to suddenly run slower if default game speed was set higher than 60 fps (and just basically prevent speed of rendering to affect internal game logic and vice versa).
Title: Re: AGS engine Android port
Post by: eri0o on Wed 27/01/2021 17:08:37
QuoteThe point is in making update and render calls independent in time, where mouse cursor position will be updated along with render. Then engine will have  separate "ups" (updates per second) and "fps" (frames per second).

This will solve other problems too, such as vsync causing game animations to suddenly run slower if default game speed was set higher than 60 fps (and just basically prevent speed of rendering to affect internal game logic and vice versa).

That would be super nice! For game logic in particular, one idea I had is having the repeat callbacks to pass a parameter that would be a float number representing the elapsed delta time in seconds since last call, like void repeatedly_execute(float dt), this would allow more fluid tween - this is how is done in love2d. Engine wise, I have no idea how to actually implement this though.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Wed 27/01/2021 18:05:55
Quote from: eri0o on Wed 27/01/2021 16:40:47
No no changes, I have been trying to figure out why it doesn't install for a ton of hours.  >:(

Now that you told me that you managed to install it must be something on my phones. I will go on with this then and just install through adb for now until I can understand what's happening. I think it's related to my security configuration on Play Protect on the device then. Thank you so much! I would be locked trying to understand for a ton of time if you hadn't told me!!!  :)

In AGS I think the cursor is locked to being rendered along with the screen, and for some reason I don't know a lot of AGS games are made set to use 40fps. This may be possible to change in the future, but it would have to be done in a way that works on all platforms. I can look on it, but it will be in the future and not solely related to Android.

I have doubled checked and reinstalled both debug and release version again (from the direct links) - both times got the PlayProtect prompt if I am sure to do so.
So yeah, something to do with that, I suppose (I take it you have enabled third party apps installation in the dev menu of your devices).

edit:

I don't suppose it matters, but just for the record, I am downloading and installing them straight from the device.
Title: Re: AGS engine Android port
Post by: tservo on Sun 31/01/2021 12:29:47
Hello I just came across the AGS Android port and it works really great. I know the right-click is still not working.One question though i tried to redirect the game folder to an actual sdcard not the emulated internal one and the game was recognized but got a warning no authorization for save games and it crashes. I set the ags to allow storage and it works in the emulated/0 storage. The reason I'd like to be able to use the real sdcard is because I have lots of space on it vs the cramped internal one. Anyway am I doing something wrong or is there a fix for it? Again thanks for the hard work and I'm checking here frequently for Right-mouse update and this storage question.
Thank you for your continued dedication.
Title: Re: AGS engine Android port
Post by: eri0o on Mon 01/02/2021 01:24:00
 I need specific details of your device, what phone, Android version,... These are in settings->about->Software Information. What did you type when configuring the directories? By using this information what I can try is to create a device in the emulator to attempt to reproduce the issues. The specifics of the errors are also valuable, if you have a error message, having the specific error message can save a lot of time.
Title: Re: AGS engine Android port
Post by: tservo on Mon 01/02/2021 05:29:46
Hi I actually went thru the whole thread and found the midi fix,works great  now and installed ver 3.50.25 debug and the back button,keyboard and right mouse button works on all my ags games from old to newest. Problem solved. The sd card location I put in under the preferences is path: /storage/F203-17FF/ags/   
the error was 'cannot do save to that location'.  Looks like reading the thread all versions seem to only work from the /emulated/0/ags location.But since everything works well now its ok.  Thank you for your fast reply. I am so happy I found this site  :smiley: :)
Title: Re: AGS engine Android port
Post by: Jinx1337 on Wed 03/02/2021 20:04:26
eri0o - any updates to your builds?

I am itching to test some more :)
Title: Re: AGS engine Android port
Post by: eri0o on Thu 04/02/2021 01:42:47
I actually added relative mouse mode here

https://cirrus-ci.com/task/6019375054454784

I know it's not perfect but I would prefer to fix on SDL2 itself - if it's not possible, then I would reimplement on the AGS Engine.

The bug is that you can hold the finger on the screen to drag the mouse but the first time the finger touches the screen it registers a click. This is wrong, it should only register the click on a quick tap not on touch-hold. I am using the relative mouse mode provided by the new backend though instead of implementing my own.

Unfortunately in the meantime a bunch of things happened so I am kinda really low on time now.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Mon 08/02/2021 19:52:18
Great. If you manage to fix it, this will basically maje the port 100% playable! :)
I have tested so far and no crashing.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Tue 23/03/2021 11:50:44
Hey eri0o!

Any new updates for this port?
I eagerly await any info :)
Title: Re: AGS engine Android port
Post by: eri0o on Tue 23/03/2021 12:03:13
I gave up. Look, I just want to make games, and I will do ports for myself and my games.

People here have too much differences from how I think things should be done (coding wise) and it's too draining for me to try to accommodate that - it resulted in me getting 0 games done in 2020 and getting depressed about it.
Title: Re: AGS engine Android port
Post by: Jinx1337 on Tue 23/03/2021 12:20:22
[offtopic][/offtopic]I understand :(

Its too bad, as your port is pretty much perfect for me, the only thing holding it back is the mouse click issue.

The official one still crashes on every version.
Thank you for your work, anyway.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 23/03/2021 17:12:09
Eri0o, your port was merged to SDL2 branch. I was literally going to do this on last Sunday anyway, only awaiting one more day to see if you reply something, because I thought you were still working on "BACK" button problem.

I am sorry if I were annoying you. I clearly made a mistake with the last comment where suggested another change. I thought about deleting it too for a while after writing but kept doubting.
I used to discuss things with people freely if something was bothering me, because wanted to make my doubts clear to others and hear other peoples' opinion; used to review and discuss alternatives before making final decision. That seemed like a normal thing to do in the past. But I guess it's frustrating for some. So maybe I should reduce doing this.

From discussion in your PR it seems that the main difference that we had is caused by a principle in our project: one change (PR) at a time. That helps to keep backup states of a program, both in case something does not work, and in case something breaks old compatibility, so that there's an actual "stage" you can use as a test, or give to a particular user in case of emergency. Unfortunately, you put everything in one PR: OpenGL renderer update, new studio projects, and so on. This was very unexpected to me. Unfortunately I was not able to discuss this with you before the PR happened.

Quote from: eri0o on Tue 23/03/2021 12:03:13
People here have too much differences from how I think things should be done (coding wise) and it's too draining for me to try to accommodate that

It's clear that we have got a communication problem. Maybe we have a misunderstanding. It may as well be that I am doing something wrong. For many years I too had to accommodate for numerous people who expected opposite things from me and the project and that may have affected the ways of doing things.

Could you please tell what differences "coding wise" do you mean?
Title: Re: AGS engine Android port
Post by: eri0o on Tue 23/03/2021 19:30:37
CW,

My basic grip with AGS codebase is the Windows port, it has no defined way of dealing with dependencies. So if you add a dependency on the project on other codebases, if it's Linux you get it from the package manager, with MacOS/iOS, you get it from Brew, or from Apple themselves, Android, it's a POM or Java package, and alternatively when using CMake you can fetch from anywhere.

I will always prefer pulling a library that does what I need, and then throwing away when I don't need more. It's part of the idea of using a Game Engine in the first place, leverage the work of others so I can progress faster.

I am not adding a copy of a library in the codebase (that is tried and tested and performs great) because I want a copy of that code. I am doing so because my hands are tied because there's no defined process for Windows. And I keep getting criticisms for doing so while I am getting nowhere when asking how to solve the problem on Windows - I mentioned a possible solution with an AGS Dependencies repository, other possibilities for Windows are Nuget packages (for project solutions) and alternatively I am sure there are other ways, unfortunately I am not experienced in Windows development.

Other problem is even though for me the way AGS is developed on Windows is not good, YOU ARE very productive in it. So I don't really want to disturb the way you do things.

But this creates an environment that makes me uneasy, when you are NOT adding libraries on the codebase, it makes switching things much easier - say, let's try a different library for font rendering because now I need utf8 support.

Anyway, any code I produced is free to get, it's there on GitHub for this exact purpose. But this approach of building everything from scratch makes things too hard for me. During this month I have been working on my MAGS game and I noticed I was much happier... So well, I think I want to finish my game now - the bigger one, not only MAGS.

But this is mostly it. And yes, we have a communication problem, and look, I know I have a communication problem. But I don't know how to address it, the conversations on GH made me so anxious that I turned off all my notifications and on the past year I got rid of my most my instant messaging too. In the end, I don't think I am cut for doing FOSS and think I should just do games for a while until I feel better.

Edit: I recently read a book called Working in Public: The Making and Maintenance of Open Source Software and there it mentions that most Open Source codebases work in a scenarium type, where a central dev does all the work and talks about the toll of working with others. Like, the cost of attention and stuff like that. It was an interesting read. Anyway, I just think personally, for me, it's best to stay away for a while and work on releasing games.
Title: Re: AGS engine Android port
Post by: tservo on Fri 26/03/2021 11:40:02
Hi I have not found any info in the whole android thread if the android version has a middle mouse click gesture or a key that emulates the middle mouse function. Thanks
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Tue 06/04/2021 21:27:48
A very curious find by one of the ScummVM developers, there's a bug in Allegro 4 that may cause crashes in some of our ports such as Android, Mac and some others. It happens only in 8-bit games and related to setting palette range.
Hard to say, but maybe it was one of the causes for crashes in Android port. I never looked closer into this so don't know in which games it happened, but if these were 256-color games then it could be the reason.
It does not happen in upcoming SDL2 version, because relevant part of Allegro code was removed.


Quote from: tservo on Fri 26/03/2021 11:40:02
Hi I have not found any info in the whole android thread if the android version has a middle mouse click gesture or a key that emulates the middle mouse function. Thanks

Sorry, I don't know and forgot to check, but it's quite possible that we don't have it at the moment. Also middle button is not necessarily present on PC mouses too, so ideally game authors should provide alternate controls.
Title: Re: AGS engine Android port
Post by: Potajito on Tue 18/05/2021 22:53:42
I was toying around with the latest (as in v.3.6.0.3 - Alpha 4) and the android player is working like a charm. Sound/speech is great so far. My only gripe so far is that I haven't been able to right click, no matter how I try to position the fingers. Reading some comments, it should work tapping with one finger the hotspot and then pressing with another in any any part of the screen, but it doesn't seem like it. Any help on that? Also, would it be possible to right click on long tap? Somehow it feels more intuitive?
Thanks!
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Wed 26/05/2021 01:24:40
Quote from: Potajito on Tue 18/05/2021 22:53:42
I was toying around with the latest (as in v.3.6.0.3 - Alpha 4) and the android player is working like a charm. Sound/speech is great so far. My only gripe so far is that I haven't been able to right click, no matter how I try to position the fingers. Reading some comments, it should work tapping with one finger the hotspot and then pressing with another in any any part of the screen, but it doesn't seem like it. Any help on that? Also, would it be possible to right click on long tap? Somehow it feels more intuitive?

Were you able to perform a "right click" in previous versions (3.5.0, 3.5.1)? Both java program and engine backend have changed so it will be interesting to compare.

Regarding the controls setup, there have been few suggestions to change them in the past (they are scattered somewhere on forums or in our issue tracker). I think first of all it would be good to gather these in a proper ticket, and secondly, it may be possible to create a config that sets these up for the emulator.
Title: Re: AGS engine Android port
Post by: Amir on Mon 28/06/2021 09:28:20
Hi, when I run my game I get 2 errors:

1-Warning: cannot enable MIDI audio. Problem: no compatible drives found in the system.
You may supress this message by disabling MIDI sound in the game setup.

2- Unable to write in the savegame directory. Make sure you have write permissions, and also check the disk's free space.

I disabled MIDI sound in the game setup but Im still getting the error from MIDI sound  :undecided:

which write permissions? and yes I have free space enough  :confused:

Does anyone know these errors and can help?
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 28/06/2021 13:03:14
@Amir, please clarify which version of the android port you are using.

Quote from: Amir on Mon 28/06/2021 09:28:20
I disabled MIDI sound in the game setup but Im still getting the error from MIDI sound  :undecided:

To double check, you need to set "midiid = none" or "0" in acsetup.cfg in the game folder.

Quote from: Amir on Mon 28/06/2021 09:28:20
which write permissions? and yes I have free space enough  :confused:

Where on the device did you put the game itself?
Title: Re: AGS engine Android port
Post by: Amir on Mon 28/06/2021 14:59:18
Quote from: Crimson Wizard on Mon 28/06/2021 13:03:14
@Amir, please clarify which version of the android port you are using.

Quote from: Amir on Mon 28/06/2021 09:28:20
I disabled MIDI sound in the game setup but Im still getting the error from MIDI sound  :undecided:

To double check, you need to set "midiid = none" or "0" in acsetup.cfg in the game folder.

Quote from: Amir on Mon 28/06/2021 09:28:20
which write permissions? and yes I have free space enough  :confused:

Where on the device did you put the game itself?


Oh I didn't know that, MIDI sound is now completely deactivate, no more error, thank u.

I'm using the latest version 3.5.1.8

I put it on my SD card, storage/extSdCard/ags . As JJS wrote the instructions "Games must be placed on the SD card root in the "ags" directory" 
I have 5 GB free space on my SD Card.

Should I put it on storage/emulated/0/ ? I have to delete some apps or games there, I have 723 MB free space.


Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 28/06/2021 15:26:11
I honestly don't know. The instructions are old, some things could've changed since. I heard that newer devices have some additional rules about writing permissions, but lack knowledge about that.

When I tested android port on my device, I put the games in "Downloads", because did not know any better.

Maybe someone else will be able to provide more information.
Title: Re: AGS engine Android port
Post by: eri0o on Mon 28/06/2021 16:01:40
@Amir, which Android device you have?

The port is not compatible with Android 11 and 12 (storage changed). Additionally, some devices+os use a different naming system for the directories. Unfortunately the way it's structured requires knowing the absolute path of where things are on your device.

Are you familiar with Android and the Share interaction? I have a code that uses that instead (use your android file navigator and just hit share and then select AGS). I thought it was the proper Android way to handle but when I showed to some people in the forums they didn't understand it, so I never pushed forward. The advantage is this way is also compatible with Android 11 and 12.
Title: Re: AGS engine Android port
Post by: Amir on Mon 28/06/2021 16:58:31
I have Galaxy Tab A (2016) Android version 5.1.1, not 11 or 12  ;-D

Unfortunately I have no idea about Android and the share interaction, I will not understand it like the other people. Anyway thank u for ur offer. I will try to put the game on the internal storage, maybe that's the solution, if that doesn't work I'll try older versions of android port. I will let you know.
Title: Re: AGS engine Android port
Post by: Crimson Wizard on Mon 28/06/2021 17:09:13
Quote from: Amir on Mon 28/06/2021 16:58:31
I have Galaxy Tab A (2016) Android version 5.1.1, not 11 or 12  ;-D

I also have 5. something, and the latest 3.5.* ports work there (as well as the new 3.6.0 one which is currently in development stage). I don't have external card though so was using internal storage.
Title: Re: AGS engine Android port
Post by: Amir on Mon 28/06/2021 17:26:27
Quote from: Crimson Wizard on Mon 28/06/2021 17:09:13
Quote from: Amir on Mon 24/02/1975 15:59:51quote author=Crimson Wizard link=topic=44768.msg636637433#msg636637433 date=1624896553]
Quote from: Amir on Mon 28/06/2021 16:58:31
I have Galaxy Tab A (2016) Android version 5.1.1, not 11 or 12  ;-D

I also have 5. something, and the latest 3.5.* ports work there (as well as the new 3.6.0 one which is currently in development stage). I don't have external card though so was using internal storage.
I have Galaxy Tab A (2016) Android version 5.1.1, not 11 or 12  ;-D

I also have 5. something, and the latest 3.5.* ports work there (as well as the new 3.6.0 one which is currently in development stage). I don't have external card though so was using internal storage.
[/quote]

Ahaaa so it must be because of SD card. Ok I'm going to delete a few things there and put the game there. Thank u.
Title: Re: AGS engine Android port
Post by: Amir on Mon 28/06/2021 19:59:25
It works now. It's weird that it doesn't work from the SD card. Well, the main point it works. Thank u guys.
Title: Re: [OLD-1] AGS engine Android port
Post by: Crimson Wizard on Wed 02/02/2022 19:29:39
I unstickied and locked this old thread, because it was started many years ago and contains alot of obsolete information.

The new one is opened here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=59751.0