Page 1 of 1

Items held by the inserters shouldn't spoil.

Posted: Tue Nov 12, 2024 3:52 am
by ik1ne
TL;DR
Make items held by the inserter not spoil for max-efficient, lock-free factory.
What?
Items held by the inserters doesn't spoil.
Why?
Consider this case:
1. Inserter picks up item that is about to spoil.
2. While the inserter arm is mid-air, the item spoils.
3. The target machine doesn't accept spoilage, so the inserter is stuck at this state and so does the target machine.
When feeding biter spawner, it is more efficient to use most spoiled item first because the nutrient value doesn't get affected by the freshness of the bioflux.
However, after configuring the inserters to pick up most spoiled item first, I noticed some biter spawner starvation due to the inserter trying to insert spoilage to spawner.
After setting the priority to fresh one I never experienced the issue, but I hope there's a way to maximize bioflux efficiency while not worrying about inserter locking.

Note: After writing this, I found the lua api flag enter_drop_mode_if_held_stack_spoiled(https://lua-api.factorio.com/latest/pro ... ck_spoiled), probably suggesting this is an expected behavior. Please disregard this suggestion if setting the priority to fresh one is the intended solution.

Re: Items held by the inserters shouldn't spoil.

Posted: Wed Nov 13, 2024 4:11 am
by McFrugal
I agree with this, for one important reason: if an inserter is taking items off a belt to feed a machine, and the item rots while the inserter is swinging, then the inserter will get clogged and there's no way to prevent it. You'd have to put a second inserter to grab any potential Spoilage off of the first inserter and that is absurd.

Re: Items held by the inserters shouldn't spoil.

Posted: Wed Nov 13, 2024 4:28 am
by Ranakastrasz
Kinda like trying to use burner inserters for everything in that way.

I think this is abusable though. Instead, if an inserter has something spoil while held, it places it in the target machine's trash slot, like when recipes are changed. Only for just now spoiled stuff, so it won't grab spoilage or anything.

Re: Items held by the inserters shouldn't spoil.

Posted: Wed Nov 13, 2024 4:47 am
by AntiBlueQuirk
I think preventing items from spoiling in inserters' hands is a good idea, but their spoilage level should still drop all the way to zero. That way the inserter can still always successfully insert the item, but it will spoil immediately in the target inventory. That's fine, because that would happen eventually anyway. The only exception I would make is for things that don't spoil into an item, like eggs. There's no point in preventing this spoilage, and it prevents preserving eggs forever by just jamming them in an inserter.

Re: Items held by the inserters shouldn't spoil.

Posted: Wed Nov 13, 2024 6:47 am
by boskid
This idea makes no sense for at least 3 reasons:
1/ There is no difference between item spoiling in the inserter hand and item spoiling inside of the drop target's input inventory, just trying to make items not spoil in inserter hand does not prevent the items from spoiling in the target so you need to make your gleba setups resiliant to spoilage in such cases anyway. This idea would not change this at all.
2/ If an item spoils while in hand, then inserter will hold an item that is known to be a spoil product of a different item. Such items get slightly different treatment when trying to insert into entity where the item does not fit into input inventory. If its attempted to be inserted into assembler and it does not fit ingredients inventory it will be put into dump inventory as a spoil product.
3/ Proposed logic could be abused to prevent spoilage by using inserters and power switches. Entire spoil mechanic was implemented under design assumption that once started, spoiling never changes speed.

Re: Items held by the inserters shouldn't spoil.

Posted: Wed Nov 13, 2024 9:01 am
by DarkShadow44
boskid wrote: Wed Nov 13, 2024 6:47 am 2/ If an item spoils while in hand, then inserter will hold an item that is known to be a spoil product of a different item. Such items get slightly different treatment when trying to insert into entity where the item does not fit into input inventory. If its attempted to be inserted into assembler and it does not fit ingredients inventory it will be put into dump inventory as a spoil product.
Thanks, that's good to know - I think that makes the entire suggestion void.
However, after configuring the inserters to pick up most spoiled item first, I noticed some biter spawner starvation due to the inserter trying to insert spoilage to spawner.
What exactly do you mean?

Re: Items held by the inserters shouldn't spoil.

Posted: Sun Nov 17, 2024 6:04 am
by Everspace
I noticed this being a little wonky with a stack inserter holding spoilage not dropping/inserting due to not reaching it's stack size.

Re: Items held by the inserters shouldn't spoil.

Posted: Mon Nov 18, 2024 10:32 pm
by tobinyehle@gmail.com
2/ If an item spoils while in hand, then inserter will hold an item that is known to be a spoil product of a different item. Such items get slightly different treatment when trying to insert into entity where the item does not fit into input inventory. If its attempted to be inserted into assembler and it does not fit ingredients inventory it will be put into dump inventory as a spoil product.
This should include fuel inventory so you can't clog a nutrients inserter on recipes like iron bacteria where the recipe spoilage is different than the fuel required for the biochamber.

Re: Items held by the inserters shouldn't spoil.

Posted: Fri Dec 13, 2024 1:01 am
by mairazl
boskid wrote: Wed Nov 13, 2024 6:47 am If an item spoils while in hand, then inserter will hold an item that is known to be a spoil product of a different item. Such items get slightly different treatment when trying to insert into entity where the item does not fit into input inventory. If its attempted to be inserted into assembler and it does not fit ingredients inventory it will be put into dump inventory as a spoil product.
I think this might not be true for captured biter spawner as I've seen an inserter pointing at one, with a piece of spoilage in the inserter's inventory, completely stuck unable to insert the spoilage into the spawner's trash slot, and I lost the spawner after some seconds.

Re: Items held by the inserters shouldn't spoil.

Posted: Fri Dec 13, 2024 1:30 am
by IsaacOscar
mairazl wrote: Fri Dec 13, 2024 1:01 am
boskid wrote: Wed Nov 13, 2024 6:47 am If an item spoils while in hand, then inserter will hold an item that is known to be a spoil product of a different item. Such items get slightly different treatment when trying to insert into entity where the item does not fit into input inventory. If its attempted to be inserted into assembler and it does not fit ingredients inventory it will be put into dump inventory as a spoil product.
I think this might not be true for captured biter spawner as I've seen an inserter pointing at one, with a piece of spoilage in the inserter's inventory, completely stuck unable to insert the spoilage into the spawner's trash slot, and I lost the spawner after some seconds.
Ths issue is that you need to remove the eggs from the output slot first. See viewtopic.php?f=182&t=124219

Re: Items held by the inserters shouldn't spoil.

Posted: Thu Jan 23, 2025 11:02 am
by kemurphy
Agreed with the reasons mentioned above why preventing spoilage in inserter hands doesn't make sense; instead, I think it would make sense for machines that take spoilable ingredients to accept spoilage from an inserter directly into the items-spoiled-inside-the-machine slot?

Re: Items held by the inserters shouldn't spoil.

Posted: Thu Jan 23, 2025 12:44 pm
by Uberang
I had an issue with this as well. Had my gleba factorio running without issue even while afking for over a week, then one time when I came back to it, saw I was getting alerts that it was taking damage, checked, and the belt with the eggs on was fully saturated and they were regularly expiring - until now, I'd been consuming more eggs than I actually produce, so the turrets I set up had never even killed anything in all that time.

Looked around, and the problem was science wasn't getting bioflux, with the machines not making bioflux because the inserters were all holding spoilage. Nothing in the machines at all except nutrients, as the moment any spoilage is in the machine, other inserters dump it out, but because you can't insert spoilage, doesn't even seem to go to any trash slot, the inserters for the jelly and mash were stuck, and had to manually remove it from the inserters via bots to get everything running again. Thankfully that's the only thing that went wrong, and the factory wasn't fully dead.

Having to manually do this when bad rng hits is kind of against the spirit of the game imo, unless there's some way of automatically taking trash away from inserters (that are positioned over a line of machines, not belts or empty space), that I don't know about.

Re: Items held by the inserters shouldn't spoil.

Posted: Thu Jan 23, 2025 1:59 pm
by boskid
kemurphy wrote: Thu Jan 23, 2025 11:02 am
Uberang wrote: Thu Jan 23, 2025 12:44 pm
I suspect both of those posts were created due to 2.0.30 recently becoming stable when there was a bug in it where an inserter could incorrectly decide to grab a spoilage from a belt when it was freshly spoiled and inserter was already trying to pickup the previous item. This should be fixed in 2.0.31 and because i heard about this from couple of places already we are making 2.0.32 stable now as it contains a fix for this behavior.

Re: Items held by the inserters shouldn't spoil.

Posted: Thu Jan 23, 2025 2:12 pm
by Uberang
Can confirm I updated to 2.0.30 and hadn't seen the behavior before that

Thank you very much for the info, I'll make sure to update

Re: Items held by the inserters shouldn't spoil.

Posted: Thu Jan 23, 2025 2:15 pm
by kemurphy
Unfortunately I was already on 2.0.32 via the beta channel earlier tonight when I observed my inserter holding spoilage and failing to insert into a biochamber in need of fuel with no internal spoilage.

Edit: And it was a direct upgrade from 2.0.28, so I never saw 2.0.30.