Page 2 of 4

Re: Porting to Android via Java

Posted: Fri Nov 26, 2010 6:28 pm
by pratfall
You guys seen the Android SDL port? It's supposed to let you build c/c++ SDL apps pretty quickly:

http://www.anddev.org/sdl_port_for_andr ... t9218.html

I'm poking at it now, but not really sure what I'm doing :D

Re: Porting to Android via Java

Posted: Fri Nov 26, 2010 6:30 pm
by monotremata
DrCode isnt there an emulator you can run on a PC for dev purposes??
Pretty sure Ive seen this mentioned at some of the android sites I frequent..

Might make things a little easier if youre testing directly on your phone..

Re: Porting to Android via Java

Posted: Sat Nov 27, 2010 7:29 am
by Malignant Manor
DrCode posted earlier that he is only using an emulator. He wants feedback on how fast Exult is on a real device.

My experience with the official emulator was extremely poor speed for navigating the basic menus on a 2.4 ghz P4. I'm not sure how this runs in Wine, but there's a program called YouWave Android designed to run Android apps in Windows that is supposed to be focused on speed. I haven't tried it at all though.

Re: Porting to Android via Java

Posted: Sat Nov 27, 2010 7:14 pm
by drcode
I think I read somewhere that the emulator is close to the speed of real devices. I've noticed that it bogs down when receiving simulated events. For example, when I hold the shift key down on my real kbd, the emulator gets a stream of events, and gets really slow, even if I turn off my event handler.

As for doing a native port using SDL, someone could try that, and it might have a better chance of success. I want to get some experience with Java and Android development, plus I've lost contact with Exult's code for a few years; and that's why I'm doing it this way.

Re: Porting to Android via Java

Posted: Tue Nov 30, 2010 11:42 am
by i30817
Mmm. Look at this. Not sure if it is useful to you:
http://code.google.com/p/libgdx/

Re: Porting to Android via Java

Posted: Tue Nov 30, 2010 11:51 am
by i30817
It's probably a abstraction layer too far.

Re: Porting to Android via Java

Posted: Tue Nov 30, 2010 4:38 pm
by Ed
ohhhh man imagine my surprise to check back in on this thread after a month of two and see all this activity.

I just got my G1

Re: Porting to Android via Java

Posted: Tue Nov 30, 2010 4:39 pm
by Ed
ok dont know why my post submitted itself mid sentence there. ANYWAY.

just got my g1 REPLACED finally, and have a g2 here now, so if you guys need any help testing etc once an APK is thrown together let me know

Re: Porting to Android via Java

Posted: Tue Nov 30, 2010 9:35 pm
by drcode
I unintentionally checked in the .apk file in our repository, though it hasn't been updated recently. Right now, you can just walk around as the Avatar (and walk through things), and click on items to see what they are. I've started writing the Usecode interpreter, but it will be a week or two before you can do anything useful.

So, yes, I would like to hear how the performance is on a real device. To run it, you'd store the STATIC directory under "/sdcard/Games/exult/blackgate", and it should work from there. But it's not very good at diagnostics yet if anything goes wrong.

Re: Porting to Android via Java

Posted: Tue Nov 30, 2010 10:39 pm
by Dominus
Maybe you should remove the apk file, add an ignore on that file (so you don't add it again) and then upload the apk file you'd like feedback on to our snapshot space. You only need to sftp to our sourceforge webspace... We can then either add a direct link on the download page (i can do this once the file is uploaded once) or link to here...

Re: Porting to Android via Java

Posted: Wed Dec 01, 2010 9:21 pm
by drcode
That's what I'll do.

Re: Porting to Android via Java

Posted: Fri Dec 03, 2010 3:02 pm
by Ed
cool, next time I'm at my home PC i'll copy over my U7 data files to my phone so I'll be ready to give it a whirl when its available

Re: Porting to Android via Java

Posted: Fri Dec 03, 2010 9:30 pm
by drcode
Another new picture up.

(edit by Dominus, all pictures in the Dropbox gallery as well now http://www.dropbox.com/gallery/7801769/ ... d?h=e27af2)

Re: Porting to Android via Java

Posted: Sat Dec 04, 2010 1:54 pm
by Helverian
When will be this ready? ;-)

Re: Porting to Android via Java

Posted: Sat Dec 04, 2010 6:14 pm
by monotremata
I can do the 'low end' Android testing when its ready.
My Backflip only has a 500 something Mhz CPU in it so at least I can see how it will run for the bottom of the barrel folks.

Although Angry Birds runs pretty choppy on here, Im wondering what something as graphically rich as U7 would do...

Re: Porting to Android via Java

Posted: Mon Dec 06, 2010 7:09 pm
by Torgus dragon
The new androids should be able to run the game pretty well. My galaxy S is a beast. Especially overclocked.

Re: Porting to Android via Java

Posted: Mon Dec 06, 2010 7:28 pm
by TDI
Finally got this thing running in Eclipse. It runs pretty choppy and keeps crashing on me after a few seconds of map-scrolling, but still very impressive work.

I'm itching to Javafy the code and fix some of those 426 warnings, but its probably best to wait until Dr. Code has finished converting from C. :)

Re: Porting to Android via Java

Posted: Mon Dec 06, 2010 8:36 pm
by drcode
You should be able to walk around (and through things) by holding the shift key and using the left mouse button. I notice that holding the shift key really slows down the emulator, so you can release it while keeping the mouse button down. You can also talk to NPC's now, but that's probably even buggier than scrolling around.:-) I'm going to try to get the opening working where the Avatar appears.

