We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Waypoint systems
Page Index Toggle Pages: 1
Waypoint systems (Read 982 times)
Waypoint systems
Jan 17th, 2007, 9:12pm
 
I'm trying to build a waypoint system for the Pathfinder library. The idea is to make it easier for people to map the Node system on to whatever they're doing.

I've made some progress but it has some fatal flaws.

I thought that you would have the Bot as a free agent. It would be assigned to it's nearest Node 'pos'. On calculation of a path it would travel to the next Node in the path 'wp' (waypoint). On reaching a collision distance 'pos' becomes 'wp' and 'wp' becomes the next Node up in the path.

Pathfinder draws paths from finish to start (that's how you get the shortest path). But I have to ask for it backwards in order to get the waypoints to flow from start to finish (I get the next waypoint in the path by just looking at it's parent).

This means that my compromise-path code won't work. It will start from a blocked off area and never get to the finish (which is actually the start?).

Here's what I've got so far. A smooth moving bot, but with some bugs.

Some feedback might help me figure this out.
Re: Waypoint systems
Reply #1 - Jan 17th, 2007, 11:53pm
 
If you've got an ArrayList of the full path, why do you need to have individual node members? Couldn't you just keep track of what index you are on and walk the path any old way?
Re: Waypoint systems
Reply #2 - Jan 18th, 2007, 2:16am
 
Just needed to hear it from someone else. Cheers.

The code for a library version will be quite ugly.
Re: Waypoint systems
Reply #3 - Jan 22nd, 2007, 8:04am
 
this is awesome! Smiley
Page Index Toggle Pages: 1