Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 7

Author Topic: Stockpile Hacks: The Undump  (Read 21422 times)

Nil Eyeglazed

  • Bay Watcher
    • View Profile
Stockpile Hacks: The Undump
« on: August 30, 2011, 02:34:35 pm »

Edited to represent latest research.

You may want to check out http://dwarffortresswiki.org/index.php/User:Vasiln/Undump for pretty diagrams that are probably easier to read, as well as a design variant that's more reliable, at the expense of greater complexity.

Code: [Select]
 
###
#s#
#b#
#h#
#s#
#^#
.t.

h is hatch over channel, b is bridge over channel, ^ is pressure plate (citizens trigger) linked to hatch and bridge, # is wall, s is a single stockpile that spans over the hatch and is set to take from stockpile t
. is floor (or whatever), t is stockpile with same settings as s, created after stockpile s
Orientation and build order may or may not matter

To spell it out, stockpile generates a "bring item" job, but when the dwarf tries to bring an item to the right-most stockpile job, he finds no path, and drops his item.  Luckily, he's already standing on a stockpile (with the same settings) when he drops the item, so he doesn't keep on trying to move that item.

What it functions as is a sort of quantum stockpile, but with normal stockpile sorting, without having to designate anything or reclaim anything, and you can still use the "dump" function to drop things in the magma.  This isn't just nice for reasons of space and automation-- since this stockpile is never full, it also means that if there is an item on the map that can be put in this stockpile, and your dwarves can path, it WILL be stockpiled.

Doesn't always play nice with other stockpiles, since it can hold infinite goods, but "take from" settings work fine.

Works slowly.  Consider expanding stockpile t for a sufficiently sized reserve in cases of high throughput (raw materials, etc).

An earlier iteration saw very slow dwarves occasionally making it to the last stockpile square, thus breaking the undump; the addition of the bridge doubles the length of time that the lure tile is inaccessible.  Haven't seen any problems since I started using the bridge.  EDIT: Stuff still makes it to the lure.  See the wiki page linked above for a different version that's functioning perfectly so far.

It's not uncommon for dwarves to drop goods on the pressure plate instead of the stockpile; that's one of the reasons there's the feeder stockpile, which will prevent infinite loops that could otherwise occur.  In my experience, about 1/3 of the goods make it to the pressure plate, and 2/3 to the stockpile, but this probably depends on the dwarves and the items in question.

If your dwarves are both drawing from and delivering to the undump, dwarves will occasionally drop an item on the way to the stockpile.  So don't use it for food (or anything else that will rot off of a stockpile.)

I think there are a huge number of applications:

1) Zero workshop clutter: Since any number of things can be stored on the tile, you can put your masons to work making doors nonstop and never have to worry about the size of your door stockpile.  Brewer's are another on of those shops that always give me trouble.  EDIT: Use with caution for stills.  Use of bins or barrels can lead to hauling loops.

2) Raw material: This can put a stockpile a single tile from a workshop-- a sorted stockpile, that you don't need to manage.  They're small enough that you can easily have separate stockpiles for individual raw materials, blocked off however you'd like.

3) Mini Mass Pit: Only ever need a single hatch for your mass pit.  Requires diagonal redesign, with an untriggered hatch east or west of the southern s stockpile tile, but that shouldn't break functionality.  Don't have to worry about empty cages with this plan, but you can always build one for the empty cages if that's what you want.

4) Socks: Dear God, socks.  Never again fear that an unowned sock is exposed to the wind and the rain.

5) Trade goods: No more bins necessary.  All goods you'll ever want to trade, right next to the depot.

6) Refuse: Tiny design means you don't have to worry about it getting cluttered up with goblin corpses, and it's easy to leave a single tile open to air.  If you don't care about getting any bones out of them, it can be designed to be magma-floodable.  EDIT: Refuse attracts vermin; vermin attracts cats.  Cats don't trigger pressure plates, and they kill vermin and can leave the vermin on inaccessible stockpile squares.  Use with caution.

7) Mandated goods: Mayor like quivers, and now you have 500 of them-- can't even run a designate dump on your front porch to clear the goblins because of prohibition of exporting quivers?  Here's how you store those goods, and whenever the mayor drops his export mandate, they're all in a nice single square, ready for designate-dump.

Poor applications:

1) Food.  It won't always make it to the stockpile square, and will rot.

2) Drinks.  They don't rot, but to stockpile them, you need to enable barrels, and that has the potential to lead to an endless loop of pick the barrel up, drop the barrel.

