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

AGD2

  • Posts: 286
    • AGD2 worked on a game that was nominated for an AGS Award!
      AGD2 worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #320 on: 02 Feb 2013, 03:41 »
Thanks for the upload! :)

The FileWriteInt error no longer occurs during start-up when the game loads. However, now there's no music. It's really odd! Starting the game from scratch results in no music in the logo movie, title screen, or game. Sound effects, ambient sounds, and speech all play just fine, though. (This happens in all games, not just Al Emmo).

For some reason, Mage's Initiation stays on a black screen for about 10 seconds before the game actually loads up. Previously, it would just start instantly.

Haven't yet tested the new "toggle keyboard" option out on the Kindle Fire, but will let you know how that goes. Will post an update soon-ish.

Crimson Wizard

  • Local Moderator
  • Posts: 8,730
    • 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 #321 on: 02 Feb 2013, 16:47 »
If you have the full version and it doesn't work on Android, let me know and I can send you a game .exe without the DRM.
Do you mean that if I buy a full version of Al Emmo, it will still have the modified executable? Or will I have a new exe free of modifications?

Joseph DiPerla

  • Posts: 1,235
  • 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 #322 on: 02 Feb 2013, 17:08 »
Hey JJS, any chance you can also expose the ShowPreferences Activity with the intent filter like you did with the AGS Runtime?

Also, According to this:

Code: Adventure Game Studio
  1. private void showPreferences(int position)
  2.         {
  3.                 Intent intent = new Intent(this, PreferencesActivity.class);
  4.                 Bundle b = new Bundle();
  5.                 b.putString("name", (position < 0) ? "" : folderList.get(position));
  6.                 b.putString("filename", (position < 0) ? null : filenameList.get(position));
  7.                 b.putString("directory", baseDirectory);
  8.                 intent.putExtras(b);
  9.                 startActivity(intent);
  10.         }

What are the extra's in "name" and "filename"? Is it the position the directory holds inside of the AGS Games directory? Does it start at 1 or 0 if that is the case? For that matter, how is the position determined? "Name" seems a bit more obvious, but I have no clue where/what the "filename" grabs.
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

AGD2

  • Posts: 286
    • AGD2 worked on a game that was nominated for an AGS Award!
      AGD2 worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #323 on: 02 Feb 2013, 22:43 »
Do you mean that if I buy a full version of Al Emmo, it will still have the modified executable? Or will I have a new exe free of modifications?

Check your PMs, Crimson Wizard.

Alright, just tested this on the Kindle Fire and I'm happy to report that the toggle keyboard option does show up when hitting the menu button, and the on-screen keyboard turns on and off just fine. Nice work!

The keyboard still isn't possible to bring up on the Galaxy tablet/Honeycomb, though. And a small correction; the menu button actually disappears when you run the AGS app (not when you tap on a game from the list, like I previously reported). I took a video of this here. Watch at the end, after I hit the "Back" button and tap "yes" to quit the game. the menu button (which had disappeared) re-appears after AGS closes.

Now, I just tested the latest version on my Galaxy S1, Galaxy tablet, and on a Kindle Fire. In all cases the music did play. For some reason, it just refuses to play on my Galaxy S3, which is very strange, as the sound effects work. The music worked without any problems on my S3 in all the previous builds.

Another peculiar anomaly is that Al Emmo averages about 44 FPS on my 'ancient' Galaxy S1, yet fluctuates between 35 and 40 FPS on my Galaxy S3, which is technically superior (dual core) and much newer. This is with identical settings for the game on both S1 and S3 ("Hardware" Renderer setting)

Crimson Wizard

  • Local Moderator
  • Posts: 8,730
    • 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 #324 on: 03 Feb 2013, 01:59 »
OK, I got your package :)
The FileWriteInt error no longer occurs during start-up when the game loads. However, now there's no music. It's really odd! Starting the game from scratch results in no music in the logo movie, title screen, or game. Sound effects, ambient sounds, and speech all play just fine, though. (This happens in all games, not just Al Emmo).
Does not happen to me on Windows. And, frankly, I can't test this on Android simply because I don't have any device with it. The only portable device I own is a cellphone. I am a bit conservative user :).
Maybe JJS could check this?


E: Hmm, I probably could use this: http://developer.android.com/tools/help/emulator.html
How precise is this emulator in its simulation?
« Last Edit: 03 Feb 2013, 02:02 by Crimson Wizard »

JJS

  • Posts: 317
    • Best Innovation Award Winner 2012, for his efforts in porting AGS to multiple platforms
Re: AGS engine Android port
« Reply #325 on: 03 Feb 2013, 13:07 »
The emulator is based on qemu and therefore offers full hardware emulation. But according to the last post, the "no music" issue only occurs on the Samsung Galaxy S3. I cannot reproduce it on my HTC Desire.

