AI not pathing as expecting through tags

We are using grid graph and node tags that have move cost penalties to simulate walls in our 3D RTS game. We want AI to path around them, but if path is too long, just go through walls and attack them.

Basically a wall sets a grid node tag, where AI has move cost for that tag of 100 000 (basic ground is 3000). However, in bellow pictures, there are 2 main issues with this:

Issue A

When some walls are diagonal, AI paths straight through them, ignoring penalty. This would not happen when those nodes would be unwalkable, so maybe this is a bug?

Issue B

Another issue is, when AI paths around the tagged areas (walls) like this:

and gets close to the edge of the tagged node, it will decide to skip its path and again, path through it to the other side.

Would you help with this issue? This is kinda a game killed for us.

Thank you!

Hi

This has been fixed in the latest (4.3.42) beta (well, at least the first issue, not quite sure what the second thing could be caused by). See the changelog here: https://www.arongranberg.com/astar/documentation/dev_4_3_42_230433a5/changelog.html

You can download the beta here: https://www.arongranberg.com/astar/download

1 Like

Thank you for the reply! Gonna try the beta soon and let you know!

The second issue seems like AIPath is pathing through obstacles (due to e.g. Funnel modifier), but when it gets on top of that node with the penalty, it decides “I’m already on top of the penalty node, then lets just path through it to the other side”.

So the modifiers path through these penalty nodes, and then recalculate path through them, if they are already standing on them.

Ah, the tags only have penalties. They are still walkable.
Yes then it’s unfortunately expected. If the agent is already standing on a node with penalty, it will get that penalty regardless of which direction it moves.

I suppose what you could do is to modify the movement script so that when it searches for a path it will first find the closest node which is not inside a wall (using a GetNearest call which is configured to exclude that tag) and then search for a path assuming that’s the actual position of the agent.

Hey @aron_granberg, I downloaded the latest beta due to Issue 1, and now the pathing through tags with penalties is quite strange :smiley:

Please observe the image (walls with blue squares bellow them are tagged nodes as “Walls”. Seeker has a penalty for “Wall” tags, so nodes have tags, not penalties)

all those nodes are walkable though

Regarding your latest suggestion about Issue 2, will try to replicate it

Hi

Could you try to disable all modifiers and post a Screenshot of the result?

yeah, it seems like Funnel modifier is messing with this

AIPath without any modifiers seems to path fine.

EDIT: it seems Raycast Modifier is working fine. Using it fixes both Issue 1 and Issue 2. Not sure if it counts as bug for other modifiers or its expected, this is up to you.

Thanks for the support!