Page 1 of 1

Reverse engineering earlier Ultima games

Posted: Fri Apr 06, 2018 11:26 am
by dreammaster
Hi All. With the expansion in recent years of ScummVM to include RPGs, I've been spending some of my time working on reversing them as well as adventures. With work nearly finished on an engine for supporting the Might & Magic Xeen games, I'm currently casting around for what to work on later in the year, once I have a chance to relax a bit, and actually play some games.

I was kind of thinking about, in addition to working on reversing some of the Legend Entertainment games, starting work on the earlier Ultimas, starting with Ultima I. I was wondering if anyone's aware of any existing previous attempt to properly disassemble the game executables (or any of the early Ultimas for that matter). I did some searching, but the most I could find was Ultima I Revenge, and that's a on hiatus attempt to implement the game by only reversing the data files, not the actual game itself.. so whilst it may prove helpful, not a proper substitute for having all the game disassembled in IDA or other such disassembly tool. I want to make sure that I'm not duplicating existing effort when/if I actually decide to start working on them.

I've always had a soft spot for the series, and it would be wonderful to have them brought into the ScummVM fold, I even made u6edit, an Ultima 6 editor back in the day. I kind of got into thinking about working on Ultima I when I was thinking back on it.. it got me to mulling about whether it would be possible to replace the bulk of the earlier games' graphics with the Ultima VI tileset. Of course, only possible to experiment with if the basic games themselves have been fully reversed and re-implemented. :)

Re: Reverse engineering earlier Ultima games

Posted: Sat Apr 07, 2018 5:38 pm
by monotremata
They don't need ScummVM though, they all work just fine in DOSBox..

Re: Reverse engineering earlier Ultima games

Posted: Sat Apr 07, 2018 9:49 pm
by Sergorn
The point with things like ScummVM is that allows the game to run natively on Windows with improvements not always possible on DOS Box so there obvious advantages, like using Exult for Ultima VII.

Now as for Ultima games recreated using data files (I'm not sure how much reverse engineering went into that) those thzt exists are :

xU4 for Ultima IV
NUVIE for Ultima VI and the Worlds of Ultima (work still being done on the WoUs)
Exult for Ultima VII and Serpent Isle
Pentagram for Ultima IX

There have been other attempts for other games but none that went far.

Always dreamt of having a single program that would run ALL Ultima games natively....

Re: Reverse engineering earlier Ultima games

Posted: Sat Apr 07, 2018 10:57 pm
by dreammaster
As Sergorn said, reimplementing the early games in their entirety in ScummVM will allow for enhancements. Part of the reason I'm interested in working on them is the opportunity to experiment with the possibilities of using the Ultima VI tilesets to improve the graphics. I've already been having fun mentally going through algorithms for upscaling the overworld map, and taking mountain ranges to figure out how to handle corners and determine where the peaks are. And likewise for other types of tiles :) The ScummVM codebase is also very mature, and it's fairly straightforward to compile for many different types of computers, handhelds, and game consoles. Combine that with the possibility of significant graphical upgrades, and it could be an experience for a whole new generation of gamers.

And I agree with you, Sergorn, I'd love to eventually see all the series supported under ScummVM. Maybe give it a few years, and several of the earlier games already being supported in ScummVM, and who knows, devs for the later games may be open to the idea. Heh.. long term, ScummVM may eventually be the one-stop shop for playing Ultima, Might & Magic, and Wizardry games. With three Xeen games shortly to be officially supported, it's already off to a good start :)

Re: Reverse engineering earlier Ultima games

Posted: Sun Apr 08, 2018 5:30 am
by Colourless
The DOS versions of the earlier ultima games are often among the worst versions due to awful graphics (cga) and sound (pc speaker) so engine reimplementation of the other more feature filled versions would be good thing. I don't know anything about the specifics of them though

Re: Reverse engineering earlier Ultima games

Posted: Sun Apr 08, 2018 6:01 am
by Dominus
@Mono, bad argument in Exult‘s forum :)
If DOSBox had existed way back then Exult might have never seen the light with such arguments.

Re: Reverse engineering earlier Ultima games

