[2.0.23] When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first

Post your bugs and problems so we can fix them.
goatpresident
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Dec 07, 2024 4:16 am
Contact:

[2.0.23] When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first

Post 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.
Attachments
Recording 2024-12-06 232922.mp4
(10.17 MiB) Downloaded 14 times
Last edited by goatpresident on Sun Dec 08, 2024 2:13 am, edited 1 time in total.
Loewchen
Global Moderator
Global Moderator
Posts: 9581
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first

Post by Loewchen »

Cannot reproduce. If you can, post a save please, see 3638.
goatpresident
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Dec 07, 2024 4:16 am
Contact:

Re: When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first

Post 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.
Attachments
bug report.zip
(450.89 KiB) Downloaded 13 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14631
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.23] When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first

Post 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?
If you want to get ahold of me I'm almost always on Discord.
goatpresident
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Dec 07, 2024 4:16 am
Contact:

Re: [2.0.23] When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first

Post 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.
robot256
Smart Inserter
Smart Inserter
Posts: 1006
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0.23] When built from ghosts, inserters will not fuel locomotive if cargo wagon is placed first

Post 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.
Post Reply

Return to “Bug Reports”