Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#7046 closed defect (fixed)

KQ1AGI: Eagle Does Not Take Graham with Him

Reported by: lordhoto Owned by: m-kiewitz
Priority: normal Component: Engine: AGI
Version: Keywords: script
Cc: Game: King's Quest 1


ScummVM 1.8.0pre133-gb1fff2d English DOS v2.0F AGI 2.917 Linux/amd64 gcc 5.3.0

After jumping to make the bird catch you, the bird is supposed to fly away with Graham. However, it only briefly picks up Graham and then it's just gone and Graham is left behind in the same screen. Graham also moves pretty fast afterwards.

I'm attaching a save at the scene where the eagle is already present. Just wait for the eagle to come to Graham and then type "jump". This bug is not fixed to the position Graham stands. It also happend when I let the eagle catch Graham in the mid of the screen and near the tree on the left.

Ticket imported from: bugs/7046.

Attachments (3)

kq1.016 (3.5 KB ) - added by lordhoto 8 years ago.
KQ1SG.2 (2.8 KB ) - added by lordhoto 8 years ago.
kq1.017 (3.4 KB ) - added by lordhoto 8 years ago.

Download all attachments as: .zip

Change History (10)

by lordhoto, 8 years ago

Attachment: kq1.016 added

by lordhoto, 8 years ago

Attachment: KQ1SG.2 added

comment:1 by lordhoto, 8 years ago

Attached is a savegame from the original interpreter. Graham stands in the same position. Letting the eagle catch you works fine there.

by lordhoto, 8 years ago

Attachment: kq1.017 added

comment:2 by lordhoto, 8 years ago

This works in 1.7.0. Attached a save at the same position.

comment:3 by lordhoto, 8 years ago

First bad commit is: 8a595e7771aa89d06876e13d7ab6751e26da8982

comment:4 by m-kiewitz, 8 years ago

It seems this is caused by scripts calling end.of.loop first because of entering "jump" and afterwards script 22 converts ego to ego+eagle and is also calling "move.obj". In original AGI it seems end.of.loop flag number "loop_flag" was using the same memory space as "move.x".

Which means if my assumption is correct, in original AGI some random flag (move.x) was set, when the loop was completed.

This "worked" previously in ScummVM because "loop_flag" and "move.x" shared the same memory space in the previous code. I removed it and thus the actually requested loop_flag is set resulting in this issue, because loop_flag signals end of the jump and that makes ego getting reset to the regular view, which then also stops flying onwards and the move motion is also stopped.

It seems NAGI compiled on Linux splits those variables up as well, so I think the same issue should happen. It would be great to get this verified. I could maybe also try to check in original AGI using a debugger.

I'm not sure yet how to fix this properly, but it seems that this is actually a script bug, that just happened to work because it set another flag because of the sharing and not the requested flag.

Needs to get verified using either NAGI on Linux or original AGI in DOSBox before I will implement a fix.

comment:5 by m-kiewitz, 8 years ago

lskovlun just tried it using NAGI on Linux and was able to reproduce the same bug.

comment:6 by m-kiewitz, 8 years ago

Keywords: script added
Resolution: fixed
Status: newclosed

comment:7 by m-kiewitz, 8 years ago

Added detection+workaround for this in commit 5484f0bc58b77bf7dd28debf1b7a53bd138ba28c

Note: See TracTickets for help on using tickets.