Stockpile Mechanic Mod Request

Started by Ospish, November 23, 2017, 02:27:55 PM

Previous topic - Next topic

Ospish

Hi to all! Yesterday I found this post: https://ludeon.com/forums/index.php?topic=12453.15
The topic of this post is "What is up with the stockpile mechanic?", about current stockpiling algorithm resulting in putting things in the stockpile entirely at random. This problem buggers me too.
In that post I linked Tynan said "It was actually a code optimization", But I think complete chaos is not like any human would arrange a stockpile.
Any sane person would make tidy and effective stockpiles around the entrance instead.
I know about a workaround with multiple little stockpiles row by row, or elsewise, but I don't think it's a right solution.
Tynan wanted to evade wasteful "cell to cell" loop in seeking the target cell.
So I'd like to ask opinion about one way to do that.
For example, if we were to create some sort of mapping for a stockpile according to distance from the door.
And then when a pawn looks for a target cell, algorithm checks one (central/random?) cell in each row, instead of whole load.
It could somewhat optimize the process and doesn't look very difficult.
So what else I want to ask the modding community is how difficult would be the code for such algorithm and implement it into a mod?

kaptain_kavern

#1
Mod "Stockpile merger" by Fluffy as solved any problems I had with stockpiles mechanics

http://steamcommunity.com/sharedfiles/filedetails/?id=857164561

Ospish

I use it as well, and it's been a great help, step in the right direction compared to vanilla.
But it's still a great waste of time to distribute items wrong and then redistribute them right like that.
I've just wondered if there is a more effective solution...