Apologies for resurrecting a year-old post. I'm bringing it back because (1) this thread comes up in the top search results when I google this problem, and...
(2) I think finally, after all these years, I have figured out why this problem happens, and how to correct it and rescue your character so you can play through the rest of the game.
I got bit by this bug on level 3. I also have the supposedly patched CD version, where the bug should have been gone. I had gone through level 3 up to 2 to finish some loose ends, and in doing so dropped some heavier items and replaced them with a larger number of light items like potions wands and gems. After that, I could no longer enter level 3 without my inventory bugging out. It would replace the contents of the first container in my inventory with seemingly random stuff, from my inventory or the level. I didn't want my first playthrough in probably 8 years to end in ruin, so I started tinkering with save editors and reading the "Ultima Underworld 1 and 2 Formats Specification" on bootstrike to see if I could figure out how to de-glitch the containers, with a hex editor if need be.
Fortunately the solution turned out to be really simple. I had left too much crap lying around in that level.
See, a long time prior to this, I had been having fun with the "infinite rats" switch on level 3. I had achieved level 12 but crashed the game, and then loaded and done enough to get back to level 12, holding short of the crash. This left a very large number of blood splats lying around. The clue came when I was trying to edit myself a set of "un-bugged" containers, and started seeing those large numbers of blood splats appearing in new glitched packs.
I think what I did there was increase the total level item count past its limits, due to all the blood splats. When I went past the limit on the level the game simply crashed, but then I restored and killed fewer rats. I think what I'd done was bring the item count CLOSE to its limit, left, and then came back with a dozen more items in my inventory, putting it past the item count. Upon entering the level the game would load my inventory, load the level items, suffer an integer wrap-around, and begin overwriting my inventory with the items from the level.
So, here's what you do (at least it worked for me) to get your character back in the game with inventory intact and no more backpack bugs:
Note: If the glitch has already happened once, the running copy of the game itself is corrupted. If you see your inventory glitch, you have to quit and restart Ultima Underworld as the buffer overflow has actually damaged the game's level / inventory loading code in RAM.
1: Back up your save files.
2: Get the save file editor called "SaveGame Editor (308KB) from the 'bootstrike/uw1/solutions" link Elwro_RPGCODEX posted above. (Many thanks to him for the link, I currently cannot post links because my account is new.) It's the one that has some TIF files in the directory with it, and a very complete screen-filling interface that lets you press 'I' to edit your inventory.
3: Follow its instructions to edit your save. Either give yourself the runes for Fireball (Por Flam) and a huge amount of mana, or find a wand of Fireball in your inventory and give it 50 or 60 charges. (Note: For the wand trick, the charges are stored on the spell object that is one item past the wand in your inventory list.)
4: Start Ultima Underworld and load your save file. Verify the things you tried to do actually worked, and walk up to (but don't go into) the stairs to the level that bugs out your inventory.
5: Drop all of your packs and all of your gear on the ground. Only keep your map, the supercharged wand of fireball if you had one, your rune bag so you can cast spells, and a light. The idea is to keep the total number of items to a minimum when the level loads.
6: Save your game, just in case, and take the stairs to the problem level, still carrying just your minimal load.
7: Go around the problem level nuking piles of debris, broken items, blood splats, unwanted items, stray sling stones, etc. with fireballs to reduce the total count of items in the level. Don't just turn them into debris, hit the debris piles with more fireballs until the items are completely gone. If there's water or lava nearby, you can just throw things in there, but fireballs are more fun and take care of a small area full of items all at once.
8: Try to destroy at least 50 to 80 objects. If you only destroy 20 and then you visit the level again with 20 more items than you have now, your glitch will come back. Stacking things might help too.
9: Once you're done with your spring cleaning, go back and pick up your stuff. Your inventory glitches should now be gone.
10: Remember at some point to put your runes and mana back the way they were. I'm personally keeping my supercharged fireball wand around, strictly just to nuke debris and unwanted objects so the bug doesn't come back. (And giving myself a few more stones of carry capacity for my trouble.)
Note for Good Old Games users:
Since the GOG launcher is running the game automatically, you might need to install dosbox separately and mount the folder that has Ultima Underworld to use the save editor. I'm partly guessing, since I don't have the GOG version. I have vanilla DosBox and an actual old copy of the game that I lugged around from apartment to apartment over the decades.
The save editor runs as a DOS program. You drop it in the same folder as UW.EXE, use the DOS prompt to CD to the save folder that's being affected by the inventory glitch, and run the editor using DOS.
For me this looks like:
* run DosBox
> mount C "C:\Program Files\Good Old Games.com\Or whatever Ultima underworld is located"
> C:
> cd UW\SAVE3
> ..\UWEDIT.EXE
[tinker with save file]
Hope this works for everybody!
Post edited May 27, 2013 by misterbk