Tilemap pathfinding (without clipping corners).

0 favourites
  • 3 posts
From the Asset Store
In this template the music plays without looping in your game
  • I know this has been discussed a lot, but I haven't seen a full explanation.

    I've set up pathfinding in my tilemap maze and it can find it's way from a to b. Problem is, it clips the corners, virtually passing through some of the walls. I've tried every combination of cell size and cell border and it either doesn't move at all, or it moves and clips the corners.

    I've seen people point out that that's all the pathfinding is really meant to do, i.e find the path. But is there a way to get to precisely follow the contours and never clip the walls? Say I have 32x32 cells, the 'player' is a 32x32 square and the walls are exactly 32x32 walls .... so the corridors are only 32x32 wide..... is it possible for the pathfinding to find it's way pixel-perfect down those corridors?

    Alternatively, would I need to do a custom pathfinder? I have an array set to the exact same shape as the tilemap already, so maybe pathfinding through the array would work?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Did you disable diagonals?

    Also, try using MoveTo behavior. It can walk on Pathfinding path. Or you can tell it to walk from tile to tile, check out this example:

    dropbox.com/s/43c9z9u762l35pw/TileWorkaround_w_Projector2.c3p

  • Woot, move-to works perfectly. I didn't need to tell it to move from tile to tile, just told it to move along the path and it goes along the squares rather than around the edges :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)