In the last U2 Upgrade release (v1.2) I included a new patching tool called “u2up”. It’s based on the same patching system that the U3 Upgrade has been using since v3.0. The system works at build-time by storing only the differences between the original and new versions of game files in a PAT file. At install time, the patching tool then applies those differences to the game files. This is in contrast to earlier releases which included a clone of ULTIMAII.EXE called U2EGA.EXE that was a fully runnable binary with all the upgrade’s modifications.
I started moving to this patching tool for several reasons…
- The first and most important reason was that whole game data files and executables were being packaged together. Although it was still a somewhat incomplete set, the upgrade had the potential to become a source of pirating the game.
- I needed a way to validate that the original data files match what’s expected. This is so the patching tool doesn’t inadvertently break someone’s game.
- I needed a way to progressively apply changes to the game files between different upgrade releases. Say, upgrading from v1.2 to v2.0.
- I wanted to give people the choice to unapply the upgrade without reinstalling the game.
- Lastly, I wanted to be able to run a common set of installation actions against DOS and Windows environments. (and Linux, but more on that later)
Ultima II Releases
As a consequence, if I wanted to patch with validation, I needed a frame of reference from which to apply the patch. In v1.2, this was the Ultima Collection release. However, locking the patch to a single starting point had an obvious side-effect. It would fail if applied to other releases of the game, of which there are several:
- Original, Sierra On-Line (3 Floppies, 1983)
- Ultima Trilogy 1-2-3 (2 Floppies, 1989)
- Ultima 1-6 Series (CD, 1991)
- Ultima Collection (CD, 1998)
- Includes Micro Dragon’s Speed Fix (Unofficial, 1997)
- Moonstone Dragon’s Map Patch (Unofficial, 1997)
- GOG.com (Internet, 2007)
There are likely others that I’ve missed as well. (e.g. I’ve no idea what the version from EA’s Origin downloader looks like.)
Upgrade’s Patching Approach
To handle this, in v2.0 I’ve added a bunch of enhancements to the patching tool to process incremental upgrades from several official or unofficial releases. This includes anything from the Ultima 1-6 Series CD release on up. I can’t think of a great way to support floppy releases unfortunately as there are are multiple disks with overlapping filenames. And given the prevalence of the CD and GOG versions it is likely an extreme edge case. But for CD and later releases, the upgrade package now includes the following files:
- u2-uc.pat – upgrades from Ultima 1-6 Series release to Ultima Collection release
- u2-map.pat – upgrades from Ultima Collection release to the Map Patch
- u2-gog.pat – upgrades from the Map Patch to GOG.com’s release
- u2up-20.pat – upgrades from Map Patch to U2 Upgrade v2.0
Now, the frame of reference for this and all future U2 Upgrade patches will be Moonstone Dragon’s Map Patch. I chose that since that was the first non-floppy “release” that became fully functional. This means that uninstalling the upgrade will roll back to this release.
Determining the current patch level isn’t an exact science, but seems to work with the versions I tested against. It’s mostly done by using the validation logic to figure out what patches are not applied. So if u2up incorrectly identifies your release, or you have a version that’s not listed above then please let me know! I’ll be happy to look at adding support.
Beyond taking simple diffs of files and applying them, the patching tool also supports a bunch of additional actions.
- change – the traditional action for patching a file in-place
- add – adds a new file
- move – moves a file to a new destination and applies a diff
- move-only – moves a file to a new destination, no diff applied
- copy – copies a file to a new destination and applies a diff
- copy-only – copies a file to a new destination, no diff applied
- replace – replaces a file, backing up the original version to a new destination
The replace action is noteworthy because I needed something to migrate saved games to the PLAYER.U2 folder when upgrading to v2.0. After a file has been backed up, it is replaced with the “master” version. It’s admittedly a bit custom rather than general-purpose, but fills an essential use-case for the saved game changes.
If you were paying attention, you may have noticed that I chose not to make the patches relative to the GOG version. The reason for this is because GOG actually uses some of the game files from the U2 Upgrade, particularly the TLK files that contain lower-case text. While I’m not at all opposed to GOG using them, I see the U2 Upgrade’s code base as the source-of-truth for that data. By contrast, the Map Patch is the last version that includes all the original game data files.
Unfortunately, while testing the patching tool I ran into problems with Linux. It turns out there are some filename case differences between the GOG version and earlier releases. The patcher doesn’t pay attention much to case-sensitivity, so while it works just fine on Windows and DOS, on Linux it fails to locate some files. To get it working properly on Linux would require a bunch more dev work that I didn’t really see as a priority.
I originally added Linux based patching and config tools as a convenience, but I really don’t have much data to indicate that the tools have a high level of usage on that O/S. The Windows builds are essential because it’s a common platform for gaming, I want to support GOG versions, and I cannot expect all users to be tech savvy. Linux users tend to be a bit more comfortable with a command-line, so I don’t think it’s that much of an inconvenience to run the upgrade commands manually in Dosbox on that O/S.
So going forward, I’ve removed Linux support from the patching and config tools. If needs change in the future I can always revisit this again.
At this point, I’ve wrapped up all the patching work and pushed it to bitbucket. I have one more feature write-up to complete then hope to have v2.0 out shortly thereafter. Thanks for the interest and stay tuned!