Posted: Sun Apr 08, 2018 6:58 pm
by monotremata
Oh my god its a nightmare to setup in DOSBox though. Exult every time! :D
Im not really too familiar with ScummVM but if its an improvement Im all for it haha. I have it and a bunch of Lucasfilm and Sierra games but now that I think about it I don't think I ever actually used it. I always assumed it was like a DOSBox kinda thing to begin with. Maybe Ill go set it up today hehe.

And yeah playing Ultima 2 might actually be tolerable if it wasn't that hideous color palette it used! (Seeing them with the U6 tiles too!)

Re: Reverse engineering earlier Ultima games

Posted: Sun Apr 08, 2018 7:42 pm
by Dominus
(To me U7 plays almost right away in DOSBox, really doesn't need any configuring)

Re: Reverse engineering earlier Ultima games

Posted: Sun Apr 08, 2018 10:34 pm
by Knight Captain
It'd be a cool mod to see an older Ultima remade in Exult. Maybe one of the earlier and simpler ones? :D

Re: Reverse engineering earlier Ultima games

Posted: Mon Apr 09, 2018 3:09 am
by Dale
I second KC :)

Re: Reverse engineering earlier Ultima games

Posted: Mon Apr 09, 2018 11:52 am
by dreammaster
I'd third that too. At the very least with the work I'll do, I'll try and set up the interface layer/logic for using the Ultima 6 tileset to be generic enough that someone experienced with Exult could experiment with setting up an automatic mapping with some effort. And someone with artistic skills to create everything needed that's not present in U7.

And I'll be honest; I'm way too intrigued at the thought of playing around with enhancing the graphics, as well as algorithms for selecting what tiles to use, to not work on the games. In fact, given that there don't seem like any existing disassemblies to leech off of, just in the last day I've already got the Ultima 1 gen.exe (that does character generation) already partially disassembled. It bodes well for simplicity in disassembling the main game. Of course, all the years I've spent reversing all those adventure games from scratch don't hurt either :)

Re: Reverse engineering earlier Ultima games

Posted: Sun Apr 15, 2018 4:48 pm
by Dunk
I would like to see U1-3 updated to a more modern engine and with some added plot and dialogue. Maybe parties for U1 and 2. U6 or 7 would be good choices. I'm partial to U7, with the clickable conversations and overall gameplay.

Re: Reverse engineering earlier Ultima games

Posted: Thu Apr 19, 2018 8:32 pm
by Donfrow
Wasn't someone at one point remaking U6 in Exult? Though I know that's not one of the "earlier" Ultima games. I vaguely recall a thread about that here over the years, though maybe that project died?

Re: Reverse engineering earlier Ultima games

Posted: Fri Apr 20, 2018 2:14 am
by Dominus
That project is still on...

Re: Reverse engineering earlier Ultima games

Posted: Fri Apr 20, 2018 4:09 pm
by dreammaster
That's good to hear. Their last update was over a year ago at http://www.ultima6.realmofultima.com/

On the disassembly side, I discovered that the Exodus Project had a technical document of the Ultima II executable, with some basic information. So that may provide valuable information about both it and Ultima I as well. Bad news, the original Ultima II executable intermingles string data directly after calls to write strings, and fiddles with the method return address. Which cause's IDA's disassembly to throw a temper tantrum, and screw up the graph view of the methods. :P

Re: Reverse engineering earlier Ultima games

Posted: Sun Apr 29, 2018 6:46 pm
by Nytegard
http://nodling.nullneuron.net/ultima/ultima.html
http://www.xenerkes.com/

The good news is, the first 5 games are all easy to disassemble and recreate, compared to 6+.

But due to their simplicity, I'd suggest don't bother to use their formats, and just convert them to a new format for any new tool.

Re: Reverse engineering earlier Ultima games

Posted: Mon Apr 30, 2018 11:19 am
by dreammaster
Thanks for the links, though pity the tech info is mostly more for the later games that there are already engines for. The end goal of all this is provide support for both the original games as well as new "enhanced" modes in ScummVM, so having some kind of conversion be required is not preferable compared to using the original data.

