Today I stumbled across a salt mine, running out of fuel. After providing fuel it didn't continue without manual intervention. I had to drive there (after many hours not recognizing the issue) and rebuild one of the entities.
This is an issue with a barreling machine (furnace), converting empty barrels and liquid fuel into fuel canisters, which are needed to power the mine.
Once the liquid fuel ran out, the inserter stopped putting the empty barrels into the machine, and when the liquid fuel returned the inserter just stayed inactive.
Expected behavior: After providing fuel (in my case via train) the mine can continue working without manual intervention.
I have attached a small save showing the issue. Let the mine continue working until out of fuel. Then build the ghost of the underground pipe.
I'm pretty sure this has do with the item+fluid recipes in the furnace. You can't even insert the item if the fluid is missing. Don't want to know how many times players were irritated by this. Looks like the game is missing a trigger to wake up the inserter when the fluidbox transitions from empty to non-empty.
Everything working perfectly:
Running out of fuel:
Fuel is back:
Inserter still doesn't want to move:
[1.1.76] Inserter does not wake up
[1.1.76] Inserter does not wake up
- Attachments
-
- Bug inserter not activating.zip
- (4 MiB) Downloaded 92 times
Re: [1.1.76] Inserter not activating as expected
I believe the fix for this will likely be changing the inserter so it can never sleep if pointed at a furnace that supports fluids. There is no event for fluids flowing into or out of a machine.
If you want to get ahold of me I'm almost always on Discord.
Re: [1.1.76] Inserter does not wake up
This is not good news. This makes it much more difficult to build factories that can restart after ingredient shortage. I've tried loaders instead of inserters, they also get stuck. Or picking up from chest / belt, but they also get stuck. The only workaround I found so far was to add a tank to the fluid system and wire it to the outputting inserter, only allow outputting filled barrels if there is enough fluid left for it to recover. I doubt that this is better UPS-wise. Or change the furnaces to assembling machines, for some reason they don't have an issue.
How do assembling machines deal with this? Observing the show-active-state debug output it looks like they only become inactive when missing items, and staying active, polling their fluidbox, when fluid ingredients are missing. That's probably the same as furnaces that end up with items only, because you added more items than the fluid supports.
I believe the cleanest solution would be to change behavior for furnaces to allow item input while out of fluid. Then the furnace switches to being always active when out of fluid, but not in normal operations (out of items / output full) they can be inactive for quite some time.
Second cleanest solution would be that inserters pointing at fluid-accepting furnaces never become inactive.
Third cleanest solution would be to add a warning to the API documentation about this behavior and contacting developers of overhaul mods to suggest using assembling machines for barreling entities.
Btw, are there furnace entities in vanilla accepting fluids? I believe not. UPS for vanilla could stay the same.
How do assembling machines deal with this? Observing the show-active-state debug output it looks like they only become inactive when missing items, and staying active, polling their fluidbox, when fluid ingredients are missing. That's probably the same as furnaces that end up with items only, because you added more items than the fluid supports.
I believe the cleanest solution would be to change behavior for furnaces to allow item input while out of fluid. Then the furnace switches to being always active when out of fluid, but not in normal operations (out of items / output full) they can be inactive for quite some time.
Second cleanest solution would be that inserters pointing at fluid-accepting furnaces never become inactive.
Third cleanest solution would be to add a warning to the API documentation about this behavior and contacting developers of overhaul mods to suggest using assembling machines for barreling entities.
Btw, are there furnace entities in vanilla accepting fluids? I believe not. UPS for vanilla could stay the same.
Re: [1.1.76] Inserter does not wake up
I just found another workaround, but that ultimately also involves the inserter not being inactive. The active belt keeps the inserter active and adding fluid after running out does reactivate the inserter. I'll probably use this for the time being, but a bugfix is still highly appreciated.
Re: [1.1.76] Inserter does not wake up
This issue is really annoying.
I tried making inserter to not go to sleep when furnace is not full. That makes one other test to fail which expects an inserter goes to sleep when trying to insert iron plate to a stone furnace before a recipe for steel is enabled because that test checks if the inserter correctly wakes up when technology is researched.
I was thinking about allowing the inserter to insert the item for which there exists any recipe with fluid, but the transfers to ingredient inventory are size limited by a value taken from a recipe which means it has to select proper recipe in order to not create issues where temporarily selected recipe gives stack limit of 10 item ingredients, inserter goes to sleep and then fluid arrives which is used by a different recipe that requires at least 20 items: in such case the fluid would not cause inserter to wakeup.
I think the only reasonable way of solving this specific case will be if to keep furnace active due to missing fluid and once there is fluid content it would wakeup inputs, worst case in every tick. Most likely the furnace is already active in that case because it should start crafting as soon as there is enough fluid and fluids cannot wakeup that furnace.
I tried making inserter to not go to sleep when furnace is not full. That makes one other test to fail which expects an inserter goes to sleep when trying to insert iron plate to a stone furnace before a recipe for steel is enabled because that test checks if the inserter correctly wakes up when technology is researched.
I was thinking about allowing the inserter to insert the item for which there exists any recipe with fluid, but the transfers to ingredient inventory are size limited by a value taken from a recipe which means it has to select proper recipe in order to not create issues where temporarily selected recipe gives stack limit of 10 item ingredients, inserter goes to sleep and then fluid arrives which is used by a different recipe that requires at least 20 items: in such case the fluid would not cause inserter to wakeup.
I think the only reasonable way of solving this specific case will be if to keep furnace active due to missing fluid and once there is fluid content it would wakeup inputs, worst case in every tick. Most likely the furnace is already active in that case because it should start crafting as soon as there is enough fluid and fluids cannot wakeup that furnace.
Re: [1.1.76] Inserter does not wake up
I spent some time today and finally found a solution that will keep the inserter from getting into a broken state. It will be fixed for the 2.0 release.
If you want to get ahold of me I'm almost always on Discord.
Re: [1.1.76] Inserter does not wake up
Thank you, again, to the most unbelievably incredible best development team ever, for another amazing improvement. Rock on!
My own personal Factorio super-power - running out of power.
Re: [1.1.76] Inserter does not wake up
I don't believe it. You folks are simply the best! Unfortunately I will continue my Pyanodons game in 1.1 without this bugfix. Just out of curiosity: What's the technical solution that can fix this bug and handle all the edge cases that might still occur?
Re: [1.1.76] Inserter does not wake up
It was mostly a matter of sitting down and figuring out the exact scenario it broke. Once that was found, I just added a check on the inserter side that says essentially "does the target machine allow me to sleep?" and in the case of furnaces with fluid AND item inputs that answer is "no".
If you want to get ahold of me I'm almost always on Discord.
Re: [1.1.76] Inserter does not wake up
I think I get it. So all furnaces with fluid boxes and at least one compatible recipe accepting both item and fluid will use this new behavior, right?Rseding91 wrote: ↑Tue Oct 03, 2023 1:43 pmIt was mostly a matter of sitting down and figuring out the exact scenario it broke. Once that was found, I just added a check on the inserter side that says essentially "does the target machine allow me to sleep?" and in the case of furnaces with fluid AND item inputs that answer is "no".
Is there even a small chance to port this back to 1.1? Doesn't sound like a lot of changed code