I'm also playing with a dropping version of this-- instead of the near stockpile square, I have another hatch, combined with a one-way, goblin-grinder style path to the undump that automatically drops goods on the way out.  So far, this is working without a hitch (I've got it dropping skulls into magma), but there's the theoretical potential for dropping a dwarf rather than his goods when doing this.  So far, it hasn't happened, so I imagine the risk is slight.  (You can make a foolproof dropping undump, but it's incredibly complicated and runs really, really slow.)


EDIT: Just a warning, because people seem really excited about this-- while I've tested this, it's not always been in a real-fortress environment.  I've been testing using super-fast dwarves (EDIT: slow dwarf test later in thread), and maybe that affects things.  Even then, there's an occasional problem, and I don't know exactly how many headaches this would cause vs. how many headaches it would resolve.  So I'm looking forward to anybody's real-fortress reports of the design-- there's always room for it to not function as well as intended.  EDIT2: I've edited this post as I've performed further testing, and I believe that the design given above, within the limits specified, is functional and useful.  Some of this thread is in reference to previous designs that aren't as useful.  Last tested, v34.02.
« Last Edit: March 09, 2012, 04:23:55 pm by Nil Eyeglazed »
Logged
He he he.  Yeah, it almost looks done...  alas...  those who are in your teens, hold on until your twenties...  those in your twenties, your thirties...  others, cling to life as you are able...<P>It should be pretty fun though.

Shawtay

  • Bay Watcher
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #1 on: August 30, 2011, 03:08:55 pm »

Did you put this on the wiki?
Logged
He likes the color green, metals, flowers, olivine, and rain for its beauty. When possible, he prefers to consume tea. He absolutely detests social interaction.

Raging Mouse

  • Bay Watcher
  • The mouse has become enraged! *DOUBLECLICK*
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #2 on: August 30, 2011, 03:15:16 pm »

This is the best invention since pre-cut, magma-toasted bread. You bet your beard this is a bookmark for later.
Logged

fluffhead

  • Bay Watcher
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #3 on: August 30, 2011, 03:16:54 pm »

I can see how this would be usefull.  When you described it in the other thread, I wasn't completely understanding how it worked.  Now I do.  Dwarfyness++
Logged

Lectorog

  • Bay Watcher
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #4 on: August 30, 2011, 03:23:32 pm »

This has been tested, right?
This is an easy, useful alternative to micromanaging quantum stockpiles. Good idea!
Logged

Nil Eyeglazed

  • Bay Watcher
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #5 on: August 30, 2011, 03:30:54 pm »

Tested.  Not on wiki.  Somebody can do that if they feel like it should be.
Logged
He he he.  Yeah, it almost looks done...  alas...  those who are in your teens, hold on until your twenties...  those in your twenties, your thirties...  others, cling to life as you are able...<P>It should be pretty fun though.

Gidwerg

  • Escaped Lunatic
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #6 on: August 30, 2011, 03:33:20 pm »

Together with the built-in stockpile settings for materials, quality and type, this solves every single clutter- (and therefore clutter-induced FPS-) problem one could encounter... probably the most game-changing invention since danger rooms. Good Job.

And it was on the wiki already when I checked ~ 1 hour ago.

: typo. Nobody likes sockpiles.
« Last Edit: August 30, 2011, 03:35:23 pm by Gidwerg »
Logged

ohgoditburns

  • Bay Watcher
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #7 on: August 30, 2011, 03:35:46 pm »

The only thing this doesn't solve is that unstockpiled food rots and withers.
Logged
The landscape routinely being soaked in flammable fluids somehow seems less than benevolent.

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #8 on: August 30, 2011, 03:37:46 pm »

Actually, undumping looks like a delicious cluster of hax and creamy caramel.  I might instal one of those for stone, simply to clean out places very quickly without having to assign dump commands.

For anyone who doesn't know how it works:
1: The dwarf picks up the stone and brings it to the left-most stockpile, the safe one.
2: The dwarf picks up another stone and brings it to the right-most stockpile, the unsafe one.
3: As they walk to the stockpile, the hatch opens and their path is removed, causing them to spam job cancel and drop their stone where they're standing.  Because they're already standing on a stockpile, then the dropped stone is already stockpiled.
4: The dwarf will pick up a DIFFERENT stone, because the one he dropped is already on a stockpile, and repeat until finished.

This looks very interesting.  My gut feeling is that it's slow, though.  It's a serial job, one dwarf at a time.

If you expand the unreachable stockpile, do all the fill-stockpile jobs cancel at once when the hatch opens?  Or just the one guy who can't move another step closer to it?

As a side note, it looks like you should set max bins and barrels to 0 in the unreachable one.  Otherwise, you'll get repeated attempts to place a bin in it.  (Might not be true in practice.)

Edit: another thought: make one three-square stockpile, then p-x the middle square.  That way, the settings for the "two stockpiles" can't get out-of-sync.
« Last Edit: August 30, 2011, 03:41:44 pm by 0x517A5D »
Logged
"I am now everlastingly grateful to Intel for freeing me from this terrible association with the worst software on the planet. These are not my words, but the words of millions of irate users.

"My elation at Intel's decision is beyond words."

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #9 on: August 30, 2011, 03:40:50 pm »

If you expand the unreachable stockpile, it will generate more stocking jobs and thus more dwarves moving goods.  You may run into trouble when a dwarf manages the very perfect timing of running over the hatch just after it closes.  This will be excruciatingly rare, and can be solved with a locked door leading to the unreachable zone, allowing you to remove contents at will.

Also, fun fact: if you put magma under the hatch, you can very quickly dump things into the magma by declaring it a garbage zone.  Got a lot of goblinite thongs you can't be bothered to sell?  Stockpile thongs, and then order them dumped once a year, tossing them from the pile and into the magma!

Nil Eyeglazed

  • Bay Watcher
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #10 on: August 30, 2011, 03:53:08 pm »

The only thing this doesn't solve is that unstockpiled food rots and withers.

Except the food is stockpiled.  It's sitting on a food stockpile.  (Haven't tested food, but experience with quantum food stockpiles says that there's nothing wrong with multiple pieces of food on a single stockpile tile.)  EDIT: It doesn't always make it to the food stockpile.  Hopefully people will try this out with food and share their experiences.

This looks very interesting.  My gut feeling is that it's slow, though.  It's a serial job, one dwarf at a time.

If you expand the unreachable stockpile, do all the fill-stockpile jobs cancel at once when the hatch opens?  Or just the one guy who can't move another step closer to it?

As a side note, it looks like you should set max bins and barrels to 0 in the unreachable one.  Otherwise, you'll get repeated attempts to place a bin in it.  (Might not be true in practice.)

I think those are good questions, and I'm not sure of the answer.  The serial nature of this kind of stockpile can be an advantage or a disadvantage.  It prevents the "Socks for the sock god!" mass hysteria, but there's the potential that haulers couldn't keep up with some stockpiling jobs (like stone, uggh)

As you mention, you could always make a larger unreachable stockpile-- this ought to create more hauling jobs.  I believe that if you do so, all of the hauled jobs will be dropped on the right square.  Haven't tested.  Dwarves won't pick up new hauling jobs while there's no path, but they will try to complete a job they've already picked up.  EDIT: Don't do this if you like your framerate.

You don't need bins anymore, but that's a good point about barrels.  I'm not sure you could use this for a booze stockpile, unless you were happy with it being both a booze and empty barrels stockpile at the same time.  That'd be fine for a still, but you might want a real booze stockpile with take-from settings too.  EDIT: I see now that even for dual function barrel/booze stockpiles, this is a problem.

You may run into trouble when a dwarf manages the very perfect timing of running over the hatch just after it closes.  This will be excruciatingly rare, and can be solved with a locked door leading to the unreachable zone, allowing you to remove contents at will.

Hatches trigger instantly and have no refractory period.  The only way a dwarf could make it over the hatch is if you linked a second pressure plate to it-- then it can get a close job while a dwarf is still on one of the pressure plates.

It would, however, be possible for somebody to hang out on the stockpile square and wander over the hatch 100 ticks later.  It would have to be idle or a child or something.  If a dwarf happened to do this, though, it wouldn't be any problem: stockpiling dwarves would still find the unreachable square unreachable, while as soon as there was a lull in hauling, the wandering dwarf would be able to path back out of the unreachable tile.  Worst thing that could happen is that he gets dropped down a hatch.  EDIT: I've seen this happen in tests; it causes no problems.
« Last Edit: August 31, 2011, 07:12:35 pm by Nil Eyeglazed »
Logged
He he he.  Yeah, it almost looks done...  alas...  those who are in your teens, hold on until your twenties...  those in your twenties, your thirties...  others, cling to life as you are able...<P>It should be pretty fun though.

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #11 on: August 30, 2011, 04:02:41 pm »

Pressure plates do not appear to re-send their data if tapped quickly.  So, if two dwarves are walking towards a stockpile, the first one will step on the pressure plate and trigger the hatch, causing the intended job cancelation and drop.  If the second dwarf is ~90 or so ticks behind, then the dwarf will step on the plate, and nothing happens, and when they step forward, the plate reaches its 100 tick mark and the hatch closes, allowing them to walk over it. and reach the stockpile.  If they're something like 70 ticks behind the first, then there's a chance that the first dwarf will start walking back and trigger the plate, causing the second dwarf to fall through the hatch, which may or may not be hilarious.

Either way, it requires intense timing that I wouldn't worry about.  It can be made even more secure if you line up additional hatches, like 3-4 hatches in a row to form the pit, which would cause any dwarf to fall in and never reach the stockpile.  A simple escape route underneath would let them out (or not) but that gets slightly larger in construction.  I really wouldn't worry about the very rare timing delay, especially because the dwarf can walk back out over the hatch freely and escape.  It will just cause job cancels as your mason attempts to grab the stone that's in the unreachable area.  A very occasional dumping will be needed, if this ever actually happens at all.  It will never happen if there's just 1 unreachable square.

Nil Eyeglazed

  • Bay Watcher
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #12 on: August 30, 2011, 04:29:59 pm »

I tried the huge unreachable stockpile.  It led to slightly faster stockpiling.  It also led to a massive framerate hit (probably just while things need stockpiling).  Wouldn't recommend it.  One unpathable job, no problem.  One hundred?  Ouch. 

Pressure plates do not appear to re-send their data if tapped quickly.  So, if two dwarves are walking towards a stockpile, the first one will step on the pressure plate and trigger the hatch, causing the intended job cancelation and drop.  If the second dwarf is ~90 or so ticks behind, then the dwarf will step on the plate, and nothing happens, and when they step forward, the plate reaches its 100 tick mark and the hatch closes, allowing them to walk over it. and reach the stockpile.  If they're something like 70 ticks behind the first, then there's a chance that the first dwarf will start walking back and trigger the plate, causing the second dwarf to fall through the hatch, which may or may not be hilarious.

They don't resend their "open" signal, but they recompute the time to send their "close" signal.  In this example:

Dwarf A reaches pressure plate at 0, leaves pressure plate at 10
Dwarf B reaches pressure plate at 80, leaves pressure plate at 90

I believe that what will happen is that the pressure plate will open at 0 and close at ~190.  (If it worked the other way, a few of my logic designs would be unnecessary.  Pain in the ass to design a false path for a goblin just so that he doesn't dance a few tiles around a pressure plate, leading to it never sending an off.)

EDIT:  Looks like initial job paths from job to dwarf, followed by dwarf pathing to item; when dwarf gets the item, he tries to path to the stockpile.  Single job at once causes one pathing hit, when the dwarf hits the open hatch.  If you wanted to minimize this framerate hit, you could do so via some engineering tricks, but it's not a big hit.  The problem is when a dwarf reaches an item and discovers that the stockpile is no longer accessible-- he paths through all squares on the map.  Multiply that times every dwarf that has accepted a stockpile job while the path was open.  Pathing from the stockpile square to give a dwarf the job, on the other hand, ends pretty much instantly: wall, wall, channel.  All we have to look at is 9 squares, the bare minimum.  Based on that, if you want faster hauling without framerate hit, you're much better off building the device as originally pictured, just in multiple.
« Last Edit: August 30, 2011, 04:48:32 pm by Nil Eyeglazed »
Logged
He he he.  Yeah, it almost looks done...  alas...  those who are in your teens, hold on until your twenties...  those in your twenties, your thirties...  others, cling to life as you are able...<P>It should be pretty fun though.

ohgoditburns

  • Bay Watcher
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #13 on: August 30, 2011, 04:30:33 pm »

Wouldn't the second tap not happen since when the first happens, both dwarves will drop their goods?
Logged
The landscape routinely being soaked in flammable fluids somehow seems less than benevolent.

EddyP

  • Bay Watcher
    • View Profile
Re: Stockpile Hacks: The Undump
« Reply #14 on: August 30, 2011, 04:36:44 pm »

I think that as soon as the path gets cut off, the dwarf will drop what he's hauling, so iIf you wanted multiple dwarves to stockpile stuff:
Code: [Select]
#####
^shs#
###s#
^shs#
###s#
^shs#
#####
Add more rows to increase the stockpiling rate

Could be made more compact by altering the layout a bit, for example

Code: [Select]
########
^shsshs^
###ss####
^shsshs^
###ss####
^shsshs^
########
Logged
Pages: [1] 2 3 ... 7