A* Pathfinding Project

Cooperative Pathfinding Update?


Sorry I’m trying to not be a jerk here… am I doing something wrong? Is anyone getting notified of these? @aron_granberg @richieturner @Fuzzy



@schmoey Well I am :slight_smile:
I hope @aron_granberg will get this feature to the stable release, it’s so cool and useful and really sets this pathfinding apart from the others.


Ha ok cool.

So question… did it actually work for you? Do the agents move? Or just the gizmos?


I will take a look at this as soon as I can.
I don’t believe it is the Teleport method though. If that was the problem it would be a compile error, but you aren’t seeing that, right?


All good, I just wasn’t sure whether the forum was working or not… but yes obviously it would be good to see this functional!

I haven’t gone back to look at it since my original post, so I’m probably wrong. No, no compile errors, just the gizmos are moving in the way you would expect the agents to, but the agents do not move at all.


@schmoey Yeah same with me, no compile errors. Just gizmos and pink bars it’s weird. No agents moving. And textures seem to be missing although I imported everything. Everything is pink


Hah. I think I found the problem…

Sometimes I use the AstarRelease compiler directive to strip out debug code or beta code from the final release. Here it seems I had mistakenly stripped out a bit too much code. I have uploaded a new beta version. The materials might still be missing though, I didn’t check why that was the case.


Oh yeah that’ll do it alright! Cool thanks it all works now, gonna have a play around with it and see what I can do. Thanks again!

Not fussed about any missing materials :slight_smile:


Yeah, I got it working too agent are still all pink but no big deal. Damn this is unbelievably cool!
@aron_granberg do you think it is stable enough to be used for a released game?
And are there any tutorials on how to set it up?


There are some kinks still. Sometimes agents will pass through each other, I haven’t really figured out why that is happening. Of course, this might be acceptable depending on the game.

There are currently no tutorials, but it’s pretty much that you have to add the CooperativeContext component to the same component as the A* component, and then add the CooperativeAI movement script to the agents (it works like the other agents, so you set the destination property or add a AIDestinationSetter component).


@aron_granberg That’s awesome. Just one more question, does this work with recast graph?


@sami14321 No, it does not. In fact there is a whole bunch of restrictions, take a look at the bottom of https://arongranberg.com/2015/06/cooperative-pathfinding-experiments/


This is really awesome. I hope this gets updates occasionally so at least its branch doesn’t end up way behind the current one.


Once again this is really good. In my testing I haven’t ever seen anything this good for getting a lot of units to navigate narrow corridors (e.g. a dungeon) without constantly getting stuck.

I think most of the limitations are fine and are workable for where this shines the best. The plan to eventually allow agent speeds as certain multipliers of the default speed will be more than good enough for me. I also think the occasional bug where agents move through each other is better than them getting stuck.

The thing I feel missing is some way to tell if an agent is queued behind agents that aren’t moving. If there’s a line of agents moving down a narrow corridor and the one in front stops I’d like the agents behind to stop rather than try to squish in. This seems possible looking through the code but I’m not entirely sure how. Perhaps check if the next node has a registered blocking agent and then check if that agent has a current valid path?