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.