Opened 21 years ago

Closed 17 years ago

#863 closed defect (fixed)

ZAK: Zak appears in wrong position (cosmetical)

Reported by: Kirben Owned by: fingolfin
Priority: low Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Zak McKracken

Description

Latest ScummVM cvs version. English version of Zak McKracken (Enchanced) Compiled under mingw with GCC 3.2.3 and running under Windows XP.

In the original game Zak is shown inside the airport, after riding the bus to the airport. But in ScummVM I have to move Zak manually into the airport, after riding the bus to the airport.

A screenshot from original game and save game is attached.

Ticket imported from: #751662. Ticket imported from: bugs/863.

Attachments (4)

airport.jpg (49.9 KB ) - added by Kirben 21 years ago.
zak.s02 (50.4 KB ) - added by Kirben 21 years ago.
Wake driver with kazoo, use CashCard and ride bus to the airport.
airport.2.jpg (47.2 KB ) - added by Kirben 21 years ago.
Bad Zak in Airport
zak.s03 (7.1 KB ) - added by fingolfin 18 years ago.
Zak going to SFO (German V2 Zak)

Download all attachments as: .zip

Change History (14)

by Kirben, 21 years ago

Attachment: airport.jpg added

by Kirben, 21 years ago

Attachment: zak.s02 added

Wake driver with kazoo, use CashCard and ride bus to the airport.

comment:1 by (none), 21 years ago

Logged In: NO

I had analysed this a bit. It looks like there's a bug in the script code, that sets zak's x coordinate to a very high value (I think the script should put him left of the bus, but he is in a different level).

Normally adjustActorPos should fix this, but the distance to the next walkbox is too big (infinite in scummvm terms). Maybe adjustActorPos in the original game can handle this better.

comment:2 by fingolfin, 21 years ago

I put in a partial fix for the problem by allowing for greater distances. So Zak will now be visible. However, he is too far down - that isn't a fault of the algorithm, that position is exactly where he should be (if you look at the box coordinates). So my guess is that the old engine used a different algorithm to find the closest point on a given box.

comment:3 by Kirben, 21 years ago

Another small point I should have mentioned earlier. When Zak crosses the Airport to enter the Plane, I usually have to click mouse button once for the scene to continue after Zak has gone offscreen.

comment:4 by fingolfin, 21 years ago

Priority: normallow
Summary: ZAK: Zak doesn't appear in the airportZAK: Zak appears in wrong position (cosmetical)

comment:5 by fingolfin, 21 years ago

Can't reproduce what you are saying, kirben. Does that still happen for you in latest CVS?

Anyway, renaming this bug and lowering priority, it's merely cosmetical now.

by Kirben, 21 years ago

Attachment: airport.2.jpg added

Bad Zak in Airport

comment:6 by Kirben, 21 years ago

No the problem of having to click mouse again to continue after Zak crosses Airport room to plane no longer occurs.

Zak's position when entering the Airport is correct sometimes now too but not always, a screenshot is atached. If you go straight to Airport after starting new game Zak's position is always incorrect.

by fingolfin, 18 years ago

Attachment: zak.s03 added

Zak going to SFO (German V2 Zak)

comment:7 by fingolfin, 18 years ago

Attached is a current savegame for the German V2 that can be used to reproduce the issue.

So, when entering Airport SFO (room 145 / 8), Zak initially is at position (720,120) (in block coords, that woud be (90,60)). This is so because the coords are unchanged from those in the previous room outside, where he entered the bus at the very far right side of a wide room.

Hence Zak initially is out of any box. Eventually, Actor::adjustActorPos() is called, which in turn invokes adjustXYToBeInBox, trying to place Zak into the nearest valid box. This happens to be box 0, which has these coordinates: (0,112) - (0,126) - (256,112) - (304,126)

Now, as some simple calculations verify, the point closest on that quadrangle to Zak's former (invalid) position happens to be the lower right corner, i.e. (304,126). Hence Zak is placed there.

But the original seems to have placed Zak at (264,120). Notice that the y coordinate did not change. Now, this leads to the idea that maybe when adjusting the actor pos, the y value is not changed, or only changed "if necessary" or something like that. However, the point on box 0 with y coordinate 120 which is closest to Zak is in fact (283,120). If you take into account that in the original game, x-coords always were a multiple of 8, that still leaves us with (280,120) -- a very noticable 16 pixels farther to the right than expected.

All in all, I am still not sure what is going on here :-/. Just thought I'd post my observations here in case somebody else wants to investigate this at some point....

comment:8 by fingolfin, 18 years ago

Correcting myself: The (720,120) coord is *not* from being to the far right on the previous screen. Rather, putActor is called twice:

putActor(264, 120, 145) for actor 1 called from script 54 then a bit later: putActor(720, 120, 145) for actor 1 is being called from room 3's exit script... oops

So this looks like one of the various "bad script order" problems we've seen numerous times by now.

comment:9 by fingolfin, 17 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:10 by fingolfin, 17 years ago

Fixed in Subversion, next daily build should have the fix.

Note: See TracTickets for help on using tickets.