[kovarex] [15.19] Trains collide reproducibly on specific layout

This subforum contains all the issues which we already resolved.
IV 
Inserter
Inserter
Posts: 46
Joined: Thu Oct 27, 2016 2:16 pm
Contact:

[kovarex] [15.19] Trains collide reproducibly on specific layout

Post by IV  »

Hi there. I have a peculiar train collision. I have not changed the signals recently and I'm not driving manually, so this probably should not happen.
One train with coal has reserved a path through the waiting bay. It is going almost at full speed.
Coal Train and its path
As it enters the bay, it still has his path reserved
At the moment when it is completely in the bay, it gives up its reservation of the block it exited and is about to enter again, the train is going at full speed and will not stop
The train loses the right to enter this block, the train next to it has reserved this block
The train enters the block anyway
The train collides with the other train
What happens from the perspective of the other train:
Before the train with coal is completely in the bay, the train with copper is not allowed to pass
Once the train with coal is in the bay, and has wrongfully given up his reservation, the train with copper can leave
The trains are now in the same block
Loewchen
Global Moderator
Global Moderator
Posts: 9171
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Train wrongfully gives up block reservation

Post by Loewchen »

Post a save where this can be observed please.
IV 
Inserter
Inserter
Posts: 46
Joined: Thu Oct 27, 2016 2:16 pm
Contact:

Re: Train wrongfully gives up block reservation

Post by IV  »

Wait a bit at the station and get in to the train that will soon arrive. Get in to the first train that arrives. This is the train with coal, so be prepared for a bumpy ride ;)

If you want to, you can also run north and still be in time to get in to the train with copper.
Attachments
Error03.zip
(7.63 MiB) Downloaded 218 times
IV 
Inserter
Inserter
Posts: 46
Joined: Thu Oct 27, 2016 2:16 pm
Contact:

Re: Train wrongfully gives up block reservation

Post by IV  »

If you want to reproduce the bug, you will need the following:
- 3 locomotives
- Some fuel
- The blueprint below (4 stations, 6 signals, 3 chain signals, some rails)
- Set up one single headed loc to go around the circular track and the other one, a two headed wagonless train to go back and forth on the other track.
- Each train should stop at the two stations on his track with the condition "leave after 5 seconds of inactivity".
Blueprint
Factorio 0.15.12 22_5_2017 23_40_53.png
Factorio 0.15.12 22_5_2017 23_40_53.png (2.77 MiB) Viewed 9612 times
Enjoy the colliding trains ;)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14273
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Train wrongfully gives up block reservation

Post by Rseding91 »

IV  wrote:If you want to reproduce the bug, you will need the following:
- 3 locomotives
- Some fuel
- The blueprint below (4 stations, 6 signals, 3 chain signals, some rails)
- Set up one single headed loc to go around the circular track and the other one, a two headed wagonless train to go back and forth on the other track.
- Each train should stop at the two stations on his track with the condition "leave after 5 seconds of inactivity".
Blueprint
Factorio 0.15.12 22_5_2017 23_40_53.png
Enjoy the colliding trains ;)
I've done all your steps but the trains are working flawlessly and never hit each other.

Are you using any mods? How long do i have to wait?
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14273
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Train wrongfully gives up block reservation

Post by Rseding91 »

Ok, so after reproducing it in 0.15.12 it happens almost immediately. It doesn't happen at all in 0.15.13 so I guess we already fixed it :)
If you want to get ahold of me I'm almost always on Discord.
IV 
Inserter
Inserter
Posts: 46
Joined: Thu Oct 27, 2016 2:16 pm
Contact:

Re: Train wrongfully gives up block reservation

Post by IV  »

The bug is solved for this blueprint but a slight adaptation shows that the bug is not fixed. The new blueprint:
Blueprint
Loewchen
Global Moderator
Global Moderator
Posts: 9171
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Train wrongfully gives up block reservation

Post by Loewchen »

IV  wrote:(...)a slight adaptation shows that the bug is not fixed.
Can confirm with 15.13 and new save.
Edit: Still the case for 15.19.
User avatar
Philip017
Filter Inserter
Filter Inserter
Posts: 360
Joined: Thu Sep 01, 2016 11:21 pm
Contact:

Re: [Hanziq] [15.19] Trains collide reproducibly on specific layout

Post by Philip017 »

