Tile-wide extent tracing on a grid.

Posted by Larolaro on Game Development See other posts from Game Development or by Larolaro
Published on 2011-06-30T15:01:06Z Indexed on 2011/06/30 16:32 UTC
Read the original article Hit count: 291

Filed under:
|

I'm currently working on A* pathfinding on a grid and I'm looking to smooth the generated path, while also considering the extent of the character moving along it. I'm using a grid for the pathfinding, however character movement is free roaming, not strict tile to tile movement.

To achieve a smoother, more efficient path, I'm doing line traces on a grid to determine if there is unwalkable tiles between tiles to shave off unecessary corners.

However, because a line trace is zero extent, it doesn't consider the extent of the character and gives bad results (not returning unwalkable tiles just missed by the line, causing unwanted collisions).

So what I'm looking for is rather than a line algorithm that determines the tiles under it, I'm looking for one that determines the tiles under a tile-wide extent line.

Here is an image to help visualise my problem!

Does anyone have any ideas? I've been working with Bresenham's line and other alternatives but I haven't yet figured out how to nail this specific problem.

© Game Development or respective owner

Related posts about tiles

Related posts about path-finding