I don't see anything in the last changes that would cause music to stop. Would it be possible that the issue is caused by something else specific to the phone? I had weird issues that were caused by file system corruption which rather easily happens on Android in my experience.

The keyboard still isn't possible to bring up on the Galaxy tablet/Honeycomb, though. And a small correction; the menu button actually disappears when you run the AGS app (not when you tap on a game from the list, like I previously reported). I took a video of this here. Watch at the end, after I hit the "Back" button and tap "yes" to quit the game. the menu button (which had disappeared) re-appears after AGS closes.
Ok, here is the problem: Starting with 4.0 there is no more "menu" functionality. Instead apps are supposed to use the "action bar". The problem is that AGS runs fullscreen which hides the action bar. I also don't see an easy way to display it (or the menu) on demand without interfering with the game itself.

A quick and dirty solution would be setting the target SDK version to Android 2.x. This will force the menu button to appear but it will also make all UI elements look very huge and ugly. Another solution would be replacing the "longpress on back" functionality with popping up the menu. At least I can reproduce the issue in the emulator because with recent updates it seems to display software buttons correctly.


3) An odd glitch that I noticed. I have "use custom preferences" checked for KQ3. For some reason, when I turn the phone sideways, the "use custom preferences" box suddenly shows as unchecked and all the other options revert to the 'default' state. If I then turn the phone upright again, all the checkboxes reappear. I can keep turning the phone sideways and upright and the options keep changing back and forth.

The opposite happens for another game which does not have "use custom preferences" checked. If I turn the phone sideways, then all the buttons do become checked and vice versa.

In the general/Global Preferences, I do have custom settings and checkboxes ticked. So maybe the individual game settings are getting confused and displaying those when turned sideways and upright?
I pushed a possible fix.



Hey JJS, any chance you can also expose the ShowPreferences Activity with the intent filter like you did with the AGS Runtime?
Done. The parameters mean this:
Code: Adventure Game Studio
  1. name = "5 Days A Stranger" // Is displayed at the top of the preferences, can be anything
  2. OR
  3. name = "" // Indicates that the global preferences should be shown
  4.  
  5. filename = "/sdcard/ags/5days/5days.exe" // Full path to the game exe
  6. directory = "/sdcard/ags" // Path to the "root" ags directory
  7.  

The position in the launcher is of no concern for your application.


Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Joseph DiPerla

  • Posts: 1,235
  • 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 #326 on: 03 Feb 2013, 14:29 »
Awesome! Thanks JJS.
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

AGD2

  • Posts: 286
    • AGD2 worked on a game that was nominated for an AGS Award!
      AGD2 worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #327 on: 03 Feb 2013, 23:50 »
Quote from: JJS
I don't see anything in the last changes that would cause music to stop. Would it be possible that the issue is caused by something else specific to the phone? I had weird issues that were caused by file system corruption which rather easily happens on Android in my experience.

I thought so too, but then I tried playing with it a bit more and I think I've pinpointed the issue. It actually happens on my S1, Galaxy Tablet, and S3 and I have confirmed the bug and the solution on all devices. The "no music" glitch seems to be related to the "Needs MIDI patches on the SD card" setting. If you have this option checked in an individual game's preferences, then the digital music will play. However, if you have it unchecked, then the digital music will not play.

I actually downloaded several older versions of the AGS app from the daily page and have confirmed that it happened as far back as AGS_2012-11-29_17-36-18.apk.

Quote from: JJS
Ok, here is the problem: Starting with 4.0 there is no more "menu" functionality. Instead apps are supposed to use the "action bar". The problem is that AGS runs fullscreen which hides the action bar. I also don't see an easy way to display it (or the menu) on demand without interfering with the game itself.

A quick and dirty solution would be setting the target SDK version to Android 2.x. This will force the menu button to appear but it will also make all UI elements look very huge and ugly. Another solution would be replacing the "longpress on back" functionality with popping up the menu. At least I can reproduce the issue in the emulator because with recent updates it seems to display software buttons correctly.

I still don't understand why they didn't just keep both as physical buttons on the tablet devices, like they do on smartphones. (wrong)

Hmmm... the problem with long-press is that Jellybean seems to come with a "multi-window mode" toolbar that is auto-configured to appear whenever you long-press the back button. I'm sure it can probably be reconfigured or disabled someplace, but by default it hijacks the long-press function when AGS games are running. In addition to that, the Kindle Fire doesn't register long-presses on the Back button either.

The only other thing I can think of would be to make the Back button handle everything by popping up the menu instead, which would probably mean sacrificing its ESC key functionality.

