Prioritize Stockpiles

All right, I’m sort of understanding the situation better. But does this mean the concept of assigning a stockpile (or stockpile) to “gathering/collecting” zones (in our current case, farming and trapping) would work? I suppose my request is more from the user interface side of the situation, since I’d like more control of resource-gathering actions in the game. (But it sounded like it’s plausible without being too additionally intensive on processing?)

It’s probably too much to expect in the main game, but I’d even be interested in being able to physically map the route for the workers from said task area to the desired stockpile (allowing the player to avoid danger). I assume however that this would not equate to one pathfinder altogether though, since a pathfinder is connected between two specific entities (i.e. the workers following said path)?

Ultimately, I think I got your message. Stockpiles are confusing as hell and self-centered, and they could use some redefining so they’ll play a little nicer with your game and processor.

1 Like

Currently, it’s only doable if you were to explicitly mess with the stockpile filter function (i.e. instead of just looking if item X matches like it does today, it would also need to check that X isn’t in a region that was assigned to another stockpile). This could cause all sort of issues though because once a pathfinder has found an item, it checks for its validity. If it’s valid, the pathfinder returns it (and dies), if it isn’t, the pathfinder continues and ignores this item (because it was already found). There’s ways to reconsider entities, but do you want to reconsider all entities on the ground as soon as one filter changes? That could cause major disruptions in the whole PF area (because every pathfinder in every unit could, potentially, start over again from zero).

With my concept, you could do that more easily. You could define a region (region: an area, all zones are “regions”, mining stuff too) and even do stuff like “Put every third item into stockpile X, and the rest into Y”. Code-wise, you’re really free to do what you want. It would only be necessary to hook that up to a GUI, which shouldn’t be too difficult.

Correct. The algorithm of the pathfinder (A*) would allow you to do something like that (each block has a “price”, the pathfinder searches for the lowest cost route - by artificially setting the price for some tiles (the danger zone) high, the pathfinder would avoid it).

At some point, I would expect that we get more access to the pathfinder, especially for things like linking nodes (might already be limited possible, as there are ladders after all) to make conveyors/teleports/railcraft easily possible. Defining areas where there is a low penalty, or high penalty, would be in that list too. I mean, technically I suppose it’s already doable - after all, roads are favoured. What you would need would be some sort of anti road, i.e. a block that, if you walk on it, slows you down a lot. The PF would/should automatically avoid it at all costs. There’s functions around that define the ground speed of units within area X, so you only would need to abuse that. On the dark side, that would mean that if they ever should enter the zone, they would be slowed down a lot. So just having an artificial zone for the PF is nicer.

If you’re interested in how stockpiles work, I’ve discovered the AI action in a RepeatFeed. Thanks to sdee’s presentation I know fully understand how it works and a few points are a bit off, but you could get the idea.

1 Like

Hello there.
Just leaving a small idea for stockpiles.

I feel as though the community could benefit from having the ability to give certain stockpiles priority over others. Just having a number with up/down or left/right arrows [such as with crafting] and then having the citizens check the higher prioritized stockpiles for space first seems like it’d work fine. When the villagers have spare time, the last thing on their list, just after moving items into the stockpiles in the first place, would be moving things from lower priority stockpiles into higher priority stockpiles. I constantly find myself having trouble keeping enough wood near my carpenter’s house, and have to keep removing my larger wood stockpile just long enough for them to fill the nearby one, then re-creating it. The ability to move materials between the stockpiles more efficiently seems as though it would be a fine addition to the game.

Sorry ahead of time if this is a similar post to anyone else’s.
Thanks for any consideration of the idea.

1 Like

I’ve actually thought about this before and was just reminded of it again while playing, something that would be nice would be to have a chest near the farmer’s farmland that holds nothing but pumpkins, the farmer will harvest his pumpkins and put them in the containers until it’s full. however, let’s say your public diner, or your chef’s house, is far away from the farmer. someone takes the pumpkins out of the farm chest and moves them to the stockpile, a large building that holds anything and everything in large quantities. this makes room for the farmer to place more pumpkins in the chest. someone then checks if the chef has any room for food in his chest, and then takes food from the stockpile to the chef’s diner. the chef then prepares the food and places it in a chest placed in such a way that it looks like a shopkeeper’s bar - hearthlings go to that bar and “buy” their food, taking it out of the chest and moving to a table to eat.

