Bay 12 Games Forum

Please login or register.

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

Author Topic: Pathfinding (2010) Tips/Hints/Bugs  (Read 3461 times)

Guilliman

  • Bay Watcher
    • View Profile
Pathfinding (2010) Tips/Hints/Bugs
« on: April 09, 2010, 12:08:17 pm »

Lets share some tips and possible bugs/changes in pathfinding of DF.

Last few forts in the new released I have had to abandon after 100 dwarfs cause massive slowdowns for random reasons.
One of which I noticed was, dwarfs refuse to give up a task that's blocked by a locked door, causing slowdowns.

I'm also wondering if people have good ways to counter pathfiding slowdowns. I still can't get my head around the Traffic features (I know these are older then the new version). How does one use these effectively.

Also, Up/Down stairs, or ramps, anyone notice a difference? Particular when you have several Up/Down stairs next to each other. Does this effect pathfinding in anyway?

Anyone know of other things that can or are effecting dwarf pathfinding? How do corners effect it, better to keep a 90 degree angle corner, or mine away bits so they're rounder?

One tip I can share. Make very wide main corridors, and line the outsides with a long 1 wide stockpile strips for booz.
Like this:
Logged

tigrex

  • Bay Watcher
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #1 on: April 09, 2010, 12:23:00 pm »

For what it's worth, trying to dig a checkerboard pattern results in many digging jobs getting cancelled as unreachable.
Logged

barconis

  • Bay Watcher
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #2 on: April 09, 2010, 03:43:02 pm »

Also, Up/Down stairs, or ramps, anyone notice a difference? Particular when you have several Up/Down stairs next to each other. Does this effect pathfinding in anyway?

I've hardly ever used ramps, because I had a lot of problem getting the pathing to work right in 40d. I've got two active forts in 31.01, and both use a central 3x3 core of up/down stairs; never any pathing problems from those as far as I can tell.

New stuff on the map, like walls and workshops, though... major problems. I usually end up saving and reloading to clear those kind of hang-ups. I also heard a tip to lock and unlock a door to reset the pathing, but I haven't checked to see if that frees up dwarves hung up on a wall yet.

I'm hoping it doesn't slow down too much above 100 dwarves. By the time I've got 60 I'm already down under 50 FPS, which is getting pretty slow for me.
Logged

smjjames

  • Bay Watcher
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #3 on: April 09, 2010, 03:47:33 pm »

@Barconis: Theres some kind of bug going on with doors and pathfinding atm. As far as ramps go in 40D, as long as they are next to a wall, it should work.

Quote
Make very wide main corridors,

This seems to be a tried and true method for alleviating pathing issues since 40D and maybe before.
Logged

MrWiggles

  • Bay Watcher
  • Doubt Everything
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #4 on: April 09, 2010, 04:18:30 pm »

Doors in general slow down pathfinding. They have to do an extra check for them.

Multiple passages to other z level also slow down pathfinding. Try to keep to one central stairwell.

Wide corridors don't really affect pathfinding. They do help though, just for different reasons. Small corridors cause dorf to crawl over one nother, and that slows them down. Wide corridors allows them to go arond one nother.

The best thing for path finding as far as I know is no doors, and keep the fortress on one z-level will help things a lot.

The booze idea should work, but kinda of doesn't. Dorf will go after preferred booze not the closet booze. So if you keep your fortress one booze town and deal with sad dorf, it could work.


I use the traffic feature for decorative reasons. If I want my dorf to use a bridge over a brook, I set the bridge to high and the brook to restricted.

I also tend to use it to make more travel paths in the wilderness to avoid saplings from getting trampled, then usually make paved walkways for those paths.
Logged
Doesn't like running from bears = clearly isn't an Eastern European
I'm Making a Mush! Navitas: City Limits ~ Inspired by Dresden Files and SCP.
http://www.bay12forums.com/smf/index.php?topic=113699.msg3470055#msg3470055
http://www.tf2items.com/id/MisterWigggles666#

Nukeitall

  • Bay Watcher
  • HURR DURRR
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #5 on: April 09, 2010, 11:16:28 pm »

Interesting thread. I wish I had some tips, but aside from keeping cats to a minimum, I can't say any.
Logged

Greiger

  • Bay Watcher
  • Reptilian Illuminati member. Keep it secret.
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #6 on: April 09, 2010, 11:38:13 pm »

Pathing tips huh?

Lesee, if you don't have dwarves leaving the fortress very often, I hear that blocking the entrance to your fortress with a layer or two of restricted traffic zones keeps the pathing checks inside the fortress instead of flooding out to outside where they aren't likely to find a path to where they wanna go.   Has the opposite effect though if a number of dwarves do suddenly decide to take a trip outside however. 

The idea of this is that instead of flooding out into the big open space of the great outdoors, it just ignores everything past it til it tried to pass it 20 times. And by the time that happens ideally the pathing had found what it was looking for inside. I can confirm a slight effect from this with my experience.  Along the lines of 3 or 4 fps increase.

