Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Getting undead to path into a fortress?  (Read 4752 times)

gchristopher

  • Bay Watcher
    • View Profile
Getting undead to path into a fortress?
« on: February 20, 2015, 01:58:09 pm »

A game on a 5x5 embark with a reanimating evil biome covering three of the map edges is facing the predictable FPS death as the increasing number of undead in the caverns quickly kill any creature that enters the map, creating even more undead.

I'm attempting to lure the undead into traps/soldiers/marksdwarves/whatever to kill them off and see if FPS increases. (Which would be good evidence that undead pathing was causing the steadily dropping FPS.)

Two long hallways/stairs were dug into the top two cavern layers where most of the undead were located. After the new cavern breaches, nearly all of the undead on the entire map promptly pathed into the hallway, and then slowly mill around randomly. (Still quite far away from the actual fort.)

I'm beginning to suspect that the undead pathing algorithm somehow can distinguish between an open tile in a cavern, and an open tile dug by dwarves, and considers the hallway to be "in the fortress," but that's as far as they get using that pathing algorithm and must then actually see a target to go any farther?

Has anyone else encountered this? Can anyone think of what tile properties I might look at in dfhack to explore the theory?
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #1 on: February 20, 2015, 02:06:28 pm »

A quick way to check if undead are your problem would be to run "exterminate undead" on a copy of your save.

As for information on pathfinding: I have no idea if DFHack can be of any help there, but I doubt it.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

gchristopher

  • Bay Watcher
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #2 on: February 20, 2015, 03:25:36 pm »

I did a little poking around in lua to see what makes that empty hallway such a magical target for undead pathing. Not much came up so far.

It's not biome. The tiles had a lingering job priority value assigned from when they were dug out, but clearing that didn't change pathing behavior.

Two possibilities are the designation[x%16][y%16].feature_global flag in that tile block and maybe details of the tile type. (Which are harder to interpret, including plant cover, which is present in the caverns but not in the hallway.)

If it's not in the tile block structure (dfhack.maps.getTileBlock(x, y, z)), then it'll probably be a whole lot harder to find. (or impossible)

Logged

GhostDwemer

  • Bay Watcher
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #3 on: February 20, 2015, 03:50:28 pm »

I always thought enemies pathed towards the closest meeting zone? Do you have any meeting zones in the hallway?
Logged

gchristopher

  • Bay Watcher
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #4 on: February 20, 2015, 04:14:16 pm »

Nope, it's just a 2-wide dug out hallway leading to a 2x2 stairway into the fort. It was pretty amazing how 300 undead came running into the hallway, then apparently halted and started diffusing around randomly.  (It really looks like random diffusion to me.)
Logged

gchristopher

  • Bay Watcher
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #5 on: February 20, 2015, 08:41:22 pm »

exterminate undead raised FPS from 10-15 to 40-45 after the smoke cleared, so pathing around 400 undead is a pretty strong contender for the FPS problem.

Still haven't found a way to make them come farther into the fortress. Tried setting the global_feature flag to true for lots of tiles, but that had inconclusive results.
Logged

gchristopher

  • Bay Watcher
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #6 on: February 21, 2015, 08:01:22 pm »

I have progress to report! I was planning to experiment with having marksdwarves behind fortifications firing down the hallway, but as soon as the miner dug anywhere near the stalled undead, they started rushing towards the interior of the fortress.

Apparently having a valid target anywhere near the undead whether or not they have line-of-sight is enough that they'll search for a path to the target and begin following it. The dwarf that triggered them to move wasn't even on the same z-level. In this case, the path they found was very long, going in through the trap sections, and then back down the parallel mining shaft.

That might be good enough to get undead (and maybe other enemies) pathing into a fortress! Dig a shaft parallel to them and see if the presence of any dwarf in the vicinity is enough to lure them into a distance entrance.
Logged

gchristopher

  • Bay Watcher
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #7 on: February 21, 2015, 08:34:14 pm »

Repeated tests seem to confirm that having a dwarf path nearby, regardless of line-of-sight or z-level, 'wakes up' undead and gets them moving into a fort. I dug a tunnel directly above a hallway full of stalled undead and set up a loop of three stockpiles with 'Take From Links Only) and a circular set of Give/Take directions, so a dwarves would frequently haul one item up and down the hallway above the undead.

That seems to get them pathing! FPS for this test has already doubled from 13 to 26 as ~150 undead have been mashed in the trap section.
Logged

Sadrice

  • Bay Watcher
  • Yertle et al
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #8 on: February 23, 2015, 03:07:35 am »

Thank you so much for this.  Undead sieges have been an extraordinary nuisance for me for a long time, because there seemed to be no way to get rid of them other than direct military action.

Building a lever under the trap corridor and setting it to pull on repeat worked well for me.  There was a group of three zombies that didn't respond, even when I sent a miner to dig directly underneath them (one was named, as he had killed a few of my dwarves, if that makes a difference), but they were easily mopped up.
Logged