In any case, I concur on the ease. In just a few weeks of casual work, I've already the bulk of the logic in Ultima 1 for overworld, citiies, castles, including all character and monster logic. I've used it to put together a bare-bones engine framework with having support for multiple Ultimas in mind. And on top of which, for Ultima 1, I've already set up enough loading logic to allow it to display the overworld, city, and castle maps, and let me walk around, enter, and leave them. A nice base that I can experiment with enhanced rendering using the u6 tileset on top of.

That is, later on in the year, when I get get onto working on it in more earnest. I still want to devote some time to playing a few games in my backlog before I fall back into reverse engineering more games. :)

Re: Reverse engineering earlier Ultima games

Posted: Mon Apr 30, 2018 11:43 am
by Dominus
Sounds great! Looking forward to this!!!

Re: Reverse engineering earlier Ultima games

Posted: Mon Apr 30, 2018 8:20 pm
by Nytegard
Well, someone had to do those efforts at one point in time to get the data:)

Anyway, as for Ultima 1, try asking this person:

http://programmersranch.blogspot.com/20 ... oding.html

The main reason I'd say in converting all of them to a similar format is the earlier games, you'll have to inject code into any effort you make to add functionality that just doesn't exist. Also, the formats of the original Apple II version differ from something like the later DOS version of the game or the FM-Towns version (the best version of the original game imho).

Regardless, as with other people, I look forward to it.

Re: Reverse engineering earlier Ultima games

Posted: Mon May 21, 2018 12:05 am
by dreammaster
I've put up a blog posting about some of the initial mucking around I've done working on Ultima I support at http://planet.scummvm.org/

Still planning on some proper R&R first, but even my casual lunchtime reverse engineering and implementation work has shown some results that bodes well for full support sometime in the near future.. and maybe even enhanced gameplay modes.

Re: Reverse engineering earlier Ultima games

Posted: Sun Jul 29, 2018 6:54 pm
by Voyager Dragon
Hey there Paul. I happen to keep commented disassembly to Ultima's 2, 3, and 5 in order to support the Exodus Project upgrades. The code for it is in my bitbucket repo:

https://bitbucket.org/mcmagi/ultima-exodus/

Look under doc/u[235]tech/ for the files ending in .doc. (yes, MS Word docs, apologies) There's also some information on U2 & U3 file formats in the wiki:

https://bitbucket.org/mcmagi/ultima-exodus/wiki/Home

It's great that you've been experimenting this. With the latest work that I've been doing to the upgrades I've often wondered how much of an improved experience it could bring to play them in ScummVM.

Re: Reverse engineering earlier Ultima games

Posted: Mon Jul 30, 2018 7:16 pm
by dreammaster
Cool! That should be a big help when I eventually get to working on them. Thanks.

Re: Reverse engineering earlier Ultima games

Posted: Fri Aug 03, 2018 12:24 pm
by Cambragol

Re: Reverse engineering earlier Ultima games

Posted: Fri Aug 03, 2018 9:50 pm
by dreammaster
Thanks. That may definitely prove useful. Though in the case of U4, there is also xu4.. I haven't really looked at it yet, but by all accounts it's already feature complete. If so, it may be easier to use it as a basis.

Re: Reverse engineering earlier Ultima games

Posted: Tue Aug 07, 2018 1:27 pm
by Haki
I've always had a dream to play with Exult U7 and add the relics, ruins, structures, etc from the other games into it to add more series history into the game. The lighthouses, for instance.

I'd love to be able play the older Ultimas in U7's engine, so I welcome any work to extract the game logic from the executables. Disassembling is difficult for most fan-level programmers, but I think modding Exult isn't so far out of reach.

I like ScummVM, it's a great, mature platform. I'd be happy to see the Ultima series made available to new players on it too - anything that helps to resurrect interest in story-based RPGs is a win.

Another place to look for code might be on the various console platforms. I think several of the Ultima games were made for Nintendo - maybe the code there is cleaner and more easily disassembled.

Re: Reverse engineering earlier Ultima games

Posted: Thu Aug 09, 2018 1:17 pm
by agentorangeguy
Picking the U6 mod back up, gaining progress little by little hah