Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Confusing Miner Pathfinding  (Read 1042 times)

InfernoZeus

  • Bay Watcher
    • View Profile
Confusing Miner Pathfinding
« on: July 19, 2010, 08:05:01 am »

I just started playing DF and it's been great fun so far. It's amazing that it's mostly the work of one guy. Anyway, I've got a quick question.

Does anyone know how the Miner's work out which square they're going to mine out next? They seem to do it in a very round-a-bout way, and spend more time walking back and forth between tiles than actually mining. Is there anything I can do to help avoid that? TIA
Logged

GaxkangtheUnbound

  • Bay Watcher
  • To the skies!
    • View Profile
Re: Confusing Miner Pathfinding
« Reply #1 on: July 19, 2010, 08:06:11 am »

I just started playing DF and it's been great fun so far. It's amazing that it's mostly the work of one guy. Anyway, I've got a quick question.

Does anyone know how the Miner's work out which square they're going to mine out next? They seem to do it in a very round-a-bout way, and spend more time walking back and forth between tiles than actually mining. Is there anything I can do to help avoid that? TIA
They seem to mine left to right, going down.
Then again, I think they are just crazy.
Logged
Proud of my heritage.
Prepare to lose your sanity.

TheyTarget

  • Bay Watcher
  • Memento Mori
    • View Profile
Re: Confusing Miner Pathfinding
« Reply #2 on: July 19, 2010, 09:16:05 am »

They tend to take the tile they think is the most top left, in little squares. But they can only see squares that are accessible. So they kind of cut out weird patterns. Go to the surface and channel out a giant square. You'll quickly see what I'm talking about. Theres ways to capitalize on this probably.
Logged
Code: [Select]
This is a platinum warhammer. All craftsdwarfship is of the highest quality. it menaces with spikes of platinum.
there is an image of the goblin Utes Gozrusrozsnus and dwarves in elf bone. The goblin is making a plaintive gesture. the dwarves are striking a menacing pose.
this image relates to the slaying of Utes Gozrusroz

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: Confusing Miner Pathfinding
« Reply #3 on: July 19, 2010, 09:35:40 am »

In addition to the leftmost/topmost tile choice, immediately after a dwarf has just mined a tile he will check if any adjacent tile is designated for digging, and if so will dig that tile next.  This is why when mining a large area dwarves will often carve random twisting paths through the area to be mined instead of mining the entire path left to right.  I don't know if there is a pattern to which adjacent tile they pick or if it is random.
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.

SenorPez

  • Bay Watcher
    • View Profile
Re: Confusing Miner Pathfinding
« Reply #4 on: July 19, 2010, 09:57:37 am »

Is there anything I can do to help avoid that? TIA

Burrows. I force my miners to finish one room before moving to something else.
Logged

InfernoZeus

  • Bay Watcher
    • View Profile
Re: Confusing Miner Pathfinding
« Reply #5 on: July 19, 2010, 10:10:36 am »

Is there anything I can do to help avoid that? TIA

Burrows. I force my miners to finish one room before moving to something else.

Thanks, I'll try that. So far I've avoided Burrows, but they seem to pop up everywhere  :P I think it might be time to learn how they work..
Logged

Altaree

  • Bay Watcher
    • View Profile
Re: Confusing Miner Pathfinding
« Reply #6 on: July 19, 2010, 01:24:14 pm »

Designate big rooms in parallel lines like
+-----------------
|
+-----------------
|
+-----------------
|
+-----------------
|
+-----------------

They will follow the line to the end.  Once they are done, designate the remaining lines of walls, the dwarves will again mine these one line at a time.  Works great for large rooms.
Logged
Dan Pearson:
This is a game which calculates the volume of blood in every creature it generates so it knows how much alcohol it would have to consume to get drunk, an update which, remarkably, ended up covering people's fortresses in cat vomit.

deoxy

  • Bay Watcher
  • Insert witty comment here.
    • View Profile
Re: Confusing Miner Pathfinding
« Reply #7 on: July 19, 2010, 04:25:23 pm »

In 40d, it worked like this:

1) decide on square to dig:
   A) if a designated square is adjacent to the one you just finished, choose that one (random is several to choose from)
   B) else, top most "block" with a designated square ("blocks" are large areas... smaller than embark squares, I think, but still quite large)
   C) choose farthest left designated square in block - if several in the same column, choose top-most square
   D) I don't know how that works by z-levels, but they seem to prefer lowest z-level first in many cases

2) after choosing square to dig, dig it from an adjacent square, with this order of preference:
   A) left
   B) right
   C) up
   D) down
   E) up-left
   F) up-right
   G) down-left
   H) down-right
   I) from a different z-level (by ramp)

It doesn't matter if the miner is ALREADY adjacent to the square he is supposed to dig, if he can reach the square to the LEFT of the dig-square, he will go there to dig it, NO MATTER HOW FAR IT IS.  Yeah, it's really annoying sometimes.  Notice that the second choice (#2, above) does NOT take into account how far any of those squares are from current location.

As best I can tell, that's the preference order for pretty much everything (which is why it's so easy for masons to build themselves into a wall).

As also mentioned above, you can use these rules to get them to do what you want (or at least pretty close) - designate 1-square dig-paths, they will follow them (until they come to a corner, dig diagonal first, then get the one in the corner, and go "start over" with step 1, above - note that step 1 ALSO doesn't take distance from current location into account).
Logged

shibdib

  • Bay Watcher
  • How much for Goat?
    • View Profile
Re: Confusing Miner Pathfinding
« Reply #8 on: July 19, 2010, 04:49:26 pm »

In 40d, it worked like this:

1) decide on square to dig:
   A) if a designated square is adjacent to the one you just finished, choose that one (random is several to choose from)
   B) else, top most "block" with a designated square ("blocks" are large areas... smaller than embark squares, I think, but still quite large)
   C) choose farthest left designated square in block - if several in the same column, choose top-most square
   D) I don't know how that works by z-levels, but they seem to prefer lowest z-level first in many cases

2) after choosing square to dig, dig it from an adjacent square, with this order of preference:
   A) left
   B) right
   C) up
   D) down
   E) up-left
   F) up-right
   G) down-left
   H) down-right
   I) from a different z-level (by ramp)

It doesn't matter if the miner is ALREADY adjacent to the square he is supposed to dig, if he can reach the square to the LEFT of the dig-square, he will go there to dig it, NO MATTER HOW FAR IT IS.  Yeah, it's really annoying sometimes.  Notice that the second choice (#2, above) does NOT take into account how far any of those squares are from current location.

As best I can tell, that's the preference order for pretty much everything (which is why it's so easy for masons to build themselves into a wall).

As also mentioned above, you can use these rules to get them to do what you want (or at least pretty close) - designate 1-square dig-paths, they will follow them (until they come to a corner, dig diagonal first, then get the one in the corner, and go "start over" with step 1, above - note that step 1 ALSO doesn't take distance from current location into account).

This for most unnecessary complicated FAIL of the day..

U guys do realize that any time of actual ingame unpaused saved by these crazy ideas just mean u wasted a crapload of time planning and implementing them
Logged

Smew

  • Bay Watcher
  • I'll kill you with my bear face.
    • View Profile
    • Deep Games for Deep Gamers
Re: Confusing Miner Pathfinding
« Reply #9 on: July 19, 2010, 07:51:22 pm »

U guys do realize that any time of actual ingame unpaused saved by these crazy ideas just mean u wasted a crapload of time planning and implementing them
Behold, 50% of the fun of dwarf fortress, with only 10% of the english!

shibdib

  • Bay Watcher
  • How much for Goat?
    • View Profile
Re: Confusing Miner Pathfinding
« Reply #10 on: July 20, 2010, 01:09:43 am »

U guys do realize that any time of actual ingame unpaused saved by these crazy ideas just mean u wasted a crapload of time planning and implementing them
Behold, 50% of the fun of dwarf fortress, with only 10% of the english!

im all for crazy ideas, not so much on the grammar/spelling nazi'ism tho.... but some things described in this thread are absurd
Logged

Christes

  • Bay Watcher
    • View Profile
Re: Confusing Miner Pathfinding
« Reply #11 on: July 20, 2010, 02:04:51 am »

Absurd?  Yes.  But also true.  And of course:

Spoiler (click to show/hide)
Logged