Dom: BTW, how do I upload to the snapshot area?

Re: Porting to Android via Java

Posted: Mon Dec 06, 2010 9:01 pm
by Dominus
To access the snapshot folder: sftp to web.sourceforge.net
username (your SF accountname AND ,exult): jsf,exult
cd /home/groups/e/ex/exult/htdocs/snapshots

Re: Porting to Android via Java

Posted: Mon Dec 06, 2010 10:43 pm
by TDI
Hmm, I can't walk around. I start off on a black screen off the top left of the map. I can scroll around the map with the arrow keys, making the terrain and objects appear, and click on things, that's pretty much it. Don't see any alive NPCs either. Just a dead monk east of the Empath Abbey cemetery.

Re: Porting to Android via Java

Posted: Tue Dec 07, 2010 4:28 am
by drcode
Should start out at the normal place with Iolo and the peasant poised for the opening scene.

Re: Porting to Android via Java

Posted: Tue Dec 07, 2010 4:52 am
by drcode
Thanks! It's in the snapshot area as "ExultAndroid.apk".

BTW, I've had little luck profiling. Trying it again tonight, it shows the most time spent reading in the item names and creating about 1300 name strings. Seems unlikely considering all the work that goes on painting and reading in objects (and sorting them).

Re: Porting to Android via Java

Posted: Tue Dec 07, 2010 3:16 pm
by Malignant Manor
ExultAndroid.apk

Right click and save as on the direct link above.

Re: Porting to Android via Java

Posted: Tue Dec 07, 2010 9:30 pm
by Dominus
added the link to our download page. Also added that this is not tied to the normal changelog.

Re: Porting to Android via Java

Posted: Tue Dec 07, 2010 10:01 pm
by TDI
Strange. I always find myself "avatarless" at the top left (or bottom left) of the map with a black screen, as if some initial repaint isn't happening. Only after scrolling around does the sea start to appear. I tried scrolling to Trinsic to see if the Avatar is there, but Exult always crashes before I can reach it.

I wonder, can it have something to do with the game files? I basically copied the patch, static and gamedat directory and the files from the root ultima directory that seemed important (all the files except TEMP... and SAVE...).

The only thing I changed in the code is change the base dir to "/sdcard/games/Ultima7"

Re: Porting to Android via Java

Posted: Wed Dec 08, 2010 12:23 am
by drcode
Try it without the patch and gamedat directories. It will create gamedat using the initgame file in static. While I've been including code that accesses patch files, I haven't tried it at all, and there are lots of sections that I haven't included yet since I still consider this 'experimental' (or 'educational').

Also, you can see messages from the program in the 'logcat' view in the emulator, although I don't know where you could see them on an actual device.

Re: Porting to Android via Java

Posted: Wed Dec 08, 2010 7:01 pm
by TDI
That did the trick, thanks. I'm starting in Trinsic now and can talk to the few NPCs present. I can't walk around with the shift key however.

Re: Porting to Android via Java

Posted: Wed Dec 08, 2010 7:47 pm
by drcode
You have to put the emulator in raw keyboard mode. There's a startup switch, '-raw-keys', or you can toggle it with ctrl-k.

I may change this, because holding a key down makes the emulator much slower. However, you can release the shift key after the Avatar is moving and continue just dragging with the mouse. Seems like there should be a better way, but I don't have a real phone to experiment with yet.

Re: Porting to Android via Java

