Why does the train crash?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
User avatar
5thHorseman
Smart Inserter
Smart Inserter
Posts: 1193
Joined: Fri Jun 10, 2016 11:21 pm
Contact:

Re: Why does the train crash?

Post by 5thHorseman »

Nemo4809 wrote: ↑
Mon Feb 17, 2020 11:52 am
I don't believe this special exception was ever mentioned in the mini-tutorials
I don't think they covered not making your trains too big for your rail setup at all.

Squelch
Filter Inserter
Filter Inserter
Posts: 346
Joined: Sat Apr 23, 2016 5:31 pm
Contact:

Re: Why does the train crash?

Post by Squelch »

Nemo4809 wrote: ↑
Mon Feb 17, 2020 11:52 am
I kind of see it as

"because the tool provide by the game to prevent collisions did not work as advertised" :P

I don't believe this special exception was ever mentioned in the mini-tutorials - heck, even if it was, I probably forgot about it as I was overwhelmed with information and desperately trying to grasp how the signals work; and how I should be using them.
Heh, such is the nature of trains.

They can become highly complex and frustrating. Please also consider that the debug tools we now have at our disposal were not available back when this exception was added. I'm not even sure if signal blocks showed as much information while being placed as they do now. My memory might be failing me here however.

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Why does the train crash?

Post by mrvn »

boskid wrote: ↑
Tue Feb 11, 2020 2:14 pm
Nemo4809 wrote: ↑
Tue Feb 11, 2020 2:08 pm
Any reason for that? Just curious since it allows crashes to happen and seem to be an exception to train-signal behavior.
https://factorio.com/blog/post/fff-299
The rail network in the FFF is ill formed imho. Along a straight path (no looping back or anything too crazy) a block should not appear twice.

If it does the train should simply fail to reserve the second case. If the train is short enough ti might release the first occurance of the block and then be able to reserve the second and go on. But more likely you end up with a deadlock. But you get what you build. Ideally the game should detect such a setup and make the signals blink green/yellow/red like in other illegal cases. But this case might be hard to detect.

There is a reason for why a train ignores its own reservation and that is: viewtopic.php?f=11&t=19619&p=302527#p302527. But isn't that case obsolete? Trains no longer repath inside chain signals. That path would never have been chosen from outside the turn-around and once inside the path isn't changed anymore.

So this looks like an exception to the rules made as workaround to a problem that has since been solved properly? We could now remove the exception and have train networks save from trains colliding with them self without getting trains stuck in every roundabout. Yes, some existing train system would break but I consider those ill formed to start with, badly signaled like in the FFF.

Taking this one step further the path finder could know how long a train is (+possibly breaking distance) and see that a short train will clear a block before reserving it a second time. As in the score for a red signal caused by the train itself changes depending on the distance traveled since leaving the block. If it's <= train length then cost = infty. Train length < distance < train length + max breaking distance gives a sliding cost since the larger the distance the faster the train can pass through it without breaking for a red signal. Distance > train length + max breaking distance would have cost 0.

Note: this would be for the cases where a track loops over itself. A path that must be avoided for long trains and best suited for short trains. You get those in grids.

Squelch
Filter Inserter
Filter Inserter
Posts: 346
Joined: Sat Apr 23, 2016 5:31 pm
Contact:

Re: Why does the train crash?

Post by Squelch »

I suspect what the ill formed layout FFF-229 is specifically highlighting, is a simplified layout that was causing the increased crash reports (see the graph in the same blog), and the result off an underlying bug.

I might be wrong.

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Why does the train crash?

Post by mrvn »

Squelch wrote: ↑
Mon Feb 17, 2020 3:31 pm
I suspect what the ill formed layout FFF-229 is specifically highlighting, is a simplified layout that was causing the increased crash reports (see the graph in the same blog), and the result off an underlying bug.

I might be wrong.
Totally. It's probably the simplest case you can have where a train crosses the same block twice.

A more realistic case might be a grid where you can only take left turns. Three lefts make a right but then you cross your own path. Then imagine a giant ore train finding it's way into the grid. It will take 3 left and crash into itself. There is no way to signal this correctly so that a long train will not crash into itself due to the exception.

netmand
Filter Inserter
Filter Inserter
Posts: 302
Joined: Wed Feb 22, 2017 1:20 am
Contact:

