Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0008784Dwarf FortressDwarf Mode -- Jobs, Assignment of Jobspublic2015-02-03 13:162015-02-03 13:16
PatrikLundell 
 
normalminoralways
newopen 
PCWindows8.1
0.40.24 
 
0008784: Job distance calculation gives too high priority to different Z level
It seems job distance calculation for miners (at least) changed between 0.40.19 and 0.40.23. Now (0.40.24), if you designate digging of a number of rooms above each other connected by a staircase to the side, the miner will dig a couple of tiles, run to a different level, dig a couple of tiles... Thus spending most of the time running back and forth.
I assume the behavior is a result of a distance comparison that ignores the actual path in order to reduce the CPU cost. However, since dwarves basically cannot climb (and certainly not through rock), equating Z level distance with X/Y distance generally leads you astray.

I'd suggest the following modification:
Make the basic check if there is a Z level difference between the target and the destination, and if so, add a fixed "level change cost" (probably somewhere in the range 10-100 tiles, I'd guess around 30) to the computed distance to handle that vertical distance usually results in the use of stairs somewhere off to the side. This level hysteresis should cost almost nothing in CPU terms.
No tags attached.
Issue History
2015-02-03 13:16PatrikLundellNew Issue

There are no notes attached to this issue.