Jibble

Author Topic: Let's build for Android!  (Read 20418 times)

Re: Let's build for Android!
« Reply #80 on: 16 Sep 2021, 23:45 »
Quote
But the game looks awful. It wont rotate it stays vertical on the device, so small and pixelated and it runs very slow

@eri0o
I read u can set it to full screen mode and let it rotate, it seems to be due to Android Studio. But can u tell me how I can show that device or the preview mode? I cann't find it.
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

Re: Let's build for Android!
« Reply #81 on: 16 Sep 2021, 23:49 »
Just for checking, are you sure you are using the release builds of the Android libraries? The debug version will run reaaaally slow, it's not meant to be used unless you have a need for debugging AGS Native code and for some reason you are not able to build the C++ libraries yourself.

Other than this, make sure you are using a hardware accelerated renderer and about rotation, make sure you are setting the desired rotation. These are set in the android.cfg file.

Code: Adventure Game Studio
  1. [misc]
  2. rotation = 0 // user can rotate
  3. rotation = 1 // portrait
  4. rotation = 2 // landscape

Code: Adventure Game Studio
  1. [graphics]
  2. renderer = 0 // software renderer
  3. renderer = 1 // hardware, render to screen
  4. renderer = 2 // hardware, render to texture

These settings are the same since jjsat first wrote this config file in 2012 because the Android Player was made to keep the same settings menu. In the future the idea is to ditch this and instead use acsetup.cfg only, but this changes a lot the Settings menu and requires touch to be a thing accross all systems (which IS, but it's not configurable yet)

Quote
But can u tell me how I can show that device or the preview mode?

I don't understand, what do you mean? In the emulator?

Spoiler: ShowHide


You need to go into the AVD (Android Virtual Device) manager and create an emulator for the device you want.

Spoiler: ShowHide


From there on just the config the phone as you want and hit next to the end.

Spoiler: ShowHide


Once this is done, just click play in the device you just created in the AVD manager



from there on, the ADB running on Android Studio will pickup and show it as a device available for you to run your stuff. more details here...


About sound not working I don't know, in the past there was a sound cache config in the Android and iOS devices but these are no longer used internally by the engine, but I don't think they would explain sound failing in your case...
« Last Edit: 17 Sep 2021, 00:11 by eri0o »

Re: Let's build for Android!
« Reply #82 on: 17 Sep 2021, 19:06 »
Quote
You need to go into the AVD (Android Virtual Device) manager and create an emulator for the device you want.

Thank u. but it doesn't matter, I will use my device becoz I enabled VT-x in my BIOS then I got the error: the emulator process for avd has terminated and I tried all solution and it dosn't work, Android Studio is full of bugs. so wherever.

Quote
you sure you are using the release builds of the Android libraries?
Do u mean this folder: AGS-3.6.0.8-android-libs-release. Yes I am sure.
But I read some solutions to fix that. I will try them later.

rotation = 1 is already there. that means I just have to add rotation = 0 // user can rotate , right?
and add all of renderer 0, 1 and 2.

smoothing and smooth_sprites were = 0 I set them to 1 and now it's clean and no longer pixelated  :-D

But there is a big problem. The English translation doesn't work 8-0 when I change to English, only the English graphics appear but the texts are in German (default) the file English.tra doesn't appear to be recognized.

Sounds are still not complete.

Here is my android.cfg. maybe I can still change something and solve some problems?
Spoiler: ShowHide
Code: Adventure Game Studio
  1. [misc]
  2. config_enabled = 1
  3. rotation = 1
  4. translation = default
  5. [controls]
  6. mouse_method = 0
  7. mouse_longclick = 0
  8. [compatibility]
  9. clear_cache_on_room_change = 0
  10. [sound]
  11. samplerate = 44100
  12. enabled = 1
  13. threaded = 0
  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 = 1
  23. scaling = 1
  24. super_sampling = 0
  25. smooth_sprites = 1
  26. [debug]
  27. show_fps = 0
  28. logging = 0
  29.  
  30.  


translation = default I shouldn't change it to English, right?

And in acsetup.cfg [language]translation= . = nothing?  (wtf) Is that normal?

(I haven't tried AGS 3.6.0 yet and haven't moved and renamed yet)
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

Re: Let's build for Android!
« Reply #83 on: 17 Sep 2021, 19:21 »
The list of properties I gave was just to explain what each value was, you should only set one value per property in the android.cfg file.

About translation, I don't really know how translation works, would need to check what files the engine looks for.

Edit: internally engine uses the AssetManager for translation so it should work, but my guess is the value you want is English and not default - not sure, maybe there's somewhere where default gets switched to English but I could not find it looking in the source code. :/
« Last Edit: 17 Sep 2021, 19:36 by eri0o »

Re: Let's build for Android!
« Reply #84 on: 18 Sep 2021, 09:38 »
Ok, thank u. I'll try to find it out too.
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #85 on: 18 Sep 2021, 11:57 »
Edit: internally engine uses the AssetManager for translation so it should work, but my guess is the value you want is English and not default - not sure, maybe there's somewhere where default gets switched to English but I could not find it looking in the source code. :/

"default" value in config is not interpreted as real default, but as "Default.tra", which probably does not exist. To use default language you should leave the config option empty.

PS. I still suggest to test with the windows version first to see if there are any logical bugs in the new version, as it is more reliable and easier to test.
PPS. by that I mean not necessarily convert the project to 3.6.0, but use its acwin.exe + sdl2.dll to run your compiled game and see how it behaves.
« Last Edit: 18 Sep 2021, 12:22 by Crimson Wizard »

Re: Let's build for Android!
« Reply #86 on: 18 Sep 2021, 14:59 »
Thanks for the explanation.

I saw your edit too late. But I copied the project and converted the copied project to 3.6.0. It runs well except for the sounds. it happened like it happenes on the device through Android Studio. Incomplete, you hear 80 percent of the sound. But I noticed that only the sounds that are in the script are not complete aDoor.Play();
The frame sounds dont cause any problems, they are complete.

I tried the files from Data folder from 3.6.0 in Android Studio, hoping something will be corrected, but there is no difference. The .tra file is not read and the game runs very slow including the sounds.

I started working on a new short game. Which version is the safest and can you recommend me? AGS 3.5.1 - Patch 3? Do the sounds work well there?  :)
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #87 on: 18 Sep 2021, 15:34 »
It runs well except for the sounds. it happened like it happenes on the device through Android Studio. Incomplete, you hear 80 percent of the sound. But I noticed that only the sounds that are in the script are not complete aDoor.Play();
The frame sounds dont cause any problems, they are complete.

