View Issue Details

IDProjectCategoryView StatusLast Update
0000797Dwarf FortressPathfindingpublic2020-05-18 20:21
Reporterking doom Assigned Touser6 
Status confirmedResolutionopen 
Product Version0.31.01 
Summary0000797: Animals/pets repeatedly try to find path through pet-locked/"tightly closed" doors, causing lag
DescriptionDoors can be set to stop pets and animals moving through them, but they do not stop pathfinding calculations from planning routes through them, leading to swarms of animals headbutting doors, choking your PC to death as they try again and again to move down the same route over and over, despite the fact there is a door in the way.
Steps To ReproduceBuild a corridor with an exit where an animal might want to go. A cat and the surface works well, as the cat will try and wipe out every vermin in existence on the surface. Make a door, place the door in the corridor, mark it tightly closed, watch the game slowly choke to death and die.
Tagsdoor, hatch, leftover from 40d, pathfinding, pet


has duplicate 0007846 resolveduser11 Dogs behind door set to passable but not pet passable cause fps drop 
has duplicate 0007915 resolveduser6 Animals trying to path out of the cavern bring FPS to a crawl when they reach a non pet passable door 
has duplicate 0007921 resolveduser6 Animals stuck behind pet impassable doors cause fps drop 
has duplicate 0008890 resolveduser11 Lock 4 puppys in a room and the FPS goes down substantially 
has duplicate 0009390 resolvedlethosor Fort slows from a stable 100 fps down to a permanent 5 without anything unusual happening 
has duplicate 0009689 resolveduser1294 Game at Unplayable Speed 
has duplicate 0010602 resolvedLoci FPS death after immigrations 
has duplicate 0010888 resolvedLoci Severe lag due to bugbat pathing through pet-impassable door 
related to 0001340 new Walling off HFS kills FPS 
related to 0002945 new Animal trainer selects animal behind pet-impassable door, waits forever for animal to arrive at kennel 
related to 0005555 new War dogs ignore "tightly closed" and forbidden doors (walk through them, then canĀ“t find back). 
related to 0006446 acknowledgeduser6 Birds claim nest boxes behind tightly closed doors 
related to 0008213 resolvedToady One Restrained animals repeatedly try to path to meeting areas, then forced prone 



2010-04-08 11:29

reporter   ~0002104

This was true in .40d as well. Animals pathfind as dwarves and get surprised when they can't go through tightly closed doors, and just sit there and try to repath repeatedly. Since pathing thinks they can go through the tightly closed door, they keep trying. Processor issue: the animal is continuously calling the pathfinding code.

Quick test: get an animal trapped in a room with 2 doors. Lock one and tightly close the other. Watch the animal move to the tightly closed door and sit there with a '?' flashing. Switch which door is locked and which is tightly closed. Animal moves to the new tightly closed door.

MaDeR Levap

2010-07-22 10:31

reporter   ~0010830

I suppose this would require separate map of pathable tiles in memory, at least two versions (for animals and for everything else). Funny thought: how would be memory req for having separate path tile map for each living entity? This could allow things like forgetting about part of fortress for this dorf that got hit in head recently. But I do not see this being implemented any time soon.


2010-07-22 10:41

reporter   ~0010837

For gameplay purposes,
tightly closed doors should prevent animals from passing through...

It's pretty much useless right now because your animal will pass along with a dwarf, then get stuck in the room and can't go out until another dwarf comes.


2010-07-22 10:45

reporter   ~0010839

Its a very old issue, I don't know how far back it goes, but certainly before 40D.


2010-07-22 21:11

reporter   ~0010856

This happens to me as of 31.10, and also happened in 40d.


2011-03-27 01:52

reporter   ~0016657

Not sure about Dwarf Fortress, but at home my cat is *constantly* trying to path through closed doors, meowing in dismay when he cannot. :-)

Besides, this animal behavior is actually pretty useful in many situations.


2011-11-13 05:17

reporter   ~0018977

The main performance problem IMHO is that everything tries to path into everywhere. If critters at least occasionally preferred random wandering (a job with a set probabilty to pop up at each new job "?") within their sight, they would still fail, but won't have to recalculate the way around half of the map when they fail.
This doesn't mean they won't occasionaly try to pass closed doors even in wandering mode.

Having dragons beeline to your doors may have some sense (they have heard about you and are overconfident), but for mindless critters like scorpions there aren't great reasons for map-wide clairvoyance.

As to learning critters, a simple compromise is to mark food/danger/potential consorts met during wandering in a set (per critter) number of (decaying/renewable at a set rate) waypoints would need much less memory than a full mental map (even ONE, let alone per critter).


2014-02-25 15:57

reporter   ~0024566

Also applies to hatches. I had a hostile giant olm trapped under one that was forbidden and tightly closed. The olm came rushing at it when it was made non-forbidden, but just sat under it and alternated between prone and standing until I set it to allow pets. A cool emergent behavior IMO (nasty creature lurking under a hatch, waiting for a dwarf to come along and open it), but ultimately a bug.


2014-08-08 14:58

reporter   ~0028618

This one might get some attention now since it's a contributor to lag in worldgen forts and mountainhomes.

The pastures help by keeping them from pathing elsewhere, but the bug is still there.


2014-12-04 11:08

reporter   ~0031257

This can also be reproduced in any worldgen fort as the loads of cats rush to one place and get stopped by a door, causing noticeable lag.


2015-05-24 06:44

reporter   ~0032715

I can confirm this for .40.24. Some crundle was trying to path through a door set to be tightly closed - and my usual 100 FPS dropped down to 15. The FPS made a complete recovery once I disabled the setting on that door, and the crundles flooded my fort.