If you have alot of idlers in your fortress, having every tile of your meeting zones, party areas, food stockpiles, barracks(dorms in 2010), and dining room, as well as the paths between them all high traffic can have a strong effect.  I had as much as a 15 fps increase once from doing that.  Though it's usually a bit lower around 7 or 8 fps.  The increase goes away for a bit during mass hauling and such though.  But of course mass hauling kills fps anyway, so it's not like the difference would matter at that point.

The idea of that is that all the idlers use the supposedly faster to process high traffic zones. (medium traffic zones need to count to 2 before passing into the tile, high traffic only counts to 1) for their day to day needs.  Like snacking drinking partying and sleeping.
Logged
Disclaimer: Not responsible for dwarven deaths from the use or misuse of this post.
Quote
I don't need friends!! I've got knives!!!

Garky

  • Bay Watcher
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #7 on: April 10, 2010, 01:30:03 am »

I haven't messed around with burrows at all yet myself, but they might be worth mentioning here. Do dwarves attempt to pathfind outside of their designated burrow? If not, that might be an excellent tool.
Logged

bluephoenix

  • Bay Watcher
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #8 on: April 10, 2010, 02:54:34 am »

I haven't messed around with burrows at all yet myself, but they might be worth mentioning here. Do dwarves attempt to pathfind outside of their designated burrow? If not, that might be an excellent tool.
I tried burrows and it was horrible: dwarfs couldnt find their way to anywhere, workshops apparently didnt have access to any material and they couldnt find the well or furniture when I wanted to place some even though everything was provided for them and was inside their burrows so I dont know what happened there but with my new fort I might try it again and maybe the results will change.
Logged

G-Flex

  • Bay Watcher
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #9 on: April 10, 2010, 03:39:30 am »

Regarding pathfinding, I was trying to dig a straight vertical shaft of up/down stairs and sometimes the miner would flat-out refuse to mine down to the next level, even though he'd mine stuff on the same level, or dig stairs somewhere else.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

bluephoenix

  • Bay Watcher
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #10 on: April 10, 2010, 03:54:16 am »

Regarding pathfinding, I was trying to dig a straight vertical shaft of up/down stairs and sometimes the miner would flat-out refuse to mine down to the next level, even though he'd mine stuff on the same level, or dig stairs somewhere else.
Yeah thats part of the pathfinding problem which has been reported a lot of times, just save and reload that fixes it for a short period of time.
Logged

Vayre

  • Bay Watcher
  • Quoth the Raven, "Nevermore"
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #11 on: April 10, 2010, 03:59:08 am »

I tried burrows and it was horrible: dwarfs couldnt find their way to anywhere, workshops apparently didnt have access to any material and they couldnt find the well or furniture when I wanted to place some even though everything was provided for them and was inside their burrows so I dont know what happened there but with my new fort I might try it again and maybe the results will change.

Hmmm, looks like the burrows idea might not be that good, apart from small lines to use as military points and stuff.

If doors are causing problems now, then try using stairs instead for stuff that you want to not be open, I sometimes used to do this with bedrooms If I didn't have enough masons to make doors for bedrooms.
Logged
And, they came. My fingers tingled, my nose twitched and my toes tickled... they came around the corner, over my bridge... Into my courtyard... Onto my trade depot...

Then everything near it exploded in a cloud of blood.

G-Flex

  • Bay Watcher
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #12 on: April 10, 2010, 06:25:24 am »

Those problems don't make the idea any worse. Just sounds like bugs and implementation problems to me.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

Fetus4188

  • Bay Watcher
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #13 on: April 10, 2010, 07:50:31 am »

A general tip to improve pathfinding for people who don't want to make use of the in-game traffic zones.  Open up the init.txt and change the weighting on the "normal" zone from 2 to 1.  This will basically double the effectiveness of all your pathfinding, but make high traffic zones meaningless.
Logged

andrewas

  • Bay Watcher
    • View Profile
Re: Pathfinding (2010) Tips/Hints/Bugs
« Reply #14 on: April 10, 2010, 08:21:17 am »

That should not make a difference. A grid of cost 2 squares should behave the same way as a grid of cost 1 squares. Its the interaction between different costs that makes the difference. Such is theory, anyway, if you have done any testing then let us know.

I'm also wondering if people have good ways to counter pathfiding slowdowns. I still can't get my head around the Traffic features (I know these are older then the new version). How does one use these effectively.

These features change the cost of pathing across a square. By default, a dwarf will pathfind 12 squares past a restricted zone before it attempts to path through it.

So, for instance, if you have a room just before a corner, normally dwarfs will attempt to path into the room to get round the corner. If there is no such shortcut,they will back up and path along the corridor. Putting a restricted zone in the door of the room will cause dwarves to first pathfind around the corner and only back up to the restricted zone when they have exhausted their attempt to enter the room from the far side.

This makes pathfinding into the room more expensive, but makes pathing around the corner cheaper. If the room is only occasionally visited and the corridor is heavily travelled, this will result in improved performance overall. On the down side, you need to do this throughout your fort for it to make a measurable difference.

In short, use restricted and high traffic zones to guide pathfinding towards the most common path through an area in cases where heading straight towards the destination won't get you there, forcing pathfinding to back up and try again. 
Logged
Pages: [1] 2 3