Page 1 of 3

Native Android Port

Posted: Thu Feb 03, 2011 7:14 am
by KenC
Hi All,

I've made a preliminary native port of exult to Android using the Crystax NDK toolchain and Pelya SDL port. The port seems to run fairly well, but needs some work on input/control to make it playable.

I've posted a patch series here:

http://dl.dropbox.com/u/20250869/exult_ ... 110202.tgz

And a binary package here:

http://dl.dropbox.com/u/20250869/exult_ ... 110202.apk

The package includes all the data files that build with exult. It can also automatically download and install the sound and music packs if you select them in the "Optional downloads" menu. Note that these menus come from the Pelya SDL port and are not customized for Exult.

As usual, the original game data is not included, and needs to be manually installed. I used these commands to install it from my Ultima Collection CD:

adb push ULTIMA7 /sdcard/app-data/net.sourceforge.exult/blackgate
adb push SERPENT /sdcard/app-data/net.sourceforge.exult/serpentisle

If you want to build from source, apply the patch series to the subversion sources (patches were made against rev 6813) and use Makefile.android. By default, it will download and install local copies of the crystax toolchain and pelya SDL port. If you already have these installed somewhere, you can specify the path to them with ANDROID_NDK=... and ANDROID_SDL=...

I seem to have less and less time to work on this, so if anyone else can make improvements, please do.

Ken

(edit by Dominus: Since dropbox changed public files sharing rules old links do not work anymore.
I've uploaded the last patch (I only have the latest) to our patch tracker at https://sourceforge.net/p/exult/patches/108/.
Be advised the patch is likely not going to apply without manual help as Exult's source has changed since then, especially indentation which will screw up the patch utility.)

Re: Native Android Port

Posted: Fri Feb 04, 2011 12:09 am
by Summ
I must say that I am truly astonished by this version of Exult. It almost works flawlessly, apart from awkward controls and that only the quicksave slot works. (WTF? It says something about "savelist bg*.sav" not implemented...)
But sound, music and most importantly: speed is all perfectly fine. Even the graphic filters are working tremendously good (Scale2x, Sai, SSai, SEagle).

Thank you very much KenC :-)

(For reference: my Device is Desire-unrooted-android2.1)

Re: Native Android Port

Posted: Fri Feb 04, 2011 2:38 am
by KenC
Kudos definitely go to the Exult team for a clean, portable codebase and Pelya and CrystaX for libraries and toolchain. I actually made very few changes to the codebase - about the only one of significance was fixing signed char issues since arm defaults to unsigned.

As far as input goes, there's been a lot of good ideas floated over on the Java thread, and many of them can probably already be implemented by tweaking the setup in the runtime configuration menu (magnifier and onscreen buttons in particular; not sure if pelya has support for using the screen as a touchpad).

I hadn't actually tried saving a game yet, so hadn't noticed that issue. I'll try and take a look at it eventually, but I've had very little time lately to continue working on this.

Ken

Re: Native Android Port

Posted: Fri Feb 04, 2011 6:08 pm
by Summ
[quote=KenC]
I hadn't actually tried saving a game yet, so hadn't noticed that issue. I'll try and take a look at it eventually, but I've had very little time lately to continue working on this.
[/quote]
That would be very cool - its like playing Zelda when one has only a single savegame X-)
I will try and take a look at the awkward controls - pelya said, that he would improve mouse emulation asap, but he also has very little time.

Would you please tell me on what device you tested the exult port? Would sure be nice to have a compatibility database somewhere.

And another question: did you try compiling with the ndk-r5b? It should make CrystaX obsolete, but I had little success with it.

Re: Native Android Port

Posted: Sat Feb 05, 2011 5:51 am
by KenC
"Would you please tell me on what device you tested the exult port? Would sure be nice to have a compatibility database somewhere."
I started out on the simulator and it was working pretty well, although I just noticed that it no longer does - bunch of "called unimplemented OpenGL ES API" messages in the log and no display. For hardware, I'm testing on a Nexus One.

