Hierarchical pathfinding demo

2010-07-26

Hierarchical pathfinding demo

Permalink 02:03:59 am, Categories: General  

I created a new demo application to test the HPF algorithm (it's the pathfindingtest app). In this application, there is a player controled actor (Cally), which can be moved around by the arrow keys. The map used in this demo is the Castle map, from CrystalSpace.

Here is a list of hotkeys for this application:

  • b: Build the navigation structure.
  • l: Load a previously built navigation structure.
  • s: Save the current navigation structure.
  • c: Clear the navigation structure, as well as the current path, if there is one.
  • 1: Toggle navigation structures debug rendering.
  • 2: Toggle destination point debug rendering.
  • 3: Toggle path debug rendering.

Once a navigation structure is either built or loaded, the mouse can be used to create paths. A left click will create a path between the actor's current position and the clicked position.

For the path following code, I used the pcmove.mover property, modified so the curves are sharp and precise instead of smooth. If the old smooth behaviour was used, there would be no guarantee that the actor would not walk out of the navigation meshes. The new behavior can be activated in any application that uses pcmove.mover, all that has to be done is set iPcMover::SetSmoothMovement() to false (the old behaviour is the default one).

I made a video of the actor moving around, being controled by the mouse, you can check it clicking here or in the image below (unfortunately, I was unnable to embed the video).

Path following
Path following

Trackback address for this post:

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

Comments, Trackbacks, Pingbacks:

No Comments/Trackbacks/Pingbacks for this post yet...

This post has 9 feedbacks awaiting moderation...

Comments are not allowed from anonymous visitors.

October 2014
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Leonardo RD's blog

Search

Archives

Misc

XML Feeds

What is this?

powered by
b2evolution