[OLD-1] AGS engine Android port

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

Previous topic - Next topic

rykkeri

Quote from: DoorKnobHandle on Thu 02/05/2013 11:55:15
I've always just used the alternative input mode where you can put your finger down anywhere on the screen and it WON'T warp the cursor over there but leave the cursor where it was and just move it RELATIVE to your finger position. Works really well!

The problem with your idea is that, when the cursor is always to the top left of where your finger is, all of the sudden you can't click things on the right or bottom edge of the screen. :p

Oh, didn't either notice that relative behavior or it didn't work for HTC Explorer with Android 2.3.5. Will try again, thanks for the tip.

And yes, for the idea that I presented there should be the standard way activated for using the cursor when closing to the bottom corners.

garry4all

I tried to build the Android libraries with ndk-build and I get the following error.

C:/android-ndk-r8e/build/core/add-application.mk:128: Android NDK: WARNING: APP_
PLATFORM android-14 is larger than android:minSdkVersion 4 in jni/../AndroidMani
fest.xml
Install        : libagsengine.so => jni/../libs/armeabi/libagsengine.so
Install        : libpe.so => jni/../libs/armeabi/libpe.so
Install        : libags_snowrain.so => jni/../libs/armeabi/libags_snowrain.so
Install        : libagsblend.so => jni/../libs/armeabi/libagsblend.so
Install        : libagsflashlight.so => jni/../libs/armeabi/libagsflashlight.so
make: *** No rule to make target `jni/../jni/../../../Engine/../Plugins/agslua/a
gslua/agslua/agslua_autogen.cpp', needed by `obj/local/armeabi/objs/agslua/__/Pl
ugins/agslua/agslua/agslua/agslua_autogen.o'.  Stop.

I was finally able to extract the libraries from the apk, but I would like to know why the ndk-build didn't work.

Thanks.

fischkopf

#382
Could you add to the port, a virtual screen keyboard  that pops up, if i open save game menus? Or, if you don't type anything name the savegames save[$], etc...That is the only thing i have to critisize, great port nonetheless!

Crimson Wizard

#383
Quote from: fischkopf on Wed 08/05/2013 22:38:48
Could you add to the port, a virtual screen keyboard  that pops up, if i open save game menus?
I doubt it is possible to detect when savegame menu is on, because for the engine all menus are the same (unless the game uses default built-in AGS functionality, which is not very common in latest games).
Probably it would be possible to detect when a text input control is shown and has focus.
Still, this won't help in exceptional cases when game has some custom way to program user input. Therefore, I am wondering if it would be better to bind virtual keyboard appearance to any of the persistent device's controls?

Quote from: fischkopf on Wed 08/05/2013 22:38:48
If you don't type anything name the savegames save[$]
Again, that depends on the game. If the game does not test for empty string and tries to save game even with empty name, then engine will be able to hack in and change that name, but if the game is scripted in such a way that it checks for empty string and does not let to save if string is empty, then not much may be done...

To summ up, since the engine is a "virtual machine" which executes scripts, in most cases it has no means to "understand" the meaning of script actions as we, users, see it and find the ways to override it.
Unless the overrides are programmed on per-game basis, that is.

Cubbie

Hi,

I was wondering if there was any progress on the 'no keyboard on nexus 7' issue.
I've made some experiments with Tasker, trying to have the keyboard pop up on certain conditions. I.e. 'AGS running and display orientation = portrait' works well. alas, not in AGS... :)
something seems to prevent the keyboard from popping up. Maybe there is some kind of flag to set, that enables input?

everything else works really well and it's a shame that such a little problem renders the whole thing pretty much unusable.
Hope this can be resolved somehow :)


garry4all

Quote from: Joseph DiPerla on Thu 25/04/2013 04:26:17
I believe that if you replace the target Android SDK to be 14 or higher, it will show a soft key menu button, which would then allow you to pop up the keyboard. That has to be done in the Android Manifest file of the source code. I will try re-compiling the sources I have to see if that would do the trick.

