Page 1 of 1
[0.12.19 - minor] Train giving way to all other trains
Posted: Wed Nov 25, 2015 7:50 pm
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).
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.
Re: [0.12.19 - minor] Train giving way to all other trains
Posted: Thu Nov 26, 2015 10:17 am
by kovarex
But what exactly is the problem? I don't really understand.
Re: [0.12.19 - minor] Train giving way to all other trains
Posted: Thu Nov 26, 2015 11:05 am
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.
Re: [0.12.19 - minor] Train giving way to all other trains
Posted: Thu Nov 26, 2015 6:09 pm
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).
Re: [0.12.19 - minor] Train giving way to all other trains
Posted: Thu Nov 26, 2015 8:03 pm
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
I agree it doens't have a high priority, it was just something I noticed and thought it was strange

Re: [0.12.19 - minor] Train giving way to all other trains
Posted: Thu Nov 26, 2015 8:08 pm
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
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.
Re: [0.12.19 - minor] Train giving way to all other trains
Posted: Fri Nov 27, 2015 8:12 am
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.
Re: [0.12.19 - minor] Train giving way to all other trains
Posted: Tue Dec 01, 2015 12:36 pm
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.