Page 1 of 1

Bot should choose closest box when supplying player

Posted: Tue Jan 24, 2017 5:34 pm
by Mithaldu
I tried searching for previous discussion of this, but really wasn't able to find anything specific about this, and all i got on IRC was "bots ignore distances".

I suspect bots don't consider distances as a performance optimization, which would be quite sensible.

However when relying on bots to fill logistics slots, it's always really painful when entering/leaving big logistics areas, and the bots decide to really go aaaall the way across the map to bring a bunch of belts to the player, making them wait for a minute or two.

If bots in general can for some reason not be made to take distances into account, maybe there's some space for making the player logistics slots a special case where they do select the nearest chest?

Re: Bot should choose closest box when supplying player

Posted: Tue Jan 24, 2017 6:39 pm
by Rseding91
Robots already do pick the closest chest to the player when delivering items.

Re: Bot should choose closest box when supplying player

Posted: Tue Jan 24, 2017 6:55 pm
by Mithaldu
I am sorry. You are entirely right. I was misinformed in IRC and had overlooked an active provider chest in my tests. (It was a little hard to find looking manually.)

Does the current code always check distance or only for player supplying?

Re: Bot should choose closest box when supplying player

Posted: Tue Jan 24, 2017 7:40 pm
by Rseding91
Mithaldu wrote:I am sorry. You are entirely right. I was misinformed in IRC and had overlooked an active provider chest in my tests. (It was a little hard to find looking manually.)

Does the current code always check distance or only for player supplying?
Always.

Re: Bot should choose closest box when supplying player

Posted: Tue Jan 24, 2017 7:44 pm
by Mithaldu
Excellent, thank you. :D

Re: Bot should choose closest box when supplying player

Posted: Wed Jan 25, 2017 4:19 pm
by raidho36
Bots don't just "don't consider distance", in my experience they deliberately choose the farthest possible object they could go for that would satisfy your order. If you order to build something, they'll first build the farthest possible objects. If you order to destroy, they'll first destroy farthest possible objects.

Clearly there is a list of targets for them to pick from. Simply reversing the list will do the trick because now the closest objects are highest priority.

Re: Bot should choose closest box when supplying player

Posted: Wed Jan 25, 2017 5:17 pm
by Mithaldu
That's construction, and if it is like that, should be a different thread. :)

Re: Bot should choose closest box when supplying player

Posted: Wed Jan 25, 2017 9:49 pm
by Rseding91
raidho36 wrote:Bots don't just "don't consider distance", in my experience they deliberately choose the farthest possible object they could go for that would satisfy your order. If you order to build something, they'll first build the farthest possible objects. If you order to destroy, they'll first destroy farthest possible objects.

Clearly there is a list of targets for them to pick from. Simply reversing the list will do the trick because now the closest objects are highest priority.
No they don't.

Re: Bot should choose closest box when supplying player

Posted: Thu Feb 16, 2017 4:24 pm
by hansson
Rseding91 wrote:
Mithaldu wrote:I am sorry. You are entirely right. I was misinformed in IRC and had overlooked an active provider chest in my tests. (It was a little hard to find looking manually.)

Does the current code always check distance or only for player supplying?
Always.
If this is the expected behavior, then how is this gif explained?: https://gfycat.com/HatefulUnlawfulErmine
(Credit: https://www.reddit.com/r/factorio/comme ... s/ddtc2lw/)
Clearly the closest chest to the active provider is not being chosen, is there a misunderstanding here? I would expect the storage chest closest to the active provider to be chosen, not the one further away. Or is the behavior related to distance only relevant for requester chests and player supply?

Re: Bot should choose closest box when supplying player

Posted: Thu Feb 16, 2017 4:31 pm
by Mithaldu
Rseding91 was talking about the case where a bot is trying to satisfy a request for an item to be brought.

The gif is showing an item being sent away into the logistics network, which follows different rules meant to minimize chances of there being no empty slot in the network to deliver something to.