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

I'm making a node editor tool to help people set up node networks.
How are you drawing those lines?

EDIT: Derp http://forum.blockland.us/index.php?topic=230647.0




w
what
it's a node editor
He can select the node tool with /node
Press light key to place a node
if he aims at a node and Left clicks, it will let him link nodes
if he presses cancel brick button (0), it will stop joining nodes
if he right clicks a node(or something else) it will delete it

it's a handy tool and looks great!
He has bots run around the entire ACM City inside and out
he also has them chase people

Since I thought the code and API in general were inefficient and cluttered, I completely rewrote every aspect of it. Find the new version in the GitHub repository.
The main changes a developer should know about are:

findPath(obj a, obj b[, int max]) is now findPathBlocking(obj a, obj b).
findPathDelayed(obj a, obj b[, int rate[, int delay]]) is now findPath(obj a, obj b[, str callback]).

If "you no like change" and want the old version, just go to a previous point. These changes are in the "ts-pathing v2" commit.
« Last Edit: April 22, 2013, 06:04:38 AM by Port »

Here's a testing release of the Node Editor (SA only):
http://hostr.co/H16vKTKRVEDI

If you find any bugs, do tell.
Known bugs:

  • On occasion, lines that indicate connections between nodes may stay after nodes are destroyed.
« Last Edit: April 23, 2013, 02:43:16 AM by Port »


Oops. There was an issue with the released Node Editor (incorrect paths) that made the "fancy node graphics" not show up. Here's a fixed version:
http://hostr.co/H16vKTKRVEDI


Here's a great example of what you can do with this.

http://www.youtube.com/watch?v=z7lfSia3Vc8



I wonder if it would work much faster if it weren't combining strings with @ and instead used pseudo arrays.

It would be a bit faster for adding to lists, but extremely much slower for removing from them, which is why I didn't do that.

Someone sticky this!

I don't think anybody is going to use it anyway, so there's no point in that.

I'm tempted to download this ONLY to see how the thing is set up to draw lines between things lol