In response to discussions on the Steam forums, the stockpile handling code has been completely written this weekend. Yes, again. The new code uses the following algorithm when a colonist wants to "return a good": - first, as in the current code, check if we need to evict goods, or merge containers ("stockpile cleanup") - if no stockpile maintenance is required: - find the closest good to the colonist for each of the possible filter types ("raw", "fooddrink", "refined", etc.) - for each of these goods, find the closest point, on each stockpile that might accept this good, to the current colonist - perform breadth-first search, starting from these closest points, of the stockpile looking for a good drop-off location So colonists will now always try to minimize total distance walked, both to pick up the good, and to drop it off at a stockpile or in a container (or suitable receptacle.) This seems to finally be the thing that works correctly - i.e. if you have some resources in a far away location with a stockpile near them, colonists will finish tidying the area of the map they are currently in, using the closest stockpile to the goods that need to be put away, then slump off to the further away goods and tidy them into THAT stockpile. There is still a certain amount of cleanup to do, but I think we will see a noticeable improvement. As an added bonus, the code is also cleaner and faster. While I was at it, I also made sure the checks for "inaccessible stockpile" and "inaccessible good" were working as they should have done, which should reduce if not completely kill the occurrence of people getting stuck in a pickup-drop loop while hauling materials.
Do colonists take into account demand for an item nearby a stockpile - that is, if I have one stockpile by a farm and another nearby a kitchen, will raw food items eventually be carried to the kitchen (and then stay there)?
Nope. There is a vague ticket for having designated "input/output" stockpiles, and it could be engineered so that we tried to keep the input stockpiles full first, but I'm not tackling this until the next major revision at the earliest. (It will make logistics people very happy.)
It looks good from what I saw of it, but there is still a "paper cut" issue with this behaviour for me. Would it be expensive for colonists, on reaching the intended drop off square if it's a stockpile, to recheck the stockpile for a stack/container suitable for the item? I'm seeing cases where a colonist hauls, but before they reach the stockpile another colonist has deposited a similar item. Rather than immediately stacking, the latecomer puts the item down, takes the post-haul scatter step away, then immediately goes back to pick the item up again and stacks it on the other. As well as costing the colonist time, it looks scatterbrained of them...
I'm noticing in Revision 44 that colonists don't always go to the nearest stockpile when dealing with goods produced in places like mines. I've got a colony going on at the moment and whenever they bring up resources: * They frequently ignore the stockpile right next to the mine flagged to only receive raw resources. (They don't always ignore it, just most of the time they do) * Instead will march all the way back to the colony to drop the mined resources at another stockpile flagged to receive raw resources. * Whilst mining in a shaft, they may bring up 3 items at once in their hands, but will only even drop 1 of them. The rest end up permanently stuck to them. This will continue every time they use the mineshaft eventually leading to some number of colonists wandering around with large chunks of coal/sulphur for hands. Thing I've noticed: * The area around the mine definitely is being classified as 'Civilisation', as established on how colonists flee (or rather don't flee) when they're attacked near the mine, instead they just run around it until they die. * Mines are the main example of this, but I have seen it happen with some workshops. Produced goods will go to the main central stockpile the colony started with, rather than the one right next to the workshop. * Once a colonist has items stuck to them that they failed to drop in a stockpile, that's it. Those items are for all intents and purposes lost. If it helps replay of the R44 colony where these things were noticed. Main mine related behaviour occurs later on in the replay, general workshop stuff happens throughout.
This is exactly correct, because workshops and offices (and mines!) have not been moved over to the new stockpile code yet. So they're still doing the old, bad thing. This is because the plumbing is a little more complicated as we don't know what the item *is* when the job is executed, and the AI isn't set up to support that. I need to bolt that on somehow. This, however, is probably a totally different bug. In general mines are a little funky, so I will make a ticket in the morning. TL;DR: known, but there's a weird bug here which is new, and mines are just kinda gross.
Ah OK cool, hadn't seen mention that workshops and offices haven't been switched to the new behaviour yet. so no worries about that then it's not really a problem as such anyway just figured it seemed to be an anomaly to what was expected. On an aside, a few things come across as hitting into the "Don't know what's being output ahead of time" or "Colonists aren't set up to support xxxx behaviour" restrictions that eventually get worked around in other ways. Has there been any discussion about if long term it may be more pertinent to revisit things to allow for knowing what might be output ahead of time, or to set colonists up to support xxxx behaviour, in light of new (and future) demands to come up with something with a bit more 'wiggle room' that doesn't require so much working around? Certainly nothing immediately, but potentially a bit further down the road once the framework for all the main pieces are at least present and you've got a proper feel for what you actually have to work with and what would best tie into it all? Or are the things that impose those restrictions essentially locked down for most purposes?
If the mines issues are going to take a while (understandable) ...any chance of surface ore spawning being bumped up a bit in the meantime?