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

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 #20 on: 04 Nov 2011, 07:21 »
Ok, as I cannot reproduce the problem it might take a bit of time to get this sorted out. But it will work eventually  ;)

First of all: have they finally released an Android port of Allegro? This is too good to be true ;)
Actually I did the port myself, a patch to allegro 4.4.2 is in the source repository.

Also, my test game, which was compiled with V2.6SP1, didn't show up. Is it because my game is 8-bit and the engine does not support 8-bit modes?

I actually tried the PSP version some time earlier out of curiosity and it also didn't recognise my game, but since I just tested it with an emulator (I don't own a PSP, and never will) this cannot be any indication.

EDIT: I just put another 8-bit test game compiled with V3.21 and it was recognised (also white screen though), so it shouldn't be a colour depth. Maybe it has difficulties recognising V2.6SP1 games.
Can you post a link to the non-working game? I would like to check it out. Trilby Notes is an 8 bit game compiled with 2.62 and works, so it might be a file format difference that I didn't account for.

Ok, it works on my hero but not on my sensation but the mouse movement doesnt work very well. The track ball seems to move the mouse a tiny bit and click the left button every time you move it.

dragging the mouse doesnt work at all.
Trackball movement is something I couldn't figure out. The ball on my G1 seems to be pretty much useless because it needs about a full turn to register any movement. Dragging the mouse should work though.

My game doesn't load for some reason. I get a script error about some import called menu? Then when i try to quit I end up having to force close. btw I got a Sidekick 4g
I am aware of this problem and will try to correct it.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Gilbert

  • * KILL* * KILL * * KILL *
    • Lifetime Achievement Award Winner
    •  
Re: AGS engine Android port
« Reply #21 on: 04 Nov 2011, 08:31 »
Can you post a link to the non-working game? I would like to check it out. Trilby Notes is an 8 bit game compiled with 2.62 and works, so it might be a file format difference that I didn't account for.
Well... Turned out the executable was compiled with the DOS engine for some reasons. I swear the last time I tested it it was using the Windows engine. :P After recompiling it with the Windows engine the game was recognised, however, it just crashed upon loading, not even showing the white screen, so I think it's still worthwhile in sending you the game (check your PM).

Also, I had also checked stuffing the ac2game.ags file into the folder before but it was not recognised, so this engine may be unable to locate (or has some troubles in locating) a game using raw data file, without the Windows engine appended to it.

Re: AGS engine Android port
« Reply #22 on: 04 Nov 2011, 10:31 »
This is absolutely fantastic. Great work!

I'm also getting the white screen on my Samsung Galaxy S (Android 2.2) for all the games I've tried. I can rotate it and it will flip without crashing. There are no glitches with the sound or music.

Out of curiosity, I decided to test some of our games compiled with differing AGS versions. Several of them behaved differently to others:

Al Emmo and the Lost Dutchman's Mine v3.0: (AGS 3.2.1.1115)
Loaded with a white screen. For some reason, this game skips over the Ogg Theora logo movie file that plays before the title screen (all other games play movies). If I run the game files from the Android's folder on my PC, the logo movie does play.