2016-01-04 16:36

reporter   ~0034316

Still happening in 42.04 , saved game :

On save load, you should be on the 1st cavern level
There's a barrack with a squad of soldiers training there, and a double door leading directly to the cavern.
Both doors have disabled pet passage, so only non-pets can move through.

In front of those doors there is a group of "naked mole dogs".

Unpause the game you will quickly notice that game performance is so bad it's unplayable.
Press q , move the cursor over the double doors and enable pet passage.

Suddenly performance is back at relatively playable, while the naked mole dogs enter the barracks


2016-04-13 13:08


lightman posted a 0.42.06 save in 0009689.


2017-10-06 13:30

reporter   ~0036766

A single cave crocodile lowered my FPS from about 40 to only 9 because she was trying to get through a tightly closed door. Even killing all other creatures and deleting all items with DFHack didn't make a significant difference to FPS as long as she was still alive.



2018-03-06 09:33

viewer   ~0037861

v0.44.05: Magnani posted a save in 0010602:


2018-09-19 13:19

viewer   ~0038817

v0.44.12: aids_spreader posted a save in 0010888:


2020-03-03 16:16

reporter   ~0040308

Last edited: 2020-03-03 16:17

v0.47.03: still has this issue. Ran into this problem several times so far. Because I was not aware of this bug, I thought my save was corrupted and did a restart. Now it happened again: a cave swallow from 1st cavern wanted to go through a door that did now allow pets (to prevent cats go to cavern and kill the cave spiders). Game dropped to 1 FPS on my machine. After making the door pet passable, FPS went back to normal.


2020-05-09 16:48

reporter   ~0040534

v0.47.04: still has this issue. Ran into this problem each time I build an enclosed atom smasher. Vermin will begin to spawn in the smash area. Cat will try to path through the door.


2020-05-18 20:21

reporter   ~0040557

v0.47.04: Confirmed still a issue. Each time my cygnets hatch from my Giant Swan eggs I go down 20-30fps easily. Each time cave crocodiles or crundles hatch I go to nearly 0FPS. (this is because hatched eggs dont stay in the Pen/pasture. I have a pet locked - impassible door and until I unlock it to become pet passable the FPS tanks.

Add Note


Issue History

Date Modified Username Field Change
2010-04-08 08:35 king doom New Issue
2010-04-08 10:57 king doom Tag Attached: pathfinding
2010-04-08 10:57 king doom Tag Attached: door
2010-04-08 10:57 king doom Tag Attached: pet
2010-04-08 11:29 Squirrelloid Note Added: 0002104
2010-07-22 10:31 MaDeR Levap Note Added: 0010830
2010-07-22 10:41 OzoneGrif Note Added: 0010837
2010-07-22 10:45 smjjames Note Added: 0010839
2010-07-22 11:10 user6 Summary Doorways marked tightly closed do not count as barriers with regard to animal pathfinding. => Animals/pets repeatedly try to path through "tightly closed" doors, causing lag
2010-07-22 11:10 user6 Sticky Issue No => Yes
2010-07-22 21:11 eatatree Note Added: 0010856
2010-07-26 08:27 Kanddak Tag Attached: leftover from 40d
2010-11-18 18:20 user6 Relationship added related to 0001340
2010-11-18 18:20 user6 Relationship added related to 0002945
2010-12-14 08:30 user6 Summary Animals/pets repeatedly try to path through "tightly closed" doors, causing lag => Animals/pets repeatedly try to find path through pet-locked/"tightly closed" doors, causing lag
2011-03-27 01:52 Lav Note Added: 0016657
2011-11-13 05:17 TBeholder Note Added: 0018977
2014-02-01 10:29 user6 Relationship added related to 0005555
2014-02-23 13:08 user6 Relationship added related to 0006446
2014-02-25 15:57 eidako Note Added: 0024566
2014-02-25 15:57 eidako Tag Attached: hatch
2014-02-27 11:14 user6 Assigned To => user6
2014-02-27 11:14 user6 Status new => acknowledged
2014-08-04 20:30 user11 Relationship added has duplicate 0007846
2014-08-08 14:12 user6 Status acknowledged => confirmed
2014-08-08 14:12 user6 Relationship added has duplicate 0007915
2014-08-08 14:58 smjjames Note Added: 0028618
2014-08-09 05:37 user6 Relationship added has duplicate 0007921
2014-09-01 14:12 user6 Relationship added related to 0008213
2014-12-04 11:08 smjjames Note Added: 0031257
2015-04-01 00:07 user11 Relationship added has duplicate 0008890
2015-05-24 06:44 Witty Note Added: 0032715
2015-12-20 20:27 lethosor Relationship added has duplicate 0009390
2016-01-04 16:36 Robsoie Note Added: 0034316
2016-04-13 13:08 user1294 Relationship added has duplicate 0009689
2016-04-13 13:08 user1294 Note Added: 0035009
2017-10-06 13:30 a52 Note Added: 0036766
2018-03-06 09:31 Loci Relationship added has duplicate 0010602
2018-03-06 09:33 Loci Note Added: 0037861
2018-09-19 13:18 Loci Relationship added has duplicate 0010888
2018-09-19 13:19 Loci Note Added: 0038817
2020-03-03 16:16 Alatun Note Added: 0040308
2020-03-03 16:17 Alatun Note Edited: 0040308
2020-05-09 16:48 bugsubmitter20001 Note Added: 0040534
2020-05-18 20:21 evilmasteryoda Note Added: 0040557