evictedSaint

  • Bay Watcher
  • if (ANNOYED_W_FANS==true) { KILL_CHAR(rand()); }
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #9 on: February 23, 2015, 04:05:55 am »

I would bet a shiney nickel that "scent" has something to do with it.  I haven't seen much evidence of it, but is it possible the undead pathed to the hallway due to lingering dwarf scent, then later pathed toward the miner since his proximity would give a stronger scent? I doubt smells are restricted by walls...

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #10 on: February 23, 2015, 07:11:22 am »

I would bet a shiney nickel that "scent" has something to do with it.  I haven't seen much evidence of it, but is it possible the undead pathed to the hallway due to lingering dwarf scent, then later pathed toward the miner since his proximity would give a stronger scent? I doubt smells are restricted by walls...
I doubt undead can smell very well (in fact, they smell quite bad,) but they do have EXTRAVISION, which would let them sense living things through walls all the same.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

gchristopher

  • Bay Watcher
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #11 on: February 24, 2015, 02:31:54 pm »

Glad this is helpful. I ended up digging a long tunnel parallel to hallways and stairs on which undead were stalling.

A simple hauling loop or job on repeat (like pulling a lever) can create traffic to the end of the tunnel. I didn't want to devote a full time dwarf to walking up and down the hallway, so I set up a timing mechanism to send a dwarf down the hallway only once every 10 days. (Though the timing is easily changed)

The timing mechanism I settled used three stockpiles and a minecart route. Here's a diagram:

░ <-- Stockpile 1
╥ <-- Southbound track. Location of Route Stop 1
╨ <-- Northbound track + Track Stop with Dump South. Location of Route Stop 2
░ <-- Stockpile 2
.
.  <-- very long "bait" tunnel
.
░ <-- Stockpile 3

The idea is to use a hauling route with the "Every N days" setting to time the dwarves hauling a single item down and back the tunnel. It helps to pick an item that is light, appears nowhere else in the fortress, and can be uniquely selected by the stockpiles. I used a wooden training sword.

Stockpile 1 is a weapon stockpile with "take from anywhere" that accepts only training swords. It has a "take" link from Stockpile 3.
Stockpile 2 is a weapon stockpile with "take from links only" that accepts only training swords. It has a "give" link toStockpile 3.
Stockpile 3 is a weapon stockpile with "take from links only" that accepts only training swords. It has a "take" link from Stockpile 2 and has a "give" link to Stockpile 1.

The hauling route sits between Stockpiles 1 and 2 and serves as a rate-limiting timer for the stockpile loop. It has two stops:
Route Stop 1: Takes training swords from Stockpile 1. Has a "Guide south after 10 days" depart condition.
Route Stop 2: Sits on a Dump South Track Stop that immediately dumps the contents on Stockpile 2. Has a "Guide North immediately always" depart condition.

Here's how the hauling/route loop function.

1. The training sword is brought to Stockpile 1 from either Stockpile 3 or wherever some idiot last dropped it. (Urist McLongWalk has cancelled bring item to stockpile, getting something to drink.)
2. The sword is loaded into the minecart at route stop 1.
3. Wait 10 days (ish), then the cart is guided south and the sword drops onto Stockpile 2.
4a. The cart is guided back north to route stop 1.
4b. The training sword is carried to Stockpile 3, rousing some lost undead into sometimes coming a little farther inside.
5. Repeat from step 1!
Logged

Iamblichos

  • Bay Watcher
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #12 on: March 09, 2015, 05:15:59 am »

I tried this after your recommendation on another thread... even with the dwarves pathing through a tunnel ~7 tiles from undead on the same Z-level, they didn't react and kept milling randomly around the area  :(
Logged
I'm new to succession forts in general, yes, but do all forts designed by multiple overseers inevitably degenerate into a body-filled labyrinth of chaos and despair like this? Or is this just a Battlefailed thing?

There isn't much middle ground between killed-by-dragon and never-seen-by-dragon.

gchristopher

  • Bay Watcher
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #13 on: March 30, 2015, 05:53:32 pm »

Uh-oh! Did an open path exist between the undead and your bait miner? Can you post a save?

I wouldn't be surprised if there's something even more complicated going on.
Logged

Iamblichos

  • Bay Watcher
    • View Profile
Re: Getting undead to path into a fortress?
« Reply #14 on: March 30, 2015, 06:40:52 pm »

This is a known issue... Bug 008099.

http://www.bay12games.com/dwarves/mantisbt/view.php?id=8099

It was driving me nuts as well, but it looks like Toady needs to fix it.
Logged
I'm new to succession forts in general, yes, but do all forts designed by multiple overseers inevitably degenerate into a body-filled labyrinth of chaos and despair like this? Or is this just a Battlefailed thing?

There isn't much middle ground between killed-by-dragon and never-seen-by-dragon.
Pages: [1] 2