[2.0.15] Disabled inserters holding item will still insert into train car

Post your bugs and problems so we can fix them.
lazrfloyd
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Oct 29, 2024 9:14 pm
Contact:

[2.0.15] Disabled inserters holding item will still insert into train car

Post by lazrfloyd »

I have inserters at a loading station disabled through a circuit condition. They will only enable when a train is sitting at the station and only if the train id does not match my "personal" train. I wanted to be able to stop at stations without having to worry about accidentally loading my train with unwanted items.

Blueprint of full station and train:


Note: I noticed my train id had changed when working to duplicate and I addressed that by updating the condition to ensure the id in the condition would match the train id. Also note the constant combinator below the track is disabled and not sending any signal on the circuit.

Combinator and inserter settings:
11-14-2024, 14-31-47.png
11-14-2024, 14-31-47.png (491.54 KiB) Viewed 346 times
11-14-2024, 14-34-09.png
11-14-2024, 14-34-09.png (583.85 KiB) Viewed 346 times
Station layout with ore train being loaded:
Note: The other combinators are configured to enable/disable the station itself through train limit and priority and are not used to alter the inserter state
11-14-2024, 14-37-14.png
11-14-2024, 14-37-14.png (2.32 MiB) Viewed 346 times
Ore train has just left the station and personal train is entering:
Note: Only the two loading sections on the left have 5 x inserters actively holding 2 ore each, as only the first two cars in the ore train had a slot available
11-14-2024, 14-43-13.png
11-14-2024, 14-43-13.png (1.92 MiB) Viewed 346 times


Personal train id 111, matching the above combinator rule, is at the station and has had 20 copper ore loaded, 10 in each of the first two cars. Space is available in all four cars but the last two did not have any ore loaded:
11-14-2024, 14-45-57.png
11-14-2024, 14-45-57.png (5.63 MiB) Viewed 346 times
Here you can see the inserters are in a disabled state due to the circuit configuration:
11-14-2024, 14-47-44.png
11-14-2024, 14-47-44.png (3.87 MiB) Viewed 346 times

There appears to be a bug/undesired behavior where if an inserter is currently holding say copper ore, and is disabled, it will still insert that ore into a train car but will not insert any further ore. I can duplicate by having a "normal" ore loading train stop at the station with available space, accept some ore and leave the station. When I then send my "personal" train to the station it will load the ore the inserters are currently holding that they did not insert in the previous train. It's interesting to note that only inserters which were adjacent to a car on the previous ore train that had available space would then insert into the next train. So essentially only inserters which were actively engaged previously will show this behavior, while inserters which had nowhere to insert on the previous train will not.

Expected behavior would be for an inserter to remain completely disabled regardless if an available container/car is adjacent and regardless if the inserter is holding anything. As it is disabled, it should not perform any function except wait to be enabled.
robot256
Filter Inserter
Filter Inserter
Posts: 872
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by robot256 »

Duplicate, said to be "not a bug" in 2019 67508
MechBFP
Inserter
Inserter
Posts: 47
Joined: Sun Nov 03, 2024 4:02 am
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by MechBFP »

It’s not so much as “not a bug” as much as “doing the opposite causes other problems as well”.
lazrfloyd
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Oct 29, 2024 9:14 pm
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by lazrfloyd »

robot256 wrote: Thu Nov 14, 2024 10:23 pm Duplicate, said to be "not a bug" in 2019 67508
I skimmed through most of that and wasn't able to find where it said not a bug. Looks like they made a change to it way back in alpha 0.15.22 then reverted in 0.15.23 when a bunch of people had their entire factory break. I wasn't totally clear on the timeline and initial behavior prior to the changes. Nowhere was it clear to me that a disabled inserter holding something should be expected to still drop it, once able. Seems like if you're telling something to turn itself off then it should, no matter the state. But that would be intuitive.. :lol:
robot256
Filter Inserter
Filter Inserter
Posts: 872
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by robot256 »

lazrfloyd wrote: Thu Nov 14, 2024 11:41 pm I skimmed through most of that and wasn't able to find where it said not a bug.
You're right, I based my statement on the subforum the thread was sorted into by the mods.
lazrfloyd
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Oct 29, 2024 9:14 pm
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by lazrfloyd »

viewtopic.php?f=11&t=49170
Twinsen wrote: Tue Jun 20, 2017 1:11 pm Not necessarily a bug. Inserters finish dropping what they are holding when disabled.