"And another question: did you try compiling with the ndk-r5b? It should make CrystaX obsolete, but I had little success with it."
I haven't played witn ndk-r5b yet, but this makes it sound like a nonstarter: 'C++ Exceptions and RTTI are not supported in the default STL implementation.' When I first started playing with porting exult, I tried to do it by using ndk-r4 and STLPort and getting rid of all exception usage in Exult, but eventually gave up when I found the CrystaX toolchain. The r5 release notes on STL and exceptions are worded a little oddly though, so maybe I'm misunderstanding and there is a way to get STL and exceptions.

Re: Native Android Port

Posted: Sat Feb 05, 2011 6:13 pm
by ShadowJack
I have been testing this on a Droid2.

The only trouble I am having is picking up objects like the key at the murder seen. I have been trying various options on the SDL configuration, but I have not found one that works.

Re: Native Android Port

Posted: Mon Feb 07, 2011 2:13 am
by Summ
@ShadowJack:

I found that moving objects is broken when using hardware buttons for LMB. I suggest pressure oriented LMB (somewhere in the options of SDL).
I was able to play to Lord British this way, and will try to play through in the next few days.
Doubleclick is extremely hard this way however... I suggest using some hardwarebuttons for inventory (SDLK_SPACE) attackmode (SDLK_C).

Re: Native Android Port

Posted: Mon Feb 07, 2011 5:22 am
by KenC
Mixed results with r5b: was able to build, but the app hangs while trying to load libsdl-1.2.so. Could easily be a problem with how I built, but going to punt on r5b for now and stick with CrystaX.

Re: Native Android Port

Posted: Mon Feb 07, 2011 7:45 pm
by ShadowJack
@Summ

Thanks for the suggestion. After a bit of tuning, I was finally able to pick objects. I am still have trouble picking up coins, but a bit more tuning may work.

@KenC

May I suggest that you use r4b instead of r5b. Several other developers had much more success with the older NDK. Being behind a version may make it easier to move to Google's r5c (or what ever comes next).

I'll give the port a bit more testing later today.

Re: Native Android Port

Posted: Mon Feb 07, 2011 7:52 pm
by KenC
r4(b) doesn't have STL, RTTI or exceptions. You can add STL using STLPort, but you still need exceptions for exult. The CrystaX toolchain is a rebuild of r4 with STL, RTTI and exceptions.

Re: Native Android Port

Posted: Mon Feb 07, 2011 9:24 pm
by Summ
I'd like to know how good exult performs on different android devices. My Desire has a 1Ghz CPU, but does it work on less performant hardware? Does it work on 1.6? 2.3?
It would be awesome if it would work on some of the cheaper android tablets with resistive touchscreen, so that one can use a stylus :-)

I'm currently stuck into porting JaggedAlliance2 to android, but I will take a look at building with r5b in the next few days. (To anyone who is interested: the JA2 works, but has some issues with speed and some with text-display)

@KenC: how about adding the sdlport to exult svn? Would be much easier to keep up with the development process.

Re: Native Android Port

Posted: Mon Feb 07, 2011 10:06 pm
by XDelusion
I've considered picking up one of those Panditigal Novel Readers and hacking it. So if I do, I'll give this a spin and see if works on there also.

Re: Native Android Port

Posted: Tue Feb 08, 2011 6:17 am
by KenC
Have the savegames fixed. They weren't working because I stubbed out the U7ListFiles function with the intention of coming back to it later, and then neglected to do so.

Going to try updating to the latest rev of the exult and pelya SDL trees and then will post a new patch series and binary - hopefully tomorrow.

@Summ: were you suggesting getting my patches merged into the official exult svn repository? I'm all for it, whenever someone with write access wants to review/apply them. As I don't have write access to SVN, it may make more sense to keep working with the external patch series for a little longer until we work out the kinks. I'll be rebasing the patch series on the latest exult/pelya sources each time I post an update.

Re: Native Android Port

Posted: Fri Feb 11, 2011 4:39 am
by KenC
Updated build and patch series based on latest Exult and Pelya-SDL sources. This also has a fix for the savegames.

http://dl.dropbox.com/u/20250869/exult_ ... 110209.apk
http://dl.dropbox.com/u/20250869/exult_ ... 110209.tgz

Re: Native Android Port