I guess this is more of an engine implementation, but would it eventually be possible to let game authors put a perpetually-visible AGS GUI button on their game screen, which would invoke the Android's Menu button functionality when pressed?


Quote from: JJS
I pushed a possible fix.

Thanks! From what I've tested so far, it seems to work.

R4L

  • Posts: 1,363
  • You need me Rick...
Re: AGS engine Android port
« Reply #328 on: 05 Feb 2013, 05:52 »
Hey JJS I'm getting a weird occurrence in Pleurghburg. About halfway through you can't advance any further because parker will not walk into the old mans apartment. Therefore you can't show her an item to advance. any way I can get around this or is it engine related? Playing on my HTC Evo 3D

JJS

  • Posts: 317
    • Best Innovation Award Winner 2012, for his efforts in porting AGS to multiple platforms
Re: AGS engine Android port
« Reply #329 on: 05 Feb 2013, 06:59 »
Can you provide a savegame that shows the issue? If you cannot upload it, just send it to my email jjs@jjs.at. It is most probably a problem with backward compatibility.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Crimson Wizard

  • Local Moderator
  • Posts: 8,730
    • 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 #330 on: 08 Feb 2013, 14:06 »
Can you provide a savegame that shows the issue? If you cannot upload it, just send it to my email jjs@jjs.at.
Wouldn't it be a good idea to find a centralized place to allow people upload files related to their errors? This might be essential now, when there's Wadjet Eye's releases for Linux.

Joseph DiPerla

  • Posts: 1,235
  • 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 #331 on: 09 Feb 2013, 13:58 »
So JJS, I was having some issues in getting the preferences to load properly. For instance, this is what I am passing to com.bigbluecup.android.PreferencesActiv ity:

Name: Pleurghburg
Filename: /storage/sdcard0/ags/Pleurghburg_DA/Pleurgh.exe
directory: /storage/sdcardo/ags

Yet, when I start the preferences from my app, it says that AGS had to close. Any thoughts? Are any of these details wrong?
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

R4L

  • Posts: 1,363
  • You need me Rick...
Re: AGS engine Android port
« Reply #332 on: 10 Feb 2013, 04:51 »
I'll upload my save game soon.

EDIT: Here you are! Note that you'll have to go to the fourth floor and talk to the boss first then it will automatically bring you to the room where the problem is happening.
« Last Edit: 10 Feb 2013, 05:01 by R4L »

Joseph DiPerla

  • Posts: 1,235
  • 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 #333 on: 10 Feb 2013, 19:47 »
Hey JJS, looking through the code for PreferencesActivity...

Should line 71 read:

Code: Adventure Game Studio
  1. public void onCreate(Bundle bundle)

rather than be protected?

And on lines 47 to 49, it reads:

Code: Adventure Game Studio
  1. gameName = getIntent().getExtras().getString("name");
  2.         gameFilename = getIntent().getExtras().getString("filename");
  3.                 baseDirectory = getIntent().getExtras().getString("directory");
  4.  

Would this make it a difference:


Code: Adventure Game Studio
  1. String gameName = getIntent().getExtras().getString("name");
  2.         String  gameFilename = getIntent().getExtras().getString("filename");
  3.                 String baseDirectory = getIntent().getExtras().getString("directory");


And remove the declarations on line 17,18 and 20. Could that be causing my issue with Accessing Preferences Activity? Because if I pass nothing to it, the engine wont crash. So I am wondering that because those items are hidden to be used within the code itself, it could be causing my crashing when I try to access the Game's Preferences.
« Last Edit: 10 Feb 2013, 19:49 by Joseph DiPerla »
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

piperhcombs

  • Posts: 211
  • aka Trish
Re: AGS engine Android port
« Reply #334 on: 12 Feb 2013, 17:02 »
Quote from: AGD2
Quote from: JJS
Ok, here is the problem: Starting with 4.0 there is no more "menu" functionality. Instead apps are supposed to use the "action bar". The problem is that AGS runs fullscreen which hides the action bar. I also don't see an easy way to display it (or the menu) on demand without interfering with the game itself.

A quick and dirty solution would be setting the target SDK version to Android 2.x. This will force the menu button to appear but it will also make all UI elements look very huge and ugly. Another solution would be replacing the "longpress on back" functionality with popping up the menu. At least I can reproduce the issue in the emulator because with recent updates it seems to display software buttons correctly.

I still don't understand why they didn't just keep both as physical buttons on the tablet devices, like they do on smartphones. (wrong)

Hmmm... the problem with long-press is that Jellybean seems to come with a "multi-window mode" toolbar that is auto-configured to appear whenever you long-press the back button. I'm sure it can probably be reconfigured or disabled someplace, but by default it hijacks the long-press function when AGS games are running. In addition to that, the Kindle Fire doesn't register long-presses on the Back button either.

