[OLD-1] AGS engine Android port

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

Previous topic - Next topic

JJS

Ok, as I cannot reproduce the problem it might take a bit of time to get this sorted out. But it will work eventually  ;)

Quote from: abstauber on Fri 04/11/2011 07:03:40
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.

Quote from: Iceboty V7000a on Fri 04/11/2011 02:56:04
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.

Quote from: Calin Leafshade on Thu 03/11/2011 23:13:15
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.

Quote from: S3 on Thu 03/11/2011 21:45:20
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

Quote from: JJS on Fri 04/11/2011 07:21:58
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.

AGD2

#22
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?

JJS

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

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: ags

//pseudo

if (Game.OS == eOSAndroid) {
 mouse.visible = false;

}



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

Quote from: JJS on Thu 03/11/2011 20:18:29
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

QuoteOh, 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

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

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

Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Calin Leafshade

yep that fixes it.

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

Gilbert

Quote from: Calin Leafshade on Fri 04/11/2011 17:31:25
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).

Jim Reed

=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 =)

AGD2

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

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

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

AGD2

#36
QuoteAlso 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.

Bòógieman

Quote from: JJS on Fri 04/11/2011 20:01:40
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

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

pcj

#39
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.
Space Quest: Vohaul Strikes Back is now available to download!

SMF spam blocked by CleanTalk