Re: Why does the train crash?

Post by netmand »

Nemo4809 wrote: ↑
Fri Feb 14, 2020 12:04 pm
I just think it's kind of silly. No train conductor will ignore a red signal in RL.

In the FFF example, the signals are poorly placed and things could easily be fixed by adding a signal to split the top curved track.
I can see you feel strongly about this. Consider these:

In real life train signalling does indeed allow the driver to proceed under certain situations; depending on the line owner's rules, company rules, regional rules, and prevailing conditions. It's pretty easy to find images of real life signalling that include red lights (some signals only have red light) meant for proceeding. Factorio does not implement the complex decisions that a train driver makes while driving a train. Factorio approaches trains from more of a logistical perspective; determining ways to move items efficiently from one place to another.

The value in signalling is all about the train's ability to path to its destination in this game, not about anti-collision. Signals provide a way for trains to move closer to their destinations by declaring blocks of tracks that the path finding algorithm can use. Poorly placed signals may result in deadlocks or collisions. In your example, A red signal means nothing if it's red because the same train is occupying the same block. It's a poorly designed example that results in a collision. If you take that design and add 1,200 rails in the middle, stretching the curved ends out so you can't see the whole design in one screen, the value in letting the train proceed becomes more obvious (I hope!)

P.S. Sorry to be pedantic but a conductor does not drive the train.

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Why does the train crash?

Post by ptx0 »

Zavian wrote: ↑
Mon Feb 17, 2020 11:23 am
Everything can be fixed by smarter rail design by players.
i didn't really read anything else you wrote because this is my whole point, the original solution to a bad behaviour was more bad behaviour.

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Why does the train crash?

Post by ptx0 »

mrvn wrote: ↑
Mon Feb 17, 2020 3:22 pm
boskid wrote: ↑
Tue Feb 11, 2020 2:14 pm
Nemo4809 wrote: ↑
Tue Feb 11, 2020 2:08 pm
Any reason for that? Just curious since it allows crashes to happen and seem to be an exception to train-signal behavior.
https://factorio.com/blog/post/fff-299
The rail network in the FFF is ill formed imho. Along a straight path (no looping back or anything too crazy) a block should not appear twice.

If it does the train should simply fail to reserve the second case. If the train is short enough ti might release the first occurance of the block and then be able to reserve the second and go on. But more likely you end up with a deadlock. But you get what you build. Ideally the game should detect such a setup and make the signals blink green/yellow/red like in other illegal cases. But this case might be hard to detect.

There is a reason for why a train ignores its own reservation and that is: viewtopic.php?f=11&t=19619&p=302527#p302527. But isn't that case obsolete? Trains no longer repath inside chain signals. That path would never have been chosen from outside the turn-around and once inside the path isn't changed anymore.


thanks, i forgot to mention that earlier when Dominik's thread was linked. the issue there was spontaneous repathing inside chain signal segments.

we can now make trains avoid blocks they occupy because they don't spontaneously repath.

maybe if we all say it 3 times the devs will remember and fix this problem.

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Why does the train crash?

Post by mrvn »

Just want to add a note to hopefully close the discussion:

Both with and without the exception there is some bad behavior. With the exception long trains crash into them self. Without the exception trains can deadlock in an example like the FFF. The deciding argument for me is that the deadlock can be avoided by proper signal placement. The long trains can not be prevented from crashing into them self.

So to me clearly the way to go is to leave the things the player can fix to the player and fix the thing the player can't fix.

mergele
Fast Inserter
Fast Inserter
Posts: 158
Joined: Sat Aug 20, 2016 5:45 am
Contact:

Re: Why does the train crash?

Post by mergele »