Posted: Fri Feb 11, 2011 4:13 pm
by Bogatyr
Starts fine on Droid X, however I can't seem to start a new game without it crashing. Once I enter my name and sex and click to continue, it crashes.

Re: Native Android Port

Posted: Fri Feb 11, 2011 4:15 pm
by Dominus
Maybe you need to delete the gamedat folder contents first.

Re: Native Android Port

Posted: Fri Feb 11, 2011 5:11 pm
by Bogatyr
I deleted the contents of the gamedat folder and now it shows the red loading effect and as it fades away, then it crashes. So it goes farther... but still won't start.

Re: Native Android Port

Posted: Fri Feb 11, 2011 5:42 pm
by KenC
@Bogatyr: Have you tried both the original and the latest builds - do both crash? Can you grab a logcat dump of the game launching/crashing and post it here or email it to me (using the latest build).

Re: Native Android Port

Posted: Sun Feb 13, 2011 10:34 am
by 486DX2/66 Dragon
Congratulations!!! I can't begin to describe how happy I am. :-)

I installed it on an unrooted Nexus with Android 2.2 but it crashes just after I start a new game (after the red squares screen). Any ideas on what could be wrong? I used the apk posted on 02-11-11 05:39 on this thread.

Re: Native Android Port

Posted: Sun Feb 13, 2011 3:11 pm
by KenC
Confession time. I had tested my development build, but ran a completely clean build of the apk that I posted on 02-11-11, and never actually tested it. Just tried it out and also saw it crash after starting a new game :-(

I'll post a new apk as soon as I get it sorted out, but in the mean time, the 02-09-11 build should work for you (although only the quicksave slot works).

Ken

Re: Native Android Port

Posted: Sun Feb 13, 2011 4:52 pm
by 486DX2/66 Dragon
Thanks again for your efforts!!

Re: Native Android Port

Posted: Tue Feb 15, 2011 4:08 am
by KenC
Ok - patch series and new build, take 3. Didn't chase down root cause on the crash in the last build, but updating to the latest pelya-SDL sources seems to have fixed it. Tested on my N1 this time and verified I can start a new game.

http://dl.dropbox.com/u/20250869/exult_ ... 110214.apk
http://dl.dropbox.com/u/20250869/exult_ ... 110214.tgz

Re: Native Android Port

Posted: Tue Feb 15, 2011 6:36 am
by Malignant Manor
Size Patch

This patch increases the size of many shapes by either using an alternate frame or resizing the image and adjusting the outline. It should work with BG, SI, and the Keyring Mod.

Things like increased gem size and venom look a bit off. Most shapes should look alright. Hidden keys are more visible but I can't really increase the size of the buckets or plants.

Re: Native Android Port

Posted: Thu Feb 17, 2011 3:00 am
by Bogatyr
The new build runs quite well. Love it! Just needs some interface work, the mouse is very very very sensitive to clicking when using the touch screen.

Re: Native Android Port

Posted: Fri Feb 18, 2011 10:08 pm
by ShadowJack
This build runs well. I am able to drag and drop with the press firmly option. Has anyone tried to drag and drop with a hardware button?

Re: Native Android Port

Posted: Sun Feb 20, 2011 11:48 am
by TheOtherAlex
This is simply fantastic! I was ecpecting some highly unstable pre-alpha testing release, but right now I'm playing through Monitor without encountering any issues so far :))
I've disabled relative mouse emulation so I can use the touch screen as it's supposed to be used - works like a charm!
As long as there's no virtual keyboard, I can't name savegames properly, but I've assigned the most important short cuts to the 6 onscreen buttons, and that's o.k. for me.

Thank you very much, keep it up!

Re: Native Android Port

Posted: Sun Feb 20, 2011 8:16 pm
by KenC
There should be a virtual keyboard button (semi-transparent) on the top-right corner of the screen. It's a little quirky, but from the little testing I've done with it, you tap the onscreen button, then proved some other input (roll the trackball a little or something) and a text entry widget will pop up. After you're done entering text in the widget, it will send the SDL kestrokes to type the text into the game. Backspaces seem to work as well, but you have to count up how many you need in your head since you can't see the results in the game as you type them.

Ken

Re: Native Android Port

Posted: Sun Feb 20, 2011 9:48 pm
by KenC
s/top-right/top-left/

Re: Native Android Port

Posted: Mon Feb 21, 2011 8:11 am
by TheOtherAlex
Maybe I was just being stupid, maybe it's due to the new build, but I never managed to pass letters through to ScummVM when typing with the virtual keyboard, so I disabled it. Surprisingly (at least for me ;) ) it works quite well now.

Again, this is amazing. I've started a new game (named my Avatar properly now the keyboard's working...) and started exploring the Serpent Isle again :)

Re: Native Android Port

Posted: Mon Feb 21, 2011 9:39 am
by TheOtherAlex
Did I actually say ScummVM? Oh well...

Re: Native Android Port

Posted: Tue Mar 01, 2011 10:38 am
by TheOtherAlex
After several hours of testing (including Monitor, Knight's Test and parts of Fawn), gameplay still seems very stable. I've encountered two bugs so far:
Firstly, the avatar is sometimes placed on the List Field gallery when he's supposed to enter the arena, and goes haywire - in fact the dumbass turns into a murderous nutter and starts killing his friends. ;)
Secondly, while I was raiding the goblin-infested guard tower, I entered the cellar in combat mode while there were still goblins running around outside, which caused Exult to hiccough and crash. I couldn't reproduce this bug, though.
Apart from that, everything runs smoothly.

Btw, what about adding this port to the download section?

Re: Native Android Port

Posted: Thu Mar 03, 2011 5:08 am
by KenC
I haven't played through either game in many years so it might take me a while to get to any particular location in the game :) If you have a savegame I can use to reproduce the list field issue I can try to look into it. Have you checked whether you can reproduce it with a regular host build of exult?

Regarding adding this port to the download section and/or SVN - Is anyone reading this thread who has access to do either? If not, I can try the mailing list.

Ken

Re: Native Android Port

Posted: Fri Mar 04, 2011 12:33 pm
by TheOtherAlex
Don't bother. Although this has happened two or three times, I haven't been able to reproduce the bug after my last post (haven't tried too hard, though). If you still want to look into it, simply start a new game, enter Monitor, go to the List Field, and ask for a fight.

I'm happy with this port as it is, seeing as there don't seem to be any major issues.

-Alex

Re: Native Android Port

Posted: Sat Mar 05, 2011 3:43 pm
by Malignant Manor
You should put the patch for the latest SVN on the patch tracker. I'm pretty sure this is something that would require one of the better Exult coders.

Re: Native Android Port

Posted: Sun Mar 06, 2011 9:22 pm
by Geoff
Ummm... I'm going to risk sounding like a fool...

I have the ultima collection, but I have no idea how to use exult, apply the patches, etc... and move the appropriate files over to my Android 2.1 pad.

Is there a 'how to' file/post which would summarize all the steps necessary (in noob-speak) so I could get this going?

I know I can connect my device to my PC and use the usb host mode to copy files over... I know I can do this and an apk installer to install any apk files... but after that, I'm lost.

Any help?

Re: Native Android Port

Posted: Sun Mar 06, 2011 10:31 pm
by Dominus
copy folder ULTIMA7 to your sdcard into the folder /app-data/net.sourceforge.exult/blackgate
copy folder SERPENT to your sdcard into the folder /app-data/net.sourceforge.exult/serpentisle
Then install the apk and it may work.
Don't bother with patches unless you want to compile it on your own.

Re: Native Android Port

Posted: Mon Mar 07, 2011 12:02 am
by KenC
Hi Geoff,

There's some notes about installing the game data in the first post at the top of the thread. These are the commands I use from a command prompt starting at the root of the Ultima Collection CD:

adb push ULTIMA7 /sdcard/app-data/net.sourceforge.exult/blackgate
adb push SERPENT /sdcard/app-data/net.sourceforge.exult/serpentisle

I need to write up a README.android that summarizes this, but haven't gotten around to that yet. Will try and write something up soon and include it with the patches for inclusion into the main exult sources.

Ken

Re: Native Android Port

Posted: Wed Mar 30, 2011 7:41 am
by Lacry74
lg gt540-android 2.3.3mur4ik 825mhz : could not find the static data for either THE Black Gate or Serpent isle please edit the configuration file and restart exult

Re: Native Android Port

Posted: Wed Mar 30, 2011 7:51 am
by Dominus
where are the data files on your device? Where is the file called usecode for either game?

Re: Native Android Port

Posted: Wed Mar 30, 2011 8:00 am
by Lacry74
app-data\net.sourceforge.exult\blackgate\ULTIMA7
app-data\net.sourceforge.exult\blackgate\ULTIMA7\STATIC\USECODE

Re: Native Android Port

Posted: Wed Mar 30, 2011 1:27 pm
by KenC
I think you need to have it as app-data\net.sourceforge.exult\blackgate\STATIC\USECODE. Your ULTIMA7 folder should be moved up one level and renamed to blackgate, not inside a blackgate folder.

Ken

Re: Native Android Port

Posted: Thu Mar 31, 2011 12:43 am
by Lacry74
all okay. Russian version does not run. Put the British working

Re: Native Android Port

Posted: Sat Apr 02, 2011 10:26 am
by Sleepy Emp
Um, the Russian version works fine - just tested on DesireHD. Make sure you do a manual install of the translated files into the Static folder. The automated installer won't work with the Android port, of course.

Re: Native Android Port

Posted: Tue Apr 05, 2011 5:09 pm
by JasonG
Hi,
brilliant work, I'm amazed at the stability of the game! If only the hardware key LMB worked with drag and drop it would be perfect.
I just can't seem to control it with pressure LMB or normal mode, its too awkward.

Re: Native Android Port

Posted: Tue Apr 05, 2011 10:27 pm
by KenC
I'll put that next on the list of things to work on, although I'm only working on this occasionally, so it may be a while. I think any changes/fixes to the input will have to happen in SDL itself, but I'm not averse to making changes there and sending them upstream. I ported exult to my A780 phone several years back and in that port, I used a hardware button to toggle between RMB/LMB mode rather than having to hold a hardware button down, and that seemed to work fairly well. Would probably be good to support both options though.

Right now I'm trying to wrap up a few loose ends so I can get the patches submitted to the tracker for inclusion in the main codebase. Next build will include Malignant's size patch, as well as the various mods and patches as optional installs on the download screen. I've got the size patch in, but am still sorting out the build process for the other mods and patches.

Ken

Re: Native Android Port

Posted: Thu Apr 07, 2011 11:14 am
by TheOtherAlex
Good to see you're still working on this port.

I haven't had much time to play over the last weeks, but I've made it to Fawn so far, released Captain Hawk from Bull Tower prison, raided the goblin camp and put Marsten into jail.

Gameplay is still quite stable, occasional crashes being a rare exception. One thing I've noticed is that antialiasing through SDL settings seems to make it quite unstable.

-Alex

Re: Native Android Port

Posted: Thu Apr 07, 2011 11:36 pm
by Mr. Wiggles
Awesome work on the Android port! I have it running on an unmodified Droid X... but no sound.

Did the autodownload thing from the SDL configuration menu, but no dice. Any ideas?

Re: Native Android Port

Posted: Fri Apr 08, 2011 3:22 am
by KenC
A fellow Washingtonian! :)

Don't have any ideas off the top of my head about the sound. When I was first playing with the port, I wasn't getting any sound, but it ended up just being a problem with not having the sound files in the right place. The auto-download should guarantee that they're all installed correctly.

If you run 'adb logcat' while the game launches and runs and post it here or email it to me, I'll review it for any potential problems. Might also be useful to see a copy of your exult.cfg, which you can copy off with 'adb pull'.

Ken

Re: Native Android Port

Posted: Fri Apr 08, 2011 7:05 am
by TheOtherAlex
IIRC you have to enable digital music and SFX in Exult settings menu (not SDL settings).

Re: Native Android Port

Posted: Sat Apr 09, 2011 5:23 pm
by KenC
The default exult.cfg in the NDK port is copied below. I think that's enough to use the digital music and SFX without modifying anything in the menus. Exult ends up rewriting exult.cfg with defaults for all the other settings not specified below the first time you run it.




.


.





yes





Ken