Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Pathfinding check  (Read 1038 times)

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Pathfinding check
« on: June 18, 2008, 12:53:25 pm »

I would like to know how long until job pathfinding will notice if one of the tiles they need to walk across could be used instead of the one it is looking for.

After watching a dwarf walk across a parfectly good building spot to get to the other side to install a floodgate, I believe that it is a good and wanted feature that wouldn't hurt preformance by any noticeable ammount

It would reduce the impact of the direction bias and even make them work faster sometimes.
Logged
Eh?
Eh!

Draco18s

  • Bay Watcher
    • View Profile
Re: Pathfinding check
« Reply #1 on: June 18, 2008, 02:27:51 pm »

There's actually a better solution around on the forums somewhere and it involves pathing off the "I'm gonna stand here" assuming that the construction is built.  The advantage here is that with slightly more slick code you can do soemthing like this:


#######
#OOOOO##
#OOOOO..
#OOOOO##
#OOOOO#
###.###
  #.#

O's being walls-to-be-built.  What it does is the program figures out what order the walls need to be built in order for every job to get done and every drwarf can get out.


#######
#12222##
#23345..
#23432##
#23521#
###.###
  #.#


As long as the walls are completed in one series before the series numbered 1 higher, all walls will get built.

I don't remember the original wordage, but it involved a reverse path-find from each job site back to some known location (fort entrance, the dwarf's bed, a food stockpile, a well...) and that any site that didn't get walked on was #1.  Ones that got walked on by job #1 were job #2, and so on down the line.
« Last Edit: June 18, 2008, 02:30:42 pm by Draco18s »
Logged