King's Quest I Remake v4.1c: (AGS 3.2.0.1110)
Loaded with a white screen. Ogg Theora movie logo played upon start-up (couldn't see it, but could hear the music).

King's Quest 2 Remake v3.0: (AGS 3.1.2.1074)
White box appears on-screen briefly and then the game automatically exits.

King's Quest 3 Redux v1.1: (AGS 3.2.1.1115)
Loaded with a white screen. Ogg Theora movie logo played upon start-up (couldn't see it, but could hear the music).

Quest for Glory II v1.1: (AGS 2.72.920.0)
White box appears on-screen briefly and then the game automatically exits.

Quest for Glory II v2.0: (AGS: 3.2.0.1110)
Loaded with a white screen. Ogg Theora movie logo played upon start-up (couldn't see it, but could hear the music).

Also, quick question: is it possible for this Android port to include an optional mode where the player doesn't need to physically drag the mouse pointer around with their finger to position it? In other words, simply tapping the screen to have the 'click' register directly at the tapped location?
« Last Edit: 04 Nov 2011, 15:04 by AGD2 »

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 #23 on: 04 Nov 2011, 10:50 »
I think I found the problem with the white screen and I will post an updated version later (in a couple of hours). Thanks for all the feedback!

Overall, the input method has to be refined and is open to discussion. Such a mode could certainly be implemented. Also it has to be decided how to do a mouse "drag" with held down left mouse button.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #24 on: 04 Nov 2011, 14:42 »
I would suggest adding new functions to the engine specifically for use with android so that the game dev can change things depending on the platform.

Alternatively you could just add a value to the Game.OS (or whatever it is) enum.

i.e

Code: Adventure Game Studio
  1. //pseudo
  2.  
  3. if (Game.OS == eOSAndroid) {
  4.  mouse.visible = false;
  5.  
  6. }
  7.  
  8.  

and then the game just registers clicks from finger taps without showing the cursor.

Obviously this doesnt help for older games but some form of emulation could be added for older versions of the engine.

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 #25 on: 04 Nov 2011, 14:55 »
Here is the initial version of an engine port to Android. It is based on the PSP port, so it also shares some features:

- Support for AGS data files version 2.60 - 3.21
- Plugin support including AGSBlend and open-source recreations of the Snow/Rain and Flashlight plugin
- All color depths and screen resolutions (scaled to the screen size with correct aspect ratio)

The mouse cursor is moved by dragging, a left click is done by a quick touch and a right click by a slightly longer touch. Only hardware keyboards are supported right now (no way to open the software keyboard atm.)

I chose the namespace as "com.bigbluecup.android". The reason was that I want to avoid the situation of the ScummVm project, where another private namespace was initially used and is still kept to avoid breaking updates through the market. Still, this is open to discussion. For now, the application is also not on the market (would be too early in development anyway).

In this version, no options can be set but I would implement it the same way as in the PSP. So there would be a config file for all games that can be overridden by each individual game. This would ideally be accessible from within the game or launcher.

Games must be placed on the SD card root in the "ags" directory. Each game needs its own subdirectory (like in the PSP port). The data file is automatically detected within the folder.

The native libraries are compiled for generic ARM cpus. Therefore performance could be improved on newer ARM7 cpus by building a "fat" package with multiple libraries (maybe even for x86 Android).

I am no expert in Android development so I would appreciate any feedback.  :=


Download of the package here: http://jjs.at/temp/AGS.apk

Source here: http://gitorious.org/~jjs/ags/ags-for-psp

I LOVE YOU!!!!!!! I am gonna try this on my phone and tablet as soon as I get a chance. Oh, after reading Steve Jobs New biography, please do not port to IPhone. I do not want another feather in apples cap.
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

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on a game that was nominated for an AGS Award!
      abstauber worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #26 on: 04 Nov 2011, 15:00 »
Quote
Oh, after reading Steve Jobs New biography, please do not port to IPhone. I do not want another feather in apples cap.
Have you bought the biography, my feathered friend ;) ?

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 #27 on: 04 Nov 2011, 15:04 »
Unfortunately. While a lot is interesting and I admire what the man has done, that dude had some issues and I felt like he thought he was a god or something.
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

  • You need me Rick...
Re: AGS engine Android port
« Reply #28 on: 04 Nov 2011, 16:18 »
I may be stupid for saying this but...

You said this engine uses OpenGL to render right? Well maybe to fix the white screen issue you could use Chainfire 3D on the app market. Again, just suggesting. I might be stupid for suggesting that lol.

Also, does the ROM matter? It should work on any android ROM right? Because I have rooted LG Optimistic V with bumblebee rom.

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 #29 on: 04 Nov 2011, 17:22 »
Hopefully this fixes the white screen bug: http://jjs.at/temp/AGS_2.apk
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: AGS engine Android port
« Reply #30 on: 04 Nov 2011, 17:31 »
yep that fixes it.

Still cant drag the mouse on either of my phones tho.

Gilbert

  • * KILL* * KILL * * KILL *
    • Lifetime Achievement Award Winner
    •  
Re: AGS engine Android port
« Reply #31 on: 04 Nov 2011, 17:47 »
yep that fixes it.

Still cant drag the mouse on either of my phones tho.
+1

And there seems to be some sprite problems when running my test game (check the horizontal at the title screen).

Re: AGS engine Android port
« Reply #32 on: 04 Nov 2011, 19:00 »
=D \o/

...but

mouse control doesn't work, it doesn't move the mouse (can't click either) and there is no support for landscape mode.

Samsung Galaxy SII, tried Kuma Story and Barn Runner 4.

Still, glad to see this happening =)

Re: AGS engine Android port
« Reply #33 on: 04 Nov 2011, 19:37 »
The white screen issue is fixed for me on the Samsung Galaxy S.

The mouse pointer was very hard to move for me as well. I found that if I held my finger still on the screen for a few seconds, then moved it very slowly, I could sometimes get the pointer to start moving. Sometimes it would follow my lead for a while and I could move it around in patterns. Other times (more often than not) the pointer moved a few pixels and then stopped following my finger. It seemed slightly more responsive in high-res games... but that may just be my imagination.

If the pointer stopped moving, I found the only thing that could possibly get it following again was to rotate the phone and then trying to drag and move it again on the new view.

The games themselves seem to run well for the most part, with little slowdown.

A few other things worth mentioning:

-Ogg Theora videos are pretty laggy during playback. They're somewhat acceptable in 320x200 games, but way too slow at any higher res.

-in Al Emmo, a very lengthy character animation that has "Run next loop after this to make a long animation" checked to span 4 loops always seems to freeze the game in the same place and makes it auto-exit.

-DosBox for Android handles right-clicking by holding one finger down on the screen, and then tapping a second finger on the screen simultaneously. That might be less frustrating that using a single finger for both click modes where you have to correctly determine the duration of your taps?

-You can't currently use the volume buttons on the side of your phone to increase/decrease the overall volume of the game.

I also agree with the idea of having editor functions to control certain things. That way, if people want to release commercial AGS games to the Android Market, authors will be able to prevent the PC builds of their games from being run on Android. They'll also be able to include Android specific features.

Bòógieman

  • Carmageddon!
Re: AGS engine Android port
« Reply #34 on: 04 Nov 2011, 19:53 »
a dream comes true!  :o  :-*

I tested some Maniac Mansion Mania episodes with different AGS-versions on my Samsung Galaxy Ace and they all worked but suffered from the following problems:
- the mouse control
clicking always worked, but I was most of the time unable to drag the cursor around
it only worked once in a while and then the cursor moved only a very short distance before stopping again  :'(
- the speech text font
when a character says a longer sentence, the black border of the font is not on its right position
- no music
all games I tried use MIDI music which did not play
but I am not sure if my Samsung Galaxy Ace supports MIDI anyway, so this might not be a problem at all  ;)
MP3 and WAV sounds did work just fine

keep on the good work  :-*
>>>> END OF LINE <<<<

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 #35 on: 04 Nov 2011, 20:01 »
The way I consume the touch events seems to only work on my phone.  :'( I am working on it though.


At the moment I am targeting Android 1.6 and that doesn't support multitouch, but I will see if backwards compatibility can be assured while still using features of newer versions if available.

Ogg videos being choppy is somewhat expected since there is no hardware acceleration at all for the video, not even optimized assembler code. Everything is done in C. Also videos are being played without framedrop. This is necessary for slow devices because they will always lag behind and therefore skip rendering all frames (happened on the PSP). This could be made optional though.

Al Emmo is a 2.72 game? I suppose this is a bug in the backwards compatibility code, but I cannot tell without checking it out myself (and I don't have the game). It is most likely not Android specific, though it should be noted that overall I haven't really tested highres games because the PSP port didn't support them.

As for midi music, it works the same as on the PSP port:
- Download this file: http://www.eglebbk.dds.nl/program/download/digmid.dat
- Rename it as "patches.dat"
- Place the file in the "ags" directory on the SD card
- Midi should play

I know about the wrong outline bug. It happens on all games that use a certain Lucasarts style template (like Murder in a Wheel). Seriously, I have no idea what causes it but it occurs on both the PSP and Android. I also tried different versions of Freetype, but I cannot get rid of that strange effect. It doesn't even make any sense since the font itself is drawn correctly. Just the outline is wrong as if the font spacing was dependent on the screen position. Weird, really.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Re: AGS engine Android port
« Reply #36 on: 04 Nov 2011, 20:13 »
Quote
Also videos are being played without framedrop. This is necessary for slow devices because they will always lag behind and therefore skip rendering all frames (happened on the PSP). This could be made optional though.

Ah, so that would allow Theora videos to play and keep their speed, by dropping frames where necessary? Would be better than the lag, I think.


Al Emmo was originally compiled with 2.72, but I've been testing the newer version compiled with 3.21. I haven't checked this crash in the 2.72 build yet (QFG2VGA v1.1, the other 2.72 game I tried, exited on startup).  But I'll upload a copy of the 3.21 Al Emmo game later for you so you can take a look if you want. It'll also demonstrate the other video-related issues I referred to elsewhere in the thread.
« Last Edit: 04 Nov 2011, 20:15 by AGD2 »

Bòógieman

  • Carmageddon!
Re: AGS engine Android port
« Reply #37 on: 04 Nov 2011, 20:16 »
As for midi music, it works the same as on the PSP port:
- Download this file: http://www.eglebbk.dds.nl/program/download/digmid.dat
- Rename it as "patches.dat"
- Place the file in the "ags" directory on the SD card
- Midi should play
thanks, MIDI works just fine now  :D
>>>> END OF LINE <<<<

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 #38 on: 04 Nov 2011, 20:41 »
Another version: http://jjs.at/temp/AGS_3.apk

This should have a working mouse. Don't be surprised if it feels a bit "loose" (for lack of a better word), this is because the touch events are only processed with 10 Hz as not to waste too much CPU on it. Might be worth increasing it for faster devices though.

I also enabled frameskip for theora in this version.

And it contains binaries for ARM7 CPUs, so potentially this is much faster on newer hardware. At least I hope it is without recompiling all libraries, not sure about that though. Please let me know if you see a performance difference. A good test case should be something like the main menu of Beacon which stresses the CPU a lot.

AGD2, I would certainly like to check the game if you can upload it.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Re: AGS engine Android port
« Reply #39 on: 04 Nov 2011, 21:08 »
Don't get the white screen anymore, but Theora video doesn't play.

EDIT: OK, it plays some Theora video, but very slowly if at all.
« Last Edit: 04 Nov 2011, 22:14 by pcj »
Space Quest: Vohaul Strikes Back is now available to download!