COMPLETE REWORK
The gist is in steam description, but I thought I’d explain here how it works in a bit more detail. And, as always, I’m keen to see people’s experiences and how much of a difference it makes. And whether it hurts performance significantly.
Method
Each food gets assigned a priority. This is the percentage of that food in the entire settlement which is currently below 50% health and has less than 12 months of shelf life left. (Both are needed because otherwise short lived food like meat would always be at 100% priority, or long-lived food like preserves would have a high priority even when they still have years of shelf life left.) This priority is then modified by a random number between 0 and 100. This means that a food that’s all nearly spoilt will always be high priority than one which is at full health, but in the middle there’s a small chance for the order to sometimes be reversed. This prevents the system from being too rigid. When it comes to eating food, stocking markets, or restocking shelters, villagers then try to have an equal amount of each of the 5 food types; within each food type they follow the priority given above.
Two things to note:
- This doesn’t change which buildings villagers restock from, only what they’ll pick from that storage building.
- The food priority depends on the village-wide spoilage percentage of a food, which may not be exactly the same as the spoilage ratio in the building that the villager is visiting.
I can’t feasibly get around these given the current architecture of the logistics system. And, anyway, doing so might make villagers too much of an omniscient hive mind. Still, the effects of these changes are significant IMO.
Impact
I played the same save file on autopilot for 3 years, in one case with default eating / stocking priority, and in the latter with the mod active. It takes a few years for the changes to kick in (because taking food from cellar → market → house → villager → eaten) takes a while, but the drop in spoilage in Y48 is significant.
That last screenshot is from a playtest where the mod did not include a fix to the barrel bug (which is in the version uploaded to steam). Including that fix, and playing a bit more, including adapting my farming industry to the changes, and the changes are even more visible:
They’re actually eating (most of) their greens! And total vegetable spoilage is almost 0 (because the roots are getting pickled, the beans end up being half-spoilt first, and so the villagers rush to consume those rather than the pickles).
The slight spike in spoilage in Y52 is when I had a shortage of glass for preservation - that it’s visible shows that even with the mod you have to take care of your food. You’ll notice that my food stockpiles are almost entirely Veg Preserves, which are sitting safely in cellars while the fresh veg are being eaten. Cheese and Fruit Preserves aren’t stored in such huge quantities despite also having a long life, because villagers are still prioritising eating from the 5 different food types.
Works too well?
While I haven't played a full length game from the start to see how these changes play out as a whole, I think there's a real risk that it makes maintaining food stockpiles too easy. The aim of the mod was never to lower the difficulty, but to remove the frustration that comes from villagers making silly choices which render some types of food unviable. To remedy this, the mod includes an option (in a config file, not enabled by default) to globally reduce the lifetime of all foods - an inverse Ice of Amatok of sorts. I think setting it at around -10 or -20% is likely to keep the "feel" about right.
As always, impressions / feedback / bug reports are highly welcome. The logistics part of the game is huge, complex, and prone to unexpected emergent behaviour, so there could be some unintended consequences (either good or bad). If you come across any, or see a change in the food consumption pattern in your village, please do share!