Native Android Port

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
KenC

Native Android Port

Post 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.)
Summ

Re: Native Android Port

Post 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)
KenC

Re: Native Android Port

Post 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
Summ

Re: Native Android Port

Post 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.
KenC

Re: Native Android Port

Post 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.
ShadowJack

Re: Native Android Port

Post 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.
Summ

Re: Native Android Port

Post 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).
KenC

Re: Native Android Port

Post 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.
ShadowJack

Re: Native Android Port

Post 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.
KenC

Re: Native Android Port

Post 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.
Summ

Re: Native Android Port

Post 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.
XDelusion
Posts: 4
Joined: Thu May 14, 2020 1:34 pm

Re: Native Android Port

Post 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.
KenC

Re: Native Android Port

Post 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.
KenC

Re: Native Android Port

Post 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
Bogatyr

Re: Native Android Port

Post 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.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Native Android Port

Post by Dominus »

Maybe you need to delete the gamedat folder contents first.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Bogatyr

Re: Native Android Port

Post 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.
KenC

Re: Native Android Port

Post 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).
486DX2/66 Dragon

Re: Native Android Port

Post 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.
KenC

Re: Native Android Port

Post 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
486DX2/66 Dragon

Re: Native Android Port

Post by 486DX2/66 Dragon »

Thanks again for your efforts!!
KenC

Re: Native Android Port

Post 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
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Native Android Port

Post 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.
Bogatyr

Re: Native Android Port

Post 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.
ShadowJack

Re: Native Android Port

Post 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?
TheOtherAlex

Re: Native Android Port

Post 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!
KenC

Re: Native Android Port

Post 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
KenC

Re: Native Android Port

Post by KenC »

s/top-right/top-left/
TheOtherAlex

Re: Native Android Port

Post 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 :)
TheOtherAlex

Re: Native Android Port

Post by TheOtherAlex »

Did I actually say ScummVM? Oh well...
TheOtherAlex

Re: Native Android Port

Post 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?
KenC

Re: Native Android Port

Post 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
TheOtherAlex

Re: Native Android Port

Post 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
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Native Android Port

Post 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.
Geoff

Re: Native Android Port

Post 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?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Native Android Port

Post 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.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
KenC

Re: Native Android Port

Post 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
Lacry74

Re: Native Android Port

Post 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
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Native Android Port

Post by Dominus »

where are the data files on your device? Where is the file called usecode for either game?
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lacry74

Re: Native Android Port

Post by Lacry74 »

app-data\net.sourceforge.exult\blackgate\ULTIMA7
app-data\net.sourceforge.exult\blackgate\ULTIMA7\STATIC\USECODE
KenC

Re: Native Android Port

Post 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
Lacry74

Re: Native Android Port

Post by Lacry74 »

all okay. Russian version does not run. Put the British working
Sleepy Emp
Posts: 20
Joined: Thu May 14, 2020 1:34 pm

Re: Native Android Port

Post 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.
JasonG

Re: Native Android Port

Post 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.
KenC

Re: Native Android Port

Post 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
TheOtherAlex

Re: Native Android Port

Post 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
Mr. Wiggles

Re: Native Android Port

Post 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?
KenC

Re: Native Android Port

Post 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
TheOtherAlex

Re: Native Android Port

Post by TheOtherAlex »

IIRC you have to enable digital music and SFX in Exult settings menu (not SDL settings).
KenC

Re: Native Android Port

Post 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
Locked