[0.15] Bot dropoff algorithm very inefficient; moddable?
Posted: Tue Sep 05, 2017 9:58 am
TL;DR: The vanilla bot item dropoff algorithm is frustratingly inefficient (trashing and deconstruction); robots travel across large bases for minutes, instead of picking close chests in a matter of seconds, making bot operations very inefficient - unnecessarily so. Can the algorithm for item dropoff be modded?
Detail:
Hi everyone! First of all: Factorio is the most awesome game ever created! And I'm addicted to it - not so awesome
Anyway, there's many things in vanilla I'd change, mostly related to UI and algorithms. Today I want to ask about how robots do item dropoff. Many things in vanilla "could be improved", up to personal preferences of course, but in this case, I really don't understand why behaviour is the way it is, because the obvious algorithm would actually be more useful and simpler.
Concretely, in large bases, a better approach would be to let item dropoff happen simply to the closest storage chest that still has space. This may create a "mess" in terms of mixing items, but keeping order in storage chests has no practical value - robots dropping off items as quickly as possible however does plenty.
Of course, more sophisticated algorithms can be thought of that achieve a good balance of both, order and efficiency. But then things get complicated - and subjective again. (See below.)
In the meantime, I'm asking: Can vanilla behaviour at least be modded? I.e. make robots always pick the closest chest for dropoff that still has space?
More Detail (one of many possible solutions; just sketched):
Robots might consider different dropoff destinations, properly weighted:
(A) Chests already containing the same item.
(B) Chests being empty.
(C) Chests already containing one different item.
(D) Chests already containing four different items.
Each of these categories would be weighted (adjustable?), for example: (A) 1 (B) 2 (C) 4 (D) 8
Now, the distance to closest chest in each category is multiplied by the category weight, to create a "weighted distance", then the robot drops off into the chest that is closest according to "weighted distance".
As an illustration: Assume a robot has two possible chests for dropoff, one in category B and one in category D. Now, according to the above given weights, a robot would prefer D over B if and only if B is more than four times as far away than D.
Thanks for your consideration!
Detail:
Hi everyone! First of all: Factorio is the most awesome game ever created! And I'm addicted to it - not so awesome
Anyway, there's many things in vanilla I'd change, mostly related to UI and algorithms. Today I want to ask about how robots do item dropoff. Many things in vanilla "could be improved", up to personal preferences of course, but in this case, I really don't understand why behaviour is the way it is, because the obvious algorithm would actually be more useful and simpler.
Concretely, in large bases, a better approach would be to let item dropoff happen simply to the closest storage chest that still has space. This may create a "mess" in terms of mixing items, but keeping order in storage chests has no practical value - robots dropping off items as quickly as possible however does plenty.
Of course, more sophisticated algorithms can be thought of that achieve a good balance of both, order and efficiency. But then things get complicated - and subjective again. (See below.)
In the meantime, I'm asking: Can vanilla behaviour at least be modded? I.e. make robots always pick the closest chest for dropoff that still has space?
More Detail (one of many possible solutions; just sketched):
Robots might consider different dropoff destinations, properly weighted:
(A) Chests already containing the same item.
(B) Chests being empty.
(C) Chests already containing one different item.
(D) Chests already containing four different items.
Each of these categories would be weighted (adjustable?), for example: (A) 1 (B) 2 (C) 4 (D) 8
Now, the distance to closest chest in each category is multiplied by the category weight, to create a "weighted distance", then the robot drops off into the chest that is closest according to "weighted distance".
As an illustration: Assume a robot has two possible chests for dropoff, one in category B and one in category D. Now, according to the above given weights, a robot would prefer D over B if and only if B is more than four times as far away than D.
Thanks for your consideration!