[Scummvm-devel] That pesky CMI walkbox problem... (fwd)

Max Horn max at quendi.de
Wed Feb 5 06:30:02 CET 2003


At 5:53 Uhr -0600 05.02.2003, J.Brown (Ender) wrote:
>I think your on the right track here. But does adding in a min/max check
>to switch the coordinates in getBoxCoordinates help? I quickly tried it,
>and it does indeed seem to fix the box problem...
>
>But there are also two other noticable walkbox problems, and I wonder if
>they are related and this is an incorrect, or at least incomplete, fix.
>
>To wit:
>   - On entering either the grove where Elaine's statue is, or the Cannibal
>Village, for the first time, Guybrush is placed in the wrong starting box.
>
>Also remember that COMI boxes -are- polygons, so the orientation of the
>coordinates really -shouldn't- matter. If any of our code does fail
>because of this, it is a bug..

COMI walkboxes, like the walkboxes in other Scumm games, are 
tetragons (i.e. polygons with four vertices and four edges). The 
order of the edges is *not* arbitrary, and it does matter, for any 
polygon. True, "rotating" the vertices keeps a polygon invariant, but 
that's not true in general. Compare with this ASCII art, with the 
same vertices but in a different order:

1--2
|  |
|  |
4--3

1  3
|\/|
|/\|
4  2

Our code to check whether a point is inside the walkbox assumes the 
walkbox is konvex, a very reasonable assumption, and I would be 
surprised if they were  using non-convex walkboxes, it makes no sense 
to do so.

Cheers,

Max




More information about the Scummvm-devel mailing list