Opened 6 years ago

Closed 5 years ago

#10775 closed defect (fixed)

QFG4: Resting repeatedly in one place results in consecutive moonrises

Reported by: Vhati Owned by: bluegr
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 the castle... Resting late at night will advance the clock, but - in the time dialog, rather than a sunrise - the moon will rise again. Despite appearances, the "Sleep until morning" option will not be available during faux night.

Walking to another room, then checking the time again, will correctly show the sun.

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 (4)

sci.054 (86.4 KB ) - added by Vhati 6 years ago.
SavedGame (CD) - Castle resting moon loop
sci.041 (60.2 KB ) - added by Vhati 6 years ago.
SavedGame (Floppy) - Castle resting moon loop
sci.022 (70.0 KB ) - added by Vhati 6 years ago.
SavedGame (CD) - Nikolai resting moon loop
sci.042 (46.6 KB ) - added by Vhati 6 years ago.
SavedGame (Floppy) - Nikolai resting moon loop

Download all attachments as: .zip

Change History (15)

by Vhati, 6 years ago

Attachment: sci.054 added

SavedGame (CD) - Castle resting moon loop

comment:1 by Vhati, 6 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, 6 years ago

Attachment: sci.041 added

SavedGame (Floppy) - Castle resting moon loop

comment:2 by Vhati, 6 years ago

Summary: Resting in the castle results in consecutive moonrisesQFG4: Resting in the castle results in consecutive moonrises

comment:3 by Vhati, 6 years ago

I don't know if the castle and Nikolai's house (#10776) share a common cause or if there are bugs in two places. They've got their own tickets in case they need to be fixed and closed independently.

comment:4 by Vhati, 6 years ago

Did some checking with Floppy edition under ScummVM. Now I think this one is indeed widespread enough to probably have a shared cause.

  • Castle
  • Nikolai's house (enter at night)
  • Inn's dining room
  • Shop (enter during day)
  • Cranium's hallway + lab
  • Adventurers' guild + thieves' guild
  • Monastery + basement

Exception: If you try this in the Burgomeister's office (enter during day), he will stand beside you for one REAL night. Then you'll die in the morning for being 'caught' as a burglar. So there's no problem there.

Interesting that Nikolai doesn't have a morning wake-up event to prevent this. He just sleeps indefinitely.

by Vhati, 6 years ago

Attachment: sci.022 added

SavedGame (CD) - Nikolai resting moon loop

by Vhati, 6 years ago

Attachment: sci.042 added

SavedGame (Floppy) - Nikolai resting moon loop

comment:5 by Vhati, 6 years ago

Summary: QFG4: Resting in the castle results in consecutive moonrisesQFG4: Resting indoors results in consecutive moonrises

I merged the Nikolai ticket into this one.

comment:6 by Vhati, 5 years ago

  • global120 - Granular time, for a 3600 unit day (1 hour is 150 units).
  • global123 - Simplified time of day, the nth 3-hour span: 6,7,0,1,2,3,4,5. The 6th span is midnight aka "You are getting tired". Starts do get dark partway through 4. Light again at 0.
  • global122 - The nth day (1-based).
  • local3 - Influences the sun/moon x pos.
  • local4 - Influences the sun/moon y pos.
  • local5 - 1 for night, 0 for day.
  • timeIcons use View 938 for landscape, sky, sun/moon, with local5 indirectly offsetting their "loop" attribute.



script 7

(instance showTime of Code
	(properties)
	
	(method (init &tmp temp0 temp1 temp2)
# ??? - - - - -
		(= temp0 global122)
		(if (or (!= global123 6) (> global120 500))
			(++ temp0)
		)
# ??? - - - - -
		(if (>= (= temp2 global120) 2780)
			(= temp2 (- temp2 3600))
			(= local5 1)
		)
		(if (<= temp2 820)
			(= temp2 (+ temp2 1800))
			(= local5 1)
		)
		(= local3 (/ (= temp2 (- temp2 1800)) 16))
		(= local4 (Abs (/ temp2 48)))
		(= local3 (+ local3 81))
		(timePanel init: show: dispose:)
	)
)



That first if block and temp0 are useless.


(instance timePanel of PuzzleBar
	(properties
		state $0000
	)
	
	(method (init &tmp temp0 temp1)
		(super init: &rest)
		(= temp1 0)
		(if local5 (= temp1 3))

# Next come a bunch of timeIcons like this.
		(self
			add:
				((timeIcon new:)
					nsLeft: (+ local3 12)
					x: (+ local3 12)
					nsTop: (+ local4 6)
					y: (+ local4 6)
					cel: 0
					loop: (+ 2 temp1)
					setPri: 251
					init: self
					yourself:
				)
		)



showTime is exported, and showTime::init() is triggered by UI's hourglass button (iconTime) in script 20.

Once it discovers night, there's nothing setting local5 to 0 to make it day again. Except for room transitions. How those are involved is still mysterious. I couldn't catch "showTime::dispose" with a breakpoint.

Anyway, the correction should be a simple matter of rewriting the useless bit to reset local5.

comment:7 by Vhati, 5 years ago

Summary: QFG4: Resting indoors results in consecutive moonrisesQFG4: Resting in one place results in consecutive moonrises

comment:8 by Vhati, 5 years ago

Pull Request: SCI32: Fix QFG4 consecutive moonrises

comment:9 by Vhati, 5 years ago

Summary: QFG4: Resting in one place results in consecutive moonrisesQFG4: Resting repeatedly in one place results in consecutive moonrises

comment:10 by digitall, 5 years ago

Keywords: has-pull-request added

comment:11 by bluegr, 5 years ago

Owner: set to bluegr
Resolution: fixed
Status: newclosed

Thanks for your work! Closing as resolved

Note: See TracTickets for help on using tickets.