Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Supply-Chain Management: "Take Excess From"  (Read 782 times)

solsword

  • Escaped Lunatic
    • View Profile
Supply-Chain Management: "Take Excess From"
« on: November 24, 2014, 10:19:03 pm »

Having just run my first 200-dwarf fort and with one now climbing around 100, I've been getting into more late-game stuff and thinking about supply chain management. I know that there have been lots of related suggestions and I'm looking forward to the hinted at custom-automated-jobs that may be coming soon. I've got another suggestion to throw on the pile though: a "take excess from" stockpile link.

In terms of the code, it would work like this: if a full stockpile has any "take excess from" links pointing to it from non-empty stockpiles, it will generate hauling jobs as it normally would, but the items get hauled to one of the excess piles.

The point of adding this would be that it's a way to reserve a certain quantity of stuff for particular uses. Say for example you've captured and tamed several cave crocodiles and pastured them in your dining room: they'll need a regular meat/fish supply for retraining otherwise great fun might be had. But if you're also in the habit of queueing up regular patches of "Cook Lavish Meal (30)" via the manager in order to use up flour and excess plump helmets, there's no easy way to prevent running out of meat and fish besides picking a particular type of meat/fish in the kitchen menu and designate it as non-cooking (but of course your dwarves might eat it raw anyways). Enter the "take excess from" link: simply designate one or more food stockpiles that give to your kitchen(s), and set these as "take excess from" a reserve stockpile, as well as setting them to "take only from links." Now your dwarves will only cook food as long as the reserve stockpile is full: otherwise there won't be any food items in the overflow stockpiles that you set to give to the kitchens.

Obviously this idea of a "reserve" stockpile has many, many appplications in pretty much every industry, especially industries like gem cutting/setting where the easiest way to manage the industry involves using up all available supplies. While it's true that strategic reserves can be currently created via forbidding items, this is a time-consuming and micromanagement-heavy process, and it has to be done after the items are already created, as opposed to being set up as part of a supply chain that can dynamically handle input items.

I feel I've rambled on enough at this point, so I'll stop here, but I'm interested in feedback from the community: would other people like this feature? Are there other presumably-simple-to-implement supply-chain focused quality-of-life improvements that people have in mind (besides those on the eternal voting thread)?
Logged

Aranador

  • Bay Watcher
    • View Profile
Re: Supply-Chain Management: "Take Excess From"
« Reply #1 on: November 25, 2014, 02:16:30 am »

Here is what you need to do:

Make your 'excess' stockpile, have it take from anywhere.  For bonus points, have it quantum stockpile

Now create your reserve piles.  Have them take from the excess pile (or the quantum pile if you are using it).  Do not use quantum piling here.

Have your various industries only take from their own piles, that are fed only from the excess pile.

Voila - your industries will use their reserve, replenishing from the excess, until they've used up all their own and all the excess, but never touch the reserves of other industries.
Logged

Reelya

  • Bay Watcher
    • View Profile
Re: Supply-Chain Management: "Take Excess From"
« Reply #2 on: November 25, 2014, 06:36:33 am »

Adding to what Aranador said, someone worked out a really great cooking system to force use of specific ingredients (which is great if you want 1 solid food and 3 liquid/non-solid foods per meal). this can help streamline micro-management of which ingredients get used in cooking, in which proportions. No forbidding needed, and you can quickly switch allowed ingredients on the fly.

you set up each kitchen to take from 1 "solid food" stockpile of 1 square exactly, which you only set it to accept your allowed foods. Also link the kitchen to a stockpile that has whichever "filler" ingredients you like (this can also be multiple small stockpiles next to the kitchen to force meal combos, but that is more hauling jobs for the workers and more fiddly). When the cook starts cooking a lavish meal, he will look for a solid ingredient first, and there is only 1 item available, so he takes that. After that, he looks for 3 more ingredients which may be solid or liquid. Since the 1x1 solid food stockpile almost certainly won't have been refilled yet, he will take 3 ingredients from your designated "filler" stockpile(s) which are near the kitchen. While he's cooking, haulers should have refilled his 1x1 stockpile for the next meal.

