Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: How is stone chosen for tasks?  (Read 911 times)

XRsyst

  • Escaped Lunatic
    • View Profile
How is stone chosen for tasks?
« on: April 21, 2008, 07:36:00 pm »

In my fortress I've observed that the stone that is chosen for certain tasks (smelting, filling a stockpile, used in crafting) is not the closest stone at hand, and it's usually nearly the furthest stone away.

Has anyone else noticed this?  Is there a setting somewhere that will cause my workers to use the nearest stone that will satisfy a task rather than stone that's super far away?

Logged

ZedEh

  • Bay Watcher
    • View Profile
Re: How is stone chosen for tasks?
« Reply #1 on: April 21, 2008, 07:43:00 pm »

There's a few things that are known about this.
  1. Stoneworkers will pick up the stone that's closest to them when they start a job.
  2. As far as I can tell, a different Z-axis is considered one "step" away, regardless of how long the actual path to that stone is.
Logged
our sig will appear here

greggbert

  • Bay Watcher
    • View Profile
Re: How is stone chosen for tasks?
« Reply #2 on: April 21, 2008, 08:03:00 pm »

A good rule is to create a 2x3 stone stockpile near your workshop which specifies the type of stone (ie:  Marble) to use.  This will ensure that everything but your first stone will be marble.
Logged
ou have struck Mica!  Now Niki''s gonna kill you!

Lyrax

  • Bay Watcher
    • View Profile
Re: How is stone chosen for tasks?
« Reply #3 on: April 21, 2008, 08:55:00 pm »

The first stone is chosen at random.  This makes things difficult.
Logged
Witty

Comedian
Dabbling Pacifier
Dabbling Judge of Intent
Skilled Forum Poster

Tayrin

  • Bay Watcher
    • View Profile
Re: How is stone chosen for tasks?
« Reply #4 on: April 21, 2008, 09:22:00 pm »

Random? I thought the first stone chosen was the one "nearest" to the dwarf at the time of them taking the job.
Logged

Danaru

  • Bay Watcher
  • 100% Manly
    • View Profile
Re: How is stone chosen for tasks?
« Reply #5 on: April 21, 2008, 09:59:00 pm »

I've had some bauxite that I brought along for magma gates turned into doors a couple times, they were in my wagon, and there was plenty of rock around in the tunnels.

I had to forbid all my bauxite in order to get him to stop wasting it

Logged
Odd how "Experiment" in DF is often synonymous with "Raging inferno of death and dispair"

HisMajestyBOB

  • Bay Watcher
    • View Profile
Re: How is stone chosen for tasks?
« Reply #6 on: April 22, 2008, 12:04:00 am »

It seems to me that Dwarves like to take newly mined stone, so they'll usually take it from your recently excavated mine shafts rather than the old bedrooms or dining hall. [f]orbidding stone through the [d]esignate menu allows you to easily restrict where dwarves will gather stone.
Logged

Thexor

  • Bay Watcher
    • View Profile
Re: How is stone chosen for tasks?
« Reply #7 on: April 22, 2008, 01:14:00 am »

Unless I'm hugely mistaken, the rock chosen is the rock closest to the dwarf executing the task at the time the dwarf receives the order.

If the dwarf happens to be standing in the workshop (after having finished the previous job), then the rock he picks will (coincidently) be the closest one to the workshop. Hence the reason that a stockpile next to the workshop is useful.

That said, the first rock is less predictable. If your dwarf is standing in the middle of your Bauxite pile when he gets the bright idea to make a door, he'll grab the Bauxite (which is closest to him), and then haul it to the workshop. Hence the reason that Danaru lost his bauxite to an over-zealous mason - the wagon is the default 'idle' zone, so your mason was probably hanging around the wagon when he started the "Construct rock door" task, and the bauxite was right next to him. This nature is what makes the first stone seem 'random', too.

The other nasty fact about rock selection is that the distance is the absolute distance, not the path distance. Z-levels count as a single tile. That means that, with a mason's workshop smack dab in the centre of a 9x9 dining hall, the mason would rather grab a stone from 6 levels above/below his current position than grab a stone from the edge of the room, even if getting down 6 levels requires him to spend the next five-ish minutes walking. It's kind of counter-intuitive, since both stairs and z-level transistions make most fortress designers plan horizontally, not vertically. It's very frustrating to try and clear out a room when you're digging another one directly beneath it - {f}orbid any newly-mined stone, and after your dwarves stop grumbling, they'll use the stuff you want them to use.

Logged

Odalrick

  • Bay Watcher
    • View Profile
Re: How is stone chosen for tasks?
« Reply #8 on: April 22, 2008, 12:01:00 pm »

I have the impression that this does not apply to stockpiles though.

For them, the dwarves ignore close items, preferring to haul from far away. Does anyone else have the same impression?

It would make a certain amount of sense, since nearby items are already close to where you want them. Hauling a faraway item provides more value.

Logged

XRsyst

  • Escaped Lunatic
    • View Profile
Re: How is stone chosen for tasks?
« Reply #9 on: April 22, 2008, 12:56:00 pm »

My impression also is that for stockpiles they seem to haul the stone that is the furthest away, I can 100% tell you they don't pick the closest stone either by walk distance or absolute distance.  It appears to me they will pick stone that is almost the furthest away from the stock pile.
Logged

Derakon

  • Bay Watcher
    • View Profile
Re: How is stone chosen for tasks?
« Reply #10 on: April 22, 2008, 01:05:00 pm »

I suspect that, for transportation to the stockpile, dwarves choose the most recently-created stone first. This tends to be the furthest-away stone since you rarely do mining close to your workshops once they're created.
Logged
Jetblade - an open-source Metroid/Castlevania game with procedurally-generated levels

Thexor

  • Bay Watcher
    • View Profile
Re: How is stone chosen for tasks?
« Reply #11 on: April 22, 2008, 02:11:00 pm »

quote:
I suspect that, for transportation to the stockpile, dwarves choose the most recently-created stone first. This tends to be the furthest-away stone since you rarely do mining close to your workshops once they're created.

Hence the reason I never make stone stockpiles for non-economic stones.  :D
Logged

numerobis

  • Bay Watcher
    • View Profile
Re: How is stone chosen for tasks?
« Reply #12 on: April 22, 2008, 10:10:00 pm »

The first stone is hard to predict, as others have pointed out.

A mason / craftsdwarf searching for the next stone will pick the closest accessible stone, where distance is max(dx, dy, dz).  I'm not sure how it breaks ties across z-levels, but on the same level, it goes row by row.  Note that it completely ignores path length for this, which is a pity.

Logged

numerobis

  • Bay Watcher
    • View Profile
Re: How is stone chosen for tasks?
« Reply #13 on: April 22, 2008, 10:12:00 pm »

Another trick is to des'i'gnate a zone as a garbage dump.  Then, find some offensive stone and 'd'ump it (one by one).  Once it's been taken to the dump, 'd' 'c'laim it.  Set up a workshop right next to the dump, and make crafts like there is no tomorrow.  When it runs out, find some more stone and dump it.  That way, you control where the stone comes from.

[ April 22, 2008: Message edited by: benoit.hudson ]

Logged