Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Pathfinding  (Read 766 times)

FreakyCheeseMan

  • Bay Watcher
    • View Profile
Pathfinding
« on: July 15, 2010, 05:21:56 pm »

Anyone know how pathfinding in DF actually works- like, the specific algorithm?

And anyone know how it could be made better- like, maybe with specific checkpoints the player adds? (So current pathing algorithm just gets you to the nearest player-defined node, which knows/can quickly compute the path to all other nodes, bringing you to the node closest to your target, and from there uses normal pathfinding again.) Would increase the amount of work the player had to do, but...
Logged
What do you really need to turn Elves into Dwarves? Mutation could make them grow a beard; insanity effects could make them evil-minded, aggressive, tree-hating cave dwellers, and instant, full necrosis of their lower legs could make them short.

Mason11987

  • Bay Watcher
    • View Profile
Re: Pathfinding
« Reply #1 on: July 15, 2010, 05:49:28 pm »

Anyone know how pathfinding in DF actually works- like, the specific algorithm?

And anyone know how it could be made better- like, maybe with specific checkpoints the player adds? (So current pathing algorithm just gets you to the nearest player-defined node, which knows/can quickly compute the path to all other nodes, bringing you to the node closest to your target, and from there uses normal pathfinding again.) Would increase the amount of work the player had to do, but...

Although it isn't really a complete answer to your question, Toady almost certainly uses some variant of A*.  I think the idea of player placed nodes to improve path finding is interesting though, and I could see how that could be useful.

existent

  • Bay Watcher
  • I Watch Bays
    • View Profile
Re: Pathfinding
« Reply #2 on: July 15, 2010, 07:17:31 pm »

There's also the traffic designation, although I've never used it myself.
Logged
[DF 0.31.13]  ۝ War of the Ring Mod ۝  [WotR 0.13.3]

War of the Ring is back baby!
A mod based on Lord of the Rings, by JRR Tolkien.

Helmaroc

  • Bay Watcher
    • View Profile
Re: Pathfinding
« Reply #3 on: July 15, 2010, 07:20:24 pm »

There's also the traffic designation, although I've never used it myself.

It can be useful if you have 3 or more tile-wide hallways. Designating high traffic to the middle can sometimes help prevent confusion.
Logged