Using a base with roundabouts/track junctions and Train Stations which are often enabled/disabled by circuit network.
Trains occasionally collide with
What I think is happening is that multiple trains are passing through a junction in a way such that both trains have selected paths through the junction that don't collide with each other, so they proceed through. Then, while navigating through the intersection, one or more train stations that the involved trains were pathing towards becomes inactive, and the train(s) pick new routes which are not clear or collision safe.
This is possibly exacerbated by a separate possible bug where trains which have entered a segment of blocks linked with rail-chain-signals doesn't seem to care if new trains enter, even if there is room to stop/re-route. See attachment "Factorio Signal Bug 2.gif" for demo. (I say possible bug, because i'm not sure if it's technically a bug, practically speaking this should never happen except for really weird circumstances, like manually placing train cars. Even with poorly designed rails, the train system should always block any train from entering any segment intersecting anything in the path of rail-chain-signals. Maybe it's different if the two trains are _already_ in intersecting segments but on paths that don't intersect? I'm not sure, and all my experiments to dig deeper into this particular aspect have failed.) . Possibly trains which have entered the junctions rail-chain-signal segments don't see other trains in other parts of the segment, and re-route dangerously?
Note: I use primarily roundabouts for my train junctions.
What did you expect to happen instead? It might be obvious to you, but do it anyway!
I expected trains to re-route more gracefully/safely, and not collide with or block one another.
Does it happen always, once, or sometimes?
It happens somewhat rarely in my primary games, maybe once or twice over a 6-hour period. However, I created a worst-case-scenario simulation (See below) in which it can be observed happening extremely frequently.
Possibly related to this report >> viewtopic.php?f=29&t=58460&hilit=train+collision << at least, some parts, there are multiple similar occurrences described in that thread, which is over a year old.
Write down the steps to reproduce the bug if you know them.
Build a system of rails with stations that are disabled via circuit network. For instance, in my current save, my factory trains run in a fetch pattern; they will sit in my base until all of the cargo has been unloaded, then they head to an ore station to fill up. The ore stations I use are disabled until they have buffered enough ore to fill up a train. That way, the trains don't all just pile up at the nearest ore station, they will skip empty stations and go to farther away ones to fill up instead. Often times, a train on its way to a particular station will find that that station has been drained/disabled by another train which got there first, and it will re-route to a new station. If it's in a junction when it re-routes, bad things happen. I have seen trains switch courses and collide with each other, and in the case of roundabouts I've even seen them collide with themselves, presumably re-routing through a junction exit which they had already passed.
I've included a setup demo with 40-trains seeking a network of train stations which enable/disable somewhat realistically (They are enabled for a period of time, then are disabled the rest of the time), which is on par with the setup I have in my main bases where I experience this issue, albeit designed in such a way as to increase the frequency of collisions (1 per about 5-10 minutes)
https://drive.google.com/file/d/1TwhJ2a ... sp=sharing
I've also included a worst-case-scenario demo with 40-trains seeking a network of train stations which rapidly enable/disable randomly, and within two minutes or so all of the trains have reduced each other to rubble.
https://drive.google.com/file/d/1IwV6_a ... sp=sharing
In both scenarios, the player starts near a Constant combinator (Marked on the map as "Train Controller") which should be turned off to start the trains running.
Note: The latest experimental (0.17) has serious perf problems on most of my bases, so I play mostly in latest stable (0.16.51), so most of my testing/experiences are _not_ from latest experimental, so experiences there may differ, however I did load my demo saves in 0.17 and confirmed that the bug is still an issue in the latest experimental build.