A* Pathfinding Project

GetContours offset / more contours?


I was wondering if you could help me out with the GraphUtilities.GetContours code? I’d like to get some additional points for the contour. It looks like the code is just checking the 4 main directions, and not the diagonals. I’d like to check diagonals so that I can reduce the offset multiplier, in order to have the contours closer to the center of the node.

Essentially, in the picture the red dots are the current contours, but I’d like to get the blue dots returned instead. Is something like that possible?



This is not possible out of the box at the moment. However I think it should be possible to post-process the contours that you get from the current method. You can move each vertex by 0.5 node widths towards the inside of the shape. I think that should give you what you want.