Page 1 of 1

[0.15] Bot dropoff algorithm very inefficient; moddable?

Posted: Tue Sep 05, 2017 9:58 am
by quadrium
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 :P

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!

Re: [0.15] Bot dropoff algorithm very inefficient; moddable?

Posted: Mon Sep 11, 2017 8:15 pm
by Tekky
Maybe the logistics buffer chests as described in Factorio Friday Facts #203 will solve (most of) these issues?

Re: [0.15] Bot dropoff algorithm very inefficient; moddable?

Posted: Tue Sep 12, 2017 8:51 am
by quadrium
Tekky wrote:Maybe the logistics buffer chests as described in Factorio Friday Facts #203 will solve (most of) these issues?
Thanks for replying! Buffer chests are an almost necessary extension to the system; however, I don't think they solve the issue with drop-off. The problem is that construction bots (and logistic bots when trashing) seem to try and be "smart", picking storage chests that already contain the item they want to get rid off. This causes them to travel insanely long ways across bases, when lots of empty chests would be right next to them. So, in a way, robots should be "dumber" when storing items, and just pick the closest chest. (And then, logistic bots could "restore order" if that's what the player wants.)