Multiple Pathfinders / List graphs

HomeForumsA* Pathfinding ProjectSupportMultiple Pathfinders / List graphs

This topic has 2 voices, contains 2 replies, and was last updated by  Chris 100 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
Author Posts
Author Posts
February 7, 2012 at 22:43 #1456

Chris

Hi Aron,

1st – great job on the pathfinding engine…it has come in really handy.

I implemented the A* with a list graph and it works great for my npc’s and keeping them off the road.
I am trying to create a second list graph to use for my main characters waypoint system (these waypoints are in the center of the road).
Is there a way to define which graph the seeker is to use to come up with a path?
Ive searched through the docs, examples, and forums to find something but was unable to. You’re help would be greatly appreciated.


Just to reiterate:
List graph 1 is for npcs and keeps them off the road.
List graph 2 is for the “compass” and points to waypoints on the road.
Need to tell the seeker(s) to use either 1 or 2 depending on situation.

February 8, 2012 at 08:15 #1458

Aron Granberg

Hi

This is currently only possible using the Pro version of the system. Then you can pass a graphMask variable to the StartPath call (or create your own path object and set the path’s nnConstraints graphMask variable youself if you want).
http://arongranberg.com/astar/docs/class_pathfinding_1_1_n_n_constraint.php#a63a785ae519f012d295916dd9969170c

//Enable only the second graph to be searched since the graphMask is a bitmask
//and 1<<1 will set it to have only it's second bit set.
mySeeker.StartPath (startPoint, endPoint, myCallbackFunction, 1 << 1);

http://arongranberg.com/astar/docs/class_seeker.php#ab50a876ab529ceb3eb9b97deb5a48d1e

You can also do some ugly workarounds, such as place the grid graph some distance above the map and then translate all coordinates accordingly (move the start and end points up, and when you get the path back, you move all path points down).

February 8, 2012 at 16:31 #1460

Chris

Ahh… I see.
I read through the stuff on nnConstraints earlier and it seemed the most logical place to try, but it looked like it was meant for walkable/unwalkable states.

It makes sense though. Thanks for the reply!!

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Multiple Pathfinders / List graphs
Your information:






<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>