[0.13.9] [Twinsen] inserter with condition change behavior with stack bonus
Posted: Tue Jul 19, 2016 7:35 am
by gheift
Hello,
I have two inserters connected to a circuit network, the left one has the condition anything > 0, the right one everything = 0. Both inserters read their hand content in pulse mode. The decider has the condition everything < 3.
0.13.9_inserter_with_stack_bonus_holds_item_forever_1.png (74.81 KiB) Viewed 7493 times
With this build I can split the items 2:1. Without stack bonus, all values in the circuit network are initially zero, the right inserter grabs an item, gives the signal over the network and moves the item to the chest. The combinator will hold this signal through the loop and the right inserter will not grab any more item, because its condition is not satisfied any more. This is the behavior I expected.
When stack bonus 2 is researched, the right inserter grabs the first item and gives the signal to the network, where it is hold. Since the condition is not satisfied any more, the inserter does not grab any more items, like I expect it. But it neither moves the item, which it has already grabbed, to the box, it just holds it forever. I expect it to move the grabbed item to the box.
0.13.9_inserter_with_stack_bonus_holds_item_forever_2.png (82.8 KiB) Viewed 7493 times
Thanks,
Gerhard
Re: [0.13.9] inserter with condition change behavior with stack bonus
Posted: Tue Jul 19, 2016 8:30 am
by BlakeMW
Hmm, I've studied this in significant detail. There are basically 3 ways of switching an inserter:
1) Use an enabled/disabled condition
2) Use "set filters" on a filter inserter
3) Use the power switch to cut power.
All three work differently.
Enabled Condition puts the inserter in "suspended animation", once it reactivates it will resume what it was doing, for example if it was picking up items, it'll keep picking up items.
"Set Filters" causes the inserter to immediately drop its load if the new filters are incompatible with what it is holding and swing back into position.
Cutting electricity seems to freeze the inserter in place and also resets it if the power cut lasts longer than about 30 ticks, it forgets what it was doing and when it is powered back on it will dump its load and resume normal activity. This is unlike the suspended animation of enabled/disabled condition.
It didn't occur to me that the "suspended animation" behaviour is a bug, but now I think about it, it probably would be more useful if a "disabled" inserter immediately drops its load and then swings back into position before ceasing activity.
Re: [0.13.9] inserter with condition change behavior with stack bonus
Posted: Tue Jul 19, 2016 8:35 am
by Klonan
Thanks for the report,
Can you post a save where you have the setup so i can reproduce and confirm it?
Re: [0.13.9] [Pending] inserter with condition change behavior with stack bonus
Posted: Tue Jul 19, 2016 8:45 am
by BlakeMW
suspended animation is really easy to demonstrate: Just wire an inserter to a power pole and use "Enabled: Everything = 0", and "Read hand contents: Hold". If there is inserter capacity bonus then the result is an inserter which can pick up a single item and never put it down because it still wants to fill its hand.
Re: [0.13.9] [Pending] inserter with condition change behavior with stack bonus
Posted: Tue Jul 19, 2016 9:00 am
by gheift
Created a testcase. Just connect the belts. The upper one puts one copper into the chest, the lower stack inserter grabs one copper and holds it forever.
Re: [0.13.9] inserter with condition change behavior with stack bonus
Posted: Tue Jul 19, 2016 9:04 am
by gheift
BlakeMW wrote:Enabled Condition puts the inserter in "suspended animation", once it reactivates it will resume what it was doing, for example if it was picking up items, it'll keep picking up items.
The inserter is only suspended in its animation, if it has a stack bonus. If it only grabs one item (because there is no stack bonus), it will put the grabbed item to its destination regardless if the condition is met or not.
Re: [0.13.9] [Pending] inserter with condition change behavior with stack bonus
Posted: Tue Jul 19, 2016 9:09 am
by Klonan
Thanks for the report,
I have confirmed the odd behaviour:
Re: [0.13.9] [Twinsen] inserter with condition change behavior with stack bonus
Posted: Tue Jul 19, 2016 9:21 am
by XKnight
This bug report is going to be an incredibly important.
Looking forward to this fix.
Re: [0.13.9] [Twinsen] inserter with condition change behavior with stack bonus
Posted: Tue Jul 19, 2016 9:25 am
by gheift
It gets even more wired. After I build this setup, I research inserter-capacity-bonus 1 & 2 and build another one. So top right built before research, top left built after research. The right one was not activated/used after building it. Now connect both belts. The left one will hold the item, the right one will put it into the chest for the first time. After this, the right inserter behave like the left one.
Re: [0.13.9] [Twinsen] inserter with condition change behavior with stack bonus
Posted: Fri Jul 29, 2016 2:39 pm
by Twinsen
Fixed in Version: 0.13.12
Thanks for the saves.
gheift wrote:It gets even more wired. After I build this setup, I research inserter-capacity-bonus 1 & 2 and build another one. So top right built before research, top left built after research. The right one was not activated/used after building it. Now connect both belts. The left one will hold the item, the right one will put it into the chest for the first time. After this, the right inserter behave like the left one.
This is due to the minor issue that the inserter's stack bonus gets updated after it moves one item, thus the old inserter has no stack bonus for the first item. But the situation in your save is no longer visible since the bug from this topic was fixed.
Re: [0.13.9] [Twinsen] inserter with condition change behavior with stack bonus
Posted: Wed Aug 03, 2016 6:48 am
by gheift
Twinsen wrote:Fixed in Version: 0.13.12
Thanks!
Twinsen wrote:This is due to the minor issue that the inserter's stack bonus gets updated after it moves one item, thus the old inserter has no stack bonus for the first item. But the situation in your save is no longer visible since the bug from this topic was fixed.
This is quite interesting. Why has each inserter its private stack bonus stored? I don't see any possibility to modify the stack bonus of an inserter beside the prototype and research, or is it planned to make it configurable by mods/circuit network?
I only want to understand the reason behind this. I interpret your current work flow as something like this: