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:
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?
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.