Jump to content
  • Advertisement
Sign in to follow this  
dxdotnet1

Pathfinding on a 3D heightmap

This topic is 4811 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ello guys i just need to ask on how to implement A* pathfinding on a heightmap implemented using a quadtree and a heightmap from an bmp file. I already implemented A* on 2D tile map since i can divide my map to a tile. i just dont knw how to implement this on a 3D heightmap since the map are not implemented using tiles.

Share this post


Link to post
Share on other sites
Advertisement
Even though it is rendered as a 3d object, it is still a 2d surface (most likely, unless you have some caves or otherwise undercut geometry), and each point on that surface can have attributes such as a gradient, material, and flags. So it should be straight forward to adapt your tile based A* algorithm to this 2d grid.

Share this post


Link to post
Share on other sites
also you can create 3d array with all the nodes(if map not big), Or do search in 2d array. It's pretty simple. I yesterday write my A* algo + binary heaps and he is praty fast 500x500 map he found path by 10 ms.

Share this post


Link to post
Share on other sites
Create a 2d tileset that describes the difficulty of travelling from one location to another.

If there difference in height is positive (uphill) then have a higher difficulty based on the gradient.
If there is no difference then have the difficulty as 0
If there is a downwards slope then have a difficulty < 0 unless it becomes too steep and then make it positive.

That way the computer can plot a path that takes in to account the height and possible paths across the terrain.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!