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

Re: AGS engine Android port
« Reply #780 on: 20 Mar 2018, 01: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?



Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #781 on: 20 Mar 2018, 01:34 »
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).


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.
« Last Edit: 20 Mar 2018, 01:38 by Crimson Wizard »

Joseph DiPerla

  • Joseph DiPerla, Adventure Game Creator Wannabe!
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with play testing
    •  
    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
Re: AGS engine Android port
« Reply #782 on: 20 Mar 2018, 01:37 »
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
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

Re: AGS engine Android port
« Reply #783 on: 20 Mar 2018, 01:38 »

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.

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.
« Last Edit: 20 Mar 2018, 01:43 by Chicky »

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #784 on: 20 Mar 2018, 01:48 »
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.

Privateer Puddin'

  • Mittens Knight
  • bob
Re: AGS engine Android port
« Reply #785 on: 20 Mar 2018, 02:38 »
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?

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #786 on: 20 Mar 2018, 02:41 »
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.

Privateer Puddin'

  • Mittens Knight
  • bob
Re: AGS engine Android port
« Reply #787 on: 20 Mar 2018, 03:10 »
Tried Last & Furious - got the same black screen. Here's the log from trying to run my game:

http://tom-simpson.com/ags.log

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #788 on: 20 Mar 2018, 15:08 »
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.

« Last Edit: 20 Mar 2018, 18:00 by Crimson Wizard »

Re: AGS engine Android port
« Reply #789 on: 20 Mar 2018, 18:24 »
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 and I've got one device that I could try it on.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #790 on: 20 Mar 2018, 18:43 »
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.
« Last Edit: 26 Mar 2018, 01:34 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #791 on: 30 Apr 2018, 14:56 »
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:
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.
« Last Edit: 30 Apr 2018, 15:00 by Crimson Wizard »

Re: AGS engine Android port
« Reply #792 on: 30 Apr 2018, 22:37 »
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).

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #793 on: 01 May 2018, 01:28 »
Alright, I got colors fixed.
https://www.dropbox.com/s/qww9leoj643ltwr/AGS-3.4.1-debug.apk?dl=0

The fix was trivial, 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.
« Last Edit: 01 May 2018, 01:38 by Crimson Wizard »

Privateer Puddin'

  • Mittens Knight
  • bob
Re: AGS engine Android port
« Reply #794 on: 01 May 2018, 02:45 »
Woo! It works, top work Crimson.



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:



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.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #795 on: 01 May 2018, 03:01 »
Hmmm, no. As I was suspecting, my latest changes have broken colors in 16-bit Software mode. Looks like this is not the end.


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.

Privateer Puddin'

  • Mittens Knight
  • bob
Re: AGS engine Android port
« Reply #796 on: 01 May 2018, 03:13 »


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:



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.

NicolaGs

  • Going nowhere fast
    • NicolaGs worked on a game that was nominated for an AGS Award!
      NicolaGs worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #797 on: 01 May 2018, 10:51 »
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.
My first game : I Want Out!

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #798 on: 01 May 2018, 10:57 »
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?

NicolaGs

  • Going nowhere fast
    • NicolaGs worked on a game that was nominated for an AGS Award!
      NicolaGs worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #799 on: 01 May 2018, 11:59 »
Oh, sorry... yes! The very last link you provided...
My first game : I Want Out!