Opened 4 years ago

Closed 23 months ago

#12182 closed defect (fixed)

ULTIMA8: Trolls do not drop items

Reported by: bliznik Owned by: OMGPizzaGuy
Priority: normal Component: Engine: Ultima
Version: Keywords: Troll money coins drop
Cc: Game: Ultima VIII: Pagan

Description

In the original Ultima VIII, Trolls were one of the only Foes that would drop items. Gems, Money, sometimes useless items like Poison potions. But in the ScummVM version, I haven't been able to find a single troll that drops an item. Their corpses don't seem to have anything on them.

This is a bit problematic since Troll-killing is pretty much the only way to grind money in the game, which is necessary to purchase Mythran's most powerful spellbook.

Attachments (11)

Screenshot_1.jpg (134.9 KB ) - added by bliznik 4 years ago.
Screenshot_2.jpg (134.4 KB ) - added by bliznik 4 years ago.
Screenshot_3.jpg (146.4 KB ) - added by bliznik 4 years ago.
Screenshot_4.jpg (196.9 KB ) - added by bliznik 4 years ago.
scummvm-2021-04-30.png (134.6 KB ) - added by mduggan 4 years ago.
Screenshot_1.2.jpg (126.5 KB ) - added by bliznik 4 years ago.
Screenshot_2.2.jpg (191.1 KB ) - added by bliznik 4 years ago.
Screenshot_3.2.jpg (142.9 KB ) - added by bliznik 4 years ago.
Screenshot_4.2.jpg (89.3 KB ) - added by bliznik 4 years ago.
Screenshot_5.jpg (78.9 KB ) - added by bliznik 4 years ago.
Screenshot_6.jpg (176.9 KB ) - added by bliznik 4 years ago.

Download all attachments as: .zip

Change History (28)

comment:1 by bliznik, 4 years ago

Update...it seems like the loot tables for all Foes have been broken. The only items that Trolls seem to drop are daggers, none of the Skeletons drop items (before they resurrect), and none of the Changelinks drop obsidian coins either

comment:2 by mduggan, 4 years ago

Thanks for the report. Looks like I'll have to dive into the code a bit deeper to check the original behavior.

Update: actually the config should already drop coins for trolls, so something about that is broken. Will need to debug that bit.

Last edited 4 years ago by mduggan (previous) (diff)

by bliznik, 4 years ago

Attachment: Screenshot_1.jpg added

by bliznik, 4 years ago

Attachment: Screenshot_2.jpg added

by bliznik, 4 years ago

Attachment: Screenshot_3.jpg added

by bliznik, 4 years ago

Attachment: Screenshot_4.jpg added

comment:3 by bliznik, 4 years ago

OK, here are a few screenshots of what the loot looks like when the game is run in DOSBox

comment:4 by sev-, 4 years ago

Priority: highnormal
Summary: Ultima VIII - Trolls do not drop itemsULTIMA8: Trolls do not drop items

by mduggan, 4 years ago

Attachment: scummvm-2021-04-30.png added

comment:5 by mduggan, 4 years ago

Playing with the latest version, it seems to work fine for me locally now - I uploaded a screenshot of the drop I got. This is with no particular changes to ultima.dat or any other code changes. Could you check again with the latest version?

by bliznik, 4 years ago

Attachment: Screenshot_1.2.jpg added

by bliznik, 4 years ago

Attachment: Screenshot_2.2.jpg added

by bliznik, 4 years ago

Attachment: Screenshot_3.2.jpg added

by bliznik, 4 years ago

Attachment: Screenshot_4.2.jpg added

comment:6 by bliznik, 4 years ago

Hmm, I just installed version "windows-x86-64-master-ac1d5352", loaded an old save, killed 4 trolls, and only one of them had items (a single mace).

However, it's possible that it's something with my savegame that is corrupted.

Later this weekend, I'll start a new game and will grab slayer to do some Troll killing and will report back!

by bliznik, 4 years ago

Attachment: Screenshot_5.jpg added

by bliznik, 4 years ago

Attachment: Screenshot_6.jpg added

comment:7 by bliznik, 4 years ago

Hmm, I just started a new game using this version: 2.3.0git15849-gac1d5352be (Apr 30 2021 05:40:01), grabbed Slayer, killed a troll (the one in West of Tenebrae, inside the arena where you fall down to enter), and still no items.

I completely removed Ultima VIII from Scumm, moved all savegames to another directory (so I could start a fresh game instead of only being able to load a previous one), and added Ultima VIII (this is the GOG version, found in my install directory of D:\Games\GOG Games\Ultima 8\ENGLISH)

