A* pathfinding algorithm for Map Generator

A* pathfinding algorithm for Map Generator

Return to topic list

Sat May 31 22:06:37 2014   by   Mysterious
I see you were searching for a way to implement river in your map generator.
The A* algorithm seems like a good choice for it. Not sure if you know about it already.

The code is quite simple, yet very robust. There are also some variants for it.

Also, you can use it to set roads in your maps between random points which could represent cities.

It's just a suggestion, but I think it's worth looking it up.
 
Mon Jun 2 09:07:05 2014   by   Torben
The problem with A* and similar is that they are global in the sense that you need a detailed map of the whole area that you need to flood or follow paths on.  This means that if you zoom in on a local map, you need to do the algorithm on a global scale anyway, as you need to know where rivers enter and exit the local area.  I would much prefer a method that works by recursive subdivision in the same way that the map generator does.  I have tried a few different methods, but none, so far, has given satisfying results.

The source code for the planet generator is available on the webpage, so you are welcome to experiment with it to see if you can get anything to work.
 
Fri Jul 25 05:28:53 2014   by   Mysterious
Hey, thanks for the answer!
Yeah, I stand corrected, A* is not a good alternative for you.

Maybe you could develop a tutorial so users could add the rivers themselves?
 
Fri Jul 25 11:14:41 2014   by   Torben
I don't really do a lot of Photoshop and similar post-processing on the maps I generate (I usually just add place names and such), so I'm probably not the best to make such a tutorial.
 

Return to topic list



New message:
Topic:
Posted by:

Type the values of the dice shown below:

Return to topic list