Support Forum

Unwalkable Nodes Loop Hole

Hi! I have a question regarding unwalkable nodes.

Capture.PNG

For some reason, the agents still pass through unwalkable nodes if they move diagonally like in the image above. I circled the two corners where the agents can pass through. Is there a solution for this? A way wherein the agents cannot go through that corner since it is technically unwalkable?

Hi

That’s odd. Pathfinding does not allow that by default. Are you sure they actually generate a path through that diagonal?
One thing that might happen is that if they stand very close to that corner they might overshoot in one frame and end up closer to the other side of the wall, therefore their next pathfinding calculation threats them as if they were on the other side of the wall. Maybe this is what happens?

Hello! I’m not so sure. I’ll investigate further on this. But assuming what you said is correct, is there any way to solve the frame issue?

That depends on what movement script you are using.

We are using the AILerp.

Oh, that really shouldn’t be affected by this issue. Would you mind posting a video of this happening?

Here is a video of it happening.
https://drive.google.com/file/d/10o9sK9rYyf4eZ67dcC77q12_8oTa1COY/view?usp=sharing

Huh. Have you done any manual updates to the graph?

What do you mean by manual updates? If we are rescanning the graph manually? If that is what you mean then yes. We are calling this part of the code in AStarPath.

It seems like something has been done to the code that calculations node connections for the grid graph. Either something is setting a node’s Walkable property without recalculating node connections, or something else has been done to the node connection calculation code. The system doesn’t allow units moving along those diagonal connections by default.

What is the call for recalculating node connections after setting the node’s Walkable property?

Also, maybe this is where we went wrong?

No, everything that goes through AstarPath.UpdateGraphs will recalculate the connections automatically. It’s only if you have modified the nodes via a script directly.

You can visualize the connections by clicking “Show Connections” in the A* Inspector -> Grid Graph.

I don’t think we are modifying nodes directly. We are only rescanning graphs if the map changes, like when a wall if built or destroyed, we rescan that part of the graph. Also, even at the start of the game wherein we do not manually update the graph, it still happens.

I think there is something wrong with the Eight connections.

image

As you can see there really is a connection there (I circled it blue).
Unlike when using Four connections, like this one.

image

The red lines are cut off, so I assume that the red lines are the connections.

Is there anything I can do to cut the connections there when using the “Eight” connections?
Here is a more zoomed in screenshot.

image

Wait a minute. Are you using multiple graphs?

Yes we do but the agents only walks on one graph at a time. They only switch graphs when they need to fly. 1 graph is for people walking on the ground and the other is for flying agents. When I removed the other graph this is what happened.

image

I tried removing the second graph, it still happens. I thought the second graph is the reason for this issue lol.

image

Hi, is there anything I can do on my part on this?