[0.13.9] [Twinsen] inserter with condition change behavior with stack bonus
[0.13.9] [Twinsen] inserter with condition change behavior with stack bonus
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.
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.
Thanks,
Gerhard
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.
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.
Thanks,
Gerhard
Re: [0.13.9] inserter with condition change behavior with stack bonus
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.
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.
Last edited by BlakeMW on Tue Jul 19, 2016 8:41 am, edited 2 times in total.
Re: [0.13.9] inserter with condition change behavior with stack bonus
Thanks for the report,
Can you post a save where you have the setup so i can reproduce and confirm it?
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
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
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.
- Attachments
-
- stack_inserter_condition.zip
- (4.18 MiB) Downloaded 123 times
Re: [0.13.9] inserter with condition change behavior with stack bonus
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.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.
Re: [0.13.9] [Pending] inserter with condition change behavior with stack bonus
Thanks for the report,
I have confirmed the odd behaviour:
I have confirmed the odd behaviour:
Re: [0.13.9] [Twinsen] inserter with condition change behavior with stack bonus
This bug report is going to be an incredibly important.
Looking forward to this fix.
Looking forward to this fix.
Re: [0.13.9] [Twinsen] inserter with condition change behavior with stack bonus
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.
- Attachments
-
- stack_inserter_condition_3.zip
- (4.36 MiB) Downloaded 116 times
Re: [0.13.9] [Twinsen] inserter with condition change behavior with stack bonus
Fixed in Version: 0.13.12
Thanks for the saves.
Thanks for the saves.
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.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.
Re: [0.13.9] [Twinsen] inserter with condition change behavior with stack bonus
Thanks!Twinsen wrote:Fixed in Version: 0.13.12
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?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.
I only want to understand the reason behind this. I interpret your current work flow as something like this:
Code: Select all
struct inserter {
/* ... */
struct prototype *prototype;
struct entity *src;
struct entity *dst;
int stack_bonus;
int stack_size;
int wait_until;
};
struct prototype {
/* ... */
int stack_bonus;
};
wait_until_somthing_is_needed(inserter);
grab_from_src_wait(inserter); /* updates stack_size */
if (inserter->src->is_belt)
while (inserter->wait_until >= game->tick && inserter->stack_size < inserter->stack_bonus) {
grab_from_belt(inserter); /* updates stack_size & wait_until */
}
rotate_to_dst(inserter);
put_into_dst(inserter);
rotate_to_src(inserter);
inserter->stack_bonus = inserter->prototype->stack_bonus;
Code: Select all
while (inserter->wait_until >= game->tick && inserter->stack_size < inserter->prototype->stack_bonus) {
grab_from_belt(inserter); /* updates stack_size & wait_until */
}