Porting to Android via Java

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

Re: Porting to Android via Java

Post by Dominus »

Ha, dungeon hunter is nothing, modern phone games can look like this: http://itunes.apple.com/de/app/infinity ... 28400?mt=8
Infinity Blade looks stunning but lacks in story and is very short...
--
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!
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Malignant Manor »

Dungeon hunter looks like a 3d PC game from 1999 or so ago. The small size makes the game look better than if stretched out on a monitor.
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Wizardry Dragon »

And likewise I dont think the Exult/Ultima 7 graphics do too bad on handhelds either :-)
----------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

On my emulator, the text of books and scrolls looks pretty bad, but the rest of the graphics look ok, though clearly like a PC game from about 20 years ago.:-)
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Wizardry Dragon »

You know though, when you think about it, U7's graphics have aged pretty gracefully for a video game of that age.
-----------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

I just put up a new snapshot with the walking method suggested by Wizardry. You drag from the Avatar's position to get him moving. I like it, as it's very close to the original.

Don't be surprised if there are bugs...:-) In particular, I notice that sometimes the Avatar starts walking in the opposite direction after hitting an obstacle.
Ed

Re: Porting to Android via Java

Post by Ed »

the new snapshot immediately crashes on my phone, in place upgrading the version that was on there previously, same /sdcard/Games/exult/blackgate folders/files. has anything changed re: where the files should be?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Dominus »

Added a new section on our download page for the Android snapshot and changelog. Since the Android port is not tied to our regular changelog, this looks better :)
(you might need to refresh the downloads page)
--
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!
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

Whoops. You probably need 'exult_bg.flx' in the 'exult' folder now.
Ed

Re: Porting to Android via Java

Post by Ed »

raaaaats ill have to grab it when i get home haha
Ed

Re: Porting to Android via Java

Post by Ed »

yup that did it, up and running again now. everything seems to still be going great, the movement works a-ok with one question: is it possible to make the area-which-counts-as-the-avatar a bit larger? as it is you have to be pretty precise to grab him to make him move, without hitting near him and not moving him, if that makes sense. i.e. a mouse cursor is easy to click him with but a fingertip is a bit less accurate. otherwise, going great

and i had way too much fun dragging the mayor around fyi i formally request this as a feature in the final build =)
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

Yea, I was wondering about using the touch interface with your finger, since the objects in U7 are so small. Maybe when you touch the screen, but aren't on an object, we should show a cross-hairs pointer. When you let up, we could remember the location (or maybe the object that it's on). Then if the next click is within a couple pixels, that's what we'd activate.

The latest snapshot should give you a 'too heavy' message when you try to drag the mayor.
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Wizardry Dragon »

The easiest way to give a larger target area for touch aiming is to make it the bounding box for the shape, but that may result in difficulties trying to select things very close to a NPC or the avatar. A better solution would be to increase the selextion area by x pixels, though that would be more difficult to program.
----------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
NewAndroid

Re: Porting to Android via Java

Post by NewAndroid »

Hi,

I'm new to Android but I would love to test Ultima 7 on my mobile phone.
Can anyone maybe give me some instructions on how to "install" Ultima 7 and the android-Exult on my phone?
486DX2/66 Dragon

Re: Porting to Android via Java

Post by 486DX2/66 Dragon »

Woot woot woot!!!!!! Fantastic effort! Congratulations!!

Guess what we will be playing when Sony PSP Phone/Android gets on the market. :D
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

Thanks! My biggest worry now is speed, especially in the emulator. My computer is a few years old, but shouldn't be all that shabby (Pentium D 2-core at, I think 2.8Ghz). I just added support for eggs, so now Iolo joins right away, and walking around with him is pretty slow. Or maybe the egg-detection is slowing things down. I'm worried that when I add pathfinding and NPC schedules, it will become impossible to use.

I'll work a bit on performance (blindly, since profiling didn't work the last time I tried), plus the user interface.
Ray

Re: Porting to Android via Java

Post by Ray »

Running the Nexus One, unlocked, rooted, etc, so I'll take a look at this soon, and give feedback on performance.

Control Ideas:
-----------------
It is safe to assume that Android devices have a touch screen and either a ball-mouse or a d-pad that is clickable.

