AI cutting corners even if option is disabled

Hi!

I am using a slightly modified version of the AIPath script and I have disabled “Cutting Corners” on my A* object but it still cuts corners. And thanks to my game style with tiles without walls the AI falls off the map when it reaches a corner. How can I fix this? I really want the AI to walk a bit closer in on the tile.

Hi

The AIPath script has a setting for “Pick next waypoint distance” and “Forward Look”, reduce those values and you will see that it adheres closer to the path.

See also http://arongranberg.com/astar/docs/class_a_i_path.php

2 Likes

@aron_granberg
After some testing it didn’t do much change. Sure the AI stays on the tiles but barley. I want the AI to be closer to the middle. How can I do that? Right now the AI is walking along on the edge.

Can you post a screenshot?

@aron_granberg
Here are two screenshots. One is from the A* object and the other one is when the AI is close to the edge.


Hi

Could you show it with the graph visible (Show Graphs option enabled)?

@aron_granberg

Hi

I think one source of confusion might be that while the graph looks like it renders squares, it actually renders the connections between the nodes.
So the corners of the things the look like squares in the image are the node positions and the lines are connections between the different nodes.

Also, try to increase the “erosion” setting on the grid graph, that might help.

2 Likes