i have checked both of these blueprints and it appears to be a problem with improper signaling, the little loop is missing signals, and the timing just perfect on the other signals to cause the trains to colide, adding a signal on the top loop prevents the trains from coliding again. i looked closely at the other topic that is also related, viewtopic.php?f=182&t=49581 and it is also a signaling issue, the weird looking intersection makes it hard to see but a few of the intersections are missing signals, and the petro train in the video should have taken the right lane but instead took the left lane, ive seen my trains do strange stuff like this too, but have no idea why.
IV 
Inserter
Inserter
Posts: 46
Joined: Thu Oct 27, 2016 2:16 pm
Contact:

Re: [Hanziq] [15.19] Trains collide reproducibly on specific layout

Post by IV  »

Greeting Philip,
the signaling is indeed absurd in the given example. It is not meant for any practical purpose, it is only meant to give a small reproducible example. However, improper signaling on its own can never lead to collisions between trains.
Let me elaborate why. Two trains can only collide if they are in the same block. This should never happen. If a train is already occupying a block (or has reserved it) a second train should not enter the block. Thus in each block there will always be only one train. There is a corner case, where two trains try to enter/reserve a block simultaneously. In such a case, if it is handled properly, only one of the trains will enter the block. (In factorio probably the one with the smaller id.)
User avatar
Philip017
Filter Inserter
Filter Inserter
Posts: 360
Joined: Thu Sep 01, 2016 11:21 pm
Contact:

Re: [Hanziq] [15.19] Trains collide reproducibly on specific layout

Post by Philip017 »

i remember that crashing trains with out proper signaling was actually called a feature of this game, therefore not a bug.
if the devs decide to change this functionality then true trains should never crash with crazy signaling.
but in my opinion it is part of the fun of the game, don't give your trains proper signaling, then prepare to have to deal with the wrecks that ensue.
trains are one of the things that was a large learning curves, for me, about this game.
it could be simplified a bit in not requiring signals to prevent crashes.
but then you could build an entire rail network with out needing signals at all.
for me, leave as is, let the trains crash, but if you change it to not needing signals at all, it will certainly simplify the rail network (better for newbies)
IV 
Inserter
Inserter
Posts: 46
Joined: Thu Oct 27, 2016 2:16 pm
Contact:

Re: [Hanziq] [15.19] Trains collide reproducibly on specific layout

Post by IV  »

Philip017 wrote:i remember that crashing trains with out proper signaling was actually called a feature of this game, therefore not a bug.
if the devs decide to change this functionality then true trains should never crash with crazy signaling.
This is surprising to me. Under which conditions can a train enter a block which is already occupied/reserved by an other train?

I do recall that a train can crash into itself, if it is long enough and the block it on has a self-intersecting loop that is tight enough.
inick
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Thu Jun 16, 2016 7:36 pm
Contact:

Re: [Hanziq] [15.19] Trains collide reproducibly on specific layout

Post by inick »

Umm,

I don't know if it's related, but.. isn't (attached) that piece a little awkward when it comes to reserving track?


We have overlapping sections.
Attachments
track issue.png
track issue.png (190.46 KiB) Viewed 9015 times
User avatar
Philip017
Filter Inserter
Filter Inserter
Posts: 360
Joined: Thu Sep 01, 2016 11:21 pm
Contact:

Re: [Hanziq] [15.19] Trains collide reproducibly on specific layout

Post by Philip017 »

IV  wrote: This is surprising to me. Under which conditions can a train enter a block which is already occupied/reserved by an other train?
I do recall that a train can crash into itself, if it is long enough and the block it on has a self-intersecting loop that is tight enough.
it looks like the devs are hard at work to help identify improper signaling,

https://www.factorio.com/blog/post/fff-198

before reading that FFF i didn't even know the debugging information was there to help identifying signaling issues, once this is fully implemented i believe that creating automated rail networks will be much better.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [kovarex] [15.19] Trains collide reproducibly on specific layout

Post by kovarex »

I identified and cleaned up some mess and logical problems in the train logic. It should be fixed for 0.16, I'm actually wondering now, why didn't it happen more often.
MrCake
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Aug 23, 2017 5:01 am
Contact:

Re: [kovarex] [15.19] Trains collide reproducibly on specific layout

Post by MrCake »

This may also be caused by landfill placement, placing a large solar array blueprint or alignment before placing it.

3-4x now after expanding my solar setup the trains have become blocked at my iron smelter.

Signal passed at danger
https://puu.sh/xj9Df/2bff13f607.jpg

Signals
https://puu.sh/xj9Fs/73b9e8ff2d.jpg
Post Reply

Return to “Resolved Problems and Bugs”