Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0004372Dwarf FortressDwarf Mode -- Jobs, Building Construction and Destructionpublic2011-03-28 01:562015-12-10 11:48
Toady One 
0004372: occasionally get negative distance value for materials for constructions
When constructing buildings, particularly walls, I sometimes get a negative distance value for some materials. These materials are listed first, and usually in the -60,000 to -70,000 range. The distance doesn't scale properly, moving one square to build the next wall produces a difference of several hundred or more. When selecting that material the building is suspended when a dwarf attempts to build it.

When hitting 'x' the expand the selection I can still select an individual item with a positive value, though the negative value items show up first. I can forbid the negative value items in this menu to get past this.

I'm using Phoebus' graphic set version 24.00. In case it's caused by that.
0.40.24: See 0004372:0033030
No tags attached.
related to 0001137resolved Toady One 0000070, negative distance to building materials, still occurs on 0.31.03 
related to 0001254resolved Toady One When cavern is breached, web collection pathfinding spams with "unable to find path" 
has duplicate 0005932resolved Footkerchief Distance to available stone is negative 
has duplicate 0006404resolved Dwarfu Negative values reported for materials vs positive values 
has duplicate 0009067resolved lethosor Active woodcutting shows negative distance and inaccurate amount of wood logs in building item screen 
related to 0003868new  Strange tile behavior after water freezing/ice melting/building 
related to 0010026confirmed Loci Negative item distances also appear during forest fires 
related to 0010208new  Removal of tree in path results in negative distances for construction materials 
Issue History
2011-03-28 01:56DrawdeNew Issue
2011-03-28 02:33FootkerchiefNote Added: 0016712
2011-03-28 02:33FootkerchiefRelationship addedrelated to 0001137
2011-03-28 05:31KogutNote Added: 0016714
2011-03-28 18:24DrawdeNote Added: 0016748
2011-03-28 18:52FootkerchiefNote Added: 0016749
2011-03-28 18:52FootkerchiefRelationship addedrelated to 0001254
2012-06-14 16:30FootkerchiefRelationship addedrelated to 0003868
2012-06-14 16:30FootkerchiefRelationship addedhas duplicate 0005932
2014-01-05 22:07DwarfuRelationship addedhas duplicate 0006404
2014-02-24 09:12FootkerchiefAssigned To => Footkerchief
2014-02-24 09:12FootkerchiefStatusnew => acknowledged
2014-02-28 06:26smjjamesNote Added: 0024580
2014-08-29 10:16heritage727Note Added: 0029772
2015-09-02 15:02LociNote Added: 0033030
2015-09-02 17:31lethosorNote Added: 0033033
2015-09-02 17:31lethosorStatusacknowledged => confirmed
2015-09-02 17:31lethosorSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13293#r13293
2015-09-08 16:38lethosorRelationship addedhas duplicate 0009067
2015-12-10 11:48Toady OneNote Added: 0033732
2015-12-10 11:48Toady OneStatusconfirmed => resolved
2015-12-10 11:48Toady OneFixed in Version => Next Version
2015-12-10 11:48Toady OneResolutionopen => fixed
2015-12-10 11:48Toady OneAssigned ToFootkerchief => Toady One
2016-10-02 18:38LociRelationship addedrelated to 0010026
2017-04-23 11:55LociRelationship addedrelated to 0010208

2011-03-28 02:33   
Reminder sent to: Drawde

It would be extremely helpful to upload a save demonstrating this problem to http://dffd.wimbli.com/ [^]
2011-03-28 05:31   
Is it possible that you are constructing things from ice? It happened for me after melting of mined ice.
2011-03-28 18:24   
Done, under "Negative material distance" in the bugged saves section.

I listed the steps I took to duplicate it. I had to remove the stairs in a room, the only way into it, and then tried rebuilding the stairs there. As I said, it doesn't always show up. But I think it's caused when some of the material is unreachable, but locked doors didn't seem to be enough to cause it.
2011-03-28 18:52   
For ease of retrieval you can also link the file, like so: http://dffd.wimbli.com/file.php?id=4069 [^]
2014-02-28 06:26   
I had it happen once in relation to smoke blocking access. I forget the exact circumstances, but I think it happened when I tried to build something in an area that was covered by smoke. Or at least the smoke was either blocking the pathing or was blocking materials, don't remember exactly.

I know it's not much to go on, but it's a possible lead to reproducing it.
2014-08-29 10:16   
I've encountered this in 40.10 and have uploaded a save to http://dffd.wimbli.com/file.php?id=9557. [^] Smoke may have been a factor here as well--I had just had a dwarf incinerated by a fire imp nearby. Also, I noticed that each time I escaped from the selection menu and then reentered it, the distance would increase by an additional 1250000. Screenshots at http://i.imgur.com/2vbjyen.jpg [^] and http://i.imgur.com/2e780p6.jpg.> [^]
2015-09-02 15:02   
Confirmed in v0.40.24. This bug appears to occur when the path to a material is "soft invalidated", and resolve itself when the game is reloaded (and paths presumably recalculated).

A reproducing scenario:

designate one tile for channeling per z-level in a 2x1 area, alternating which tile on each z-level, such that each subsequent z-level "breaks" the ramp on the prior z-level.
wait for your miner to dig down and produce some boulders
designate a construction on the surface, and note the recently-produced boulders appear at the top of the list with negative distance.
2015-09-02 17:31   
Toady One   
2015-12-10 11:48   
Cool - I also got it to happen with channels. Thanks for the reproducible procedure. There might be other configurations that cause this to happen, or something with water or cave-ins or whatever, but this is probably the main culprit, so I'll mark it off until we see it again.