A* Pathfinding Project

Erosion/Tags optimization


#1

We use Erosion with tags to allow for large and small AI’s.
Unfortunately, the large AI’s represent half of our AI’s and they suffer a performance penalty due to the use of tags and the fact that the Layered Grid Graph that we are using uses nodes whose walkability and native connections are based on the small finer grained path.
We have considered using two graphs, but that would be a lot of overhead.
I wonder if there was a way to overlay more than one set of connections, walkability flags and heuristic optimizations on the same graph for different tag masks (we only need 2, not 2^32 :wink: )


#2

Hi

This is not possible I’m afraid.
I would recommend to use two graphs instead.


#3

@David_Wu have you considered just modifying the generator code?
Since you’re working with a layered grid graph it’s not too difficult to modify the logic of how graphs are scanned. You could easily add a boolean to each node.
Then either change the default traversal behavior, or use the ITraversalprovider interface, only on your smaller agents, https://arongranberg.com/astar/docs/itraversalprovider.html


#4

David_Wu is specifically asking about things like heuristic optimizations and most likely the flood fill optimizations. These operate on nodes and cannot be extended by just modifying the generator code. You would have to add some complexity to a lot of different places in the code to support this I’m afraid.


#5

aron is correct. I may use two graphes, I could do the ray casts, copy the graph and then apply the erosion to one of the graphs


#6

An alternative can be with tags (https://arongranberg.com/astar/docs/tags.html) per agent mark areas that are not passable?