Redoing the Hauling System

Started by MikeLemmer, January 14, 2017, 08:30:25 PM

Previous topic - Next topic

MikeLemmer

A lot of late-game problems with colony management are related to the current Hauling system. Currently, haulers can easily get occupied hauling just 5-10 berries across the base every time someone cooks a single meal, ignoring harvested wood, crops, and drop-pod items disintegrating out in the open. Here's my proposal for making the Hauling system more efficient with minimal extra complexity.

Behind-the-Scenes: Change Hauling Priorities

Currently, hauling priority is based solely on the colonist's distance to the item-to-be-hauled. This means haulers will often get occupied items back & forth across the base while items outside the base walls decay. I would change hauling priority to be based on 3 criteria:


  • Spoiling items get top priority.
  • Deteriorating items get second priority, behind spoiling items.
  • Then which item to haul is determined by proximity.

All spoiling items will be hauled first, followed by all deteriorating items, and only then will stable (non-spoiling/non-deteriorating) items be hauled. This is to reduce how much manual hauling assignment is needed to stockpile items before they spoil/deteriorate.

Two New Types of Stockpiles

The biggest change is the addition of 2 new types of stockpiles:

  • Gather Stockpiles: Gathers together multiple small quantities of items into larger stacks for more efficient transportation.
  • Supply Stockpiles: Stores stacks of items that are gradually depleted, such as ingredients for cooking, meals for the dining room, and kibble for animals. Only requests more items once it drops below a certain amount.

Here's a rough flowchart of how it would work:



Gather Stockpiles: The Technical Details
Gather stockpiles are a special type of stockpile that have no priority. They are compared to other stockpiles based solely on distance. They also only accept items that aren't already in a stockpile.

Once there's a full stack of items on a Gather Stockpile, or X hours have passed since the first item in a stack was hauled onto it, that stack will be hauled to a standard stockpile. The X number of hours can be set via slider, replacing the Priority setting. This is to give haulers time to gather a large stack before it's moved.

Gather Stockpiles only hold items temporarily, either to put them someplace safe for future hauling, or build large stacks before hauling them.



Here, a Gathering Stockpile is used to collect wood, berries, stones, and animal corpses into large stacks for more efficient transportation later. You could set a roof above it to keep wood from deteriorating, or get fancy and set it in a small freezer to keep food from spoiling while it awaits transport.

Other uses include:

  • Set one up next to a battlefield to quickly get looted weapons/apparel underneath a roof before they deteriorate.
  • Set one up next to fields outside your colony to temporarily store harvested crops without hauling them all the way back to your colony.
  • Set one up next to a stove or drug lab to stack up meals/drugs until you have a full stack ready to transport to your stockpiles.

Supply Stockpiles: The Technical Details
Supply stockpiles have no priority. Instead, they automatically request more items once they drop below a certain threshold. This % threshold can be set via slider, replacing the Priority setting.

For example, you can make a 2-tile Supply Stockpile for meals in your dining room and set it to request more items once it drops below 50% capacity. Once it drops below 10 (out of 20) meals, it will automatically request another stack of meals. This is more efficient than a high-priority standard Stockpile, which would immediately request more meals the moment a single meal is eaten.

Other uses include:

  • Set up Supply Stockpiles next to production tables to provide ingredients.
  • Supply Stockpiles for medkits in Hospital Rooms.
  • Artillery shell Supply Stockpiles for mortars.



Here, all 3 types of stockpiles are used to make a hauling-efficient kitchen. Two 1-tile Supply Stockpiles (one for meat, one for veggies) are set adjacent to the stove with a 33% threshold. A Gather Stockpile for meals with a 4-hr timer is also set adjacent to the stove. A large standard Stockpile is set in the freezer. The cook delivers his meals to the Gather Stockpile because it's closer than the freezer Stockpile; once the Gather Stockpile has a full stack of 10 meals or 4 hours have passed, those meals are hauled to the freezer. The cook takes his ingredients from the meat & veggie Supply Stockpiles next to the stove; they don't request more items until their stack has dropped below 25 items (33% quantity). This keeps the cooking running steadily without requesting a hauler every time the chef cooks something.

I've also set up Supply Stockpiles for the dining room and dog kennel. The dining room has a 2-tile meal Supply Stockpile with a 50% threshold; the kennel has a 4-tile kibble Supply Stockpile with a 75% threshold. These thresholds ensure only full stacks of supplies are hauled to them.

Anonymoose


b0rsuk

You can simulate gathering stockpiles by having a lower priority stockpile further away. The problem is they will take stuff from the actual stockpile to gathering stockpile, so you need to manually change priorities in stockpiles. Or a new feature.

When does a gathering stockpile take priority over a normal stockpile ? When it's closer ?

I think this rule would be more intuitive:
* stuff is taken from GATHERING stockpile once a stack is FULL (or time passes)
* stuff is taken to GATHERING stockpile if it's closer than normal stockpile

* stuff is added to SUPPLY stockpile once it's EMPTY (it has an empty square).

