Reverse engineering earlier Ultima games

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
Locked
dreammaster
Posts: 14
Joined: Thu May 14, 2020 1:34 pm

Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

Post by monotremata »

They don't need ScummVM though, they all work just fine in DOSBox..
Morbius Dragon
-==(UDIC)==-
Since 1992!
Sergorn

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

Post 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!)
Morbius Dragon
-==(UDIC)==-
Since 1992!
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Reverse engineering earlier Ultima games

Post by Dominus »

(To me U7 plays almost right away in DOSBox, really doesn't need any configuring)
--
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!
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

Post by Dale »

I second KC :)
dreammaster
Posts: 14
Joined: Thu May 14, 2020 1:34 pm

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

Post by Dominus »

That project is still on...
--
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!
dreammaster
Posts: 14
Joined: Thu May 14, 2020 1:34 pm

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

Post by Dominus »

Sounds great! Looking forward to 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!
Nytegard
Posts: 2
Joined: Thu May 14, 2020 1:34 pm

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

Post 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.
Voyager Dragon

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

Post by dreammaster »

Cool! That should be a big help when I eventually get to working on them. Thanks.
Cambragol

Re: Reverse engineering earlier Ultima games

Post by Cambragol »

dreammaster
Posts: 14
Joined: Thu May 14, 2020 1:34 pm

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

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

Re: Reverse engineering earlier Ultima games

Post by agentorangeguy »

Picking the U6 mod back up, gaining progress little by little hah
-------------------------------------------------------------------------------------
Ultima 6 Mod for Exult site: http://www.ultima6.realmofultima.com/
Locked