This would make a safe fallback of clicking the d-pad/mouse-ball to bring up inventory, tap to move, double-tap for double-click.

Optionally, mouse-wheel/d-pad to move when inventory is not displayed.

Additionally, since most (all?) phones out right now are essentially "widescreen" format, it would be safe to drop a couple on-screen buttons into the left-and right margins (combat mode toggle, perhaps?) without covering any of the playable area.
NewAndroid

Re: Porting to Android via Java

Post by NewAndroid »

I copied Ultima 7 onto the sdcard to the directory Games/exult/blackgate

I then installed the exult app from the downloads-section on this website but when I run it I get the error-message "Process .com exult.android was unexpectedly closed."

What am I doing wrong?
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Malignant Manor »

You need exult.flx in the Exult folder. You could probably just take the one from Exult's data directory of whatever OS you normally use.
NewAndroid

Re: Porting to Android via Java

Post by NewAndroid »

Thanks! It works! :)
Great work! Can't wait to play the full game ;)
Ed

Re: Porting to Android via Java

Post by Ed »

to Ray: not that its a huge number, but some devices are actually coming out with no trackpad/trackball. not just low end devices either but some of the big upcoming ones, like the Incredible HD. i dont know why, it seems kinda baffling to try to change the form factor now but who knows. sadly the only input method thats guaranteed to be on every device is the touchscreen, and even then youre not always guaranteed multitouch on every device or software version

the 'joys' of android development =)
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Wizardry Dragon »

Android platforms suffer from having very different input schemes. It may be beneficial to have a single-touch interface by default, and then the option to use additional other interfaces (dpad/trackpad/multitouch) to augment it. A single-touch touchscreen is really the only constant I think, so that would be the best "foundation"
----------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

Yes, for now I'm just going to assume that a touchscreen is present. For moving the Avatar, how about if dragging on the ground also starts him moving? Maybe with a double-click, holding down the second time.
monotremata
Posts: 246
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by monotremata »

I was gonna mention the input methods the other day and completely forgot to reply hehe..
But yeah Wizardry is right, best bet by default would be a single touch interface..

Lower end phones like my Backflip dont have things like trackballs or even a multi-touch display.. (Although we did somehow get a physical keyboard).. Out of the whole Motorola Cliq/Backflip family, only the CliqXT got MT capability in its 2.1 upgrade.

Leave the options in though I say!
Some phones have custom roms that enable things like multi-touch (the Backflip does although its still up in the air whether multi-touch is safe on the display and hardware) but the 'common man' might not be so technically inclined to root and mod his/her phone..
Morbius Dragon
-==(UDIC)==-
Since 1992!
Ed

Re: Porting to Android via Java

Post by Ed »

drcode, the doubleclick-hold anywhere to move you just mentioned sounds like a good spot to try. that avoids having to precision click the avatar at least when youre trying to move. still going to have to precision click a lot of other things but at this resolution shouldnt be tooooo much of a problem hopefully (scummvm on android had to deal with similar things and it works pretty alright most of the time)
sgordon777

Re: Porting to Android via Java

Post by sgordon777 »

>> You need exult.flx in the Exult folder. You could probably
>> just take the one from Exult's data directory of whatever OS you normally use.


Can you please tell where is the data director under Android?

Thanks
sgordon777

Re: Porting to Android via Java

Post by sgordon777 »

Forget it, I had an old exult.flx.

Nice work.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

Thanks. The next snapshot will print errors instead of just crashing.:-)
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

The current snapshot has the opening scene working. Made me realize that the next thing to work on is save/restore.
Ed

Re: Porting to Android via Java

Post by Ed »

running splendidly, even the little forge of virtue earthquake business

is there an inventory/picking things up implemented yet? tried to pick up the key, can move it around but cant seem to 'get' it. if thats not in yet then disregard that as a bug haha
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

You can't drop it directly on something, but you should be able to drag it into a bag or the inventory screen. That's one of the (many) things I've overlooked.

Funny, but the earthquake doesn't show in my emulator. Only a few pixels at the edge of the screen move.
Ed

Re: Porting to Android via Java

Post by Ed »

