[0.12.19 - minor] Train giving way to all other trains

Things that we don't consider worth fixing at this moment.
Post Reply
jeroon
Filter Inserter
Filter Inserter
Posts: 351
Joined: Sun Jan 26, 2014 10:18 am
Contact:

[0.12.19 - minor] Train giving way to all other trains

Post by jeroon »

I've made a small test setup, but I've seen it in my normal games as well, not sure if this is already being changed for 0.13:

The two trains on the left give way to about every other train on the track before driving off (which they do in the end).

Image

Save and mods attached. I also use WaiTex for HD textures, that's too big to add, and my guess is it doesn't change anything game/logic wise.
Attachments
WeirdTrainStopped.zip
(9.8 MiB) Downloaded 256 times
mods.rar
(99.7 KiB) Downloaded 1109 times

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.19 - minor] Train giving way to all other trains

Post by kovarex »

But what exactly is the problem? I don't really understand.

gheift
Fast Inserter
Fast Inserter
Posts: 188
Joined: Tue Mar 03, 2015 9:20 pm
Contact:

Re: [0.12.19 - minor] Train giving way to all other trains

Post by gheift »

The system, which decides which train goes next through the junction prefers trains on the right side. I think the expected behavior is that after the train on the right passes, the train on the left should pass the junction, because it waits longer than the next incoming on the right. It should handle incoming trains as a FIFO and not as a FILO list.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.19 - minor] Train giving way to all other trains

Post by kovarex »

That is not a bad idea, but it would be much more complex in real world obviously, as there can be X signals guarding the block, and X trains waiting for it, not just left/right.
But yet, it still could be done in a way, that the priority of the signals in the block would somehow affect which train will try to go first.

I'm moving this to waiting for 0.13 (without the promise that it will be actually solved, as there are tons of other things to be done).

jeroon
Filter Inserter
Filter Inserter
Posts: 351
Joined: Sun Jan 26, 2014 10:18 am
Contact:

Re: [0.12.19 - minor] Train giving way to all other trains

Post by jeroon »

This happened to me in my normal game: 2 copper trains were waiting close to the station but gave way to at least 7 other trains, while I needed the copper :D

I agree it doens't have a high priority, it was just something I noticed and thought it was strange :)

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.19 - minor] Train giving way to all other trains

Post by kovarex »

jeroon wrote:This happened to me in my normal game: 2 copper trains were waiting close to the station but gave way to at least 7 other trains, while I needed the copper :D

I agree it doens't have a high priority, it was just something I noticed and thought it was strange :)
Mainly, it is not a bug, it is a feature request. We never said that trains will switch turns when going somewhere.

dee-
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Jan 19, 2015 9:21 am
Contact:

Re: [0.12.19 - minor] Train giving way to all other trains

Post by dee- »

I think the naively expected behaviour of interleaving trains entering from left and right tracks stems from the mechanic that belt splitters use, these are interleaving.

As a workaround to prevent stalling of a train track you could perhaps pseudo-randomize the order in which train/signal logic is evaluated, which, in case of a "more than one train qualify to be sent now"-situation prevents cutting off of trains as described by OP.

SirRichie
Fast Inserter
Fast Inserter
Posts: 244
Joined: Wed Feb 25, 2015 4:50 pm
Contact:

Re: [0.12.19 - minor] Train giving way to all other trains

Post by SirRichie »

I may underestimate the complexity of train scheduling, but here is my suggestion, which I believe should not be too hard to implement:

To me, the whole thing is very similar to scheduling strategies (network packets, processes, ...).
For every block defined by signals, you have a list of waiting trains. Each of these has an arrival time and therefore also a waiting time. You can factor in further parameters like current train speed, amount of resources carried, ...

From these create a normalized utility function (waiting time could get an exponential weight) and whichever train ends up with the highest utility value gets to go.

Post Reply

Return to “Won't fix.”