Posted: Thu Dec 09, 2010 7:36 pm
by Dominus
Jeff, could you maintain a changelog and when you update the snapshot, could you add this as "androidchangelog" or so?

Re: Porting to Android via Java

Posted: Fri Dec 10, 2010 4:23 pm
by Ed
finally got back around and could try this out..it's crashing immediately after opening on my G2, using the APK that was previously posted. I've got the files sitting in /sdcard/Games/exult/blackgate as mentioned wayyy back, has the location for this changed? after launching it shows the Exult title bar with a blackscreen for about two seconds then force closes

Re: Porting to Android via Java

Posted: Fri Dec 10, 2010 4:25 pm
by Ed
OH wait, just got it. deleted the GAMEDAT folder and it launches now

Re: Porting to Android via Java

Posted: Fri Dec 10, 2010 4:31 pm
by Ed
trip report: doesnt run much slower than it's supposed to, far as I can tell (g2 clocked at 1.4ghz). avatar doesnt seem to run faster if you click towards the edge though, not sure if thats implemented. talked to iolo, got him to 'join,' wandered around trinsic without any crashes. nobody moves around and theres no 'interiors' but I'm guessing thats all just not in there yet.

all in all looks like a pretty solid start. holding shift and clicking to walk is odd, maybe not holding shift to walk and holding shift when clicking things to use/talk would be more intuitive/less work?

Re: Porting to Android via Java

Posted: Fri Dec 10, 2010 5:33 pm
by drcode
Thanks for the report. And yes, lots not implemented:

1. Schedules - nobody moves
2. Pathfinding
3. Different walking speeds
4. Pretty sure there are bugs in the conversations.
5. Containers.
6. Combat.
7. Eggs.
8. Audio.
9. Dragging things.
10. Save/restore.

But recently (last few days) added:

1. 'Blocking' - can no longer walk through things, but you can walk up stairs.
2. Roofs disappear when you walk inside.
3. Companions will walk around with you (but only if you stay close).
4. Books/scrolls display.

I think I'll take your advice on the mouse use.

Re: Porting to Android via Java

Posted: Fri Dec 10, 2010 5:52 pm
by Ed
cool, glad to help. the only hangup i could think of with the non-shift click to move would be picking things up and moving them, but i guess a quarter-second 'long touch' on an item to pick it up would do the trick (or holding some other key?)

other than that list i guess also just an icon =D looking forward to future updates (like, super excitedly)

Re: Porting to Android via Java

Posted: Sat Dec 11, 2010 2:57 pm
by CC.Chris
Looks good so far. Runs great on my Droid 2 Global though I do agree with Ed about the walking mechanics (no shift to walk, shift to click on items/talk).

Definitely looking forward to playing it through on my phone :)

Re: Porting to Android via Java

Posted: Mon Dec 13, 2010 9:58 pm
by Darren__
Neat. After some fiddling with files, I got it to work. I have a very modern android, which unfortunately lacks the key interface. I'm amused how I can use my 'laser scroll wheel' to move my view around the game map and double-click doors and lamps despite the avatar being stuck at the intro area.

Let me know if you're interested in some collaboration on the android api / java side. I'd love this excuse to learn the android API, and I'm pretty smooth with java.

D.

Re: Porting to Android via Java

Posted: Wed Dec 15, 2010 7:46 pm
by drcode
There are Androids without keyboards? Uh oh.

The interface is going to be a challenge. For example, sometimes U7 pauses so you can click on something, like when you're using food. But there's no mouse cursor, so I'm thinking about how to let the user know this. Maybe we should show the 'click-on-an-item' cursor on the screen, have it move around with a light touch, and have it activate on a double click.

Perhaps that's also how the Avatar can move. We show one of the arrow buttons; you drag it around; and then double-click or press it harder (if all Androids can detect that) to control the Avatar.

Re: Porting to Android via Java

Posted: Thu Dec 16, 2010 2:35 pm
by Torgus dragon
Most of the higher end andiods do not have keyboards. I assume that trend will continue.

Re: Porting to Android via Java

Posted: Thu Dec 16, 2010 3:11 pm
by Wizardry Dragon
Its easier to produce touchscreen phones than it is to produce ones with keyboards, and with current pricing schemes companies can charge more for touchscreen phones, so I imagine we'll be seeing more rather than less of them. Have an iPhone myself, so I wouldnt mind seeing an iPhone version. You could probably manage an onscreen keyboard for game particulars on an iPad version.

