Bay 12 Games Forum

Please login or register.

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

Author Topic: Manager Auto-fills stockpiles  (Read 6287 times)

INSANEcyborg

  • Bay Watcher
    • View Profile
Manager Auto-fills stockpiles
« on: December 14, 2009, 09:59:31 pm »

Short version:

  Have the manager automatically queue up jobs to fill certain stockpiles.  If a rock block stockpile has room for 10 more, they'll makes 10 "make rock block" jobs.  If its a food or booze stockpiles, they'll keep it full automatically.


Long, detailed, how it'll work version:

Eligibility
  Only certain things would work with this.  Things that need designations, like stone, logs, plants from gathering/farming, meat from butchering, as well as other various things wouldn't work.  I'll put up a list later.

Setup: 

  Two ways I can think of.  First is to make a third option for existing stockpiles.  In addition to the Allow and Don't Allow we have now, a particular item can be set to auto fill, and have a different color (yellow?).   The second option is to make a separate type of stockpile that only auto fills.   In both cases, since not everything can be made from the manager, only eligible items could set to auto fill.

How it works:

  Every so often, the manager will do a check to see which stockpiles aren't full.  How often can be set with a setting, like bookkeepers precision level. They'll figure out how many free spots are in the stockpile, and make equal amounts of the various items that goes in it.   If its not specific enough, they'd do the next best thing, And if there's multiple options, they'd default to a standard one.  For example, it would use "Brew Drink" if it needs Dwarven wine, or in the case of alloys, it would default to "make from bars" instead of ore. 
  Note, this would only queue up the orders, the manager would still have to go to his office and validate them.

Mechanics:

  My current understanding is that empty stockpiles create a "move item here" job.  This is pretty much the same thing, only if it fails, it  now makes a "create item to move here" job.   These would be created when the manager checks them.


Potential problems:

  Game slowdown.  By only having the manager check so often instead of constantly, it hopefully won't slow the game down too much

  Ordering things made while already in the queue.  If something can't be made because of lack of materials or time, it might be doubled up when it gets checked again.  Easiest way to fix this would be to cancel all the non-player made orders with each new check.  If it checks too fast there might not be enough time to make anything.

  Stockpiles with multiple items.  If a stockpile is for gold and silver bars, but your out of gold ore, it might keep trying to smelt gold instead of silver.  Or if spaces open up one at a time, it keeps making gold instead of silver.  Splitting up the jobs between all items in allowed in the stockpile should fix most of this.  If the open spots are less than the number of items, adding them in a random order would stop the first one from being done more than the others.

  Gems. There are a lot of gem types and the stockpiles don't let you pick certain types.  I'd make it so only glass type gems work. 

  Bins/barrels and space.  How to include bins into how much free space a stockpile has.    I would have it only include bins that are currently on the stockpile.  Using the max number of allowed bins might cause problems if there isn't enough bins for the stockpile after it gets filled.   If you have extra bins, there's usually an empty one placed on each stockpile, which means more room during the next check.

  Multiple materials.  If something can be made from wood, rock, glass, and or metal, how would it pick which one to make it from.  If it can be made from metal, which metal would it make it from.  Or in the case of coke, would it use coal or lignite.  Not sure how to fix these, for now I'd make everything default to stone.  If it can't be made from stone, don't make it eligible.  Things only made from one thing, like beds, would still work.

  Multiple stockpiles or specific items.   If two stockpiles accept the same thing, the auto fill one would fill them both up.  Or if the stockpile only accepts a certain quality, or type of booze, it'd keep making them until it gets enough of the right type.   Most of these are probably good things, and if you don't want them, changing settings should fix most of them.  Like using the take from stockpile option to keep the auto filled one full before the others, or allow all qualities.