How about just modifying hoppers to work like SUPPLY stockpile and be done with it ?

MikeLemmer

Quote from: b0rsuk on January 15, 2017, 02:16:04 AM
You can simulate gathering stockpiles by having a lower priority stockpile further away. The problem is they will take stuff from the actual stockpile to gathering stockpile, so you need to manually change priorities in stockpiles. Or a new feature.

Or forbid the items in your current stockpiles so colonists can't carry them. I suppose you could just restrict a colonist from reaching a higher-priority stockpile; I haven't tried it yet, and it seems like a messy, manual-intensive way of accomplishing it.

QuoteWhen does a gathering stockpile take priority over a normal stockpile ? When it's closer ?

Yes. If the hauled item currently isn't in a stockpile, it goes to the closest gathering stockpile or high-priority normal stockpile. Items already in stockpiles aren't taken to gathering stockpiles.

QuoteI think this rule would be more intuitive:
* stuff is taken from GATHERING stockpile once a stack is FULL (or time passes)
* stuff is taken to GATHERING stockpile if it's closer than normal stockpile

Only if it's not already in a stockpile, else you'd get circumstances where an item is shuttled back & forth between two Gathering Stockpiles.

Quote* stuff is added to SUPPLY stockpile once it's EMPTY (it has an empty square).

I also considered this, but that would mean that 1-tile Supply Stockpiles would be temporarily empty mid-use, which could lead to unusual behavior like a cook marching halfway across the map for veggies whenever the stockpile runs out. Refilling at 25-33% capacity leads to much smoother work.

QuoteHow about just modifying hoppers to work like SUPPLY stockpile and be done with it?

Also considered it, but uses up extra steel and people may want multi-tile Supply Stockpiles. (For instance, a 3-tile meal Supply Stockpile for a large colony.)

bhavv

Create a 'gathering' stockpile by putting a normal unrestricted stockpile near harvest areas. After the harvest and collection are done, forbid the items in the gathering stockpile and they will get moved to another that allows them.

MikeLemmer

Quote from: bhavv on January 15, 2017, 09:08:31 PM
Create a 'gathering' stockpile by putting a normal unrestricted stockpile near harvest areas. After the harvest and collection are done, forbid the items in the gathering stockpile and they will get moved to another that allows them.

Feasible, but requires memorizing the highest priority of your other stockpiles and matching it. And God help you if your highest priority for different item types differs.

talar1408

#6
There are mods that already implement most of these features.

Quote from: MikeLemmer on January 14, 2017, 08:30:25 PM

  • Spoiling items get top priority.
  • Deteriorating items get second priority, behind spoiling items.
  • Then which item to haul is determined by proximity.
Can't find a link right now but I think it was something along lines of "Enhanced Hauling".

Supply stockpiles % to haul is in mod "Hauling Hysteresis" https://ludeon.com/forums/index.php?topic=26958.0 .

However, even with these mods there are several other major sources of hauling inefficiency in game.

First: Pawns reserve only one target stack to haul, so when your grower harvests potatoes the following happens:

  • Potatoes are spoiling and deteriorating so they get high haul priority.
  • Every hauler pawn reserves single stack (like 5 potatoes) and runs across the map for it.
  • They happily haul 5-10 potatoes each, blocking hauling workflow as long as grower is working.
(This isn't a Hauling-only problem.Same happens with building: I definitely don't need each of few tiles of wooden wall/conduit built by different constructor. They waste much more time traveling than actually working.)
Second: Pawns haul to single target pile, even if it needs only 1 item and there is empty applicable stockpile on next tile for overflow.
Third: If you try to battle overflow problem by having single huge stockpile in freezer, it will end up badly fragmented (lots of partial stacks). This doesn't seem to happen when piles are reasonably small (patchwork of piles in freezer).

The only solution that really works for me is having an excess of hauling capacity provided by an army of hauling animals (at least 2-3 per colonist, whose primary job is not hauling), so that stuff gets where it needs to be despite all the inefficiencies involved.

MikeLemmer

Quote from: talar1408 on January 16, 2017, 12:54:31 AM
There are mods that already implement most of these features.

Can't find a link right now but I think it was something along lines of "Enhanced Hauling".

Supply stockpiles % to haul is in mod "Hauling Hysteresis" https://ludeon.com/forums/index.php?topic=26958.0 .

True, but since this is Early Access, I'm sticking to the vanilla game, since that's what we're supposed to be testing. Using mods to patch out the annoyances makes it hard to gauge how annoying of a problem they are.

QuoteHowever, even with these mods there are several other major sources of hauling inefficiency in game.

First: Pawns reserve only one target stack to haul, so when your grower harvests potatoes the following happens:

  • Potatoes are spoiling and deteriorating so they get high haul priority.
  • Every hauler pawn reserves single stack (like 5 potatoes) and runs across the map for it.
  • They happily haul 5-10 potatoes each, blocking hauling workflow as long as grower is working.

A problem which a Gathering stockpile near the field would help alleviate. I would also suggest tweaking the harvesting AI to stack crops, either by harvesting 3x3 squares at a time and stacking up all those crops, or hauling harvested crops to the nearest partial stack.

Swat_Raptor

I really like some of these thoughts.

I also dislike some of the inefficiency the comes with the current state of stockpiles.

the idea of having 2 types of stockpiles (with different mechanics) would be one way of dealing with some of these issues.

I had a idea which came at the problem from the other side.

My thought was wouldn't it be cool if we could create specific hauling task through a sort of bill system, rather than letting the AI create all hauling task.

the idea is that you can make a bill for a pawn to come pick up X materials once per time period (hours, days, weeks, etc) take materials from stock pile A and deliver it to stockpile B.

These Scheduled Hauling task would be the highest priority but only happen when sufficient materials are in the stock piles and when the receiving pile has a open tile, thus you could set the materials to either X number of stacks or all materials present.

it would work best between stock piles of equal priority, but in general giving us more options to control how hauling works would make it so we don't need to use higher priorities often.

b0rsuk

The approach by zones rather than bills or tasks for pawns is better, because it's less micromanagement.

Marduk

#10
There is a much simpler and more convenient way to solve all our hauling headaches by just slightly modifying the inventory\loading stuff related to the A16 caravan stuff to massively increase the "hauling output" of all pawns.
Come on, it is unrealistic and annoying that a pawn who can haul quite an amount of stuff in a caravan, or a stack of 75 steel, cannot possibly haul 25 steel and a component, or 20 berries+20 potatos at the same time.

I would imagine something rougly similar to the current "find nearby stacks of identical resource to haul too" AI, and combining it with something like a "micro caravan" AI that upon receiving a hauling job would look for items that are queued for hauling in an area, prioritizing areas with lots of queued hauling jobs and no handler, pick a weight of items from that area that the pawn can carry (the caravan mode already has carry weight handled), preferring items destined for the same or nearby stockpiles, load them, and haul them to the stockpiles to be dropped (caravan AI already has the last part i think).
As a bonus, add option for the hauler to also make use of a caravan animal he is a master of.

Due to the carry weight it won't get abuseable for hauling bricks or other crazy heavy stuff, but will greatly reduce silly "i can't carry tiny quantities of few different kinds of items at the same time" problem that is making hauling and micromanaging its issues and inefficiencies such a headache.

Thyme

Most problems are solved with Intelligent Zone Management. The supply zone can be simulated with a zone of higher priority and Hauling Hysteresis.
BUT: The Gather stockpile is a must! I want that, I need it. The sooner the better.

PS: Your suggestion of hauling priorities brings problems of its own. You can easily get one hauler per cook trapped in a supply chain that's not even working, prioritising spoiling items would enforce that.
I'm from Austria. If I offend you, it's usually inadvertently.
Snowmen army, Chemfuel Generator, Electric Stonecutting, Smelting Tweak

MikeLemmer

Quote from: Thyme on January 17, 2017, 02:33:45 AMMost problems are solved with Intelligent Zone Management. The supply zone can be simulated with a zone of higher priority and Hauling Hysteresis.

A problem that is fixed by a mod is still a problem.

QuotePS: Your suggestion of hauling priorities brings problems of its own. You can easily get one hauler per cook trapped in a supply chain that's not even working, prioritizing spoiling items would enforce that.

Not if the Cook delivers the Meals to a 2-tile Gather stockpile adjacent to him. They would have priority due to the spoiling, but the Gather stockpile's hauling delay would prevent a Hauler from moving it until there's a full stack of Meals. As for the ingredients, that would be fixed simply by treating Supply stockpiles as an endpoint for Hauling: anything that's supposed to be on it is never moved to other stockpiles. True, it's not a perfect solution, but I don't think anything short of a coding language for hauling would be.

Huh... almost makes me wish there was a Make X per Day option for production.

Swat_Raptor

Quote from: b0rsuk on January 16, 2017, 03:21:33 PM
The approach by zones rather than bills or tasks for pawns is better, because it's less micromanagement.

This isn't entirely true because if you introduce the distinction of a stockpile being a Gathering stockpile or a supply stockpile then you have to ask the question: does a stock pile have to be one or the other? or can they be both? can you filter which gathering piles feed into a particular supply stockpile or does the AI just send it where ever it can. In the end you would have to still carefully setup your stockpiles to greatly improve hauling efficiency.

Either way I agree on the basic point that it would be a welcome improvement to give the players more options to influence on how stockpiles work.

I would say that I would want options to tweak how stockpiles work but also options to tweak hauling task, why should we only want one or the other, why leave one or the entirely up to the AI.

Britnoth

Quote from: MikeLemmer on January 14, 2017, 08:30:25 PMCurrently, haulers can easily get occupied hauling just 5-10 berries across the base every time someone cooks a single meal

Stopped reading right here.

If pawns work inefficiently, it is your fault. Not the game.

It is a part of the game to learn to use the tools provided to help your pawns work more efficiently.

If you add a huge pile of AI checks to make it more efficient, you both lag the game considerably, and remove an important element in player choice and skill.