Opened 21 years ago
Closed 18 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)
Change History (14)
by , 21 years ago
Attachment: | airport.jpg added |
---|
by , 21 years ago
comment:1 by , 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 , 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 , 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 , 21 years ago
Priority: | normal → low |
---|---|
Summary: | ZAK: Zak doesn't appear in the airport → ZAK: Zak appears in wrong position (cosmetical) |
comment:5 by , 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.
comment:6 by , 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.
comment:7 by , 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 , 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 , 18 years ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Wake driver with kazoo, use CashCard and ride bus to the airport.