[OLD-1] AGS engine Android port

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

Previous topic - Next topic

AnasAbdin

All the AGS_2014-4-30.apk links I tried are dead links :(

Bhaal87

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.

Crimson Wizard

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.

Cassiebsg

There are those who believe that life here began out there...

Bhaal87

@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?

Crimson Wizard

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?

Bhaal87

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

cat

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?

Crimson Wizard

I will have more free time in the beginning of January, then I hope to study how Android port works.

Mehrdad

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 .
My official site: http://www.pershaland.com/

Crimson Wizard

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

Crimson Wizard

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


Mehrdad

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.
My official site: http://www.pershaland.com/

Crimson Wizard

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?

cat

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

Crimson Wizard

#676
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?

cat

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) and it worked then.

Crimson Wizard

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

cat

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.

SMF spam blocked by CleanTalk