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

Re: AGS engine Android port
« Reply #400 on: 19 Jul 2013, 14:09 »
Jumping into testing) Gonna give this build a try too.

Re: AGS engine Android port
« Reply #401 on: 22 Jul 2013, 20:06 »
Hey JJS, I'm just getting started exploring AGS and all it's wonderful goodness. I love what you've done so far on the Android port (though I am having issues where nearly all the games I loaded onto it crash at one point or another and return me to the home screen).

RE: Ouya Support
It shouldn't be necessary to install any particular things to support this as long as you can add controller support. I haven't delved into Android development too much so I can't give you any hints on supporting controller input. That said I have side-loaded a few games onto the Ouya that already had controller support and they work just fine. This might be useful to you: http://docs.nvidia.com/tegra/data/How_To_Support_Android_Game_Controllers.html (yes it's on a site dedicated to a particular chipset but it deals solely with InputDevice and InputEvent objects within the standard ADK) As an added bonus you'd be adding controller support for all android devices. Getting it on the Ouya store is another thing altogether but I can't imagine that would be too difficult.

I will certainly be keeping my eye on this project. One thing, though: eventually (as the bugs dwindle down), it would be nice if there were a way to use this as a wrapper on an AGS game that could then be released on the play store. I, for one, would be perfectly willing to provide some sort of monetary kickback to you if I ever decided to release something commercially (assuming the license allows such a thing, if not then maybe a donation to the... er... Charitable Fund For The Benefit of... er... JJS Porting Activities).

Re: AGS engine Android port
« Reply #402 on: 23 Jul 2013, 17:23 »
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
I was out of town this past weekend, so I didn't see your post until now. Right now I am at work so I can't try it out on the Ouya, BUT, my HTC One has USB OTG and I just tried it out on it (Mouse Only, no extra Keyboards here). Right and Left buttons work perfect, single clicks with both registered as expected. The mouse pointer did move when I moved the mouse, but at a much smaller scale. If I started at the far right side, and moved the mouse pointer all the way to the Left side, the Game Pointer only goes about 1/2 to 2/3 the way across. I would not worry about there being double cursers, DosBox Turbo and ScummVM have the same issue. On a side note about both of those apps, ScummVM keeps both cursers pretty close, DosBox Turbo on the other hand has a Mouse Offset that you can adjust (I think I have it about 35% - 40% if that helps at all).

Re: AGS engine Android port
« Reply #403 on: 23 Jul 2013, 17:33 »
UPDATE: I had both "Relative Mouse Control" and "Dragging with Longclink" checked in the settings. after turning both of them off, mouse movement is PERFECT! there are 2 mouse pointers (System Mouse is on top of Game Mouse), but the game mouse keeps right up with the system mouse. Even when I move the System mouse off the black area of the sides of the game (4x3 game on a 16x9 screen), when I brought the system mouse back to the game area, the game mouse jumped right back to it.

Well Done JJS, I look forward to installing this on my Ouya.

UPDATE 2: Just had a chance to test this on the Ouya and it works great! Just like before I had to make sure those 2 options were unchecked. My Test game was Quest for Glory 2. Everything with the mouse worked flawlessly. I did try out a full size USB Keyboard on the Ouya too, and all the Alpha keys worked. the numb pad worked (when numlock was on). All the supported F1-12 Keys worked. the only thing that didn't (and I don't know if this can even be fixed), is the Ctrl+Alpha keys didn't work. Like in the game you can press Ctrl+S to bring up your stats... but that is not a game breaker as they are duplicated in the menus.

Once again, Amazing work and thank you so much.
« Last Edit: 23 Jul 2013, 22:25 by QuestingHero »

Re: AGS engine Android port
« Reply #404 on: 24 Jul 2013, 19:04 »
QuestingHero, you just caused me to get a wireless mouse from Amazon. I can't wait to try this on my OUYA.

I have a few AGS games that I still need to play so I'll use them as test cases. :)

Update: Even without a proper mouse this already works great on OUYA. The mouse movement is perfect and the controller has already left clicks (U) and right clicks (Y) built in. Sweet! Now if only the controller's touchpad was a bit nicer.
« Last Edit: 24 Jul 2013, 19:16 by cianty »
ca. 50% completed

Re: AGS engine Android port
« Reply #405 on: 24 Jul 2013, 19:28 »
QuestingHero, you just caused me to get a wireless mouse from Amazon. I can't wait to try this on my OUYA.

I have a few AGS games that I still need to play so I'll use them as test cases. :)

Update: Even without a proper mouse this already works great on OUYA. The mouse movement is perfect and the controller has already left clicks (U) and right clicks (Y) built in. Sweet! Now if only the controller's touchpad was a bit nicer.

:-P Always glad to help a fellow nerd spend money. A wireless mouse (Did you go bluetooth?) is much better then my really long USB Cable. Let me know what mouse you got and how well it works for you.

Also, thank you for telling me about the (U) and (Y) Buttons, did that work on other builds, or just this newest one?

