Bay 12 Games Forum

Please login or register.

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

Author Topic: Stockpile Greediness  (Read 2859 times)

Michael

  • Bay Watcher
    • View Profile
Stockpile Greediness
« on: July 14, 2010, 01:35:22 am »

I propose a package of three related extensions, called "Stockpile Greediness".  I'll be adding it shortly to Eternal Suggestions.

Main proposal:

A new parameter is added to stockpile settings, called greediness.  It has four levels.

Greediness level 0 would turn off all hauling to the stockpile.  It's not the same as deleting the stockpile, since items already correctly in it will not be available for hauling to other stockpiles (except G3).

Greediness level 1 would take only items that are cluttering workshops or are sitting in an existing stockpile in contravention of its filter.

Greediness level 2 would work as the game does at present -- any object matching the filter that isn't already on another stockpile is fair game.

Greediness level 3 would cause items to be hauled off of G2-or-lower stockpiles to keep the G3 stockpile full.

Side proposal one:

A hauling job will only be considered if there would be no jobs available were the stockpile less greedy.

Side proposal two:

A collect flag would be added, like "dump" and "forbid".  It would cause the item to be available to G1 stockpiles, as if it were clutter.

Uses:
  • G0 provides a handy way to squelch a stockpile that is distracting dwarves from tasks the player considers more important at a given time.
  • G1 stone stockpiles would help with one of DF's annoyances, which is that stockpiles made in freshly mined rock rooms will start out with rocks already scattered on them.  Depending on the type of stockpile, the dwarves may refuse to use slots these rocks have already taken.  If not, DF can still render the rocks on top of the legitimately placed items, making it hard to see at a glance how full the stock is.
    One of my most frequent abuses of the dumping system is to pre-clear stockpiles.  But this is less efficient than it would be if the dwarves would just clean new stockpiles at the same time as they gather rocks for masonry.
    The first side proposal makes this happen magically even if the player is unaware of greediness.
  • Small G3 stockpiles would be helpful for keeping non-self-reliant burrows supplied.
  • DF would probably run faster and/or assign jobs more efficiently if there were no G2 or higher stone stockpiles.  There would be no need to iterate over the vast majority of rock lying about the fort.
  • The second side proposal would allow clearing for fortress beautification, or to recover ore/rocks from areas that will be sealed off or flooded.  This would avoid even more cases of dump abuse.
Logged

Beeskee

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #1 on: July 14, 2010, 10:42:56 am »

This is a good suggestion. :) Maybe "Priority" would be a better word to use than "Greediness". I personally have wished for a way to temporarily disable a stockpile without deleting it and without it being emptied into another stockpile.
Logged
When a wizard is tired of looking for broken glass in his dinner, he is tired of life.

HollowClown

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #2 on: August 22, 2010, 08:07:15 pm »

I think this is a good thought, but I'd rather see an indefinite number of greediness levels, instead of the four you list.  Basically, just let the user set the stockpile priority to any positive integer, and haul items from lower priority stockpiles to higher priority stockpiles.  For instance, a Priority 5 stockpile would take items from stockpiles with Priority 4 or lower and be used to fill stockpiles with Priority 6 or greater;  a Priority 3 stockpile would fill from stockpiles with Priority 2 or 1, and be used to fill stockpiles with Priority 4 or greater.  This would allow for far greater control over the  hauling flow, without requiring the high-priority stockpiles to use the same greediness level.

The notion of being able to turn off hauling to stockpiles, without deleting the stockpile, is a good one;  I would love to see this. 

However, I'm not sure that having stockpiles filled only with clutter would serve much of a purpose.  As it currently stands, clutter/mis-stockpiled items will be hauled to the nearest empty stockpile without any added actions.  A clutter stockpile would fill up if there was no additional stockpile space, and empty out when there was additional stockpile space;  if there was no additional stockpile space, the clutter stockpile would fill up just like a normal stockpile.  As far as I can tell, this means that a stockpile that only took clutter would be precisely equivalent to a normal stockpile with the greediness feature enabled, or for that matter the existing 'take from' feature -- in either case, the stockpile would fill up when it had space and nearby workshops were cluttered, and empty out when there was additional space in a greedy and/or 'take from' stockpile.
Logged

