Diagonal connections on grid graph

Hi, I have a graph grid, and I would like to allow diagonal connections between A and B on that situation :

A X
X B

where X is an obstacle/non walkable node

I read some post in the forum about the BlockManager.filterDiagonalGridConnections and ITraversalProvider.filterDiagonalGridConnections, both are set to false, but when refreshing the graph I still have the diagonal connection disabled on exposed situation. I took a look to the GridNode.FilterDiagonalConnections function but as it uses bitmasks I don’t know how to change it to allow me to do what I need.

This is my first issue.

My second issue it that I would like to enable those diagonal connections only in some situations, depending of obstacle type on the X tiles, would you have advices on how to proceed ?

I’m using Astar version 5.2.4

Thank you.

My memory from the last time something came up like this was that this was not possible. I’ll tag Aron on this to have him confirm that, but last I heard, going through unwalkable nodes diagonally to a walkable one was not something that can be done.

Hi

Yes, this is not possible at the moment with walkability.
You can get this effect if you don’t use walkability, but instead use tags to make the nodes non-traversable, as disable filterDiagonalGridConnections. But it is not possible to make this depend on the types of the tiles I’m afraid (well, I guess you could make some use tags and some use walkability).

Hi, thanks for your answers, I managed to change the gridgraph generation to get what I wanted to (see image attached), but when asking for a ConstantPath to get accessible area from a position it looks like the changed graph is not taken in account and the ConstantPath returns what we would have without my changes on the graph. I did not tested yet with an ABPath. Does the ConstantPath generation not based on the graph, but on other calculations ? Would you have inputs on where I should look on ? Thanks.

This would be the first time I’ve heard of it, if this is how it works.

Give this a try with your specialized setup and if it also isn’t working we can dig more deeply to see what may be going on