Opened 7 years ago

Closed 7 years ago

#9855 closed defect (fixed)

SCI: PQ4: Spaceship collision with asteroids not working

Reported by: bgK Owned by: wjp
Priority: blocker Component: Engine: SCI
Version: Keywords: sci32
Cc: Game: Police Quest 4


ScummVM: 9f055d4ba12e809abab41ab1b7af1794eb75a1f6
Game: DOS / CD / French / Hi-Res

During the third day, Carey can go back to the Short Stop bar. When he uses his change on the arcade cabinet an Asteroids like minigame starts. The game plays fine, but asteroids go trough the spaceship without collision, making the game almost impossible to loose. Since loosing seems to be the only way to exit the game, I'm stuck playing Asteroids. Help ;)

To reproduce, load the attached save, and use the change on the arcade cabinet.

Attachments (3)

Capture d'écran de 2017-06-20 20-06-37.png (25.6 KB ) - added by bgK 7 years ago.
pq4-cd-fr.042 (60.3 KB ) - added by bgK 7 years ago.
Save (French version)
object_intersect.diff (2.7 KB ) - added by bluegr 7 years ago.
Proper implementation of kObjectIntersect

Download all attachments as: .zip

Change History (8)

by bgK, 7 years ago

Attachment: pq4-cd-fr.042 added

Save (French version)

comment:1 by bluegr, 7 years ago

The scene in question is 2010.

This probably the only SCI32 game which actually uses the kObjectIntersect kernel function, in this particular scene.

The issue is that our current implementation of this function uses SCI16 code, and yields wrong results. I'm attaching a patch that is what the original SCI21 interpreter is doing. The function itself works fine, however sometimes there's an assertion thrown in celobj32.cpp:325, in READER_Compressed, function getRow(), but it looks to be random.

I've also managed to reproduce an uninitialized read error when I died once while an enemy ship was present:
Uninitialized read for temp 7 from method enemyShip1::cantBeHere (room 2010, script 2010, localCall ffffffff)

by bluegr, 7 years ago

Attachment: object_intersect.diff added

Proper implementation of kObjectIntersect

comment:2 by bgK, 7 years ago

Thanks. Your patch also fixes the "sand buggy" arcade game on the right.

comment:3 by bluegr, 7 years ago

Thanks for your feedback! I've made a pull request with the fix for this:

comment:4 by csnover, 7 years ago

Priority: normalblocker

comment:5 by wjp, 7 years ago

Owner: set to wjp
Resolution: fixed
Status: newclosed

This should now be fixed by commit 820caf370e2c24e6aefd8b1b90227ca29564bab6. Thanks for catching this!

Note: See TracTickets for help on using tickets.