VoidPointer

  • Bay Watcher
  • Skilled Computerdwarf
    • View Profile
Re: Stockpile Greediness
« Reply #3 on: August 23, 2010, 01:52:13 pm »

I think this is a good thought, but I'd rather see an indefinite number of greediness levels, instead of the four you list.
*snip*
This would allow for far greater control over the  hauling flow, without requiring the high-priority stockpiles to use the same greediness level.

Possible. However, if this were the case, the other suggested functionality would have to either be separately implemented, or rely on magic numbers.

However, I'm not sure that having stockpiles filled only with clutter would serve much of a purpose.  As it currently stands, clutter/mis-stockpiled items will be hauled to the nearest empty stockpile without any added actions.  A clutter stockpile would fill up if there was no additional stockpile space, and empty out when there was additional stockpile space;  if there was no additional stockpile space, the clutter stockpile would fill up just like a normal stockpile.  As far as I can tell, this means that a stockpile that only took clutter would be precisely equivalent to a normal stockpile with the greediness feature enabled, or for that matter the existing 'take from' feature -- in either case, the stockpile would fill up when it had space and nearby workshops were cluttered, and empty out when there was additional space in a greedy and/or 'take from' stockpile.

Incorrect. This neglects items which are neither in a workshop nor a stockpile, which do not impact workshop clutter (and thus speed).
Logged
01011001 01101111 01110101 00100000 01101110 01100101 01110010 01100100 00101110
01001001 00100000 01110011 01100101 01100101 00100000 01110111 01101000 01100001 01110100 00100000 01111001 01101111 01110101 00100000 01100100 01101001 01100100 00100000 01110100 01101000 01100101 01110010 01100101 00101110

Threlicus

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #4 on: August 23, 2010, 02:52:22 pm »

Well, you could define certain states of materials as equal to being in a stockpile of priority X, and that gives you a nice logically consistent framework. You only haul objects to a stockpile of a higher priority class than the object is currently in.

An object is in priority state X if it matches filters and is in
Level 0: Marked for Clearing
Level 1: In a level 1 stockpile OR in a level 1+ stockpile, not matching its filters; OR in a cluttered workshop
Level 2: In a level 2 stockpile, OR in a not-yet-cluttered workshop
Level 3: In a level 3 stockpile, OR lying about on the ground
Level 4+: In the appropriate level stockpile

A level 0 stockpile would be one still marked as a stockpile but which you want moved out to another location (better than un-marking the stockpile, because then the food rots...). A level 1 stockpile only takes stuff manually marked for clearing (or a level 0 stockpile you want emptied). A level 2 takes clearing, misfiled stocks, and workshop clutter...

Seems like it could be a workable scheme.
Logged

aepurniet

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #5 on: August 24, 2010, 05:19:44 pm »

i love it, this could replicate what ive been trying to do with graphs (take from stockpile settings), without adding too much complexity. seems toady always takes a warhammer to any problem that could be fixed with a training sword though.  (think burrows).  so i assume its not going in.
Logged

Michael

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #6 on: August 30, 2010, 08:02:19 am »

Oh, this thread has revived....

I think this talk of priority is touching on a different need, which I don't quite understand myself.

Basically, G3 stockpiles are for when you really want to keep a resource handy to a specific location.  They will be small but kept full so long as the production is there.  Great to keep food and booze nearby to a dwarf you want to keep focused on his work and not commuting.

G1 stockpiles exist as shock absorbers in your material flow, so that momentary surpluses have somewhere to go rather than clutter a workshop or rot on the vine.  Use of G1/G3 settings ensures the "bubble" of unused storage is always on the shock-absorber pile, never on a local pile.

G2 is not in itself that useful if flagging for collection is available, but is an intuitive default.  G0 is for temporary, tactical uses.

I don't see why you'd need anything more.

If we did define a G4, which is just like G3 except it can additionally rob G3 piles, what would it specifically be used for?
Logged