Many "mobile" games have touchscreen arrow controls for NSEW. A tap or double tap could be a click or double click. It would be a little awkward, but it could work. Not sure how to replicate a right click though. Maybe tap-and-hold? That would be awkward though.
---------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca

Re: Porting to Android via Java

Posted: Thu Dec 16, 2010 5:56 pm
by drcode
Thanks for the info. I'm still in the dark ages when it comes to phones.

I'm thinking there should always be a cursor drawn on the screen, normally one of the green arrows. To move the Avatar, you drag or hold down the arrow, and his speed depends on the distance to the arrow, just like in the original game. Then if you click or double-click anywhere else, you can activate objects or drag them.

Or maybe clicking on an empty spot toggles the 'move' arrow...

Re: Porting to Android via Java

Posted: Thu Dec 16, 2010 6:05 pm
by Wizardry Dragon
You could make it so that if you tap and hold on the avatar, that would enable move mode, and then they would move towards where you dragged your finger, at a speed determined by how far the avatar is from your finger. That would seem the most intuitive movement interface for phones, though it may be difficult to program.

You could also maybe tap on the avatar and tap on a location to enable the pathfinding mode, or tap on the avatar and then an enemy, to enable combat AI to fight them.
--------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca

Re: Porting to Android via Java

Posted: Thu Dec 16, 2010 6:13 pm
by monotremata
One thing to keep in mind...
Some lower end Android phones (like mine) dont have multi-touch capability so you are only allowed to tap one point on the screen at a time. Could make it difficult for some...
Makes playing NES and SNES roms a pain in the butt hehe.

Luckily I do have a physical keyboard on mine though..

Re: Porting to Android via Java

Posted: Thu Dec 16, 2010 9:30 pm
by Ed
i think (after removing the shift) that the current touch to move works pretty well, if touching closer to the edge of the phone can make you move faster ala the original

as for keyboard v not keyboard, there arent a whole lot of keys necessary to play, other than the moving/clicking. maybe 4 onscreen transparent buttons in the corners or at the bottom or something for keyring, feed, map, and inventory? i realize there are more shortcuts in the game but those are all i can think of that are used regularly, and in the case of stats etc that can all be accessed from the paperdoll after hitting the inventory button

a few buttons onscreen isnt too intrusive, and keyboarded phones can just press their keys i guess! maybe with an option to turn off the onscreen versions if you dont need them in that case (similar to most of the emulators on the market)

Re: Porting to Android via Java

Posted: Fri Dec 17, 2010 12:54 am
by drcode
Maybe I'll experiment this weekend. I like Wizardry's idea, because sometimes you want to click on an item to identify it without having the Avatar move towards it.

Re: Porting to Android via Java

Posted: Fri Dec 17, 2010 9:36 pm
by Yuv422
How about tilting the phone to move the avatar? ;-)

Re: Porting to Android via Java

Posted: Fri Dec 17, 2010 9:51 pm
by Dominus
I personally dislike the tilting of the phone movement. I can only speak of the iPhone, though...

I think a steering overlay for the thumb would be nice, with it using the arrow keys function and when you keep on a direction you get faster (the overlay should be placeable on each side).
So movement (not counting the double-click-pathfind-to-this-spot) would only be through this and the green arrow (or maybe use the crosshair instead) is for interacting.

An example could be this Image fromt he Dungeon Hunter game for the iphone. Along with an icon or two for turning on combat for example...

Re: Porting to Android via Java

Posted: Fri Dec 17, 2010 10:03 pm
by Wizardry Dragon
Hate how those interfaces take up almost literally half the display area, though. Having the interface as close to the original as possible (which is to say no gui unless you start needing it) is preferable to me. Ultimately up to whoevers programming it though, I suppose :-)
----------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca

Re: Porting to Android via Java

Posted: Fri Dec 17, 2010 10:28 pm
by Dominus
yes, needs evaluation on to what works best. People actually testing/using it need to speak up as well.

Re: Porting to Android via Java

Posted: Fri Dec 17, 2010 10:33 pm
by drcode
Wow! If that's what a modern phone game looks like, isn't Ultima7 going to look fairly dated?:-)

Re: Porting to Android via Java

Posted: Fri Dec 17, 2010 10:36 pm
by Wizardry Dragon
Or if we're really masochistic we can program both interfaces and let someone choose :-)

And yes and no - some games are all graphics intensive like that, others are pixel games and tetris clones, so theres a fair diversity out there.
----------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands,ca