I tried this with no luck, my tablet already has 4 buttons in the navigation bar (home, back, recent apps, screenshot) so the menu button never appears.

Quote from: Joseph DiPerla on Thu 25/04/2013 04:26:17
EDIT:

Actually, JJS, if you change the Keycode_Back to perform this this:

Code: AGS
if ((key == KeyEvent.KEYCODE_BACK) && ((ev.getFlags() & 0x80) > 0)) // FLAG_LONG_PRESS
				{
					ignoreNextActionUp_Back = true;
					openOptionsMenu();
				}


in dispatchKeyEvent in AGSEngine.java, it should allow you to longpress the back button on screen and pop up the menu which has all the options we need: Toggle Keyboard, Exit Game, F Keys, etc... That would then allow the game to work on Nexus 7/10, ASUS and Kindle devices or other devices without hardware keys.

And this doesn't work either because the call to openOptionsMenu() does nothing if the activity doesn't have an ActionBar (as explained here: http://blog.perpetumdesign.com/2011/08/strange-case-of-dr-action-and-mr-bar.html)

So, Cubbie, a temporary workaround I did for this is to make the ActionBar visible and show the menu options in it:
In AgsEngine.onCreate delete line 76
Code: AGS
//		requestWindowFeature(Window.FEATURE_NO_TITLE);


And add these lines just before and after the setContentView
Code: AGS

		getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
		
		setContentView(R.layout.loading);
		
		displayActionBar();


Method displayActionBar:

Code: AGS

	@TargetApi(11)
	private void displayActionBar() {
		if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
			final ActionBar actionBar = getActionBar();
	        actionBar.setDisplayShowHomeEnabled(true);
		}
	}


Finally, in ingame.xml, add the following to the three menu items (@+id/toggle_keyboard, @+id/keys, @+id/exitgame)
Code: AGS

 android:showAsAction="always"


When running the games, they will not be fullscreen, you'll see the ActionBar, but at least they are playable.

There might be other ways to solve this but for the moment is all I could find. Hope this helps.

Cubbie

#386
Am I assuming right that those instructions would require me to compile the port myself? That's a bit out of scope for me. :)
I'm also not sure it would help me. On my tablet (Nexus 7), the action bar is always there! It's just missing the Menu-Button. But the Back-Home-Recent buttons never disappear. I guess since there are no hardware buttons, the system just won't allow any app to hide the bar completely. Some apps like e.g. video players can "dim" it (the three icons will just appear as dim circles until pressed), but it's never completely gone.

garry4all

What you are referring to is the Navigation Bar (Home, Back, etc), located at the bottom.
The Action Bar is always located at the top of the screen.
I'll see if I can send you my apk later in the day

garry4all

Sooo it was much easier than what I did. I reverted my changes and just set android:targetSdkVersion to 10 in both projects.
The blue theme is lost in the game selection screen, but a menu button appears in the navigation bar, as you can see in this screenshot

Here's the modified apk, I'm confident it will work on your device.

Cubbie

Awesome, thanks a lot. Works perfectly. :)
I remember the developer mentioning that possibility, but he seemed to be against it. So all the more thanks for making this available!

The Space Quest II remake still won't let me enter a name for the save game, though. Bummer :)

Blackthorne

Quote from: Cubbie on Fri 10/05/2013 19:53:02
Awesome, thanks a lot. Works perfectly. :)
I remember the developer mentioning that possibility, but he seemed to be against it. So all the more thanks for making this available!

The Space Quest II remake still won't let me enter a name for the save game, though. Bummer :)


Hmm.  I wonder why that is.  If there's anything I can do to adjust to help fix that for Android, let me know.  (My group made that.)


Bt
-----------------------------------
"Enjoy Every Sandwich" - Warren Zevon

http://www.infamous-quests.com

JJS

As for the build failing on the lua plugin: You have to initialize and update the lua submodule. See here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636451342#msg636451342

I switched the SDK target to 10 now, so the backward compatibility stuff should be in full effect now. The new daily build has that change.