Re: AGS engine Android port
« Reply #406 on: 24 Jul 2013, 19:52 »
Thanks for testing the build! Sounds very promising. Implementing button combinations (Alt-X, etc.) is a bit difficult, so it won't happen too soon I think.

The build also has some sort of gamepad support in that two buttons are mapped to left click and right click, MENU is mapped to the "select" button and ESC to the "start" button. Wiggling the analog stick around should also move the mouse cursor, but that doesn't work right yet.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Re: AGS engine Android port
« Reply #407 on: 24 Jul 2013, 19:58 »
I didn't even try the controller when I was testing (because I was focused on the mouse). this is VERY Promising , and am very excited about it. Any idea what button "start" would be on the ouya controller? looks I'll have something to play with later.

Will these feature be merged in to the normal build? and would it be a check box in the settings to enable?

Re: AGS engine Android port
« Reply #408 on: 24 Jul 2013, 20:24 »
I will push these changes to the repository, so they will be in the normal builds. I guess mouse and joystick support could be always on.

From the looks of it, the OUYA controller does not feature a start or a select button. Strange design decision.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Re: AGS engine Android port
« Reply #409 on: 25 Jul 2013, 09:12 »
@QuestingHero: Yeah, I did go with bluetooth thanks to you. As I have never used one before I didn't want to spend too much on it. Here's the Amazon link (German):

Regarding Start/Select on the OUYA, in the SNES emulator that I have played a lot with recently Select and Start are mapped on the joystick buttons: You can press on the two joysticks to trigger them.

Here's a description of the controller and its buttons:

UPDATE: So I got my new mouse and it's great! However, true controller support definately be way more convenient as you wouldn't have to switch devices (you can't fully naviagte the OUYA menus with a mouse only). Also I'm having problems with having a proper surface to place the mouse when sitting on the couch. A proper controller where the joystick(s) caused the mouse to move would be way cooler.

Also, would it be possible to have the d-pad trigger the arrow keys? This would mean auto support for all games that have character movement based on arrow keys (in addition to clicking).
« Last Edit: 25 Jul 2013, 17:12 by cianty »
ca. 50% completed

Re: AGS engine Android port
« Reply #410 on: 27 Jul 2013, 19:09 »
Ok, I have everything set up and can debug the app directly on the OUYA. Now I wanted to add check e.g. KeyEvent.KEYCODE_DPAD_RIGHT and then pass the respective ARROW_RIGHT key code to the engine. However, I have no idea what value to use here. The idea was to use glue.keyboardEvent() but what value would be right for the arrow keys? I don't quite get where the 0x1000 + 47 mapping for F1 e.g. comes from, either. Do you have any hints for me, JJS?

UPDATE: Nevermind. I have found the keycodes at http://alleg.sourceforge.net/a5docs/refman/keyboard.html. Unfortunately ESC doesn't work though, it is recognized as F1 in the engine. I'll keep looking...
« Last Edit: 28 Jul 2013, 19:32 by cianty »
ca. 50% completed

Re: AGS engine Android port
« Reply #411 on: 29 Jul 2013, 17:27 »
Do we have an update yet on being able to convert our games into APKs ourself? :)

Re: AGS engine Android port
« Reply #412 on: 29 Jul 2013, 19:08 »
I think the question is what "ourself" means here.

If it means that you don't want to install Eclipse/IntelliJ, setup the development environment, create a key to sign your APK - then I don't think there is any way you can get a "yes" here.

I see AGS and the various ports like those cross-platform tools/libraries for web apps such as Cordova/PhoneGap: You can create your entire game in AGS like you would create a web app using web standards (JS, CSS, HTML), and when you want to create "native" applications using this same core then you need the respective development environment to compile for the target OS. There is no way you can ever hope to just dump your AGS game into a pre-existing Android/iOS shell and end up with a mobile app.

The entire point of the Android keys e.g. is to allow backtracking of the APK file to the creator.

What is very well feasible however is to provide the community with an environment that can be easily set-up so that any AGS creator can compile their own APK version of their AGS game. JJS had done tons of work in that direction and it is really not too difficult (even with limited programming knowledge) to fork the GitHub repository, download and install Eclipse with Android SDK and NDK and compile the whole thing. Still there are two necessary things to do first: 1) A single-game-only launcher would be needed instead of the Emulator type of thing which JJS has done and 2) a few more bugs and problems with engine as a whole would need to be solved before giving the entire port a "go" for production. I think because of the latter JJS would be very hesitant to advocate using the port for proper releases yet.

The single-game-launcher is not too difficult. I will probably try myself at that, but currently I am working on a keyboard control that works both with keyboard and the OUYA controller.

