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

Crimson Wizard

  • Local Moderator
  • Posts: 8,737
    • 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 #840 on: 07 Aug 2018, 23:06 »
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.

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.

eri0o

  • Posts: 397
    • eri0o worked on a game that was nominated for an AGS Award!
Re: AGS engine Android port
« Reply #841 on: 08 Aug 2018, 00:45 »
I commented both // CreateShaderProgram(, and I have no more #version errors. But I still have a black screen. Unfortunately no more errors on console... :-\


ET3D

  • Posts: 12
Re: AGS engine Android port
« Reply #842 on: 02 Sep 2018, 13:33 »
Also, 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).

The creature

  • Posts: 38
Re: AGS engine Android port
« Reply #843 on: 31 Oct 2018, 10:02 »
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

Crimson Wizard

  • Local Moderator
  • Posts: 8,737
    • 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 #844 on: 31 Oct 2018, 10:40 »
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.

The creature

  • Posts: 38
Re: AGS engine Android port
« Reply #845 on: 31 Oct 2018, 11:01 »
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

Crimson Wizard

  • Local Moderator
  • Posts: 8,737
    • 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 #846 on: 31 Oct 2018, 11:11 »
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.

The creature

  • Posts: 38
Re: AGS engine Android port
« Reply #847 on: 31 Oct 2018, 11:35 »
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.

Crimson Wizard

  • Local Moderator
  • Posts: 8,737
    • 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 #848 on: 31 Oct 2018, 11:41 »
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.
« Last Edit: 31 Oct 2018, 12:15 by Crimson Wizard »

The creature

  • Posts: 38
Re: AGS engine Android port
« Reply #849 on: 31 Oct 2018, 12:26 »
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

The creature

  • Posts: 38
Re: AGS engine Android port
« Reply #850 on: 05 Nov 2018, 10:55 »
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

eri0o

  • Posts: 397
    • eri0o worked on a game that was nominated for an AGS Award!
Re: AGS engine Android port
« Reply #851 on: 05 Nov 2018, 19:17 »
Yes, I think you need to create a folder with your game name and place the android.cfg there but I am not sure.

The creature

  • Posts: 38
Re: AGS engine Android port
« Reply #852 on: 05 Nov 2018, 19:52 »
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.

Crimson Wizard

  • Local Moderator
  • Posts: 8,737
    • 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 #853 on: 05 Nov 2018, 20:14 »
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.
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).

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.
« Last Edit: 05 Nov 2018, 20:39 by Crimson Wizard »

The creature

  • Posts: 38
Re: AGS engine Android port
« Reply #854 on: 05 Nov 2018, 21:35 »
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.

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
« Last Edit: 05 Nov 2018, 21:48 by The creature »

eri0o

  • Posts: 397
    • eri0o worked on a game that was nominated for an AGS Award!
Re: AGS engine Android port
« Reply #855 on: 06 Nov 2018, 01:53 »
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 )
« Last Edit: 06 Nov 2018, 12:44 by eri0o »

Crimson Wizard

  • Local Moderator
  • Posts: 8,737
    • 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 #856 on: 06 Nov 2018, 09:20 »
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.

The creature

  • Posts: 38
Re: AGS engine Android port
« Reply #857 on: 06 Nov 2018, 13:59 »
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

eri0o

  • Posts: 397
    • eri0o worked on a game that was nominated for an AGS Award!
Re: AGS engine Android port
« Reply #858 on: 07 Nov 2018, 22:44 »
Well on a closer look I apparently just stopped once things worked correctly ¯\_(ツ)_/¯

Code: Adventure Game Studio
  1. ~/git/futureflashback/Compiled/obb$ pwd
  2. /home/e/git/futureflashback/Compiled/obb
  3. e@e-host:~/git/futureflashback/Compiled/obb$ tree
  4. .
  5. ├── acsetup.cfg
  6. ├── android.cfg
  7. ├── FutureFlashback
  8. │   ├── acsetup.cfg
  9. │   └── android.cfg
  10. └── futureflashback.exe
  11.  
  12. 1 directory, 5 files
  13.  

The creature

  • Posts: 38
Re: AGS engine Android port
« Reply #859 on: 08 Nov 2018, 19:03 »
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: Adventure Game Studio
  1. [sound]
  2. digiid=-1
  3. midiid=-1
  4. digiwin=-1
  5. midiwin=-1
  6. digiindx=0
  7. midiindx=0
  8. digiwinindx=0
  9. midiwinindx=0
  10. [misc]
  11. game_width=320
  12. game_height=240
  13. gamecolordepth=16
  14. antialias=0
  15. notruecolor=0
  16. cachemax=131072
  17. user_data_dir=
  18. shared_data_dir=
  19. titletext=Agony Setup
  20. [graphics]
  21. driver=D3D9
  22. windowed=0
  23. screen_def=max
  24. game_scale_fs=proportional
  25. game_scale_win=max_round
  26. filter=stdscale
  27. vsync=0
  28. render_at_screenres=0
  29. [language]
  30. translation=
  31. [mouse]
  32. auto_lock=0
  33. speed=1

This is my android cfg
Code: Adventure Game Studio
  1. [misc]
  2. config_enabled = 0
  3. rotation = 2
  4. translation = default
  5. [controls]
  6. mouse_method = 0
  7. mouse_longclick = 1
  8. [compatibility]
  9. clear_cache_on_room_change = 0
  10. [sound]
  11. samplerate = 44100
  12. enabled = 1
  13. threaded = 1
  14. cache_size = 10
  15. [midi]
  16. enabled = 0
  17. preload_patches = 0
  18. [video]
  19. framedrop = 0
  20. [graphics]
  21. renderer = 0
  22. smoothing = 0
  23. scaling = 2
  24. super_sampling = 1
  25. smooth_sprites = 1
  26. [debug]
  27. show_fps = 0
  28. 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