Page 1 of 1
[2.0.23] When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first
Posted: Sat Dec 07, 2024 4:31 am
by goatpresident
As the subject says, when I paste my train blueprint, the locomotive would sometimes be filled with fuel, and sometimes not, and I figured out that it is determined by whether or not the bots happen to place the cargo wagon, or the locomotive first.
I've attached a video of the issue.
Re: When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first
Posted: Sat Dec 07, 2024 7:06 pm
by Loewchen
Cannot reproduce. If you can, post a save please, see
3638.
Re: When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first
Posted: Sun Dec 08, 2024 1:40 am
by goatpresident
I've attached a save file to reproduce the issue, it uses editor extensions to make it easier to reproduce I hope that's ok.
How to reproduce:
- Take the blueprint and place it on each of the two longer rails, so that the locomotive lines up with the fuel inserter (on the left it should be facing down, and on the right it should be facing up)
- On the left, the bots will (usually) place the locomotive first, and the fuel is inserted without a problem.
- On the right, the bots will (usually) place the cargo wagon first, and no fuel is inserted.
Of note, the issue only seems to occur if the train has a schedule. If the train does not have a schedule then fuel is inserted without a problem regardless of which entity is placed first.
Re: [2.0.23] When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first
Posted: Thu Dec 12, 2024 4:37 pm
by Rseding91
Did you create this blueprint from manually putting a ghost next to an existing locomotive, then make the blueprint of the two? Or did you make it from a complete connected train in automatic mode?
Re: [2.0.23] When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first
Posted: Sun Dec 15, 2024 4:00 pm
by goatpresident
I believe it was the second one, complete train in automatic mode that I made a blueprint of. Although to confirm, I tried creating a blueprint using each of the methods, and I observed the bug in both cases, so I can't be completely sure.
Re: [2.0.23] When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first
Posted: Mon Dec 16, 2024 5:25 pm
by robot256
Replicated using the attached save on 2.0.25.
Here's my theory:
When the locomotive is placed first, it's in manual mode waiting for the rest of the blueprinted train to be placed. The inserter wakes up and starts loading it. When the wagon is placed, the train switches to automatic mode and tries to go to the inaccessible station in its schedule. It enters the no-path state. The inserter is still awake and the train is still stopped so it continues fueling the locomotive.
When the locomotive is placed last, the train is switched to automatic mode in the same tick that the locomotive is placed. The inserter does not wake up for automatic trains that are not stopped or in manual mode. Mining and replacing the inserter still does not cause it to start inserting. Switching the train to manual and then back to automatic results in the inserter waking up and continuously loading the locomotive.
My understanding is that the current intent for trains switching to automatic mode is that they do so after bot-requested fuel has been delivered. It seems that inserter-delivered fuel was not included in that logic and the train switches to automatic right away when no fuel is requested. If the train is not placed already at the first station in its schedule and fuel is inserted there, then it will cause problems switching to automatic right away.
Solution to make the current behavior more consistent would be for the inserter to *stop* inserting when the train switches to automatic even though it is stopped in a no-fuel/no-path state.
Solution to improve behavior in OP's scenario: Do not switch blueprinted trains to automatic if the blueprint does not include any fuel requests.
Solution to make it behave the way OP expects in this one specific case: Treat trains in no-path and no-fuel the same as trains in manual so that inserters wake up. This would be BAD because trains stalled out on the wrong track could be loaded by the wrong station.