This is an incomplete but functional implementation of WHCA* (Windowed Hierarchical Cooperative AStar) as proposed by David Silver
in his academic paper CoopPath05.pdf.
I had implemented this prototype a few years ago (in 2008 I guess) after then it's forgotten. Now I publish it as it is with source code
hoping it may help someone.
A couple of notes (if I remember correctly):
"Normal" A* can tell you if there is no solution but WHCA* cannot (at least as it is)
With normal A* you get unnatural and unaesthetic paths unless you do some post processing. Same applies for WHCA*.
The degree of cooperation depends on depth (of time) of search. If two units are blocked in a narrow corridor of X units of length, search depth should be at least X+1 to solve this situation.
As expected there is a trade off here: The deeper the search the more likely it should solve blockages but the more expensive it will be.
As the name suggests, the search for each unit is windowed. Each unit searches for a partial route to its destination at regular intervals. This sometimes results in -seemingly unnecessary- waits.
Demo app running with 8 units in a relatively tight environment: