Page 1 of 1

Perpetual bot motion with damaged logistics item

Posted: Fri Apr 06, 2018 6:00 am
by vinnief
Setup:

* A buffer chest requests and receives enough of a single placeable item to completely fill the chest.
* For example, requesting 2,400 laser turrets.
* A storage chest or passive provider chest exists in the same logistics zone with some of the same item
* One of the storage slots in the buffer chest contains a damaged version of the item

Result:

Logistics bots will perpetually try to move the undamaged item from the storage chest or passive provider chest into the buffer chest to fulfill the request. They will fail to insert the item, and then execute the item storage algorithm (put it back in a storage or passive provider chest). This process repeats until the damaged item is removed.

This screenshot shows the scenario:
bug.png
bug.png (987.11 KiB) Viewed 2054 times

Re: Perpetual bot motion with damaged logistics item

Posted: Fri Apr 06, 2018 9:05 am
by Loewchen
Simply request less.

Re: Perpetual bot motion with damaged logistics item

Posted: Fri Apr 06, 2018 1:28 pm
by vinnief
Loewchen wrote:Simply request less.
Yes, of course that works but is also obvious. I'm bringing this up because it is a bug which could lead to a larger issue. Currently bots do not pick up and deliver items to containers which cannot store the item, either because it already has enough of that item or because the container has no free slots. Slots holding damaged items should not count as free, as this behavior is unexpected and could counter-intuitively make bots unavailable as they continually try and fail to deliver the items.

I think it is worth fixing if it doesn't impact performance or create new problems.

Re: Perpetual bot motion with damaged logistics item

Posted: Fri Apr 06, 2018 7:32 pm
by TruePikachu
I think the underlying issue is that, when considering items like repair packs, tools, and science, there's such a thing as e.g. 0.5 steel axes. When you merge together two stacks, e.g. 1.4 steel axes and 1.3 steel axes, you get a stack of 2.7 steel axes; effectively, the 0.4 and 0.3 axes merge together into a single axe. When considering placables, however, you don't have partial objects; a 40% health turret and a 60% health turret, when merged into a single stack, average their health into a stack of two 50% health turrets.

The behaviour that bots exhibit when "brim-filling" a chest is correct when dealing with the partial-items; if a chest "has room" for 0.3 more steel axes, and a bot brings a couple steel axes over to put in the chest, 0.7 steel axes will go into the chest (satisfying the request), while the remaining 1.3 axes that don't fit overflow into other storage (as happens with items placed into active provider chests).

The bug then is that the bots see that there's a non-filled stack of laser turrets in the report provided by OP, and bring laser turrets over to try to complete the stack. However, the bots (chest?) fail to reconize that the turret is a placable, and that the only thing that can actually fit into the chest is a damaged turret. AFAIK, there's no facility in the logistics system as of yet that allows for explicitly requesting items that are damaged (this might be a useful feature, though!). As a result, the chest broadcasts a request for 49 laser turrets, which ofc can't fit.

Re: Perpetual bot motion with damaged logistics item

Posted: Fri Apr 06, 2018 8:24 pm
by vinnief
Wow, I was wondering how the game represented damaged inventory items, that's actually quite clever :) Thanks for explaining it!