you know since I mentioned it I went back and tried it again. this time it didnt do the earthquake at all. i mean it still 'happened,' everyone still danced around, but no vibration effect on the screen, not even at the edges.

I'm not overclocked this time though so I wonder if its a refresh rate/performance issue
Ed

Re: Porting to Android via Java

Post by Ed »

just tried it again and got the couple pixels around the edges version that you mentioned, weird

also, and i guess this is more a further down the road option, but without a graceful exit from the app, if you leave and come back in it comes back in a weird state of confusion (Iolo starts his opening schtick even tho you're already there, etc). just thought id mention haha
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

The earthquake needs to be rewritten, but I haven't gotten around to it yet (low priority). It's a thread/race condition. What I'm learning about Android programming is that you can't have the main thread stall doing something that takes more than a second or two. So the screen painting, usecode interpreter, and save/restore run in separate threads.

The next snapshot will have the save/restore screen implemented. Got to see if I can detect when there's no keyboard so I can give default names.

Now I wonder how it would have been to port Exult in C++ using JNI like someone suggested above. Would it just be a single thread taking over the machine?
Ed

Re: Porting to Android via Java

Post by Ed »

from what ive read i think yeah it just bruteforces everything thru a single thread which probably isnt great for performance? i cant imagine itd work well for something like this once scheduling etc is implemented

but i will openly admit my java background is...well i dont know if 'terrible' is the right word but its certainly not good haha
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

New snapshot: Main feature is save/restore. Press 's' to bring up the screen.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

Oops, 3 things:

1. If it crashes right away, try removing the contents of the 'gamedat' directory and try again.
2. The opening scene is turned off in this version.
3. It doesn't restore games from the main Exult yet, but I hope it eventually will.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

Another: First scene starts again. And music works if you put the .ogg music files in /sdcard/Games/exult/music
Andre

Re: Porting to Android via Java

Post by Andre »

I have an generic chinese 2.1 android phone.

The December 28th release works on my phone, but the January 1st "force closes".

What could be the reason?
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Malignant Manor »

Maybe music is forced at the moment. Try adding the ogg files to the path DrCode lists. If that doesn't work, try disabling audio.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

Try removing everything from the 'gamedat' directory.
Andre

Re: Porting to Android via Java

Post by Andre »

It still Force closes even after i deleted all the content of gamedat folder.
Andre

Re: Porting to Android via Java

Post by Andre »

Sorry... I run the older version after I deleted the gamedat dir and it created all the files again. I deleted it and now it works (with music =D )

Thank you, and keep up the good work!
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Wizardry Dragon »

Its too bad the requirement of App Store availability means an iPhone port is probably a no-go.
-----------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Dominus »

Let's leave the iphone out of this thread... ;)
But yes, iphone on the App store is not a very promising outlook. Same as Scummvm, a version that requires a jailbreak would be welcome ;)
Though personally I'd not use it on an iphone... On an ipad, though, sure would love it....
--
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!
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Wizardry Dragon »

If it was on an iPad, I may actually buy one, because it would be pretty awesome. Especially if it supported TFL :P

Actually, speaking on that matter, there wont be/isnt any special accomodations I need to consider for having TFL work on these other platforms such as android, is there?
----------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Dominus »

The Android port is a special case, as it is a rewrite and thus will have to have support for mods, patches, new games reimplemented. And later changes to the main branch need to be manually ported back into Android. So there are a lot of possibilities for it to break at times.
An iOS port wouldn't need that much rewrite. For iOS you only need to port current SVN to SDL 1.3 (which could be done through a compatibility header) and to make an xcode project file for it. Then you could probably already make it compile and run on iOS. You wouldn't be able to use it though, since the touch interface needs to be coded in as well ;)
--
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!
Darren___

Re: Porting to Android via Java

Post by Darren___ »

So are you translating ALL of exult into android/java?
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by Malignant Manor »

I'm guessing not the Exult Studio parts.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Porting to Android via Java

Post by drcode »

Definitely not ExultStudio.:-) But I'd like to get all the rest working, but skipping support for some things. LIke the music might require the .ogg files, where normal Exult supports lots of different options.

And yes, rewriting might be a dumb thing to do, since changes to the mainline will have to brought in by hand.
Locked