Uses:

  Food:  You'll always have x amount of prepared meals or booze on hand

  Mandates:  Someone wants 3 rings?  Make a stockpile that only accepts rings that's 3 tiles big and doesn't allow bins.   They'll keep making crafts until its filled, and then you'll have your 3 rings.  (Might not get them done in time if it doesn't check often enough)

  Production.   Ammo stockpiles wont run out.    With the exception of getting logs, using charcoal, pig iron, and steel bar stockpiles would automate your metal industry.  A sandbag stockpile can help make glass.  Have a certain amount of goods on hand for the next caravan while letting the worker do something else when you have enough.


Other

  Not sure how long it should wait before trying to refill stockpiles again.  I'm thinking the settings could be X times a month.

  Maybe have the manager go to each stockpile before making orders.  Not that important though

  Involve the Bookkeeper somehow?  Have him check the stockpiles, or make it go faster with good record keeping?  Again, not that important



Anyway, I know there have been suggestions to auto-make food and booze, but when I searched I didn't see anything about using the manager or stockpiles.
Logged

Impaler[WrG]

  • Bay Watcher
  • Khazad Project Leader
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #1 on: December 14, 2009, 10:52:04 pm »

While automatic production queuing has been discussed before this is the first ware I've seen the idea linked to stockpiles.  While it has its limitations I can see a lot of potential here.  The players already very familiar with stockpiles and how they work so adding another effect builds on a well established system.
Logged
Khazad the Isometric Fortress Engine
Extract forts from DF, load and save them to file and view them in full 3D

Khazad Home Thread
Khazad v0.0.5 Download

Astramancer

  • Bay Watcher
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #2 on: December 16, 2009, 12:54:50 am »

That would be quite nice.

While we're talking about revamping stockpiles, I'd like to see the "take from" options to be expanded to include multiple stockpiles and to include workshops.  Similarly, workshops should have a "take from" option.

Combine these two ideas, and the manager can automatically queue the workshop tasks needed to continue the chain.  This might be a way to get around the material problems, since the stockpile that the workshop is taking from would define which materials can be used.


Logged

Impaler[WrG]

  • Bay Watcher
  • Khazad Project Leader
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #3 on: December 16, 2009, 01:16:02 am »

Indeed that would be a potent combination at least for the routine food/booze/cheap-exports production that the player generally wants to do on a continual basis.  We would still need a better jobs manager to inject one-off productions into the system but this is the simplest yet firmest continual production proposal I've read.  The game really dose need to move towards being a game ware the player sets up perpetual processes and then monitors and adjusts those processes, rather then one ware they continually request one-off events for everything.  Imagine how impossible Transport Tycoon would be if you had to order every train to leave every station rather then setting up a route.
Logged
Khazad the Isometric Fortress Engine
Extract forts from DF, load and save them to file and view them in full 3D

Khazad Home Thread
Khazad v0.0.5 Download

jfs

  • Bay Watcher
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #4 on: December 18, 2009, 06:58:01 am »

It may be better to designate "roles" for stockpiles:
- Consumption (stuff for dwarven consumption, as well as intermediate products for other workshops)
- Storage (overflow buffer)
- Output buffer (workshops put finished goods here)

Stockpiles with Consumption roles would always try to stay full, taking from other kinds of stockpiles. Set up Consumption stockpiles with food near dining rooms or living quarters. Set up Consumption stockpiles with cloth near your clothing factory.

Storage stockpiles would attempt to take from Output buffer stockpiles, but only when all Consumption stockpiles are full.

Output buffer stockpiles are filled by nearby workshops and haulers will move goods from them to consumption or storage stockpiles.

Furthermore, for Consumption stockpiles, you should be able to set a target amount of each class of goods (more or less specified; e.g. both "any 50 edible food items" and "10 roasts costing at most 20 each" should be possible to specify.) They would never fill above their target amount of a class of goods.

Output stockpiles could take over most of the role of goods stored in the workshops, or maybe even entirely take it over. The worker himself would create a job to haul the finished product to an output stockpile.

Of course, it should also be possible to have a stockpile that does anything, like in early fortresses, just have an "everything clothing" pile.

Then have standing production orders like "keep all consumption stockpiles' booze quotas filled, and have at least 500 additional units in storage".
Only allow trade depots to take from Storage stockpiles, allow this to be overridden from the depot (like ignoring mandates.)
Allow prioritising standing production orders such that some orders veto others: "Have 20 plump helmet seeds in stock" with higher priority than "Have 200 prepared meals in stock" means that plump helmets and their seeds may not be cooked if it would violate the plump helmet seeds order.


All of this is probably so much work that it may require more than one dwarf to administer, if there are enough stockpiles and complex enough orders in place.
It will also make more sense to have dedicated teams of haulers then.
Logged

fizmat

  • Bay Watcher
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #5 on: December 18, 2009, 08:55:24 am »

While we're talking about revamping stockpiles, I'd like to see the "take from" options to be expanded to include multiple stockpiles and to include workshops.  Similarly, workshops should have a "take from" option.
I like this idea: rather simple to program, even more simple to learn to use. Perfect and dwarfy. If the "take from" stokpile of a workshop does not have requested material - revert to current material-retrieving algorithm, just in case.

Maybe manager's orders should prioritize workshops that have required materials in their take-from stokpile, so the craftsdwarf's near metal bars doesn't make bolts from bones piled near another craftsdwarf's across the map. That would eliminate one of the reasons I sometimes do not use the manager and make him basically the most helpful dvarf in a big fort.
Logged

PsyberianHusky

  • Bay Watcher
  • The best at being the worst at video games.
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #6 on: December 28, 2009, 01:21:27 am »

I think we should implement the Kanban system.
http://en.wikipedia.org/wiki/Kanban
The wiki article does a lousy job describing it but the basic concept is there is a marker in your stockpile that when reached will cause to production line to order just enough to keep production moving at a steady rate, I think the typical amount is 1/3 of your total supply.

I think at the very least you should be able to make it so when a supply pile goes past a point you can get a announcement about it so you yourself can take the action
Logged
Thank you based dwarf.

sweitx

  • Bay Watcher
  • Sun Berry McSunshine
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #7 on: April 14, 2010, 01:25:42 pm »

How about allow stockpile themselves to "designate" which workshop to fulfill it's order?
Or have workshop designate which stockpiles they're "responsible" to output to?

I would prefer the workshops to do the designating.  Such that a workshop can have a order similar to...
"Stockpile #25 < 75%: Brew A Drink"
And the item produce by the above order automatically generate a haul task to target stockpile (note that 75% should include items that already has a hauling request to go there).
Logged
One of the toads decided to go for a swim in the moat - presumably because he could path through the moat to my dwarves. He is not charging in, just loitering in the moat.

The toad is having a nice relaxing swim.
The goblin mounted on his back, however, is drowning.

Hyndis

  • Bay Watcher
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #8 on: April 14, 2010, 02:59:40 pm »

Standing workshop/production orders are in the eternal suggestions lists.
Logged

Samu

  • Escaped Lunatic
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #9 on: August 03, 2010, 05:02:41 am »

It would be awesome to have the bookkeeper (or possibly the bookkeeper's assistants) run around the fort, periodically taking inventory of the stockpiles and reporting back to the manager's office for new production mandates. I'd love to see that. It'd also be neat if these inventory rounds would be the basis for the (S)tocks screen report, although it could possibly be annoying if you simply can't spare a dwarf or three for the bookeeping job.
Logged
Are those new water tiles I see?! they look swell haha

mLegion

  • Bay Watcher
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #10 on: August 04, 2010, 02:16:19 pm »

I would like the ability to 'template' a stockpile, using this option gives me a cursor like the 'take from stockpile' option, but instead allows me to select a single item, the stockpile is then set to take this EXACT item type so if i for example select a clear glass statue the stockpile will be set to take clear glass statues and nothing else.
Logged

breadman

  • Bay Watcher
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #11 on: September 02, 2011, 09:33:52 am »

Let's make this easy on the programmer:

For automatic stockpile filling, let each stockpile have a setting for a single order that it can queue.  That order would be selected with the same interface as the "queue orders" screen, but without the number selection.  Then, when the bookkeeper updates stockpile records, he queues that order with a number equal to the number of empty spaces in the stockpile less the total of that order already in the queue, subject to the upper limit.

The game would not be responsible for determining whether the stockpile is in fact capable of storing any or all products of its associated order.  Users may also need to pay attention to the bin/barrel settings; allowing them could be desirable in certain situations, but would cause the stockpile to produce fewer order requests than it strictly needs.

This could produce a few more items than strictly necessary if your haulers haven't moved some of the produced items to the stockpile, but should otherwise be simple both in implementation and use.  The implementation could use an extra trick to handle multiple stockpiles with the same order, but it's not really necessary; simply looping through the stockpiles naturally uses the maximum number of empty spaces.

For bonus power, a boolean flag could toggle whether the order is queued for every empty space, or for every item in the stockpile.  The latter overlaps heavily with the [AUTO] reaction tag, but with a bit of extra control.

Edit: I originally tied the queue manipulation to the order validation job, but further reflection reveals that the bookkeeper is even better in both mechanics and flavor.

And yes, I've necro'd the thread; justified by its link from the #2 Eternal Suggestion, with #1 currently being implemented.  I have hope!
« Last Edit: April 02, 2012, 10:44:29 pm by breadman »
Logged
Quote from: Kevin Wayne, in r.g.r.n
Is a "diety" the being pictured by one of those extremely skinny aboriginal statues?

breadman

  • Bay Watcher
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #12 on: September 02, 2011, 10:34:51 am »

Maybe manager's orders should prioritize workshops that have required materials in their take-from stokpile, so the craftsdwarf's near metal bars doesn't make bolts from bones piled near another craftsdwarf's across the map. That would eliminate one of the reasons I sometimes do not use the manager and make him basically the most helpful dvarf in a big fort.

Even simpler: Each workshop should be able to disable certain tasks, so the manager never queues them to that workshop.  That would require a bit of memory/disk space and some manual setup time, but reduces the CPU time required.  It would also allow me to queue up shearing and milking jobs without getting them sent to workshops dedicated to plant processing.
Logged
Quote from: Kevin Wayne, in r.g.r.n
Is a "diety" the being pictured by one of those extremely skinny aboriginal statues?

Puzzlemaker

  • Bay Watcher
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #13 on: April 10, 2012, 01:36:50 pm »

Necroing this pertinent thread due to the ESV being worked on.  Once hauling is done, does this mean this is next, since it is #2?
Logged
The mark of the immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one.

slothen

  • Bay Watcher
    • View Profile
Re: Manager Auto-fills stockpiles
« Reply #14 on: April 10, 2012, 02:20:04 pm »

I like this idea, but options related to manager automation should be controlled per stockpile, default=off.  Sometimes extra stockpile space is a really good idea, and no one wants their general furniture stockpile filled up with wooden doors or whatever, or all their wood turned to ash.  Since people would be using the manager more, there should be an option in the workshop profile to disable certain jobs at workshop to be automatically queued (this would be time consuming to designate for forges that have many permutations of possible jobs)

However, it would be silly to do this change before the "take from" option is fixed.  We really need to be able to have one stockpile take from many, and many stockpiles take from one.

Also introducing "take from" options for workshops, and allowing/disallowing them to use non-stockpiled goods or allowing/disallowing use of goods in other stockpiles.... Brilliant.
Logged
While adding magma to anything will make it dwarfy, adding the word "magma" to your post does not necessarily make it funny.
Thoughts on water
MILITARY: squad, uniform, training
"DF doesn't mold players into its image - DF merely selects those who were always ready for DF." -NW_Kohaku
Pages: [1] 2