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

Re: AGS engine Android port
« Reply #380 on: 02 May 2013, 12:00 »
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.

Re: AGS engine Android port
« Reply #381 on: 06 May 2013, 22:45 »
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.

Re: AGS engine Android port
« Reply #382 on: 08 May 2013, 22:38 »
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!
« Last Edit: 08 May 2013, 22:41 by fischkopf »

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • 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 #383 on: 08 May 2013, 23:08 »
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?

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.
« Last Edit: 08 May 2013, 23:12 by Crimson Wizard »

Re: AGS engine Android port
« Reply #384 on: 09 May 2013, 12:30 »
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 :)


Re: AGS engine Android port
« Reply #385 on: 09 May 2013, 14:59 »
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.

EDIT:

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

Code: Adventure Game Studio
  1. if ((key == KeyEvent.KEYCODE_BACK) && ((ev.getFlags() & 0x80) > 0)) // FLAG_LONG_PRESS
  2.                                 {
  3.                                         ignoreNextActionUp_Back = true;
  4.                                         openOptionsMenu();
  5.                                 }

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: Adventure Game Studio
  1. //              requestWindowFeature(Window.FEATURE_NO_TITLE);
  2.  

And add these lines just before and after the setContentView
Code: Adventure Game Studio
  1.                 getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
  2.                
  3.                 setContentView(R.layout.loading);
  4.                
  5.                 displayActionBar();
  6.  

Method displayActionBar:

Code: Adventure Game Studio
  1.         @TargetApi(11)
  2.         private void displayActionBar() {
  3.                 if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
  4.                         final ActionBar actionBar = getActionBar();
  5.                 actionBar.setDisplayShowHomeEnabled(true);
  6.                 }
  7.         }
  8.  

Finally, in ingame.xml, add the following to the three menu items (@+id/toggle_keyboard, @+id/keys, @+id/exitgame)
Code: Adventure Game Studio
  1.  android:showAsAction="always"
  2.  

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.

Re: AGS engine Android port
« Reply #386 on: 09 May 2013, 16:02 »
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.
« Last Edit: 09 May 2013, 16:04 by Cubbie »

Re: AGS engine Android port
« Reply #387 on: 09 May 2013, 17:18 »
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

Re: AGS engine Android port
« Reply #388 on: 10 May 2013, 16:34 »
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.

Re: AGS engine Android port
« Reply #389 on: 10 May 2013, 19:53 »
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

  • Infamous Quests
    • Blackthorne worked on a game that was nominated for an AGS Award!
      Blackthorne worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #390 on: 11 May 2013, 00:29 »
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

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2012, for his efforts in porting AGS to multiple platforms
    •  
Re: AGS engine Android port
« Reply #391 on: 11 May 2013, 09:02 »
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

Re: AGS engine Android port
« Reply #392 on: 11 May 2013, 13:58 »
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

Re: AGS engine Android port
« Reply #393 on: 16 May 2013, 06:55 »
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.

Re: AGS engine Android port
« Reply #394 on: 08 Jul 2013, 10:58 »
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
« Last Edit: 08 Jul 2013, 11:03 by deee »


Re: AGS engine Android port
« Reply #395 on: 14 Jul 2013, 19:52 »
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. 50% completed

JJS

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2012, for his efforts in porting AGS to multiple platforms
    •  
Re: AGS engine Android port
« Reply #396 on: 15 Jul 2013, 08:49 »
Actually 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.

I 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

Re: AGS engine Android port
« Reply #397 on: 16 Jul 2013, 00:03 »
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,

Re: AGS engine Android port
« Reply #398 on: 17 Jul 2013, 21:07 »
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

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2012, for his efforts in porting AGS to multiple platforms
    •  
Re: AGS engine Android port
« Reply #399 on: 19 Jul 2013, 07:27 »
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