But seeing this use case I believe it is better to have them keep the item in hand if disabled.
This change will break some contraptions, but let me know if anything significant breaks.

Changed in Version: 0.15.22.
Ok, this finally clicked for me...0.15.22 is where they decided to keep the item in hand when disabled and not drop it until enabled again. And it's stated that making this change will break stuff. Then a bunch of people complained since their setups were predicated on always assuming a grabbed item will be dropped, no matter what. So they reverted back to a held item always drops when a suitable container is available, even when it is disabled/unpowered.

I've never done circuit setups relying on this so am not at all familiar with how they are configured. Seems like this should have just been a config option to satisfy different approaches to inserter management. Without having the ability to read individual train cars or setting up weird "cleanup" trains or taking up train stop space to have cleanup inserters, there doesn't seem to be a straightforward way to deal with my use case, outside of never having a train stop at a station it isn't meant to interact with. This also means you can't have a mixed car train unless you always have the same resource at the same car length, without jumping through the above hoops.
lazrfloyd
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Oct 29, 2024 9:14 pm
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by lazrfloyd »

Another thought, I'm not sure why we can't just read the state of an inserter (disabled, waiting to drop item, etc.) then have the ability to control the inserter behavior based on its status. Maybe some UPS/performance consideration. I assume this was discussed somewhere over the last 7-8 years.
MechBFP
Inserter
Inserter
Posts: 47
Joined: Sun Nov 03, 2024 4:02 am
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by MechBFP »

You can middle click with an item in hand to reserve that slot in a train cart for a specific item.
If that works for you, you can setup those carts so all the slots are reserved for specific item(s) so the copper can never get inserted into those carts period.
lazrfloyd
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Oct 29, 2024 9:14 pm
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by lazrfloyd »

MechBFP wrote: Fri Nov 15, 2024 12:45 am You can middle click with an item in hand to reserve that slot in a train cart for a specific item.
If that works for you, you can setup those carts so all the slots are reserved for specific item(s) so the copper can never get inserted into those carts period.
That's an idea anyway. Problem is I fill them up randomly depending on what I'm working on so wouldn't work very well for my use case, unless I doubled up the cars but then I have issues fitting into areas designed for small trains. Simplest solution would be to just let us decide the behavior. Obviously this was discussed at length many years ago so don't expect any traction at this point. I'll just deal with it.
danbopes
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Mon Feb 07, 2022 9:29 pm
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by danbopes »

lazrfloyd wrote: Fri Nov 15, 2024 12:35 am viewtopic.php?f=11&t=49170
Twinsen wrote: Tue Jun 20, 2017 1:11 pm Not necessarily a bug. Inserters finish dropping what they are holding when disabled.

But seeing this use case I believe it is better to have them keep the item in hand if disabled.
This change will break some contraptions, but let me know if anything significant breaks.

Changed in Version: 0.15.22.
Ok, this finally clicked for me...0.15.22 is where they decided to keep the item in hand when disabled and not drop it until enabled again. And it's stated that making this change will break stuff. Then a bunch of people complained since their setups were predicated on always assuming a grabbed item will be dropped, no matter what. So they reverted back to a held item always drops when a suitable container is available, even when it is disabled/unpowered.

I've never done circuit setups relying on this so am not at all familiar with how they are configured. Seems like this should have just been a config option to satisfy different approaches to inserter management. Without having the ability to read individual train cars or setting up weird "cleanup" trains or taking up train stop space to have cleanup inserters, there doesn't seem to be a straightforward way to deal with my use case, outside of never having a train stop at a station it isn't meant to interact with. This also means you can't have a mixed car train unless you always have the same resource at the same car length, without jumping through the above hoops.
This is actually a common issue in LTN, especially with providers that supply multiple items. The recommended approach is to make sure there's enough space in the wagon before you load it. Set a condition to enable the inserters of contents <= (cars*40*stack size)-(inserter count*inserter stack count). This will ensure the items are fully unloaded before being disabled. (The only downside is that the cargo wagon is not filled fully)
MechBFP
Inserter
Inserter
Posts: 47
Joined: Sun Nov 03, 2024 4:02 am
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by MechBFP »

