[Scummvm-devel] Re: Walkboxes question

Max Horn max at quendi.de
Sun May 1 02:47:35 CEST 2005


Am 30.04.2005 um 19:00 schrieb Eugene Sandulenko:

> Hi Max,
>
> a question. May you give some hints (or even commit :P) how to insert
> this NES-related code. As I understand this is completely different
> algo from what we have now (probably even it will work with v1 games
> too), but I am not sure how to properly do it in the light of current
> rearrangements you perform.
>
>
> http://qmt.ath.cx/~quietust/scumm/maniac/boxes.txt
>
Seems you would overload checkXYInBoxBounds in ScummEngine_v2. Note 
that it does use a different algo, because V1/V2 walk boxes are much 
simpler than those found in later games: They can only be trapezoids, 
where the top/bottom side are horizontal lines; in later games, 
(almost) arbitrary qudrangles are used. For trapezoids, finding a 
suitable point inside the trapezoid is of course easier.
The *real* interesting difference is that it computes a point in the 
8/2 grid. The fact that we do pixel wise computations is causing all 
sorts of minor (and not so minor) quirks with the v1/v2 games, so it 
might be worth to try this out, although it may cause troubles in other 
areas.

If implemented, though, checkXYInBoxBounds should still take pixel 
coordinates, then convert them (by dividing the coords by 8 resp. 2), 
and then again converting the result point to pixels (by multiplying 
them).


OTOH, adjustXYToBeInBox is virtually identical to our existing 
implementation. If you start the "tIdx" in our code at 2 (instead of 
0), you get identical behavior, unless I missed something.


Cheers,

Max





More information about the Scummvm-devel mailing list