Opened 5 years ago

Closed 5 years ago

#10789 closed defect (fixed)

QFG4: Peering through doors at absent bats in the castle

Reported by: Vhati Owned by: Vhati
Priority: low Component: Engine: SCI
Version: Keywords: SCI32 original has-pull-request
Cc: Game: Quest for Glory 4

Description

ScummVM 2.1.0git3797-ge7d23d2cd9 (Oct 25 2018 04:17:12)
Windows 7 64bit
QFG4 CD (English)

In both rooms adjacent to the bat-infested stairway...

If you "Peer through keyhole" on doors leading to the stairway, you get a message indicating the presence of bats, even after you've killed them.

"You catch a brief glimpse of the elusive flash of wings on the other side of the door."

When the bats are gone, the typical empty message would be more appropriate.

"Peering through the keyhole, you see no threatening activity on the other side of the door."

The original interpreter also does this.

File - 5kb MD5 - Full MD5
RESOURCE.000 - 263dce4aa34c49d3ad29bec889007b1c - 1364ba69e3c0abb68cc0170650a56692
RESOURCE.AUD - c39521bffb1d8b19a57394866184a0ca - 71098b9e97e20c8941c0e4812d5f906f
RESOURCE.MAP - aba367f2102e81782d961b14fbe3d630 - 801a04cc6aa5d437681a2dd0b6545248
RESOURCE.SFX - 3cf95e09dab8b11d675e0537e18b499a - 7c858d7253f86dab4cc6066013c5ecec

Attachments (2)

sci.053 (86.4 KB ) - added by Vhati 5 years ago.
SavedGame (CD) - Kill bats, then peek
sci.090 (72.7 KB ) - added by Vhati 5 years ago.
SavedGame (Floppy) - Kill bats, then peek

Download all attachments as: .zip

Change History (10)

by Vhati, 5 years ago

Attachment: sci.053 added

SavedGame (CD) - Kill bats, then peek

comment:1 by Vhati, 5 years ago

Occurs in the floppy edition under ScummVM, and its original interpreter, too.


ScummVM 2.1.0git3797-ge7d23d2cd9 (Oct 25 2018 04:17:12)
Windows 7 64bit
QFG4 Floppy 1.1a + note patch (English)

File - 5kb MD5 - Full MD5
RESOURCE.000 - f64fd6aa3977939a86ff30783dd677e1 - ff42260a665995a85aeb277ad80aac8a
RESOURCE.MAP - d10a4cc177d2091d744e2ad8c049b0ae - 3695b1b0a1d15f3d324ea9f0cc325245
RESOURCE.SFX - 3cf95e09dab8b11d675e0537e18b499a - 7c858d7253f86dab4cc6066013c5ecec

by Vhati, 5 years ago

Attachment: sci.090 added

SavedGame (Floppy) - Kill bats, then peek

comment:2 by Vhati, 5 years ago

Bat stairway is 632.
The lower room is 644.
The upper room, with the crest bookshelf, is 663.

The stairway tracks which bats have been killed with plot flags (331-334). They're in a bitmask, so instead of calling proc0_4(), we can check all four simultaneously (0000000000011110 == 30d).

global[520] & 30 == 30



The lower room was an easy fix. Combining the largely redundant say() calls makes room.

script 644 - sPeepingTom::changeState(1)

(1
	(if (< (g0_hero x?) 60)
		# You don't see any sign of life or movement beyond the door.
		(g91_gloryMessager say: 2 155 27 1 self 640)
	else
		# You catch a brief glimpse of the elusive flash of wings
		#   on the other side of the door.
		(g91_gloryMessager say: 2 155 29 1 self 640)
	)
)

Corrected version: When peering, the left door is generic. For the right door... If all bats were killed, display the generic empty message. Otherwise report bats.



The upper room has the same problem, always reporting bats.

script 663 - sPeepingTom::changeState()

(0
	(g1_Glory handsOff:)
	(g0_hero
		view: 4
		setLoop: 0 1
		setCel: 0
		setCycle: End self
	)
)
(1
	# You catch a brief glimpse of the elusive flash of wings
	#   on the other side of the door.
	(g91_gloryMessager say: 2 155 29 1 self 640)
)
(2 (= seconds 3))
(3 (g0_hero setCycle: Beg self))
(4
	(g0_hero normalize:)
	(g1_Glory handsOn:)
	(self dispose:)
)



I can't find freeable bytes to fix that one.
I'd rather not jump to a distant code cave somewhere else in the script, and back.


EDIT: Drat. Even code cave possibilities are restricted by edits the CD edition made. Inconsistency among editions means I definitely can't jump a fixed distance to anywhere before sPeepingTom or after sCastOpenDoor.

Last edited 5 years ago by Vhati (previous) (diff)

comment:3 by Vhati, 5 years ago

Keywords: has-pull-request added

Pull Request: SCI32: Fix QFG4 peering at absent bats

comment:4 by Vhati, 5 years ago

A variable could be set to 27/29 in init() and dropped in.

(global91 say: 2 155 {someVar} 1 self 640)


No available locals to hijack. An unused global, ick.

Wait... Script objects' "register" property is a freebie, right? init() could set that!

Last edited 5 years ago by Vhati (previous) (diff)

comment:5 by Vhati, 5 years ago

I couldn't free enough bytes in init().

Then there's the matter of getting sPeepingTom's lofsa value in order to set its "register" property. *sigh*

Last edited 5 years ago by Vhati (previous) (diff)

comment:6 by Vhati, 5 years ago

No available locals to hijack.

Well, there *is* local1. It tracks whether the passage is open/closed. The bookshelf patch disabled passage closing, rendering that variable moot. It'd take two short patches just to erase mentions of it. Maaaybe one with a huge ADDTOOFFSET macro? Not great.


The bookshelf patch makes sCloseSecretDoor moot too. That would take one average-sized patch to replace its content with an intelligent say(). Plus two short ones to call it from sPeepingTom (dedicated lofsa values for CD/floppy).

EDIT: This could work. It just feels like a ridiculous amount of lines for a low priority bug.

Version 7, edited 5 years ago by Vhati (previous) (next) (diff)

comment:7 by Filippos Karapetis <bluegr@…>, 5 years ago

In 0def174f:

SCI32: Fix QFG4 peering at absent bats

Fixes castle doors when all bats have been killed, bug #10789

comment:8 by bluegr, 5 years ago

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