• Resp
If the map is 20x16 but they move in steps of half a tile at a time,
this is the same as though the space of states is a 39x31 map of
quarter-tiles. In order to properly pathfind, each tile need to have
it's passability (and optionally, cost) determinable. To do so, you
merely need to map the state in the quarter-tile space to the
passability of full-tiles.
-OO
X*O
xx-
Perhaps we use the upper-left quarter as the index of the characters
location in respect to full-tile space, i.e. that it occupies the
full-tiles which it's index quarter tile, it's quarter tile to the
right, down and down-right occupy. If we assume the xs are the
quarters of the character where X is the index quarter, we see that
the X quarter is impassable because one of it's associated quarters
are occupied by a quarter of the full-tile O. In other words, you
determine the passability for a specific quarter by imagining that
the character stands there and occupies all of the full-tiles which
the 4 quarter-tiles of the character would occupy.
quarter_passable_i,j = passable(full_tile_for_{i+s},{j+t}) for all
s,t in {0,1}.
where full_tile_for_i,j = (floor(i / 2), floor(j/2)) for instance
|