Porting to Android via Java
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Porting to Android via Java
[EDIT by Dominus:
When you read on in this thread, Dr. Code is in progress of porting Exult to Android via Java]
I'm interested in trying to make a working version of Exult to run on Android devices. But I found that in order to do this, a working model of the code has to be developed in Java, which could then be adapted to run on Android by switching out the platform specific graphics-handling.
The "working-model" should only be the game logic that parses the U7 game files, and handles running the game itself while making calls to the graphics and sound code.
Is there any additional code or anyone with notes out there that could help me with parsing the game-data files? If I had something that worked like a JUnit test that can verify if a game data file is valid or not, that'd be really helpful.
When you read on in this thread, Dr. Code is in progress of porting Exult to Android via Java]
I'm interested in trying to make a working version of Exult to run on Android devices. But I found that in order to do this, a working model of the code has to be developed in Java, which could then be adapted to run on Android by switching out the platform specific graphics-handling.
The "working-model" should only be the game logic that parses the U7 game files, and handles running the game itself while making calls to the graphics and sound code.
Is there any additional code or anyone with notes out there that could help me with parsing the game-data files? If I had something that worked like a JUnit test that can verify if a game data file is valid or not, that'd be really helpful.
Re: Porting to Android via Java
I'm not sure you really need a javabased code for Android anymore. At least according to http://arstechnica.com/open-source/news ... ev-kit.ars
This port to of Scummvm to Android could maybe shed more light on this:
http://forums.scummvm.org/viewtopic.php ... ht=android
This port to of Scummvm to Android could maybe shed more light on this:
http://forums.scummvm.org/viewtopic.php ... ht=android
--
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!
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!
Re: Porting to Android via Java
The arstechnica article is mentioning that the C++ toolkit is using JNI to hook into the java code. And if you've ever delt with JNI, you'd eventually realize it gets harder to maintain in the long run, especially when newer processors come out.
So, its best to not depend entirely upon the C++ toolkit just because Exult was developed in C. I'm just trying to plan ahead here instead of just banging out code for codes sake.
And the SCUMMVM, that's an entirely different animal altogether.
So, its best to not depend entirely upon the C++ toolkit just because Exult was developed in C. I'm just trying to plan ahead here instead of just banging out code for codes sake.
And the SCUMMVM, that's an entirely different animal altogether.
Re: Porting to Android via Java
I mentioned Scummvm because we share at least the audio code.
Happy codeing...
Happy codeing...
--
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!
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!
Re: Porting to Android via Java
this book seems to cover the gist of the idea, but i have no idea how applicable it is to this project:
http://books.google.com/books?id=-1eQ71 ... CBcQ6AEwAQ
(just mentioning it because it would be terrific if it did happen)
http://books.google.com/books?id=-1eQ71 ... CBcQ6AEwAQ
(just mentioning it because it would be terrific if it did happen)
Re: Porting to Android via Java
No need to have a Java port.
You can use JNI wrappers for C++ code.
Also, there is libSDL for android.
It will be a messy thing, but theoretically it should be doable.
You can use JNI wrappers for C++ code.
Also, there is libSDL for android.
It will be a messy thing, but theoretically it should be doable.
Re: Porting to Android via Java
If someone manages to get started on this and/or get it working, please let me know at Ultima Aiera (http://www.ultimaaiera.com). I've been corresponding with Bioware Mythic, and they're getting pretty serious about seeing the Ultima games ported to mobile platforms...a working, reasonably non-buggy port of U7 to Android would probably be of interest to them, possibly even to the level of them giving it official sanction.
And no, I am not (to the best of my knowledge) kidding or being a jackarse.
And no, I am not (to the best of my knowledge) kidding or being a jackarse.
Re: Porting to Android via Java
AsI wrote on your site, they should get someone to port Exult to Android and iOS. An experienced programmer should be able to do it. Basically Exult need sto be ported to SDL 1.3 and then you can go off (as has been done for ScummVM or Dosbox...)
--
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!
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!
Re: Porting to Android via Java
If BioWare is hiring to create Java ports of Ultima games, COUNT ME IN!!!
Seriously, I'll send my resume right away.
Seriously, I'll send my resume right away.
Re: Porting to Android via Java
@TDI
A couple of quick points.
1) It's Bioware Mythic (a.k.a. Bioware Fairfax), not Bioware (a.k.a. Bioware Edmonton) that's pushing this. That's a small distinction, as there is a lot of cross-communication between studios. But at least as far as technical distinctions go, Mythic is a separate studio from the one that pumped out Mass Effect, Dragon Age, and all the rest.
2) I don't know if they are hiring at this exact point in time, but their mid-to-long-term goal is to see the Ultima games ported to other platforms, especially mobile platforms. Paul Barnett, their Creative Director, is really stoked about iOS (iPhone/iPod Touch/iPad) ports, especially, though I'd imagine an Android port would also catch his attention.
At present, they don't have the means to develop such ports in-house; their time is given over to other projects of more immediate importance. However, I have spoken with Mr. Barnett personally, and he's told me flat-out that if someone comes up with a solid, reasonably stable port of e.g. U4 (or U7; I can't imagine he'd turn it down), he'd do damn near everything to make sure that it got published EA's mobile storefront(s?) (the App Store, and I'd assume the Android Store if they have one for that ecosystem).
If you've got more questions, drop 'em here and I can forward them to Mr. Barnett.
A couple of quick points.
1) It's Bioware Mythic (a.k.a. Bioware Fairfax), not Bioware (a.k.a. Bioware Edmonton) that's pushing this. That's a small distinction, as there is a lot of cross-communication between studios. But at least as far as technical distinctions go, Mythic is a separate studio from the one that pumped out Mass Effect, Dragon Age, and all the rest.
2) I don't know if they are hiring at this exact point in time, but their mid-to-long-term goal is to see the Ultima games ported to other platforms, especially mobile platforms. Paul Barnett, their Creative Director, is really stoked about iOS (iPhone/iPod Touch/iPad) ports, especially, though I'd imagine an Android port would also catch his attention.
At present, they don't have the means to develop such ports in-house; their time is given over to other projects of more immediate importance. However, I have spoken with Mr. Barnett personally, and he's told me flat-out that if someone comes up with a solid, reasonably stable port of e.g. U4 (or U7; I can't imagine he'd turn it down), he'd do damn near everything to make sure that it got published EA's mobile storefront(s?) (the App Store, and I'd assume the Android Store if they have one for that ecosystem).
If you've got more questions, drop 'em here and I can forward them to Mr. Barnett.
Re: Porting to Android via Java
guysguysguys (and girls sorry i get excited)
sdl has been ported over, no java required. they've already pushed ports of Ur-Quan Masters and OpenTyrian to the market.
http://www.anddev.org/sdl_port_for_andr ... t9218.html
maybe just what the doctor ordered
sdl has been ported over, no java required. they've already pushed ports of Ur-Quan Masters and OpenTyrian to the market.
http://www.anddev.org/sdl_port_for_andr ... t9218.html
maybe just what the doctor ordered
-
- Posts: 246
- Joined: Thu May 14, 2020 1:34 pm
Re: Porting to Android via Java
Damn of course its only Android 1.6 or above..
I bought a stupid AT&T Backflip back in March and we're apparently Motorola's red-headed step child and are still on 1.5..
They say we're getting 2.1 and they're testing it but funny how for all of the non-US models of the phone they've cancelled it and decided they're staying at 1.5 for the best 'experience'...
Its the OpenGL they're having trouble with lately so Im guessing my phone wouldn't be up to playing Exult nicely anyways..
Time to look out for a new Samsung on Ebay heh..
I bought a stupid AT&T Backflip back in March and we're apparently Motorola's red-headed step child and are still on 1.5..
They say we're getting 2.1 and they're testing it but funny how for all of the non-US models of the phone they've cancelled it and decided they're staying at 1.5 for the best 'experience'...
Its the OpenGL they're having trouble with lately so Im guessing my phone wouldn't be up to playing Exult nicely anyways..
Time to look out for a new Samsung on Ebay heh..
Morbius Dragon
-==(UDIC)==-
Since 1992!
-==(UDIC)==-
Since 1992!
-
- Posts: 246
- Joined: Thu May 14, 2020 1:34 pm
Re: Porting to Android via Java
Ok somebody do this now haha!
The Backflip just got a custom 2.1 ROM last night based off a Cliq upgrade..
We dont have 3d acceleration yet but I can test whenever someone gets a build done hehe!!
The Backflip just got a custom 2.1 ROM last night based off a Cliq upgrade..
We dont have 3d acceleration yet but I can test whenever someone gets a build done hehe!!
Morbius Dragon
-==(UDIC)==-
Since 1992!
-==(UDIC)==-
Since 1992!
Re: Porting to Android via Java
It's not exult, but ultima7 works pretty well on my ipad via dospad (dosbox port). Should also work on iphone4 and I believe there's an android port of dosbox out there, although there's probably not anything as fast as the ipad running android yet.
Re: Porting to Android via Java
Has anyone used ScratchBox to port to Android? It sounds promising.
Re: Porting to Android via Java
The ArsTechnica article says they don't intend native code to be used for large applications, but for CPU-intensive operation. But it looks like ScummVM works.
Still, Exult is a pretty large program that's not very efficient with memory. I wonder what it would take to do a Java version, and whether the performance would be okay.
I've just started playing around with the 'Hello Android' examples in Eclipse with the emulated phone, and maybe will work up to doing a U7 shape browser as an exercise.
Still, Exult is a pretty large program that's not very efficient with memory. I wonder what it would take to do a Java version, and whether the performance would be okay.
I've just started playing around with the 'Hello Android' examples in Eclipse with the emulated phone, and maybe will work up to doing a U7 shape browser as an exercise.
Re: Porting to Android via Java
For fun (strange idea of 'fun'), I've started converting Exult code to Java to run on Android. My initial goal is just to display one image from shapes.vga, but that involves a LOT of code. I'm pretty much just translating by hand from C++ classes to Java. Eclipse makes this relatively easy in the way it does syntax-checking as you write.
So far, I've written about 1200 lines of code and all I have to show is that I can read in the Avatar's shape. But to display it, I need a palette, and that leads to bringing in most of the 'U7 file' code. Maybe tonight...
One thing that worries me about all this is that it doesn't look like an Android supports 8-bit palette graphics, which means we'll be doing a lot of converting from our 8-bit frame to its RGBA canvas. I don't know if an Android has enough CPU power for this.
So far, I've written about 1200 lines of code and all I have to show is that I can read in the Avatar's shape. But to display it, I need a palette, and that leads to bringing in most of the 'U7 file' code. Maybe tonight...
One thing that worries me about all this is that it doesn't look like an Android supports 8-bit palette graphics, which means we'll be doing a lot of converting from our 8-bit frame to its RGBA canvas. I don't know if an Android has enough CPU power for this.
Re: Porting to Android via Java
I really hope this works out! The only portable Ultima 7 fix I have is via that old psp port (and it is simply awful).
I run scumm vm on my Samsung Galaxy with no issues, so I'm hoping that these new phones have the power to run the classic greats.
Btw, thank you all for the hard work so far. Been following this project forever and gotten a lot of fun from it.
I run scumm vm on my Samsung Galaxy with no issues, so I'm hoping that these new phones have the power to run the classic greats.
Btw, thank you all for the hard work so far. Been following this project forever and gotten a lot of fun from it.
Re: Porting to Android via Java
Can you tell us more about scumm on the galaxy s? The galaxy s should be able to run u7 easily.
Re: Porting to Android via Java
@jeff, can yougive us some screenshots or photos of exult running on the android so far? Do you actually have an android or are you codeing halfblind through an android emulator? Your commits sound interesting
@torgus, I'm sure the scummvm forums would be much more suited to find information on this.
@torgus, I'm sure the scummvm forums would be much more suited to find information on this.
--
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!
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!
Re: Porting to Android via Java
I'll get a screenshot tonight, but don't expect a lot. What I'm doing is converting our c++ code to Java, skipping some things that I'll get to later and simplifying when possible. All that code (2000+ lines), and all I've got so far is the ability to render the flat terrains or paint a shape. No objects are created yet.
I only have the emulator to test with.
What worries me is performance. It doesn't seem like there's any builtin support for 8-bit graphics. So I'm painting into our own byte-array. Then on each 'blit', that gets transformed through the palette into a Color array, which then gets stored in a Bitmap (which looks like another big copy); and finally, that gets painted and stretched to fill the canvas/screen. That last operation is in the android library, so I'm hoping that maybe it's hardware supported. Seems like a lot of code being executed in Java for each screen refresh...
Maybe tonight I'll try to get the scene to scroll one tile on each refresh to see how many frames/second it can get.
Maybe it would make more sense to port the C++ code, but it doesn't sound as educational. Also, I think debugging or getting support would be a real problem.
I only have the emulator to test with.
What worries me is performance. It doesn't seem like there's any builtin support for 8-bit graphics. So I'm painting into our own byte-array. Then on each 'blit', that gets transformed through the palette into a Color array, which then gets stored in a Bitmap (which looks like another big copy); and finally, that gets painted and stretched to fill the canvas/screen. That last operation is in the android library, so I'm hoping that maybe it's hardware supported. Seems like a lot of code being executed in Java for each screen refresh...
Maybe tonight I'll try to get the scene to scroll one tile on each refresh to see how many frames/second it can get.
Maybe it would make more sense to port the C++ code, but it doesn't sound as educational. Also, I think debugging or getting support would be a real problem.
Re: Porting to Android via Java
I think everyone can view this: http://www.facebook.com/photo.php?fbid= ... 1523107292
Re: Porting to Android via Java
I added scrolling around with the arrow keys, and it's pretty slow. If you want to try it, here's where it looks for files:
String base = "/sdcard/Games/exult/blackgate"; // FOR NOW.
addSystemPath("", base + "/PATCH");
addSystemPath("", base + "/STATIC");
addSystemPath("", base + "/GAMEDAT");
String base = "/sdcard/Games/exult/blackgate"; // FOR NOW.
addSystemPath("", base + "/PATCH");
addSystemPath("", base + "/STATIC");
addSystemPath("", base + "/GAMEDAT");
Re: Porting to Android via Java
Looks very nice. Can't try it since I don't have an android. I'd root more for an iOS port
I'm still surprised that you need to do that much hard work for porting to Android. I was really sure that this would be much easier than porting to Java...
But as long as you are enjoying it...
I'm still surprised that you need to do that much hard work for porting to Android. I was really sure that this would be much easier than porting to Java...
But as long as you are enjoying 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!
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!
Re: Porting to Android via Java
A bit more progress: http://www.facebook.com/photo.php?fbid= ... 1523107292
The Avatar is still a fake (just drawing the shape, he doesn't really exist).
The Avatar is still a fake (just drawing the shape, he doesn't really exist).
Re: Porting to Android via Java
Getting better: http://www.facebook.com/photo.php?fbid= ... 1523107292
(But the Avatar is still faked.)
(But the Avatar is still faked.)
Re: Porting to Android via Java
> I think everyone can view this
I can only see those pictures if I login with a facebook account.
I can only see those pictures if I login with a facebook account.
Re: Porting to Android via Java
>> I think everyone can view this
>I can only see those pictures if I login with a facebook account.
Me, too
>I can only see those pictures if I login with a facebook account.
Me, too
Re: Porting to Android via Java
Jeff, if you don't mind I can put these pictures either on imageshack or dropbox...
--
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!
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!
Re: Porting to Android via Java
Sure, that would be nice.
Re: Porting to Android via Java
http://www.dropbox.com/gallery/7801769/ ... d?h=e27af2
Dropbox Gallery of the four screenshots
Dropbox Gallery of the four screenshots
--
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!
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!
Re: Porting to Android via Java
The worse part of being a managed language are badly designed api's that even with immutable types are paranoid and copy things into new arrays.
Anyway do you have a repository? I enjoy running findbugs on java code bases and fixing trivial @!#$.
Anyway do you have a repository? I enjoy running findbugs on java code bases and fixing trivial @!#$.
Re: Porting to Android via Java
It's in our SVN https://sourceforge.net/scm/?type=svn&group_id=2335, just to view it http://exult.svn.sourceforge.net/viewvc ... ltAndroid/
--
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!
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!
Re: Porting to Android via Java
Forgot that android doesn't use java bytecode -> findbugs won't work.
Re: Porting to Android via Java
A quick question though: you're trying to keep class to class compatibility between the codebases? There is a ObjectList class that is rather redundant considering the (rather excellent, except for very specialized uses, or primitive collections) java collections api.
Re: Porting to Android via Java
I might look into replacing ObjectList, but it currently has the advantage of not creating new links as objects are moved in and out of it, since the objects themselves have the link pointers.
Re: Porting to Android via Java
The facebook album now shows that the actual NPC's are being created. The next step, which is probably going to take some time, is to have the Avatar be able to walk around.
What sort of interface should there be for moving the Avatar? I assume Android phones have a touch screen, but is there a common way to indicate dragging with a right-mouse button like we do in U7? Or would the arrow keys work, and then use the touch screen for dragging objects?
(Edit by Dominus: dropbox album updated with this screenshot http://www.dropbox.com/gallery/7801769/ ... d?h=e27af2)
What sort of interface should there be for moving the Avatar? I assume Android phones have a touch screen, but is there a common way to indicate dragging with a right-mouse button like we do in U7? Or would the arrow keys work, and then use the touch screen for dragging objects?
(Edit by Dominus: dropbox album updated with this screenshot http://www.dropbox.com/gallery/7801769/ ... d?h=e27af2)
Re: Porting to Android via Java
There are two places where you are using iterator in the oldest way possible. You should probably use a for each there. I would give you a diff file, but netbeans is being retarded and only allowing me to diff single files, so it would take more time for you to apply that than do it manually.
Re: Porting to Android via Java
Thanks. I'll take a look tomorrow. (Anything to speed things up.)
Re: Porting to Android via Java
This won't speed anything up though. I suppose subversion commit rights are out of the question? I wouldn't actually touch the code, just refactor it around when not completely functional (that, now it appears to be).
Re: Porting to Android via Java
BTW what's the pathfinding algorithm? It doesn't seem to be anything heavy in code like A* how does it avoid obstacles, and moves actors?
Re: Porting to Android via Java
Exult does use A*. I haven't added that to the Java version yet, but I plan to (although maybe that and a few other algorithms should be kept in C++ and use JNI). Generally, I'm trying to convert our C++ code fairly faithfully to Java, cleaning up a few things in the process. It's been a while since I've worked on Exult and this is giving me the chance to become familiar with the code again.
In ExultAndroid, you can walk right through walls now. Maybe I'll call that a feature.
I'm wondering how the emulator speed compares with real devices. Anyone have experience with this?
In ExultAndroid, you can walk right through walls now. Maybe I'll call that a feature.
I'm wondering how the emulator speed compares with real devices. Anyone have experience with this?
Re: Porting to Android via Java
If they can get this game to run on a PSP you can get it to run on anything.
Re: Porting to Android via Java
>In ExultAndroid, you can walk right through walls now. Maybe I'll call that a feature.
Leave it in the game and activate it as a hidden feature when the player enters: osspispopd
That would be kinda funny.
By the way, I'm amazed at the speed of your progress on this.
Leave it in the game and activate it as a hidden feature when the player enters: osspispopd
That would be kinda funny.
By the way, I'm amazed at the speed of your progress on this.
Re: Porting to Android via Java
Thanks. What makes it go fast is that I'm mainly translating from C++ to Java, so most things work right away.
Re: Porting to Android via Java
I know of a few performing A* implementations in java.
http://keithphw.freehostia.com/LineOfSi ... Sight.jnlp
the javagaming forum is in general, a good place to as performance and api questions.
http://keithphw.freehostia.com/LineOfSi ... Sight.jnlp
the javagaming forum is in general, a good place to as performance and api questions.
Re: Porting to Android via Java
Ah.
source (note that clicking this link may not work, you may have to paste the link text into your browser window to actually download the zip file):
http://keithphw.freehostia.com/LineOfSight/src.zip
dependency jar (Java Topology Suite):
http://keithphw.freehostia.com/LineOfSight/jts-1.8.jar
source (note that clicking this link may not work, you may have to paste the link text into your browser window to actually download the zip file):
http://keithphw.freehostia.com/LineOfSight/src.zip
dependency jar (Java Topology Suite):
http://keithphw.freehostia.com/LineOfSight/jts-1.8.jar
-
- Site Admin
- Posts: 985
- Joined: Thu May 14, 2020 1:34 pm
Re: Porting to Android via Java
Is the Android specific coding minimal enough that this could easily be made allow for platform independence?
Re: Porting to Android via Java
There's some Android-specific code for handling events and painting the screen. The rest is pretty standard Java, I think.
Might be nice if someone implemented the Android Java libraries for use on a regular (Linux) PC. I'd imagine the performance would be a lot better, so I wouldn't have to wait 5 minutes for the debugger to get started.
Might be nice if someone implemented the Android Java libraries for use on a regular (Linux) PC. I'd imagine the performance would be a lot better, so I wouldn't have to wait 5 minutes for the debugger to get started.