I also tried to run ScummVM using the console, but didn't see any suspicious error messages.

comment:8 by mduggan, 4 years ago

Thanks for taking the time to test in such detail. That's strange, but clearly something is still broken.

I suspect that the treasure info is not getting loaded correctly, but not sure why. To check that it's loading it at all, could you try this?

  • Find ultima.dat in the scummvm install dir
  • It's just a zip file, so rename to .zip and open it
  • Modify the ultima8/u8monsters.ini file to be invalid - just add a junk line like asdf to the start of the file.
  • Rename back to ultima.dat and open scummvm

When you open Ultima8, scummvm should throw an error when it's trying to load the monsters file. If it's not, then the problem is that the file is not getting loaded at all, which would probably explain the problem.

Could you also check whether you have an extrapath defined in your scummvm ini file? Some notes on that are here:
https://wiki.scummvm.org/index.php?title=HOWTO-Open_Files#How_to_Open_a_File

The dat file needs to be in that search list somewhere.

For reference, I'm using MacOS so there could easily be something wrong with the loading code that only happens on Windows.

Last edited 4 years ago by mduggan (previous) (diff)

comment:9 by bliznik, 4 years ago

OK, I think we're getting somewhere! This is definitely a PC vs. Mac thing.

First, you're correct, ScummVM on a PC (I'm running Windows 10, 64-bit) does not load the ultima.dat file correctly. I found this out when I was trying to edit the ultima.dat file for something I wanted to do in Ultima IV, and I needed to use "Extra Path" to get it to work. (You can see my work here: https://forums.scummvm.org/viewtopic.php?f=2&t=16235)

Second, it does not seem like the "extrapath" variable works as expected. It's not in the scummvm.ini file, and when I try to add it to the file, I get an error message "Could not located engine data ultima.dat"

Third, even using the "Extra Path" hack, there is something funny with how ScummVM uses the u8monsters.ini file on the PC. It does a few things correctly:

  • It uses the u8monsters.ini file, since if I add "asdf" I will get an error when I try to start Ultima 8
  • It uses parts of the u8monsters.ini file correctly, since I was able to set a Troll's HP to 1 by setting hp_min=1 and hp_max=1
  • But it didn't seem to use the "treasure" field correctly. It works fine if I delete everything except for "treasure=type=weapon" but things like "treasure=type=obsidian mult=30-75" or "type=oilflask mult=1-8" don't work.

So...a few things not working here.

comment:10 by bliznik, 4 years ago

I did a few more experiments with ultima.dat, and it looks like I might just be using a different zipping algorithm than ScummVM, since my zip file is 16,821 bytes while the original ultima.dat file is 16,863 bytes. So it's possible that ScummVM just can't unzip my ultima.dat file.

Well, in either case, the other issues with u8monsters.ini still seem to persist, namely that the loot table doesn't seem to work properly with "type=" when there is a space. I can change the loot table for the troll to read "treasure=type=meat" or "treasure=type=meat;type=weapon" without a problem, but "treasure=type=firegem mult=1-8;type=meat;type=weapon" is broken.

comment:11 by mduggan, 4 years ago

Thanks for all the extra info. With help from @OMGPizzaGuy we think we narrowed down the difference to a random number diff between MacOS and Windows, and I think it should be fixed in 61d9789.

comment:12 by bliznik, 3 years ago

Were you able to get to this with help from @OMGPizzaGuy? I just loaded a save with the latest daily build and it still seems like this is an issue in Windows 10 6(4-bit)?

comment:13 by mduggan, 3 years ago

I didn't have many ideas on this and can't repro it still, but to try and resolve the parsing issues I just added a lot more error checking and also added unit tests to the treasure loader. They are added in 2345a0d.

comment:14 by OMGPizzaGuy, 23 months ago

I've made a cleanup pass of random number generation for Ultima8 in commit 2851bd0
I'll check the next nightly build, but I would like to see if this resolves the issue for you.
Thanks!

comment:15 by OMGPizzaGuy, 23 months ago

Nightly build 2.7.0git6821 worked for me on Windows 10 (64-bit)

comment:16 by bliznik, 23 months ago

Jan 10, 2023 build (2.7.0git6836-g7a3ce2ff5cf) worked for me as well, Windows 10, 64-bit. Started a new game, grabbed Slayer, drank a purple potion, and killed a troll. The first time yielded nothing. The second time yielded a bunch of gems and 48 obsidian coins.

Thanks! I can finally earn money playing Ultima 8 using ScummVM!

comment:17 by OMGPizzaGuy, 23 months ago

Owner: set to OMGPizzaGuy
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.