Opened 5 years ago

Closed 2 years ago

#11038 closed defect (fixed)

SCI: SQ4: Entering skate-o-rama incompletable at slower speeds (CD only)

Reported by: TheQL Owned by: sluicebox
Priority: normal Component: Engine: SCI
Version: Keywords: original
Cc: Game: Space Quest 4

Description

Though apparently ScummVM fixes timing problems I got blasted immediately when trying to reach the skate arena in SQ4 galleria. Every time. No chance to move away.
Then tried same savegame on Mac, timings ok, could escape. Is it possible that the timing fixes don't (all) work on iOS?

Can provide save.

iOS ScummVM build is recent git clone.

Attachments (1)

sq4-cd-win.001 (35.6 KB ) - added by TheQL 5 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by criezy, 5 years ago

Yes please, attach the save to this ticket.

by TheQL, 5 years ago

Attachment: sq4-cd-win.001 added

comment:2 by TheQL, 5 years ago

I have added the savegame. Just walk to the left and get blasted. I know it happens on Mac as well, but not each and every time and not that early.

comment:3 by criezy, 5 years ago

Component: Port: iOSEngine: SCI

With your save game I seem to be blasted immediately every time on Mac as well (I have tried about 10 times). Which is the same behaviour I have on iOS. So that one may not be specific to iOS.

I am using the English Windows CD version from GoG.

I am changing the component to see if somebody familiar with the SCI engine can have a look.

comment:4 by sluicebox, 5 years ago

There's definitely something wrong there. I got the same result on Windows and would be very surprised if the platform is relevant to this.

I'm an impatient Sierra player and always set the game speed to high. I must be in the minority because that seems to flush out a lot of bugs. I did that here before entering skateorama and I got the timinig I'm familiar with.

I will take a closer look at this, but it looks like the bug is that this scene's timing is unacceptable when speed slider is set to middle or less. I turned it down all the way and got killed before I even gained control.

Thanks for catching this! FOr now, turn up the speed for this part and you can get through it.

comment:5 by sluicebox, 5 years ago

Owner: set to sluicebox

comment:6 by TheQL, 5 years ago

I did manage to survive on Mac though without changing speed, but ironically I had tried to lower speed to survive this scene, it didn't occur to me that increasing speed could help.

comment:7 by sluicebox, 5 years ago

Keywords: original added
Summary: iOS timing issue in SQ4SCI: SQ4: Entering skate-o-rama incompletable at slower speeds (CD only)

This is a bug in the original which our timing fixes and workaround don't yet address. The same thing happens in DOS. It's a regression in the CD version. The root cause is that SCI games changed how the Speed setting worked in between SQ4 floppy and CD, but the Skate-o-rama scripts weren't updated for the change in the underlying components. (A common theme in CD regressions!) The scripts specify delays in game cycles, which in floppy was relative to game speed, but that's no longer true in CD. Game speed now only affects how fast you and other actors move, so you now have a fixed amount of wall-time to get away from the police, and it's not long enough to do so if ego is moving at medium to slow speeds.

The good news is that this is fixable, the bad news (for me) is that this is a can of worms that isn't particularly fun, as I keep finding more little problems with this scene, and am revisiting the need for our existing workaround, but we'll get there eventually. Other good news, I just saw that New Rising Sun patched this (of course!) in a way that jives with my understanding of the problem, so that's encouraging. I love prior art!

Renaming this issue to reflect this.

comment:8 by TheQL, 5 years ago

Sounds promising! Anyway, I am way past this, so take your time. I just suppose a fix is in order nevertheless ;)

comment:9 by ZvikaZ, 5 years ago

@sluicebox, maybe it's better to fix our VM to support "hybrid" timing mode, that will allow SQ4CD to use old timing scheme (or, more complicated, but I think feasible, use sometimes the old timing scheme, and sometimes the new timing scheme)?
I haven't looked in code yet, just guessing according to your description...

comment:10 by ZvikaZ, 5 years ago

BTW, could this timing scheme change be the cause of https://bugs.scummvm.org/ticket/9825?

comment:11 by sluicebox, 4 years ago

I give up on this one; I'll see if someone can remove me as the 'owner' since that's not a UI option anymore.

NRS' solution is unsurprisingly the best: converting each Script object's delay in cycles to a delay in ticks and multiplying that by the game speed. That in conjunction with our extra throttling in these rooms gets things back to intended behavior from floppy where the delays are relative to game speed, while still being able to see the lasers when speed is set to high.

The problem with patching the cycle delays is that there's over forty of them in the four rooms. That's not the deal breaker, there's room for the new bytes. The big problem is that the bytecode signature is so small that there aren't four consecutive constant bytes needed for SIG_MAGICDWORD. If this can't be done with three little generic patches then the alternatives become, in my opinion, very big and messy and out of proportion to the problem. And at that point you're really committed to stamping out all the edge cases in these rooms, and they sure have them, so it just gets messier. Our existing throttling solves the biggest problems and I'm okay with "turn up the speed like in the original." (or, use NRS' SQ4 Update!)

comment:12 by lotharsm, 4 years ago

Owner: sluicebox removed
Resolution: pending
Status: newpending

comment:13 by TheQL, 4 years ago

I patched SQ4 as suggested, maybe it would be nice if ScummVM recognized the patched version. I had to select SQ4 myself from a dropdown. Otherwise thanks for the update!

comment:14 by sluicebox, 3 years ago

Resolution: pending
Status: pendingnew

comment:15 by sluicebox, 2 years ago

Owner: set to sluicebox
Resolution: fixed
Status: newclosed

Fixed in https://github.com/scummvm/scummvm/commit/a100e036635f92983326ffd5b00a1fdba7715021

Just had to step away from this for a year or so =)

Note: See TracTickets for help on using tickets.