in addition to having priority for stockpiles, it’d be a good idea to have a profession for stockpilers, whose sole purpose is to move stuff around, making it so the other hearthlings don’t have to look for wood or food, and can simply go to one spot to get it every time, saving time and easing up the pathfinding. the stockpilers will move stuff based on priority, moving materials from the farm to the stockpile to the chef’s diner, or from the woodcutter’s camp to the stockpile to the carpenter, or even to the site of a new building to be constructed. This allows the chef to constantly be making food and the carpenter to constantly be crafting and the workers to constantly be building by designating someone as the organizer.

a later addition could be allowing hearthlings to have different priorities for certain stockpiles - the farmer’s highest priority for placing pumpkins should be the pumpkin chest, and so he will place it there as soon as he harvests it, allowing him to return back to farming. that should be his highest priority. however, since the farmer doesn’t need the pumpkin, that chest would be the lowest priority for the stockpiler, while the stockpile would be the middle and the diner would be the highest. likewise, if the farmer is looking for food, his pumpkin chest should be low, while the bar at the diner should be high, allowing the farmer to benefit from better food, should the player wish to waste a bit of efficiency in favour of the farmer needing to eat less often, or higher morale. so while the farmer’s “placing” priority would be his pumpkin chest, his “eating” priority would be the diner’s food chest.

EDIT: so after reading the merged topic, I feel I should bring something up.

I assumed that the pathfinder was completely unrelated to the stockpile and the items. the item didn’t look for a stockpile, and the stockpile didn’t look for items. rather, it was left unnoticed entirely until a hearthling picked it up. The hearthling then decides “hmm, do I want to use this block of wood for something, or do I want to put it away?”, and as it is right not, prioritizes using it over storing it. which is why a busy town is messy because no one ever puts anything away, ever. which is why I feel there should be a job whose sole purpose is putting things away, as not only does it make the workflow of everyone easier, it cleans up the town, as no one cleans the town unless they aren’t doing anything else right now.

in other words, I thought that it was the hearthlings pathfinder which decided where objects should go. after all, it’s the hearthling that has to carry it, and the distance isn’t from the block, but rather the hearthling (if 2 stockpiles have 8 tiles of empty space between them and the block is on tile 5, stockpile 2 is closer. but if the hearthling picks up the block from tile 4, stockpile 1 is closer).

while this means that the pathfinder will come up every time the hearthling decides to put stuff away, there are generally less hearthlings stocking piles than there are stockpiles, and less stockpiles than there are items, and hearthlings stock piles only every so often as it is. when no one is putting anything away, I’d rather not have my system bogged down and lagging because the stockpiles have brains and are fighting over who gets what. by having a set stockpiler pick up some wood that’s near each other until his backpack is full and then going “oh, my pack is full. where do I put this?” and from there “which path would be the fastest from here to there”, this would speed up the process drastically, and only call up the pathfinder when it’s needed, and not when it’s not.

I get that stockpiles find entities and then claim them so that when the hearthling picks it up, it doesn’t have to think about where it goes, and simply puts it where it belongs. however, as was stated before, every time you change the filter, every single stockpile must start over from 0. when you’re setting up a bunch of stockpiles (which we will be doing now that there are crates and chests), the stockpiles will constantly be recalculating over and over once the stockpiles are set up (once when the crate is placed, and one for every single time you change the filter in the chest, which would be every click, [if you want resources and wealth but not food, decorations, or gear, that’s 4 more times the stockpiles must recalculate], unless you change the settings while the game is paused, and even then I’m not sure if the pathfinder stops while the game is paused). that’s a lot of pathfinder calls that are utterly wasted because no sorting is done by the hearthlings while the pathfinders recalculate 40 times (assuming you place 8 small crates in a cube and change each one with 4 clicks, that’s 5 recalculations per crate). switching up the pathfinder to hearthling-focused will allow the pathfinder to only be called when the hearthling is putting the stuff away, and only deals with what is in the hearthling’s pack. what’s more, by doing this you can allow all hearthlings to have a basic pathfinder (what stockpile is close, which stockpile do I have a higher priority towards) but give the “stockpiler” job a special pathfinder whose job is to search the stockpiles and decide where the materials should go. if giving hearthlings priority settings, the pathfinder for normal hearthlings can even be avoided entirely, by forcing the farmer to ONLY drop is crops in certain crates, and ONLY grabbing food from the crates in the diner. if and only if there is no food in the diner/the crop crates are all full, will the pathfinder be brought up in full, as the hearthling looks for a place to put his crops or a place that has food. then the only hearthlings that have active pathfinders would be the stockpiler.

