Opened 9 months ago

Closed 7 months ago

#12183 closed defect (fixed)

Ultima VIII - Sorcery reagents of different sizes do not stack

Reported by: bliznik Owned by: mduggan
Priority: low Component: Engine: Ultima
Version: Keywords: Sorcery reagent stack
Cc: Game: Ultima VIII: Pagan

Description

In the original Ultima VIII, there were sorcery reagents of different shapes/sizes. For example, a Demon Bone could look like a skull, a rib, or a pile of femurs. But when you dragged a Demon Bone on top of another Demon Bone, they would stack and adopt one of the two shapes/sizes.

In ScummVM, the sorcery reagents are of different shapes/sizes, but you can only stack sorcery reagents of the same shape/size. For example, you can only stack two Demon Bones that are shaped like a skull, or two Demon Bones that are shaped like a rib, but you cannot stack a Demon bone that is shaped like a skull on top of a Demon Bone shaped like a rib.

Not a fatal defect, but it definitely makes inventory management more difficult.

Change History (8)

comment:1 by mduggan, 9 months ago

This is an interesting problem, and I looked into it in detail a while back - but I'm 90% sure the current behavior is correct unless there's been a regression.

Annoyingly, only earth/necromancy reagents have the engine code to enable them to stack. The others don't have the code to even print the plural form in the game (unlike say, blackmoor which is either pile or piles depending on quantity). The fire/sorcery reagents have no code to print plurals in their look() function. I even have some commented out code that could enable it if it worked:
https://github.com/scummvm/scummvm/blob/7919e9f0d025b634fb6bc9e477285f56524cca1f/engines/ultima/ultima8/world/item.cpp#L2361

comment:2 by bliznik, 9 months ago

Huh, interesting. They can stack in the original when playing it using DOSBox. I've taken a quick video as an example. https://youtu.be/CEVpg_pIAn4

I'm unsure why there's no code for it. Maybe it's hidden in a completely separate area that is buried in the code? That's a shame...thanks for checking!

comment:3 by bliznik, 9 months ago

You are correct that the usecode doesn't show how many there are. In DOSBox, if I single-click on a pile of 8 blackmoor, the GUI shows me "8 blackmoor" But if I single-click on a pile of 4 Daemon bones, the GUI just shows me "Daemon Bone"

comment:4 by mduggan, 9 months ago

Oh cool, thanks for checking!

In that case I can just enable that code - I used to have it enabled but then it was not clear how many I was carrying so I assumed I was wrong for adding it - I guess I should have spent more time checking the original.

Update: Looked at it in the disassembly - game stacking check is in function at 10b0:0000. It stacks any shape family 2, or shape family 9 (reagents) when they are the same frame. Special case on shapes 395 and 398 which has per-reagent logic for different frames, same as mine.

As an extra easter egg, quantity of one stack is limited to 666.

Last edited 9 months ago by mduggan (previous) (diff)

comment:5 by mduggan, 9 months ago

Owner: set to mduggan
Resolution: fixed
Status: newclosed

comment:6 by bliznik, 9 months ago

Resolution: fixed
Status: closednew

The latest fix merges Sorcery reagents, but does not stack them. Compare the behavior of the ScummVM behavior here (https://youtu.be/NfgdjUSdzY0) against the DosBOX behavior here (https://youtu.be/CEVpg_pIAn4)

One stacks 4 reagents, and the other merges 4 reagents. They should be stacked, not merged.

comment:7 by mduggan, 7 months ago

Sorry for the slow response. There was a stupid bug in my change so the quantity did not increase, it should be fixed now in be7ce1b6deeef80a184f06591a7d8a9481436e25.

comment:8 by mduggan, 7 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.