Threlicus

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #7 on: August 31, 2010, 10:37:44 am »

For defining which stockpile jobs get dwarves assigned to them first, I imagine. Your overflow stockpile in the basement only starts filling once your higher-level ones are filled.

Or a high-quality furniture pile, which is set to greediness 4 but only takes masterwork and legendary furniture; if it gets full, the rest gets dumped in the G3 pile, but if some gets used, the dwarves will move the G3 stuff into the high-quality pile (say, for gem-encrusting).

Logged

Michael

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #8 on: September 01, 2010, 08:39:37 am »

For defining which stockpile jobs get dwarves assigned to them first, I imagine. Your overflow stockpile in the basement only starts filling once your higher-level ones are filled.
Ah.  That's something orthogonal to greediness.
Quote
Or a high-quality furniture pile, which is set to greediness 4 but only takes masterwork and legendary furniture; if it gets full, the rest gets dumped in the G3 pile, but if some gets used, the dwarves will move the G3 stuff into the high-quality pile (say, for gem-encrusting).
Your specific example doesn't work, since your ordinary furniture pile would likely be G1, meaning that the high-quality pile can be G3 and still have the semantics needed.  Still the general principle of stockpiles with partially overlapping filters is valid; cloth would be a better example, as you can have a purely utilitarian bag-production line that wants a G3 cheap-cloth pile, alongside your dyed and embroidered export industry.

I think the way I'd integrate this is have greediness and priority be separate settings.  Priority would determine what items a stockpile "has a right to", while greediness determines how hard the dwarves are worked to make sure a given stockpile has its full entitlement.

If a pile is G0 but has high priority, that means no jobs are generated to fill it, but the items already on it cannot be robbed by G3 piles of lower or equal priority.  This would be useful if you have multiple G3 piles and wish to tactically disable one to free up haulers.  Letting it become G0 with standard priority would cause haulers to remove items to fill other G3 piles, which would not be useful and would still consume hauling effort.

One problem though, is that strict numeric priority can force long hauling trips.  If you have three piles and just numeric priorities, forcing the dwarves to prefer A to B means they have to prefer either A to C, or C to B.  Which would be problematic if C is very distant from the other two and fed by an independent local source of items.   To really make it work, we need some kind of special rules for burrows, and that brings us closer to a general scripting language....
Logged

HollowClown

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #9 on: September 07, 2010, 04:44:13 am »

If we did define a G4, which is just like G3 except it can additionally rob G3 piles, what would it specifically be used for?

Fundamentally, I'd like to see G4 stockpiles (or more generally, GN stockpiles) so that I could prioritize some workshops' raw material stockpiles over others.  As a trivial example, once I start getting legendary dwarves, I like to profile some of my workshops to only accept dwarves with legendary skill;  this lets me easily differentiate between jobs where I don't care about the output quality, and jobs where I do care about the output quality.  If I start running low on raw materials, I'd like to keep the legendary workshops well-supplied by drawing (if necessary) from the non-legendary workshops.  The G0-G3 system would work as long as there were large amounts of items to be stockpiled;  as soon as there were not enough items to completely fill all the G3 stockpiles, the system would break down.  Having G-levels > 3 would let me rank stockpiles, and specify which stockpiles were most important to keep full..

