Opened 7 weeks ago

Last modified 4 weeks ago

#15303 new defect

SCI: LSL5: Timed message skipped during LSL5 coffee scene — at Version 7

Reported by: eriktorbjorn Owned by:
Priority: normal Component: Engine: SCI
Version: Keywords:
Cc: Game: Leisure Suit Larry 5

Description (last modified by eriktorbjorn)

This one was a fluke...

I made a savegame at the beginning of Leisure Suit Larry 5 (English), right after the end of the intro. When bringing coffee to Silas, the game was supposed to print the message

"Yes, I know" you offer proudly, "I'm the Chief Tape Rewinder and Sterilizer on this project!"

But that message was only shown for a split second, before skipping to the next message. I think what's going on here is some sort of integer overflow. This is how the message is displayed in rm150.sc, sCartoon:

			(22
				(Say You_a 150 9 108 139 self) ; "Yes, I know," you offer proudly, "I'm the Chief Tape Rewinder and Sterilizer on this project!"
			)
			(23
				(= ticks 30)
			)

I think that means the message is supposed to stay up for 30 "ticks". Though that seems awfully short, so maybe it's 30 additional ticks?

If you load the attached savegame, and let the messages time out on their own (don't click to speed it up!), the skipped message happens at a point when KGETTIME_TICKS in the kGetTime() function comes (dangerously?) close to 32,767. Could that somehow cause the timeout to trigger prematurely?

Change History (8)

by eriktorbjorn, 7 weeks ago

Attachment: lsl5.003 added

comment:1 by eriktorbjorn, 7 weeks ago

Description: modified (diff)

comment:2 by eriktorbjorn, 7 weeks ago

Description: modified (diff)

comment:3 by eriktorbjorn, 7 weeks ago

Description: modified (diff)

comment:4 by eriktorbjorn, 7 weeks ago

The 30 cycles may be the delay between two messages. But I still think it's possible that it uses ticks for the message timeout?

The actual timeout handler is probably this piece of code in System.sc. But that's probably as far as my debugging goes.

			((and ticks (<= (-= ticks (Abs (- gGameTime lastTicks))) 0))
				(= ticks 0)
				(self cue:)
			)

comment:5 by m-kiewitz, 7 weeks ago

Description: modified (diff)

30 ticks really means 30 ticks
And it seems these 30 ticks are actually the duration between dialog boxes, so it's actually part of the NEXT state that follows after the message box has been removed.

Can you please check what the original interpreter is doing?
Also that's not just the follow-up dialog when you bring coffee, but it's like the 30th dialog box. Please also include which script you are posting from.

This is script 150, sCartoon::changeState, and the state number would be useful too.
I just checked my multilingual Larry 5 copy. I skipped the dialog boxes, but this specific text stays on screen for seconds.

I think I read something that there indeed is a time overflow problem with ticks, but it happens not that often.

Last edited 7 weeks ago by m-kiewitz (previous) (diff)

comment:6 by m-kiewitz, 7 weeks ago

If this is indeed a tick overflow, then the same should happen in the original interpreter, and there is not much we can do about it. It wouldn't be a ScummVM bug.

And trying to fix this would be a major thing, because you would have to patch basically all games, because they all have the same overflow problem.

Also I think I remember that games typically calculated the duration by themselves, depending on the length of the text.

Last edited 7 weeks ago by m-kiewitz (previous) (diff)

comment:7 by eriktorbjorn, 7 weeks ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.