Here's an idea for max. efficiency: force cooking of plump helmet seeds as the solid ingredient, and plump helmet wine x 3 as the liquid ingredient. This will use up some excess seeds (they don't stack past 200 anyway so potential food is thrown away otherwise), and the entire system should be 100% self-sustaining. I'll have to test this though, I know i can ban barrels from the seed input stockpile, but not sure if i can ban bags.
« Last Edit: November 25, 2014, 06:55:46 am by Reelya »
Logged

solsword

  • Escaped Lunatic
    • View Profile
Re: Supply-Chain Management: "Take Excess From"
« Reply #3 on: November 25, 2014, 03:41:22 pm »

While a working reserve can be created in this way, it requires that you completely link up your entire supply chain for all industries that use any reserved material. For example, if I wanted to make rock crafts out of "excess" stone, I'd also have to set up linked supply piles for my masonry workshops, mechanics workshops, and any craftsdwarf workshops that I want to produce other crafts like pots. With the "take excess from" link, I'd just have to make two links: one from my reserve stockpile (can be any existing stone stockpile really) to the excess pile for stone crafts and another from that pile to the craftsdwarf workshop where I want to queue up crafts tasks. The rest of my stone-using industries aren't affected at all, and there's also fewer hauling jobs, because there's no need for a separate distribution pile for each industry.

Controlling the size of the reserve stockpile in a take-excess-from system also provides a simple way of indireclty prioritizing jobs: by linking a workshop to take from a "take-excess-from" pile, you're effectively conditiononing jobs at that workshop on having a certain amount of raw materials, e.g., "don't make any wood crafts unless I have more than 20 wood" is easy to implement. With the currently working "excess pile feeds industry piles" system suggested above, I don't think there's a way to do this, because there's no way to prioritize the order in which the industry piles take from the master pile. You can approximate by setting the master pile to also give to priority workshops directly, but I'd guess most stuff would still get moved to the industry stockpiles as only when a worshop job was started would things be taken from the master pile directly, while hauling jobs from the master pile to the industry piles would be constant.

The point of a "take-excess-from" link is not just an easy way to implement reserves, it's essentially like adding another logical operation to the stockpiling language, and it's an operation that in some usages can't be conveniently approximated by arrangements of existing "take-from" links (although sometimes it can be approximated as Aranador pointed out).
Logged

Reelya

  • Bay Watcher
    • View Profile
Re: Supply-Chain Management: "Take Excess From"
« Reply #4 on: November 25, 2014, 04:58:33 pm »

Quote
While a working reserve can be created in this way, it requires that you completely link up your entire supply chain for all industries that use any reserved material.

No it doesn't actually. Or it does, but in the sense of only needing links in the exact same circumstances as your system. Arandar's set up only requires you to link up workshops which are not allowed to touch the reserve, just like your system. Workshops in both yours and Arandars set up which you don't care about whether they use the reserve don't have to be linked at all.

In your system it is required to link every workshop that isn't allowed to use the reserve material to the excess stockpile. e.g. if you create a 5x5 meat stockpile that feeds overflow to the "excess" stockpile, you need to link ALL kitchens to the excess stockpile to prevent them considering using the reserve. Though this still doesn't stop dwarves from eating the meat/fish themselves.

In Arandar's system, you ALSO link all kitchens to the main stockpile, and link the reserve stockpile to the main stockpile. The effect is: chefs will only ever consider meat if it's right there in the food stockpile. And meat will get priority assigned to refill the meat reserve. That's because stuff doesn't get hauled to workshops by haulers. If any meat from the reserve gets used up, then hauler jobs will be created ASAP to haul any meat/fish straight into the reserve. Things which are tagged for a hauler job are automatically forbidden to be used by other workers like cooks.

So, it looks like both basic set ups require the same amount of links, and only extra hauling jobs to refill the reserve if it gets emptied by legitimate uses, which by definition shouldn't be all the time.
« Last Edit: November 25, 2014, 05:11:49 pm by Reelya »
Logged