On a more general note, I feel like the G0 (don't accept new items) and G1 (only accept clutter items) behaviors are tangential to the G2 (default) and G3 (take from any G<3 stockpile) behaviors.  G0 and G1 are new behaviors for stockpiles, G3 is a more powerful version of the existing "take from stockpile" behavior.  I definitely want to see the new G0 and G1 features, but I don't think they necessarily need to be conflated with the G3 behavior;  they could equally well be implemented with simple boolean flags in the existing stockpile interface, since they would really just be applying additional filters to the existing stockpile-filling functionality.  The G3 behavior is different, because it needs to additionally look at other stockpiles and check for their contents and G-level.  If those features are added to support the G3 behavior, why not allow GN and support a deep hierarchy for taking from stockpiles?
Logged

Michael

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #10 on: September 07, 2010, 10:00:58 am »

On a more general note, I feel like the G0 (don't accept new items) and G1 (only accept clutter items) behaviors are tangential to the G2 (default) and G3 (take from any G<3 stockpile) behaviors.  G0 and G1 are new behaviors for stockpiles, G3 is a more powerful version of the existing "take from stockpile" behavior.
Other way around; G1 and G0 are the core of the Greediness proposal, and G3 is the tangential afterthought.  Ranked priority levels are an orthogonal issue, and should be a separate setting.

As I mentioned earlier, having Priority and Greediness independent allows you to tactically set a stockpile to zero greediness but high priority.  This will squelch jobs it generates, but prevent it from being raided by greedy stockpiles of equal or lesser priority.

Greediness is ready to go as soon as Toady finds the time.  Priority, unfortunately, needs a bit more design work first.  A simple, strict numeric ranking would cause excessively long hauls in common cases, as dwarves go from one side of the fort to the next to reach the "optimal" pile for their item.  So we need to invent something better.
Logged

Michael

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #11 on: April 05, 2011, 11:20:33 am »

I now have a revision to announce for this suggestion -- a fifth "greediness level".  I'll call it "GS" (S for Solid) rather than give it a number, as it both takes items G2 won't, but leaves items G2 will.

GS stockpiles can rob other stockpiles like G3, but will only take bins and barrels that are full.  If the stockpile has half-full containers, jobs will be generated to consolidate them if possible.  If the stockpile has any empty bins/barrels, then they will be considered clutter, available to any other non-G0 pile.

In steady state, a solid stockpile that is being drawn from should have one (but occasionally zero) partial bin/barrel present -- unless the stockpile contains objects that cannot share the same container.


This would be used to force dwarves to make their long-haul trips using bins rather than single objects.  You can have a small G1 pile next to your crafts workshop and a big GS pile next to the trade depot.  GS piles would also be very helpful in receiving goblinite, in coordination with G2 piles next to the dead goblins.
Logged

zilpin

  • Bay Watcher
  • 437 forever!
    • View Profile
Re: Stockpile Greediness
« Reply #12 on: April 05, 2011, 03:01:50 pm »


+1 this.

Anybody ever play the City Building Series?

I liked the way warehouses could be set to "Get", "Accept", "Deny", "Empty".
Let's you create primary and secondary storage.

I would prefer if DF let me have stockpiles get-from and send-to multiple other stockpiles, instead of the 1 to 1 relationship they have now.
Right now all I can have is very long single chains.
Logged

Michael

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #13 on: September 16, 2012, 01:02:37 am »

I'm the originator of this suggestion, and have recently returned from a long "DF Coma".  The first thing I did was check on my suggestions to make sure I wasn't still voting for something implemented in my absence.  I wasn't, however I did notice that the ever-popular "Improved Hauling" ES (which I resent because I feel it cheated its way to the top by being too vague) is marked as "in-progress" and not needing any votes anymore.  But it still holds first place (1455 votes as I write this, with second place being 1399).

So I've decided to bump my thread to advertise; to see if I can siphon off any of the votes now wasted on "Improved Hauling".  Stockpile Greediness is, after all, a specific way to improve hauling.  And it's not covered by the changes already in DF2012.

In 34.11, you could hack up the equivalent of G3 or G0 by linking to everything or nothing, and the default behavior has always been the same as my G2.  But there's no G1 or GS mode.  And GS (self-consolidating) would now be even more useful, since wheelbarrows can make bins always faster than single hauls.
Logged

D34dlock

  • Bay Watcher
    • View Profile
Re: Stockpile Greediness
« Reply #14 on: September 16, 2012, 11:30:36 am »

As of 34.11 You have the option to make a stockpile Take from or Give to another stockpile. It lets you do what this thread suggests. Use q & mouse over a stockpile & check it out. I guess it counted as part of Hauling.
« Last Edit: September 16, 2012, 11:32:36 am by D34dlock »
Logged
Pages: [1] 2