I'd really like to document this properly, because we will have to fix this eventually. Could you send us an example sound that does not play?

I tried the files from Data folder from 3.6.0 in Android Studio, hoping something will be corrected, but there is no difference. The .tra file is not read and the game runs very slow including the sounds.

Do translations work in windows version?
I cannot talk about perfomance, because haven't tried the new android port alot yet. Can you tell your game resolution? Also, what happens if you run your game with older Android launcher from 3.4 or 3.5 releases (e.g. you may try using one linked to the 3.5.1 release if you've got time to test that).

I started working on a new short game. Which version is the safest and can you recommend me? AGS 3.5.1 - Patch 3? Do the sounds work well there?  :)

3.5.1 should be the safest of course.

Re: Let's build for Android!
« Reply #88 on: 18 Sep 2021, 16:32 »
Quote
I'd really like to document this properly, because we will have to fix this eventually. Could you send us an example sound that does not play?

With pleasure. send an mp3 file? I only used mp3. Or should I record a video and show what it sounds like?

Quote
Do translations work in windows version?
I cannot talk about perfomance, because haven't tried the new android port alot yet. Can you tell your game resolution? Also, what happens if you run your game with older Android launcher from 3.4 or 3.5 releases (e.g. you may try using one linked to the 3.5.1 release if you've got time to test that).

resolution 1024 x 768.

Yes, translations work in windows version with AGS 3.4... and 3.5.1. it's up to Android Studio, I think a code has to be written somewhere for the translation to work.
I just tried the 3.5.1 version. Everything is going great. The sounds are all complete.

Quote
3.5.1 should be the safest of course.

Thank u.
« Last Edit: 18 Sep 2021, 16:55 by Amir »
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #89 on: 18 Sep 2021, 17:17 »
Quote
I'd really like to document this properly, because we will have to fix this eventually. Could you send us an example sound that does not play?

With pleasure. send an mp3 file? I only used mp3. Or should I record a video and show what it sounds like?

Yes, I need the exact file, because I need to observe how it is processed by the engine.

Yes, translations work in windows version with AGS 3.4... and 3.5.1. it's up to Android Studio, I think a code has to be written somewhere for the translation to work.

I must clarify, what about 3.6.0 windows version? Because at this point we need to know if the problem is in 3.6.0 engine in general, or Android port only.

Re: Let's build for Android!
« Reply #90 on: 18 Sep 2021, 18:20 »
Ah ok.

Edit: I sent a PM.
« Last Edit: 19 Sep 2021, 08:05 by Amir »
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #91 on: 21 Sep 2021, 13:30 »
In regards to the sound cutting, eri0o has opened a bug report for the sound library we are using, so it's up to them now, unless we find the mistake ourselves earlier...

Re: Let's build for Android!
« Reply #92 on: 21 Sep 2021, 20:10 »
Ok, thank u.
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

Re: Let's build for Android!
« Reply #93 on: 21 Sep 2021, 21:20 »
If you can, replace all audio for .ogg, since I can't say how long it will take for the mp3 library be fixed, test before, but the problem doesn't seem to manifest with .ogg audio.

Re: Let's build for Android!
« Reply #94 on: 22 Sep 2021, 07:26 »
I'm trying to get the translation done first, that is much more important, then I’ll test .ogg
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #95 on: 22 Sep 2021, 13:12 »
So, do translations work on 3.6.0 desktop versions? We need a clarification that this is purely Android problem, or general 3.6.0 problem.

eri0o, I heard you have Amir's game project, does it work if you run on Windows/Linux?

Re: Let's build for Android!
« Reply #96 on: 22 Sep 2021, 13:52 »
So, do translations work on 3.6.0 desktop versions? We need a clarification that this is purely Android problem, or general 3.6.0 problem.

eri0o, I heard you have Amir's game project, does it work if you run on Windows/Linux?

To be sure, I just tested again. Yes it's purely Android problem. Translations work on 3.6.0.9-Alpha10 desktop version.
Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #97 on: 23 Sep 2021, 14:53 »
To be sure, I just tested again. Yes it's purely Android problem. Translations work on 3.6.0.9-Alpha10 desktop version.

This is interesting, does your game have any other separate files, like audio.vox and/or speech.vox, and do they seem to work fine on Android?

I think for best testing we need to use a simpliest dummy game that changes between translations and displays text, that way we ensure that no scripting or other factors interfere.

Re: Let's build for Android!
« Reply #98 on: 24 Sep 2021, 16:04 »
Quote
This is interesting, does your game have any other separate files, like audio.vox and/or speech.vox, and do they seem to work fine on Android?

No, I don't have any separate files. Sorry I cann't test that.


Truly, truly, i say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #99 on: 24 Sep 2021, 16:07 »
No, I don't have any separate files. Sorry I cann't test that.

So basically, we would need a game which has extra files outside of the main game package, like tra, vox, or even custom files to open using script commands. Then test if opening these files works.
TBH I got an impression it should work, but haven't tried myself yet.