Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Idiot masons and stonecrafters  (Read 926 times)

Wicked

  • Bay Watcher
  • The older I get, the better I was.
    • View Profile
Idiot masons and stonecrafters
« on: September 14, 2020, 01:25:04 am »

OK, I know that all dorfs are idiots.
What the masons and stonecrafters are doing is going for the most recently mined rocks, no matter how distant,  instead of the nearest ones. Stone haulers using wheelbarrows are doing the same. Is there a way to change this? In DF Hack maybe? (but I have looked there). It will be a real pain when I go looking for magma.
Some hacks I wouldn't use because it is too much like cheating, but I would use it for this. If I could.
Thanks
Logged
If builders built buildings the way programmers write programs, the first woodpecker that came along would destroy civilisation

iceball3

  • Bay Watcher
  • Miaou~
    • View Profile
    • My DA
Re: Idiot masons and stonecrafters
« Reply #1 on: September 14, 2020, 01:43:17 am »

OK, I know that all dorfs are idiots.
What the masons and stonecrafters are doing is going for the most recently mined rocks, no matter how distant,  instead of the nearest ones. Stone haulers using wheelbarrows are doing the same. Is there a way to change this? In DF Hack maybe? (but I have looked there). It will be a real pain when I go looking for magma.
Some hacks I wouldn't use because it is too much like cheating, but I would use it for this. If I could.
Thanks
If you make a stockpile feed into a workshop, it will only allow dwarves to use items from the stockpile for the workshop operations.
However, it'll make it so that dwarves likewise cannot work the workshop if the stockpile dries up, though if they have hauling enabled they'll at least contribute to that, assuming they don't have other business to attend to.
Logged

Shonai_Dweller

  • Bay Watcher
    • View Profile
Re: Idiot masons and stonecrafters
« Reply #2 on: September 14, 2020, 02:27:01 am »

Dwarves head for the nearest rock, not the most recently dug.
What throws most people off is that Dwarves measure in a straight line, including up and down z levels. A rock lying exactly 10 squares down from the dwarf is "closer" than a rock 11 squares away in the same room, even if he has to traverse the entire fortress through your stairway system to get there.
Logged

Schmaven

  • Bay Watcher
  • Abiding
    • View Profile
Re: Idiot masons and stonecrafters
« Reply #3 on: September 15, 2020, 11:11:35 am »

You could paint a stone stockpile over the stones you want hauled, set to take from links only, and give to whichever stockpile / workshop you want.  Not 100% reliable, but I've had decent results with it.
Logged

Wicked

  • Bay Watcher
  • The older I get, the better I was.
    • View Profile
Re: Idiot masons and stonecrafters
« Reply #4 on: September 16, 2020, 01:02:26 am »

Thanks Shonai_Dweller, I didn't know that.  But I am still sure that my guys don't always go for the nearest, even taking what you said into account
And thanks  Schmaven, that is a good suggestion
Logged
If builders built buildings the way programmers write programs, the first woodpecker that came along would destroy civilisation

Starver

  • Bay Watcher
    • View Profile
Re: Idiot masons and stonecrafters
« Reply #5 on: September 16, 2020, 01:31:23 am »

To add to the "get the 'nearest' item", that maybe actually isn't in practical routing terms, the job to get that might be taken on, but the long route to that item will pass by other items made available before or since the fetching job was created.

The programmed monomania does not give any quarter to switching to a suitable substitute item, though, even without complications of other dwarves maybe psychically choosing this item.

It'd be interesting to see if a sensibly dynamic re-targetting of target items(/dig-points/etc) could be established, perhaps with the same telepathic inter-unit claim-locking augmented by a horse-trading mechanism where applicable. Though in addition to all the additional A* path-checking (every few ticks, for every 'seeker' against every relevent 'target'[1]), I think part of the delight is in these otherwise strangely omniscient little buggers not being quite so ruthlessly optimal about it.


[1] Unless it's triggered by proximity. "Hold on... On my way to pick up that diorite(/general stone) I find myself two steps from a diorite that will just as easily suit my needs. Hey! Urist McFellowhauler! You're not needing this exact stone, are you? Great! I'm grabbing this one, then..." *Urist McFellowhauler stops a moment in thought, retasks to a new stone suited to her task that also now turns out to be a little bit closer to her current position than the one she had been headed for.
Logged