Without the exception to long trains deadlock on themselves and the only way to prevent this (large enough circles were they can't block themselves) also fixes the "crashing into itself" problem with the exception.

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Why does the train crash?

Post by mrvn »

mergele wrote: ↑
Wed Feb 19, 2020 11:30 am
Without the exception to long trains deadlock on themselves and the only way to prevent this (large enough circles were they can't block themselves) also fixes the "crashing into itself" problem with the exception.
They deadlock in this simple case (and the player can fix that). Problem is they do crash into them self in more complex cases where they have alternative routes where they don't crash. Without the exception they simply take the longer route.

Squelch
Filter Inserter
Filter Inserter
Posts: 346
Joined: Sat Apr 23, 2016 5:31 pm
Contact:

Re: Why does the train crash?

Post by Squelch »

Both scenarios, train too long for track, and insufficient signalling are equally poor design choices by the player. The train to track length situation is far more obvious, and there is a helper setting that allows us to see how the wagons will fill a track. Insufficient signalling is difficult to foresee, and was especially so when the train would deadlock when its path looked like it should be clear. When space is tight, and a complicated track layout is still in evolution, it is incredibly difficult to catch all possible conflicts. The problems can lay unnoticed for a long time, and then suddenly manifest. It's a trap that I would guess has caught many of us at some time or other. My personal opinion is that a rare train crash due to length is easier to understand and mitigate against, than a subtle signalling issue.

I flippantly remarked earlier that an older Factorio version be played, and the intended message was valid even if it wasn't taken as such. Unless you have actually experienced the subtle deadlock problem, it might be hard to understand the frustrations involved. Also, forcing the old behaviour of a train stopping (deadlocking) at a red signal when crossing its own path statement is equally valid and can still achieved by slaving a circuit controlled signal from the automatic signal that is currently allowing the same ID train to pass its own path.

The only real solution to both problems is to rip up the tracks and ensure that there is both sufficient space and signalling. I'll contend that that is not always possible or obvious in the heat of gameplay.

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Why does the train crash?

Post by ptx0 »

Squelch wrote: ↑
Wed Feb 19, 2020 4:44 pm
Both scenarios, train too long for track, and insufficient signalling are equally poor design choices by the player. The train to track length situation is far more obvious, and there is a helper setting that allows us to see how the wagons will fill a track. Insufficient signalling is difficult to foresee, and was especially so when the train would deadlock when its path looked like it should be clear. When space is tight, and a complicated track layout is still in evolution, it is incredibly difficult to catch all possible conflicts. The problems can lay unnoticed for a long time, and then suddenly manifest. It's a trap that I would guess has caught many of us at some time or other. My personal opinion is that a rare train crash due to length is easier to understand and mitigate against, than a subtle signalling issue.

I flippantly remarked earlier that an older Factorio version be played, and the intended message was valid even if it wasn't taken as such. Unless you have actually experienced the subtle deadlock problem, it might be hard to understand the frustrations involved. Also, forcing the old behaviour of a train stopping (deadlocking) at a red signal when crossing its own path statement is equally valid and can still achieved by slaving a circuit controlled signal from the automatic signal that is currently allowing the same ID train to pass its own path.

The only real solution to both problems is to rip up the tracks and ensure that there is both sufficient space and signalling. I'll contend that that is not always possible or obvious in the heat of gameplay.
your fatal flaw was not understanding or remembering that the original case outlined in the FFF was a problem because trains spontaneously repathed in chain segments.

that's why no one is listening to you, you've got no idea what you're talking about (this "helper setting for displaying train car length" is limited to a low number of wagons and only appears when hilighting or managing a train STATION) - you're not a developer - and you keep telling others to shove it and play an older release if we want the correct behaviour. that's why i told you to go away.

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Why does the train crash?

Post by ptx0 »

it should be noted this is also something that mods cannot change.

circuit controlled signals can be devastating to game performance. you realise they will be required *everywhere* and trains can still get stuck and it doesn't fix the issue of trains taking the wrong route when we've signalled and pathed a correct option for them. instead, it makes more problems - unnecessary rail traffic, and more.

DerGraue
Fast Inserter
Fast Inserter
Posts: 151
Joined: Mon May 30, 2016 12:12 pm
Contact:

Re: Why does the train crash?

Post by DerGraue »

ptx0 wrote: ↑
Mon Feb 17, 2020 5:55 pm
we can now make trains avoid blocks they occupy because they don't spontaneously repath.
mrvn wrote: ↑
Mon Feb 17, 2020 3:22 pm
viewtopic.php?f=11&t=19619&p=302527#p302527. But isn't that case obsolete? Trains no longer repath inside chain signals.
Do you guys have a source for that?

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2244
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Why does the train crash?

Post by boskid »

This goes nowhere. ptx0 calm down. AFAIK trains are allowed to repath in chain signal sequence, they are only limited at what path they can choose. Train will hit itself when it its longer than a loop and path goes around loop. Closing topic.

Locked

Return to β€œGameplay Help”