Opened 3 years ago

Closed 3 years ago

Last modified 3 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
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 3 years ago.
KQ1SG.2 (2.8 KB) - added by lordhoto 3 years ago.
kq1.017 (3.4 KB) - added by lordhoto 3 years ago.

Download all attachments as: .zip

Change History (10)

Changed 3 years ago by lordhoto

Attachment: kq1.016 added

Changed 3 years ago by lordhoto

Attachment: KQ1SG.2 added

comment:1 Changed 3 years ago by lordhoto

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

Changed 3 years ago by lordhoto

Attachment: kq1.017 added

comment:2 Changed 3 years ago by lordhoto

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

comment:3 Changed 3 years ago by lordhoto

First bad commit is: 8a595e7771aa89d06876e13d7ab6751e26da8982

comment:4 Changed 3 years ago by m-kiewitz

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 Changed 3 years ago by m-kiewitz

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

comment:6 Changed 3 years ago by m-kiewitz

Keywords: script added
Resolution: fixed
Status: newclosed

comment:7 Changed 3 years ago by m-kiewitz

Added detection+workaround for this in commit

Note: See TracTickets for help on using tickets.