Wicked

  • Bay Watcher
  • The older I get, the better I was.
    • View Profile
Re: Idiot masons and stonecrafters
« Reply #6 on: September 16, 2020, 02:09:34 am »

Just posted something I now think may be wrong. will do more checking
(BTW, is it possible to delete a post instead of doing what I am now?)
« Last Edit: September 16, 2020, 02:51:14 am by Wicked »
Logged
If builders built buildings the way programmers write programs, the first woodpecker that came along would destroy civilisation

Starver

  • Bay Watcher
    • View Profile
Re: Idiot masons and stonecrafters
« Reply #7 on: September 16, 2020, 02:52:50 am »

(It could be the nearest rock not claimed by a different dwarf who already chose their rock earlier, from half way across the map... For whatever reason that happened.)
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Idiot masons and stonecrafters
« Reply #8 on: September 16, 2020, 03:24:12 am »

As far as I understand, DF does NOT repath every few steps, but generates the path as the job is taken (there's a field in the unit's unit record that holds the path, if you want to examine it [something all those people who think Toady is a moron and their bright pathing idea obviously is superior to what's used should start to compare their brain child against]). Repathing happens only when the path is blocked (e.g. by colliding with another dorf), and then only to get a route to the next step of the original route (rather than rejoin the original route, which IS something that could be improved). Likewise, the item to use is chosen when the job is taken. Switching targets would require a constant job dependent scanning of the surroundings which would probably result in odd bugs where dorfs claim and release items in a weird, buggy dance where targets are constantly shifting and the FPS tanking (job cancelled: no mica available, yes, there's one, no, there isn't, yes, there's one...).
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Idiot masons and stonecrafters
« Reply #9 on: September 16, 2020, 07:43:46 am »

In case that was in reply to...
It'd be interesting to see if a sensibly dynamic re-targetting of target items(/dig-points/etc) could be established,
...then what I was meaning was that if one were to rewrite DF to be so wastefully dynamic, then the observed and expected[1] behaviour would likely disappear.

I did not mean "establish if DF does it that way". Though I would never discourage personal ‼science‼ 8f anyone wants to get a feel of exactly how it does and does not recalculate paths (items get destroyed, pressure-plates raise drawbridges ahead in the path, etc).

Yeah, I agree the flawlessly dynamically optimal solution would be bad (for the CPU, etc), and possibly far far worse if you include lookahead and even anticipation of pressure-plate activation/closing of bridges and floodgate path-interupters. Even if it got your haulage done in far fewer game-ticks, the FPS-drop could make it take far longer in player-time, which is normally what really counts if it's not just getting too close to the seasonal visitors and you're rushing to complete depot and/or defenses... ;)

[1] By long-time players.
Logged

Salmeuk

  • Bay Watcher
    • View Profile
Re: Idiot masons and stonecrafters
« Reply #10 on: September 16, 2020, 09:09:55 am »

It would be interesting if the game even took the simulation a step further, and used the record keeper role as a sort of pathfinding generator for the fortress.

What I mean is, the record keeper / auditor / accountant would create a 'snapshot' of the location of items for dwarves. This snapshot would be funneled out to all the workshops, and dictate where / how the dwarves look for items. If they get to the designated location but the record keeper hasn't been doing their job, or has been killed or something, then the item might be long gone by the time the dwarf would get there!

Some kind of balance would be appropriate, where lets say within 50 tiles of a workshop a dwarf can pathfind all on their own, but any further than that (so, for large / older fortresses) you had better have a well-trained record keeper.

I think if this kind of system was paired with some kind of overseer painting tool that ordered priority hauling to be done, then it would represent a shift of the pathfinding towards the simulationist side, without hindering gameplay all that much. It would also give record keepers something to do, once they tally all item counts.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Idiot masons and stonecrafters
« Reply #11 on: September 16, 2020, 02:12:38 pm »

But I am still sure that my guys don't always go for the nearest, even taking what you said into account

It's the closest to the dwarf who took the job, not to where the item needs to go. Usually that would be rocks closest to the tavern, etc.
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)?