[0.16.25] Train uses incorrect wait conditions at station

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
Post Reply
Youri
Inserter
Inserter
Posts: 20
Joined: Thu Feb 12, 2015 5:05 pm
Contact:

[0.16.25] Train uses incorrect wait conditions at station

Post by Youri »

While I was out adding new mines, one of my trains has seemingly stopped working. As I was out adding new mines I am unsure what could have caused this issue, I may have added some tracks very far away, and I may have added a new train stop irrelevant to the train, but none of that should affect it.

The train in question has a simple schedule with two stops, although the wait conditions are fairly long. Calling the stops X and Y, the train is currently stationary at X, while all wait conditions for X are fulfilled but no wait conditions for Y are fulfilled, and the schedule is giving me a square infront of stop Y. The train never actually leaves for Y though, and there is no green line from the train to stop Y when I turn on debug. The train in question is set to Automatic, and both of the stops it uses are available. It may be worth noting that there are multiple stops with the same name for both of these stops X and Y.

There is a chain signal after the train stop where the train is currently stationary, but removing this signal does nothing. I can 'fix' the train manually in a number of ways, such as turning it to Manual and then back to Automatic, or clicking 'Go to the station' for either of the stops in its schedule. The interesting part though, is that some changes to the wait conditions for stop Y can actually fix the train, too.

After some testing I found that the train, while waiting at stop X, is actually using the wait conditions from stop Y. If I edit the wait conditions for stop X, even remove all of them, nothing changes. If I edit the wait conditions for stop Y in such a way that still none of them are fulfilled, nothing changes. But if I edit the wait conditions for stop Y in such a way that they do become fulfilled, the train starts moving properly to stop Y.

So the problem seems to be that the train is waiting for wait conditions of stop Y, while stationary at stop X.
Unfortunately, I have no idea how or when this happened, so I can't offer any reproduction steps. If I use any of the above actions to fix the train, the train appears to be working fine again, even when it returns back to this station for example.

Below is a screenshot of the train. You can see the train is currently at stop X, that it's on Automatic, and it shows the square next to stop Y. You can also see most of stop Y's wait conditions. If I change these to make them fulfilled, such as removing the very first one (letting the '1s inactivity' be fulfilled), then the train will properly work.

Image

Pastebin of factorio-current.log: https://pastebin.com/LfqcnAdk
Pastebin of factorio-previous.log: https://pastebin.com/N6VKr3NS

I have been running vanilla. Since first encountering the bug, I have loaded a simple mod that doesn't affect anything train related, and used it only on a different save file. Since first encountering the game I've also closed and reopened the game, as well as updated to 0.16.26. At the time of writing the train is still bugged, so none of these things seem to affect the problem when it's already been triggered.

Edit: Almost forgot to mention that I found one bug thread that seems similar, but something slightly different seems to be happening here. I'm unsure whether or not this is related: viewtopic.php?f=29&t=49217

Edit 2: Attached the save file. You should spawn right next to the broken train.
Attachments
Youri.Overhaul2.16.zip
The save
(44.68 MiB) Downloaded 99 times
Last edited by Youri on Mon Feb 26, 2018 8:53 pm, edited 1 time in total.


Youri
Inserter
Inserter
Posts: 20
Joined: Thu Feb 12, 2015 5:05 pm
Contact:

Re: [0.16.25] Train uses incorrect wait conditions at station

Post by Youri »

Sorry, it's been attached now.

Loewchen
Global Moderator
Global Moderator
Posts: 8308
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.16.25] Train uses incorrect wait conditions at station

Post by Loewchen »

Looks like: 36975
Do you have a recent save before it got stuck?

Youri
Inserter
Inserter
Posts: 20
Joined: Thu Feb 12, 2015 5:05 pm
Contact:

Re: [0.16.25] Train uses incorrect wait conditions at station

Post by Youri »

Loewchen wrote:Looks like: 36975
Do you have a recent save before it got stuck?
That indeed looks like it's about the same problem, that one didn't show up when searching threads. Unfortunately I've since continued playing so there is no chance that any of my autosaves are from before this happened.

I wouldn't be surprised if the problem occurs due to some unfortunate combination of timings, for example when you load the game at a very specific point during the train's logic. Say, when he's just cleared his wait conditions but hasn't yet planned a path, and then if you load such a game state the train's logic gets messed up like this. Which would also mean that the problem is unlikely to occur again even if you let a prior savegame run.

But yea that's my best guess, I have no other information to share on this sorry.

Youri
Inserter
Inserter
Posts: 20
Joined: Thu Feb 12, 2015 5:05 pm
Contact:

Re: [0.16.25] Train uses incorrect wait conditions at station

Post by Youri »

I just had another one of my trains becoming bugged in the exact same way. This happened on 0.16.28. I immediately checked my autosaves but unfortunately even the oldest one was already after the train got bugged, so no luck there again. I must have been pretty close to catching it though, as I'm semi-regularly checking the stations for bugged trains. This time I was working inside of the base, pretty close to the train in question, but I am 99% sure that the problem did NOT occur upon loading the save, or upon editing stations - the train was not bugged when I loaded this save and while I did edit some stations, that was right after loading the save and should be before the bug happened.

I'll continue to keep an eye out to try and catch the bug red-hot.

aober93
Filter Inserter
Filter Inserter
Posts: 453
Joined: Tue Aug 30, 2016 9:07 pm
Contact:

Re: [0.16.25] Train uses incorrect wait conditions at station

Post by aober93 »

I can kinda make this up with renaming stops. Perhaps the same effect as this bug.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.25] Train uses incorrect wait conditions at station

Post by Rseding91 »

If anyone knows of a way to reproduce this problem on a limited size map please let me know.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Pending”