I tried Space Quest II on my phone and on the emulator and I could enter characters via the onscreen keyboard, so I cannot reproduce the problem.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Cubbie

Turns out my keyboard was at fault. Although I'm pretty sure I tried the stock keyboard and it didn't work yesterday... Well, it does now. So all is good. Thanks for all the help!

zdj

Found a work around for those stuck on the gun training part of Gemini Rue due to the ctrl key issue:
1. Open the game menu by pressing back button
2. Press "keyboard" button.
3. reassign breathe action to the '6' key
4. Resume the game and you can now perform breathe by pressing the 'f' key on the on screen keyboard.

I stumbled upon this by accident and have no idea why it works but it does on my Galaxy S3. I don't know if it works on other phones.

deee

#394
First of all, this is really awesome and gets us all one step closer to cross-platform published AGS games.
Wonderful work, JJS, I just can't describe the moment I had when running one of my games on a tablet for the first time.

Actually I had some heavy performance problems (a maximum of 13 FPS) when testing a 1024x768 game (32 bit).
Even when deactivating room objects, so there are only animated characters, the frames capped at ~17, whereas my PC runs the game at ~140 FPS.
Is this normal, or can I do something to get a better performance?
I am just asking before resizing everything to 640x480 and deactivating all the good looking stuff.

Edit:
Testing devices (both at a very low frame rate) were:
-Asus Eepad Transformer tf201
-Samsung Galaxy Note n7000


cianty

I know it's been mentioned/requested before, but MAN would I love to see an OUYA port. I'm actually kind of disappointed by the weak portfolio of OUYA games. Well, at least it made be conscious of the Fester Mudd release but I ended up playing it on my iPad instead. Until there's a ScummVM - or better even - AGS port for OUYA I don't see me using the OUYA much...
ca. 70% completed

JJS

Quote from: deee on Mon 08/07/2013 10:58:31Actually I had some heavy performance problems (a maximum of 13 FPS) when testing a 1024x768 game (32 bit).
Have you tried using one of the hardware renderers from the preferences menu? It should boost the performance like using the D3D driver on Windows does. It is a bit incomplete though because there is no character tinting yet.

Quote from: cianty on Sun 14/07/2013 19:52:40I know it's been mentioned/requested before, but MAN would I love to see an OUYA port.
It should be possible to sideload AGS onto the OUYA. There would be the problem of missing controller support though. I don't have an OUYA (no intention on buying one either) and the SDK probably still doesn't work right on the emulator (I will test if that holds still true). If someone else wants to implement OUYA support be my guest.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

QuestingHero

It side loads just fine on OUYA. The only thing I wish I could do (and honestly, this would be good on ALL Android version), is use a real mouse. I have a USB Keyboard and Mouse hooked up to my OUYA, and it works great in DosBox and ScummVM. In this AGS port however, it moves to the point I click and then I have to click again if I want to single click (double Click to single click... kinda). having a way to enable real mouse tracking would be great, and would also work with OTG cables on phones.

Thanks,

deee

Thank you very much, JJS, I didn't even know about the settings.
I played around with it, and it's getting better (around 30 FPS now).
This is so wonderful! (and character tinting isn't really that important)


JJS

Quote from: QuestingHero on Tue 16/07/2013 00:03:32
It side loads just fine on OUYA. The only thing I wish I could do (and honestly, this would be good on ALL Android version), is use a real mouse. I have a USB Keyboard and Mouse hooked up to my OUYA, and it works great in DosBox and ScummVM. In this AGS port however, it moves to the point I click and then I have to click again if I want to single click (double Click to single click... kinda). having a way to enable real mouse tracking would be great, and would also work with OTG cables on phones.

Thanks,
Can you try this build with experimental mouse/keyboard support? I can only test it in a virtual machine, so I cannot tell how it behaves on a real device. Moving and left/right-click should work as well as most keyboard keys (including ESC and F1-F12). Is the AGS mouse cursor for you offset from the Android cursor? http://jjs.at/temp/AGS_mouse.apk
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

SMF spam blocked by CleanTalk