1
DF Suggestions / Re: Pathfinding through the GPU
« on: October 31, 2012, 09:40:55 am »
After looking at the problem a year or two ago I came to the conclusion the problem with DF is not the lack of processing power of the computer it's the complexity of the algorithm used for path finding.
A* is a very blind algorithm which doesn't see farther than it's next step. A* typically calculate the whole path ahead of time and when a dynamic event happen it will hit the wall and then calculate the path again.
What I was thought in the University is that if a problem is too complicated to solve it should be divided up into smaller problems. The Divide and Conquer approach does help reduce the complexity of path finding in a DF like environment. What I did is use a modified breadth first search to create rooms and also saved their access points . This way the first path is decided between rooms and then there are many sub-paths that are calculated along the way to traverse the rooms. I didn't implement an update method and abandoned the project. You can check the thread about it for details and simulator.
I think that the current world generator kind of goes around the problem by reducing the depth of the world(z). I'm still not sure about this because I haven't played DF for a while.
A* is a very blind algorithm which doesn't see farther than it's next step. A* typically calculate the whole path ahead of time and when a dynamic event happen it will hit the wall and then calculate the path again.
What I was thought in the University is that if a problem is too complicated to solve it should be divided up into smaller problems. The Divide and Conquer approach does help reduce the complexity of path finding in a DF like environment. What I did is use a modified breadth first search to create rooms and also saved their access points . This way the first path is decided between rooms and then there are many sub-paths that are calculated along the way to traverse the rooms. I didn't implement an update method and abandoned the project. You can check the thread about it for details and simulator.
I think that the current world generator kind of goes around the problem by reducing the depth of the world(z). I'm still not sure about this because I haven't played DF for a while.
. This made the difference between the room pathing . My A* still has almost 20 times more iterations than my algorithm because it's directly related to the number of nodes you visit during your search ( O(log n) insert and O(1) search for min). 