lazrfloyd wrote: Fri Nov 15, 2024 12:53 am
MechBFP wrote: Fri Nov 15, 2024 12:45 am You can middle click with an item in hand to reserve that slot in a train cart for a specific item.
If that works for you, you can setup those carts so all the slots are reserved for specific item(s) so the copper can never get inserted into those carts period.
That's an idea anyway. Problem is I fill them up randomly depending on what I'm working on so wouldn't work very well for my use case, unless I doubled up the cars but then I have issues fitting into areas designed for small trains. Simplest solution would be to just let us decide the behavior. Obviously this was discussed at length many years ago so don't expect any traction at this point. I'll just deal with it.
Alternatively you can setup an inserter that is setup with a filter that removes copper or whatever from the train cart at those stops. So the copper gets added but removed a fraction of a second later.
Then you can just disable it when the other inserters are enabled.
lazrfloyd
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Oct 29, 2024 9:14 pm
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by lazrfloyd »

danbopes wrote: Fri Nov 15, 2024 12:56 am
lazrfloyd wrote: Fri Nov 15, 2024 12:35 am viewtopic.php?f=11&t=49170
Twinsen wrote: Tue Jun 20, 2017 1:11 pm Not necessarily a bug. Inserters finish dropping what they are holding when disabled.

But seeing this use case I believe it is better to have them keep the item in hand if disabled.
This change will break some contraptions, but let me know if anything significant breaks.

Changed in Version: 0.15.22.
Ok, this finally clicked for me...0.15.22 is where they decided to keep the item in hand when disabled and not drop it until enabled again. And it's stated that making this change will break stuff. Then a bunch of people complained since their setups were predicated on always assuming a grabbed item will be dropped, no matter what. So they reverted back to a held item always drops when a suitable container is available, even when it is disabled/unpowered.

I've never done circuit setups relying on this so am not at all familiar with how they are configured. Seems like this should have just been a config option to satisfy different approaches to inserter management. Without having the ability to read individual train cars or setting up weird "cleanup" trains or taking up train stop space to have cleanup inserters, there doesn't seem to be a straightforward way to deal with my use case, outside of never having a train stop at a station it isn't meant to interact with. This also means you can't have a mixed car train unless you always have the same resource at the same car length, without jumping through the above hoops.
This is actually a common issue in LTN, especially with providers that supply multiple items. The recommended approach is to make sure there's enough space in the wagon before you load it. Set a condition to enable the inserters of contents <= (cars*40*stack size)-(inserter count*inserter stack count). This will ensure the items are fully unloaded before being disabled. (The only downside is that the cargo wagon is not filled fully)
Yeah I get you can force inserters to sync then disable before filling the train. However, if they get out of sync like if a train is sitting at an unload station and the output isn't balanced due to how half a belt will activate depending on how it is being unloaded, then you could have a car that has fewer slots taken up and eventually that could mean the others are filled when loading and still end up with the same problem. And it's an over complicated mess. I'm not doing anything crazy that would require it outside of addressing this issue so a lot of work for not much gain. I don't plan to use trains that deal with more than one item.
lazrfloyd
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Oct 29, 2024 9:14 pm
Contact:

Re: [2.0.15] Disabled inserters holding item will still insert into train car

Post by lazrfloyd »

MechBFP wrote: Fri Nov 15, 2024 12:57 am
lazrfloyd wrote: Fri Nov 15, 2024 12:53 am
MechBFP wrote: Fri Nov 15, 2024 12:45 am You can middle click with an item in hand to reserve that slot in a train cart for a specific item.
If that works for you, you can setup those carts so all the slots are reserved for specific item(s) so the copper can never get inserted into those carts period.
That's an idea anyway. Problem is I fill them up randomly depending on what I'm working on so wouldn't work very well for my use case, unless I doubled up the cars but then I have issues fitting into areas designed for small trains. Simplest solution would be to just let us decide the behavior. Obviously this was discussed at length many years ago so don't expect any traction at this point. I'll just deal with it.
Alternatively you can setup an inserter that is setup with a filter that removes copper or whatever from the train cart at those stops. So the copper gets added but removed a fraction of a second later.
Then you can just disable it when the other inserters are enabled.
This would mean taking up valuable real estate and degrading throughput. In my current factory state this wouldn't be an issue but could have an impact later if I'm trying to maximize. Obviously only applies when double loading from both sides...although might be able to get6 creative with the layout and get some long reach inserters going to handle a cleanup... :idea:
Post Reply

Return to “Bug Reports”