The only other thing I can think of would be to make the Back button handle everything by popping up the menu instead, which would probably mean sacrificing its ESC key functionality.

I guess this is more of an engine implementation, but would it eventually be possible to let game authors put a perpetually-visible AGS GUI button on their game screen, which would invoke the Android's Menu button functionality when pressed?

I can confirm that you still can't bring up the keyboard on the Google Nexus 7, which runs Jellybean.

Actually I have an idea about why. Here is a picture of the standard bottom navigation bar that you see while in an app on the Jellybean platform, which believe is the navigation bar Android 4.0 tablet and smartphones without hardware/physical keys have:
As you can see there are only three buttons. This is also what you see when running AGS. From left to right, the first button is the back button. The middle button is the Home button- quit to home screen and long press and swipe up to start Google Voice. The Home button is what I initially though you meant by the menu button to trigger the keyboard. More on that in a bit. The last button is the multiwindow one, bringing up a thumbnail list of active apps to choose from.

As you can see, there is no menu button. Thus, no way to bring up the keyboard. However, there is a possibility here. I recalled from other apps/games (for instance Gameloft's Backstab) that there is a fourth button that can be sometimes be used in the right corner that can act as a menu button. In BackStab, this serves as a way to bring up the game's pause/options menu. Here is a picture of the menu bar with this fourth button visible- known as the overflow menu button:
.
From what I've read, the overflow menu is meant for apps written for older platforms (that make use of the old menu button which is no longer there on newer platforms/devices). It is the equivalent of the old menu button, basically.

 My suggestion is that you could use the overflow menu button to trigger the keyboard like you used the menu button on devices that still have it. 
« Last Edit: 12 Feb 2013, 17:18 by piperhcombs »
:cheers: + :claps:

Temperance&Booth  Sydney&Vaughn  Nadia&Weiss

Intense Degree

  • Cavefish
  • Posts: 500
Re: AGS engine Android port
« Reply #335 on: 13 Feb 2013, 17:33 »
I don't suppose there is any chance that the tab key could be added to the keys available in the “keys” menu? (at the moment it’s just the “F” keys I think)

This is because there have been a couple of games recently where the inventory is opened by pressing the tab key and there isn’t one on my Galaxy S3 keyboard, so the otherwise perfectly functioning games are unplayable!

Cheers.

Hece

  • Posts: 6
    • I can help with making music
    • I can help with play testing
    • I can help with proof reading
    • I can help with story design
    • I can help with translating
    • I can help with voice acting
Re: AGS engine Android port
« Reply #336 on: 15 Feb 2013, 16:02 »
This is exellent emulator! 5/5
works great on LG Optimus

Schwiney

  • Posts: 2
Re: AGS engine Android port
« Reply #337 on: 19 Feb 2013, 03:12 »
Sorry if this is already known but I cannot open up the keyboard on the Kindle Fire HD 8.9 inch while playing AGS games usiing teh latest build.  So I can't name saved games.  Am I doing something wrong?  Is there a way to open the keyboard directly using a shortcut kept in Favorites?  Thanks for your help!

Schwiney

  • Posts: 2
Re: AGS engine Android port
« Reply #338 on: 19 Feb 2013, 03:54 »
Found a way to bring up the keyboard manually:
http://android.stackexchange.com/questions/28045/is-there-any-way-to-manually-bring-up-the-keyboard

I installed Hacker's Keyboard, setting to "permanently notify" and open the keyboard on the Kindle HD by pulling down the notification bar and pressing on the notification.

piperhcombs

  • Posts: 211
  • aka Trish
Re: AGS engine Android port
« Reply #339 on: 19 Feb 2013, 16:10 »
Sorry if this is already known but I cannot open up the keyboard on the Kindle Fire HD 8.9 inch while playing AGS games usiing teh latest build.  So I can't name saved games.  Am I doing something wrong?  Is there a way to open the keyboard directly using a shortcut kept in Favorites?  Thanks for your help!

Seems you've already found a workaround, but I'll reply anyway. The keyboard issue was brought up on this page of the thread and the page before it.

JJS did program in a way to bring up the keyboard, but it only seems to work on tablets/phones that still have the old MENU button (not the home button). That means he made so that the keyboard is activated by pressing the MENU button. Unfortunately, many newer Android phones/tablets like your Kindle Fire and my Google Nexus 7 no longer have the MENU button. I have already suggested a solution a few posts above yours (http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636445890#msg636445890) that involves using the overflow menu button which shows up in the right corner of the navigation bar (as my pictures show) as a way to enable apps programmed to have a MENU button function (aka written for older Android versions) to still have the MENU function. 
:cheers: + :claps:

Temperance&Booth  Sydney&Vaughn  Nadia&Weiss