Cooperative Pathfinding

Advanced game related topics
User avatar
Fig
Enthusiast
Enthusiast
Posts: 351
Joined: Thu Apr 30, 2009 5:23 pm
Location: Côtes d'Azur, France

Cooperative Pathfinding

Post by Fig »

Hi,

Cooperative pathfinding allows units of the same team to look "smart". They can pathfind, helping each others. (like units in age of empire for exemple)
They don't need to repath all the time, they don't even dodge each other, they just pathfind in space and time (but no need to be Einstein to understand it !), aware of others. (classic A* uses only space)
You can, of course, select and pathfind several agents at the same time to test...
Image

Image
Commands:
Add/Delete an obstacle [Left clic]
Select an agent/Drag and Drop to select multiples agents [Left clic]
Pathfind to a goal [Right clic]
Add an agent [Space]
Delete Selected Agent [Del]
You can download the test archive here:
http://wordoxhelper.free.fr/Projet%20pathfinding.zip
The file to compile is (of course) Main. (DisableDubugger because I debug a lot of dati=>slowdown)

Known issues: (it's just a test program please don't be too exigent yet, a final version is coming for RTs purpose :wink: )
1- Deadlock possible if you play in a 1 tile large corridor (ie Agents danses to the left and right without stopping)
2- Please do not add agent in front of a current path walked through. (except if you repath by right clicking)
Thank you to remport any comment or bug.
Last edited by Fig on Fri Mar 28, 2014 7:02 pm, edited 5 times in total.
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS
User avatar
STARGÅTE
Addict
Addict
Posts: 2084
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Cooperative Pathfinding

Post by STARGÅTE »

interesting, nice example.

Thx for sharing
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
Fig
Enthusiast
Enthusiast
Posts: 351
Joined: Thu Apr 30, 2009 5:23 pm
Location: Côtes d'Azur, France

Re: Cooperative Pathfinding

Post by Fig »

You are the lonely person that has an interest in it, so, thanx YOU for testing... :D
I'am not sure others see the "breakthrough" in PB's pathfings field... :?
Last edited by Fig on Sun Mar 23, 2014 9:35 am, edited 2 times in total.
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS
User avatar
DK_PETER
Addict
Addict
Posts: 898
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Cooperative Pathfinding

Post by DK_PETER »

You are the lonely person that has an interest in it, so, thanx YOU for testing... :D
Hi Fig.

No, not the only one.
Very nice example.

merci beaucoup ;-)
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
Fig
Enthusiast
Enthusiast
Posts: 351
Joined: Thu Apr 30, 2009 5:23 pm
Location: Côtes d'Azur, France

Re: Cooperative Pathfinding

Post by Fig »

Din franske er meget god. Hvordan er Caroline Wozniacki? Hun kalder mig mere ... :mrgreen:

Thx for your feed back, Peter. Did you find, any weird situation or bug in that simulation ?
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS
User avatar
DK_PETER
Addict
Addict
Posts: 898
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Cooperative Pathfinding

Post by DK_PETER »

Fig wrote:Din franske er meget god. Hvordan er Caroline Wozniacki? Hun kalder mig mere ... :mrgreen:
(Hun har det rigtigt godt. Hun er flyttet til Amerika). :mrgreen:
Thx for your feed back, Peter. Did you find, any weird situation or bug in that simulation ?
Votre langue danoise est bon aussi. :-)

I added several obstacles and there
were no problems avoiding them.

One time, a unit jumped back and forth - but ended up where it should be.
Other than that, I didn't find anything strange.

Furthermore - your code is real easy to understand.

Best regards
Peter
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: Cooperative Pathfinding

Post by applePi »

very useful, thanks, it is a kind of artificial intelligence program.
one of my possible usage of your code : i imagine a 3D arena with obstacles and the robot will find the correct path.
regards
User avatar
Fig
Enthusiast
Enthusiast
Posts: 351
Joined: Thu Apr 30, 2009 5:23 pm
Location: Côtes d'Azur, France

Re: Cooperative Pathfinding

Post by Fig »

Update: windowed multiple selections, Hpa* (one level deep) for large map.
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS
User avatar
idle
Always Here
Always Here
Posts: 5089
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Cooperative Pathfinding

Post by idle »

thanks for this fig, very interesting
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
Fig
Enthusiast
Enthusiast
Posts: 351
Joined: Thu Apr 30, 2009 5:23 pm
Location: Côtes d'Azur, France

Re: Cooperative Pathfinding

Post by Fig »

Thank you :D
I am still working on to improve it...
It remains a bug, in some case one unit become passable...

Update: improved stability, units pathfinds to the closest location if the goal isn't reachable.
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS
Post Reply