[OLD-1] AGS engine Android port

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

Previous topic - Next topic

AGD2

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

Quote from: AGD2 on Mon 28/01/2013 23:48:10
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

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: AGS
private void showPreferences(int position)
	{
		Intent intent = new Intent(this, PreferencesActivity.class);
		Bundle b = new Bundle();
		b.putString("name", (position < 0) ? "" : folderList.get(position));
		b.putString("filename", (position < 0) ? null : filenameList.get(position));
		b.putString("directory", baseDirectory);
		intent.putExtras(b);
		startActivity(intent);
	}


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

Quote from: Crimson Wizard on Sat 02/02/2013 16:47:16
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

#324
OK, I got your package :)
Quote from: AGD2 on Sat 02/02/2013 03:41:05
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?

JJS

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.

Quote from: AGD2 on Sat 02/02/2013 22:43:02The 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.


Quote from: AGD2 on Mon 28/01/2013 18:43:483) 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.



Quote from: Joseph DiPerla on Sat 02/02/2013 17:08:25Hey 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: AGS

name = "5 Days A Stranger" // Is displayed at the top of the preferences, can be anything
OR
name = "" // Indicates that the global preferences should be shown

filename = "/sdcard/ags/5days/5days.exe" // Full path to the game exe
directory = "/sdcard/ags" // Path to the "root" ags directory


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

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

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: JJSI pushed a possible fix.

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

R4L

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

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

Quote from: JJS on Tue 05/02/2013 06:59:20
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

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.PreferencesActivity:

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

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

Joseph DiPerla

#333
Hey JJS, looking through the code for PreferencesActivity...

Should line 71 read:

Code: AGS
public void onCreate(Bundle bundle)


rather than be protected?

And on lines 47 to 49, it reads:

Code: AGS
gameName = getIntent().getExtras().getString("name");
	gameFilename = getIntent().getExtras().getString("filename");
		baseDirectory = getIntent().getExtras().getString("directory");


Would this make it a difference:


Code: AGS
String gameName = getIntent().getExtras().getString("name");
	String	gameFilename = getIntent().getExtras().getString("filename");
		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.
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

#334
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. 
:cheers: + :claps:

Temperance&Booth  Sydney&Vaughn  Nadia&Weiss

Intense Degree

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

This is exellent emulator! 5/5
works great on LG Optimus

Schwiney

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

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

Quote from: Schwiney on Tue 19/02/2013 03:12:45
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

SMF spam blocked by CleanTalk