[OLD-1] AGS engine Android port

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

Previous topic - Next topic

Crimson Wizard

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.

eri0o

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

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

The creature

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

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.

The creature

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

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.

The creature

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

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

The creature

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

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

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

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

#853
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).

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.

The creature

#854
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

eri0o

#855
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 )

Crimson Wizard

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

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

Well on a closer look I apparently just stopped once things worked correctly ¯\_(ãÆ'„)_/¯

Code: ags

~/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

The creature

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

SMF spam blocked by CleanTalk