Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [33f/g] 'closest' should be path length  (Read 466 times)

numerobis

  • Bay Watcher
    • View Profile
[33f/g] 'closest' should be path length
« on: January 07, 2008, 09:19:00 pm »

When I dig a shaft 10 deep 100 tiles away from my mason's shop, then go back 100 tiles, my mason seems to decide that the closest stone is the one 10 tiles below her.  Even though that's actually 210 tiles away.  By contrast, the interface for choosing stones to use in a building seems to get this right.

It took me a while to figure out why I kept seeing my masons build with stone that could only have been quarried in my deepest mines (my fey dwarf going for just the right shist, clambering over hundreds of other shists just like it to get there, I could understand).

Logged

sphr

  • Bay Watcher
    • View Profile
Re: [33f/g] 'closest' should be path length
« Reply #1 on: January 07, 2008, 10:15:00 pm »

fttb, just work around the solution.

A great way is to use a garbage zone/stockpile combi for the ~3x3 area below the mason workshop, and build one workshop for every stone type that you want to build with. The following, which is the result from discussion and input from many helpful people in an earlier thread, works wonderfully for me.

code:

Design: Sorted Mason's workshop/Stone storage

Level Z-1: (workshop level)
##### #####
#MMM# #MMM#
#MMM# #MMM#
#MMM# #MMM#
##+#####+##
##...>...##
##+#####+##
#MMM# #MMM#
#MMM# #MMM#
#MMM# #MMM#
##### #####                      

Level Z21: (storage level)
####+#+####
#GSSS#SSSG#
#SSSS#SSSS#
#SSSS#SSSS#
+SSS+#+SSS+
#####<#####
+SSS+#+SSS+
#SSSS#SSSS#
#SSSS#SSSS#
#GSSS#SSSG#
####+#+####

# wall
S stone stockpile
G garbage zone/stone stockpile
M mason's workshop
+ door
. openspace
> stairs down
< stairs up


-This design is for 4 stone types with corresponding mason's workshop for storing unlimited number of stones.
-All mason's workshops/storage rooms have doors which can be locked in certain events.
-To use, set up each stockpile to a different stone type.
-When stockpile is full, dump all the stones not on the G tile.  This will move all the stones in stock pile to the garbage tile leaving space for more stones to be moved in.
-Periodically, use 'd'esignation->'c'laim to reclaim all the stones in the garbage tiles.  They won't be moved back (since they are still on a stockpile tile) so we can pile up unlimited stones this way.
-Since each workshop is directly above, it will fetch the closest stones which is the stockpile below it (make sure you don't have any rock stockpile in the levels above and below!)
-Say when you need to "mobilize" several workshops to work on one stone type, you can always lockup the other stone storage rooms. (Do note that the design above assumes corridor on all sides, so you have to lock up 3 doors for each stone room).  Then the mason's worksop should draw stones from only one storage if no stones are closeby (which shouldn't be, since you are supposed to have collected all nearby stones into storage)
-Or say if you want to issue job orders via manager but only want 1 stone type, you can lock up all the mason workshops above stone storage that you don't want, so that only one workshop is active, but does not impede stone collection for other types (than if you have locked up the stone storage rooms themselves)

Another additional thing you can do is to add a layer of mechanic's workshop similar to mason's workshop level either above or below, so that you can produce mechanisms of different stones (of different colors).  I find that partial color coding of levers to the floodgates/bridges they are linked to helps a lot when I sometimes forget which lever does what.

[ January 07, 2008: Message edited by: sphr ]

Draco18s

  • Bay Watcher
    • View Profile
Re: [33f/g] 'closest' should be path length
« Reply #2 on: January 08, 2008, 12:03:00 pm »

Yes, that's a decent work around.

The problem is not that they path "as the crow flies" but that distaces don't count the z level at all.  10 levels down and 20 levels down are both 0 tiles away.

Logged

Squeegy

  • Bay Watcher
  • I don't really have any answers for you.
    • View Profile
Re: [33f/g] 'closest' should be path length
« Reply #3 on: January 08, 2008, 07:19:00 pm »

Probably left over from the 2D version. It thinks it's standing on top of the stone.
Logged
I think I'm an alright guy. I just wanna live until I gotta die. I know I'm not perfect, but God knows I try.
Kobold Name Generator
⚔Dueling Blades⚔
Fertile Lands
The Emerald Isles

Draco18s

  • Bay Watcher
    • View Profile
Re: [33f/g] 'closest' should be path length
« Reply #4 on: January 08, 2008, 08:45:00 pm »

quote:
Originally posted by Squeegy:
<STRONG>Probably left over from the 2D version. It thinks it's standing on top of the stone.</STRONG>

That's the assumption among Those-Of-Us-Who-Aren't-Toady. :P

Logged

numerobis

  • Bay Watcher
    • View Profile
Re: [33f/g] 'closest' should be path length
« Reply #5 on: January 08, 2008, 09:19:00 pm »

Oh.  Wow.

The 'just build a stockpile below your mason shop' idea fails when you have an aquifer (that's why it's 100 tiles to the staircase down).

Logged

Stregone

  • Bay Watcher
    • View Profile
Re: [33f/g] 'closest' should be path length
« Reply #6 on: January 08, 2008, 10:01:00 pm »

I put restricted traffic on my stairs, seems to help a bit.
Logged

puffs

  • Bay Watcher
    • View Profile
Re: [33f/g] 'closest' should be path length
« Reply #7 on: January 09, 2008, 12:49:00 am »

I think the problem with using shortest-path calcs is the sheer amount of path processing it would take. you'd have to calculate the path length to an arbitrary number of allowed items.

Basically, imagine if DF locked up for a good 5 seconds every time a mason went to choose a stone.

Logged

numerobis

  • Bay Watcher
    • View Profile
Re: [33f/g] 'closest' should be path length
« Reply #8 on: January 09, 2008, 01:03:00 am »

quote:
Originally posted by puffs:
<STRONG>I think the problem with using shortest-path calcs is the sheer amount of path processing it would take. you'd have to calculate the path length to an arbitrary number of allowed items.

Basically, imagine if DF locked up for a good 5 seconds every time a mason went to choose a stone.</STRONG>


DF doesn't lock up at all when I go to choose which stone to use for my building though, and those numbers are right.  A* is pretty fast.

Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: [33f/g] 'closest' should be path length
« Reply #9 on: January 09, 2008, 01:34:00 am »

quote:
Originally posted by benoit.hudson:
<STRONG>

DF doesn't lock up at all when I go to choose which stone to use for my building though, and those numbers are right.  A* is pretty fast.</STRONG>


It's pretty fast, but not perfectly fast.  Try to time the lag between hitting [D] and getting the wagon access overlay.  It's noticable, not a full second (maybe a eight of a second) but noticable.  That's the kind of delay you'd have everytime a dwarf goes to pick his own stone.  I'd be willing to bet that the A* search for "nearest items" begins when you hit .  Move around all you want, it's doing that calculation in the time it takes for you to realize that you have a new menu to look at and for your fingers to hit keys.

Logged