[Resource] A* Implementation (Pathfinding)

Author Topic: [Resource] A* Implementation (Pathfinding)  (Read 20601 times)

I'm tempted to download this ONLY to see how the thing is set up to draw lines between things lol
http://forum.blockland.us/index.php?topic=230647.0

Not sure if hes changed it though.


Aw it's just a transformed polygon, I thought it would be something loveier and particle-based lol

I've created a sort of simple script that lets you easily make the default holebots follow a path.

Have you tested how efficient this is? Would I be able to have at least 50 bots running at once? (this is the maximum I am expecting)

Have you tested how efficient this is? Would I be able to have at least 50 bots running at once? (this is the maximum I am expecting)
I've had somewhere around 60 bots using two separate paths, one path being a two layered maze the other being an obstacle course. There was a lag increase, although it was perfectly playable. When the bot finished the path i had it killed so it respawned and had to path again, so it was pretty intensive. Generally though, once a path has been found its pretty much lag free.

I've had somewhere around 60 bots using two separate paths, one path being a two layered maze the other being an obstacle course. There was a lag increase, although it was perfectly playable. When the bot finished the path i had it killed so it respawned and had to path again, so it was pretty intensive. Generally though, once a path has been found its pretty much lag free.
Thanks, that helps.

My plan is to have as many as 50 or 60 bots running around at once. Upon spawn, the bot will be given a list of prioritized objectives. When a bot completes its first objective, it will be assigned to its objective with the next-highest priority. This means that there will be many paths and bots at once.

I've had somewhere around 60 bots using two separate paths, one path being a two layered maze the other being an obstacle course. There was a lag increase, although it was perfectly playable. When the bot finished the path i had it killed so it respawned and had to path again, so it was pretty intensive. Generally though, once a path has been found its pretty much lag free.

That sounds pretty cool, what were you using it for?

Thanks, that helps.

My plan is to have as many as 50 or 60 bots running around at once. Upon spawn, the bot will be given a list of prioritized objectives. When a bot completes its first objective, it will be assigned to its objective with the next-highest priority. This means that there will be many paths and bots at once.

Finding paths with this is pretty much entirely lagless as long as you use the background search function. If you are calculating 75+ paths all at once over a fairly complex graph obviously you're going to get some slowdown, but in that case consider making a sort of "worker pool" that queues up path searches letting only a limited set work at once.

When you've actually found paths, the only issue is Blockland's poor bot networking; the raycasts which that path following system use are much more lightweight than you'd think.

I really wish Blockland had better bot networking and a proper system for doing processing tasks in another thread than the main thread. When you've got 40+ bots all doing path finding around a very large map to reach dynamic obstacles (thus needing path recalcs), doing raycasts to crouch, jump, dodge walls, container searches to attack as well as managing group behaviors.. yeah, it starts to get pretty slow (which is why I haven't released my zombie mod - too many technical requirements needed to make it playable).

Regardless, for your case though, it sounds just fine.

I'll be redoing the holebot support script fairly soon to address these two things and to take full advantage of reactive path following.

It doesn't have dynamic obstacle avoidance yet, although it's planned (which is why it only checks for $TypeMasks::FxBrickObjectType).

  • No equivalent of AIPlayer::findPath for delayed searches.

People actually posting in this topic inspired me to start working on that actually intelligent extensible bot framework (no, not holebot based) again. Thanks. I'll be redoing the holebot support script first though.

This is amazing! I can't wait to see more done with it!

Finding paths with this is pretty much entirely lagless as long as you use the background search function. If you are calculating 75+ paths all at once over a fairly complex graph obviously you're going to get some slowdown, but in that case consider making a sort of "worker pool" that queues up path searches letting only a limited set work at once.
That's not a bad idea. Thanks for all the work you're putting into this.

That sounds pretty cool, what were you using it for?
I was just using it to test events. I made node bricks which automatically connect to neighboring nodes when they're placed, and pathTo event which makes the bot move to the nearest node to the given position.

Edit: Here. http://forum.blockland.us/index.php?topic=227254.0

If anybody would like a simple node handler to use with this, feel free to use mine. Just be sure to rename it to prevent conflicts.

Adding a node will automatically set all other nodes that are in its line-of-sight as neighbors. This is probably best used with bricks.

https://bitbucket.org/Greek2me/slayer/src/1933d2ff17bf47f3728515a1d84bdc857cd1cb3c/Dependencies/Nodes.cs
« Last Edit: September 10, 2013, 04:21:26 PM by Greek2me »

If anybody would like a simple node handler to use with this, feel free to use mine. Just be sure to rename it to prevent conflicts.

Adding a node will automatically set all other nodes that are in its line-of-sight as neighbors. This is probably best used with bricks.

https://bitbucket.org/Greek2me/slayer/src/8e5d8540e535e6a4c6dff259c698704c0db901ab/Dependencies/Nodes.cs?at=dev

Nice work. Great job on the function documentation.
Here's what I mainly use - it's a bit more complex as it supports hint nodes through a typemask for node flags, one-way node connections and fast engine-powered near-node searching.

https://gist.github.com/portify/6438358

It requires a slightly newer version of the pathfinder though because the neighbor attribute names are different which I'll release shortly.
« Last Edit: September 10, 2013, 02:06:30 AM by Port »

Amazing!!! Someday I will learn this script are very simple!
« Last Edit: September 09, 2013, 03:24:09 AM by Furling² »