I setup a FollowerEntity spawning in tag2 area, with a AIDestinationSetter whose target is in tag 3 area.
At runtime, using a debugger, I can see my custom ITraversalProvider is being called, and the false branch is being taken. However, the agent goes straight from area tag 2 to area tag 3 without doing a detour in tag1 area.
Is there something I forgot to make this all work?
Thanks. The FollowerEntity did indeed not take connection filtering into account. I’ll make some fixes in the next update. The path was generated correctly, but the FollowerEntity immediately simplified the path.
Can RVO push my character outside of what CanTraverse allows? If yes, will it try to go back on the “allowed” node first? I am afraid if it gets pushed away and triggers a path recalculation from wrong area, it will end up taking the “forbidden” path.
Would it be possible to expose “future planned path”? I would like to do queries about what lies X meters ahead (or if not possible, X nodes ahead). Ideally in forms of ranges so that I don’t have to do tons of query to be sure to not miss anything.
For example, having public access to pathTracer.nodes (from what I understood, it would only give list of next nodes without accurate distance since it’s before funneling – but it would still be better than nothing).
Also, just an update on the original issue:
I ended up creating a GraphModifier to remove the connections between those areas, it makes much more sense for my use case since it is not going to change at runtime.
A little bit about my use case, main area (tag 1) is sidewalk and tag 2/3 are separate crosswalks.
I wanted to make sure pedestrian go back to sidewalk before taking next crosswalk, even if they are slightly connected (which could easily happen in a corner).
So no hurry to fix the original issue, the current workaround seems to be working fine.
However, I was thinking it would have been nice to be able to easily query the GraphNode future list being traversed (without having to resolve Vector3D → GraphNode again), so that I could figure out all “tags” being traversed or what tag is at a specific distance marker easily.
More specifically, I want my character to stop a bit before entering the “crosswalk” area. Right now I make it stop only when FollowerEntity.currentNode.tag is crosswalk (so it is right on the edge) but ideally I would like to be able to stop 50cm before.
I guess I could compute 50cm ahead using GetRemainingPath() and then do a AstarPath.active.GetNearest(position).node, but if this GraphNode was already stored in the Path without having to do a lookup, I thought that would be more direct/fast.
Anyway, I can work it out with current system so no worries.