If you have a single game that you want to support (and if it doesn't go crazy with "unconventional" stuff like large resolutions e.g.) that I can see it very doable to test and finish off the port for Android AGS games. I wouldn't be surprised to see Wadjet do so in short time (although Blackwell on iOS would probably be way more profitable than tackling Android now).

I wonder what JJS thinks of all this...  :smiley:
ca. 50% completed

Re: AGS engine Android port
« Reply #413 on: 30 Jul 2013, 18:23 »
Thanks. We've brought this up a few times and we've been told that it's being worked on, that's why I just asked for an update.

Shane 'ProgZmax' Stevens

  • Mittens Serf
    • I can help with animation
    • I can help with characters
    • Lifetime Achievement Award Winner
    • I can help with making music
    • I can help with proof reading
    • I can help with scripting
    • I can help with story design
    • Shane 'ProgZmax' Stevens worked on a game that won an AGS Award!
    • Shane 'ProgZmax' Stevens worked on a game that was nominated for an AGS Award!
Re: AGS engine Android port
« Reply #414 on: 01 Aug 2013, 06:41 »
You are rocking these builds, JJS.  I've got to load one of my games in on the latest version and see how it works now.

Joseph DiPerla

  • 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 #415 on: 03 Aug 2013, 15:04 »
Thanks. We've brought this up a few times and we've been told that it's being worked on, that's why I just asked for an update.

Tbe problem with building your APK is that the Android port needs to be re-done a little. And I mean that the interface needs to be reworked to allow that a little. Right now it pulls up a list of games. There would need to be a specialized version of the port that can read the directory where the games files will be stored. Moving on to that issue though... Google only allows up to 50mb for the main file. While several games are under that, there are many that are not. You would need to provide expansion files, which you can have up to 2 expansion files of 2 gb each. While thats nice, it requires a heck of a lot of setup/coding. Obb files in theory are not difficult to create and to code into an app. However, for me anyway, there isn't a lot of documentation that makes using obb files easy. Just so I can explain a little bit about how the OBB expansion files work:

1)For the main APK, you need to sign the file.
2)You need to program into the app to check to see if expansion files exist and if they do:
2b) AGS will need to extract the files into the OBB directory (Which should be done automatically)
2c) AGS would either need to move those extracted files to wherever AGS will load the game from or point the game directory to the OBB directory.
3) You have to get some salt/hash security for the expansion files. So to do that, you would have to:
3b) Upload the android apk and the Expansion files to the google market server and not publish it.
3c) Take down the Salt/Hash code and download location/name.
4) Now, you would have to put some code that would allow access to the OBB file from within AGS. I think this is all done to avoid abusing the system. Whatever.
5) After that you would think you are all set... However, while OBB files should download automatically when you are installing the apps, it doesn't always. Sooooo... You would have to program within AGS to check that the obb files downloaded completely and fully. If they did not, then AGS would have to download it itself. Enter the salt/hash/download name crap.

Now, to integrate this into AGS itself is another issue too. The AGS Editor would have settings and such to take care of that (such as package name, author, etc...). AGS would also have to create the OBB Files itself as well as all they really are are zip files within the obb extension. Thats not the hard part. The hard part is making sure that the developer has the Java SDK and the Android SDK installed properly and with the environment properties set up correctly. The reason for that is so that AGS can package the game files properly into the APK and also so that it can automatically sign the APK for you. That is possible, but its a little extra work I would imagine for whoever is coding the editor. But its doable. Eclipse does it and so does Basic4Android. However, the steps for getting the HASH/Salt/Name from the google server will still be up to the game developer and that can prove to be confusing for a few people.

So it may seem like a simple Shell interface would be needed, but its a lot more complicated than that. While I develop Android Apps, I use Basic4Android and it does not currently support OBB Extensions. If it did, I would be all over making a 3rd party set up system for the APK's. If you all need it urgently, go ahead and post on the Basic4Android forums and request it to be added. Right now the developer does not see a need for it, so maybe if enough ask for it, it will be implemented. I would do this in Java, but I know very very little Java. If someone would want to take a whack at trying to implement this system, here are a few good places to start:





This was my suggestion thread on Basic4Android if someone wants to pipe in and add to the suggestions:

Hope this info helps.
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


  • Mittens Serf
Re: AGS engine Android port
« Reply #416 on: 22 Aug 2013, 21:44 »
I was just looking at the process for porting our games to Android and wow, I found out pretty much what you say, Joseph, only I only got half way there! It looks pretty near impossible to do commercial games on Android :(

I was thinking it'd be as simple as the iOS build (which was basically changing some file names here and there) but it really is not.

Re: AGS engine Android port
« Reply #417 on: 23 Aug 2013, 12:24 »
So there idea of official Android releases of our products isn't going to possible?

I'm guessing I'd have to hire someone to create the APK for me then.

Jonathan Wedge

  • It's the time of ICEY!!!
Re: AGS engine Android port
« Reply #418 on: 24 Aug 2013, 06:10 »
JJS quick question, would it be possible for some to come to you with their game, then you could take that game and the AGS apk and sorta merge it into one APK. the APK from the way I'm thinking of it would be like a zip folder or a burnable CD where the files are stuck inside that APK. Now the way it'd work is that you would change the AGS app to automatically open up that game instead of given the option to choose. Sorry if you find what I said confusing, I'm just really sleepy and I can't process a simpler way of asking my question.

Re: AGS engine Android port
« Reply #419 on: 26 Aug 2013, 12:38 »
Did you ever manage to find a work around for the stuttering OGV video playback issue? I've tried it on multiple devices and even encoded the video in different resolutions but the issue is still the same unfortunately.