sorry if I’m rambling.

1 Like

Long time lurker… first time poster…

So, the other day i was feeling like a little special time and went into my wife’s underwear drawer to see what to wear… Oh wait! wrong community…!

So, I am loving this game so far, great in what it offers and so much more potential that can be layered on. One of the challenges I foresee however is managing larger towns and more complex production and consumption chains. I would like to suggest the following to aide the game play…

  • addition of storage spaces that are specifically for consumption of the villagers either for survival and living or for production. Let call these “markets” for lack of a better name for now. These “nodes” will have the same selection list as the current storage spaces and chests, but they will be serviced by a new job role … lets call it a Vendor for now. The “market” node can be on the ground or in a crate.
  • intro of Vendor job role - supported by a Cart that is made either by the carpenter or perhaps the blacksmith.The cart will have 20 slots (or whatever)
  • the Vendor will look at the allowed items in the “market” nodes and then scurry around the other storage spaces to collect to keep the stock levels up at the “market”.
  • As an example this will allow facilitate primary producers (farmers) feeding secondary producers (cooks) who may in turn feed immediate consumers (cooked food for peeps near the living areas of a town). This can also support other complex production chains. Further, this allows production of one type of material to be at a farther distance from where it is “used” so that crafters and villagers don’t have to travel longer distances to get what is needed.
  • you can augment the “market” nodes with either 1. some interface to specify “keep x units of Y resource”. OR, 2. some background process that looks at consumption rates and tries to be dynamic. The first is easier, the second allows the Vendor to be dynamic in maintaining resource stock levels across a village as their needs rise a fall.
  • Further, this will allow storage areas to be designated near a far placed mine site for example, the villagers will keep mining while the vendor sees the need for the resource in a “market” node and will go the distance to effectively collect the resource. this greatly facilitates
  • you may even want to have a designation of the regular storage sites with “long term” and “short term”. The short term sites will drive the vendors to empty the sites where possible (againts other tasks) and put the resources into more central (long term) sites.
  • Finally, you can add some weighting to the Vendor efficiency when travelling on roads (or that they will exclusively use roads), giving the road even functionality and not just visual benefit.

Example 1. Create a farming nexus… farms and homes for the farmers in a locale with a food/water “market node”. They can produce efficiently. The food they produce is placed in a close by stroage site and the Vendors will draw from this to bring it to the town center where there is a “market” that feed the Cooks production who works right beside the “tavern” where the villager eat. The vendor draws some from the Cooks production and brings it to the “market” node near the farming center to keep the farmers feed and happy. If they implement things like tools wearing out, then the Vendor will also be bringing fresh tools to the “market” node by the farmers.

Example 2. They have implemented ranged combat and you have made a tower/wall set up to defend your space. putting beds and a small “market” node will keep the Archers in their towers and not scurrying off to get food, arrows, water, etc… and leaving their posts un-attended.

In short EFFICIENCY… especially as villages grow into more complex towns and distance becomes a factor in keeping villager feed and/or near where they work. but more importantly it will add an in-game method to take out the “un-fun” aspect of micro-managing many many villagers as a village grows. May game developers invest heavily in squishing out “un-fun” game mechanics.

Thanks for reading

although this uses different wordings, the topic you’re bringing up has already been brought up a few times

unless this is a different topic, this topic will likely be merged with that one.

oh, and welcome to the forums

Thanks for pointing the similarity out… agree with that thread that the movement of resources to where they are needed is a good thing…

I would like to still highlight the job of a Vendor (or whatever you want to call it) who’s job it is to do the relocation of the resources to locations of demand as a key thing - even if already expressed in other way… in my mind this role (or like) is a bit of a pivotal thing…

Cheers!

This will come in handy with the new update!!

Came here to post that too. It would make defense outposts more viable if we could have a high priority stockpile or crate for food that had to be filled before any stockpile more central to the town. That would guarantee food was around for defending groups.

Resurrecting this. The more I play the more I feel this needs to be in the game.