Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Designations Demystified  (Read 1634 times)

Jim Groovester

  • Bay Watcher
  • 1P
    • View Profile
Designations Demystified
« on: March 22, 2010, 01:50:28 pm »

If you've ever wondered why your dwarves don't dig things out in the most logical manner, why they choose to prefer to go all the way to the topmost and leftmost corner of the map and dig instead of the places closest to them, or why they spend all their time chipping away at a project you've designated but don't immediately need instead of more pressing concerns, then this post is for you.

If you want to know the inner workings of how dwarves choose which tiles to dig, gather plants, channel, fell trees, or any other designation, then this post is also for you.

I've done a little observation on how dwarves choose designations. This is what I've found so far.

1. The map is divided into 16 x 16 squares. Dwarves will choose the leftmost, topmost, and deepest block that contains a designation. Note that they select the tile in that order.
2. Within the 16 x 16 block, dwarves choose the leftmost, then topmost tile to work.
3. If there are designations that meet this criteria but dwarves can't reach, the dwarves choose the first tile available that meets the above two criteria.
4. When dwarves finish working a designation, they will randomly select an adjacent designation. If there's a pattern to this selection, I have yet to see it.
5. If there's no adjacent designation, dwarves return to step 1.

This is list is incomplete, because there a few instances where my goblins (minor modding) don't follow this pattern. For example, I'm not entirely sure why my miners choose to work my pumping shaft designations from bottom to top instead of my magma duct in totality, which is below them. It's likely that there's an additional searching step that I missed, or one of the steps is out of order. I'll look into it some more and hopefully I'll be able to provide a complete picture.

But this is how your dwarves select designations, for the most part.
« Last Edit: March 22, 2010, 04:58:10 pm by Jim Groovester »
Logged
I understood nothing, contributed nothing, but still got to win, so good game everybody else.

Vicomt

  • Bay Watcher
  • Just call me Vic.
    • View Profile
    • Steam Profile
Re: Designations Demystified
« Reply #1 on: March 22, 2010, 02:04:53 pm »

Mining is different to Ramping.

in ramping, they do what you wrote up there (good info that), but for mining, if they run out of a designated mining block right next to them, they'll look a block or two away for other designations before going back to step 1. This means that they can skip a couple of empty spaces. they do NOT do this while ramping, actually while ramping, they sometimes even ignore designated tiles right next to them when they go searching for the left/top most designation.

I haven't actually watched mass-de-construction, so I don't know what the rules are there.

I can only assume that Toady did something specific for mining, something specific for ramping, something else specific for something else, and never got round to homogenising the logic across all the designations.

Lummox JR

  • Bay Watcher
    • View Profile
    • BYOND
Re: Designations Demystified
« Reply #2 on: March 22, 2010, 04:29:40 pm »

My observations of mining show that depth is an important consideration but not the only one. In fact for my miners it seems to be that they choose a block in leftmost, deepest, topmost order. In my current fort I had designated the entire perimeter of the lowest Z-level for digging, and dwarves easily preferred digging out anything on a higher level if it was further west. However I suspect the real order of preference is determined by something like x+y+z, not x>z>y.

In mining, dwarves seem to have a preference for continuity and will continue to mine out the same vein. If the vein is broken up into pieces by their mining efforts, I believe all bets are off and they may end up selecting a brand new vein after they finish one of the broken parts.

The annoying thing with miners though is that they have a preferred square to stand on, so if your dwarves are headed north or west mining out a tunnel connecting two locations, they'll often stop on the last tile and go all the way around to the other side to finish the tunnel.
Logged

Spectre

  • Bay Watcher
    • View Profile
Re: Designations Demystified
« Reply #3 on: March 22, 2010, 04:40:42 pm »

I believe there is allready a page in the wiki about this. You could check that out and compare to your observations.
« Last Edit: March 22, 2010, 05:21:18 pm by Spectre »
Logged

Retro

  • Bay Watcher
  • o7
    • View Profile
Re: Designations Demystified
« Reply #4 on: March 22, 2010, 04:45:05 pm »

Mining is different to Ramping.

in ramping, they do what you wrote up there (good info that), but for mining, if they run out of a designated mining block right next to them, they'll look a block or two away for other designations before going back to step 1.

Sorry, going to have to disagree with you. There is no reason Toady would use different pathfinding code for different designations anyhow, especially considering that yes, removing constructions works the same way - as do up stairs, down stairs, up/down stairs, etc.

Jim Groovester

  • Bay Watcher
  • 1P
    • View Profile
Re: Designations Demystified
« Reply #5 on: March 22, 2010, 04:57:31 pm »

I belive there is allready a page in the wiki about this. You could check that out and compare to your observations.

Is there now?

I'll have to check. I'm looking at the mining page, and there's some vague comments about what tiles they pick, but nothing really all that specific. Do you have a specific link?

In fact for my miners it seems to be that they choose a block in leftmost, deepest, topmost order.

Hmm. Perhaps I've confused myself on the proper order.

Anyways, my guess to what happens is that, starting from the deepest, leftmost, topmost 16 x 16 square block, the game first searches upward (skyward) for any designations. If it doesn't find any (or the designations are simply inaccessible), the game moves downward (south) to the next 16 x 16 block, and searches upward (skyward) again.

The result of this search is that leftmost tiles are prioritized, then topmost, then deepest. I'll edit the main post to reflect this.
Logged
I understood nothing, contributed nothing, but still got to win, so good game everybody else.

Spectre

  • Bay Watcher
    • View Profile
Re: Designations Demystified
« Reply #6 on: March 22, 2010, 05:23:09 pm »

Do you have a specific link?

Afraid not. But I think I recall having read something about this topic in the wiki once.
Logged

Cuchulain

  • Bay Watcher
    • View Profile
Re: Designations Demystified
« Reply #7 on: March 22, 2010, 06:51:47 pm »

You are perhaps referring to this page?
Logged

bombcar

  • Bay Watcher
    • View Profile
Logged

Spectre

  • Bay Watcher
    • View Profile
Re: Designations Demystified
« Reply #9 on: March 23, 2010, 09:17:30 am »

Yeah, that was it. If you think you have figured out something. I would suggest comparing and adding it there.
« Last Edit: March 23, 2010, 09:19:12 am by Spectre »
Logged

Moosey

  • Bay Watcher
  • [moose brute extract]
    • View Profile
Re: Designations Demystified
« Reply #10 on: March 23, 2010, 12:12:12 pm »

If they're channeling rather than digging, they seem to snap back to step 1 even if there are adjacent squares.  A channel square in the middle of a bunch of dig squares can break a miner out of his chain.

I hear all this may be radically different in the next version...
Logged
Backs to the wheel
There's granite to shove

Lummox JR

  • Bay Watcher
    • View Profile
    • BYOND
Re: Designations Demystified
« Reply #11 on: March 24, 2010, 09:34:20 am »

I hear all this may be radically different in the next version...

Boy, that would be nice. Aside from dwarves accidentally walling themselves into constructions, mining and channeling can be nightmares to manage. For one thing channeling is so dangerous the way dwarves do it that you have to micromanage it. But mining is worse in some ways, because dwarves will pick a preferred tile to stand on even if that tile requires them to walk a long distance to get there, slowing down the mining effort considerably. My biggest problem with mining though is that if you're doing any exploratory mining, more important designations like digging out new rooms might not get done for quite some time.
Logged