[0.18.9] Green train signal with train on both sides

Bugs that are actually features.
Post Reply
User avatar
planetmaker
Fast Inserter
Fast Inserter
Posts: 180
Joined: Mon Jan 21, 2019 9:30 am
Contact:

[0.18.9] Green train signal with train on both sides

Post by planetmaker »

Consider the setup as in the screenshot and savegame.

There is a station which is occupied by a train with a signal immediately in front of the station and one immediately after the station.

Why is the signal in front of the station (thus where the train is standing on, gps -96,-48) also green while the train is waiting on the station beyond it?
Attachments
BlueprintBuild.zip
(4.18 MiB) Downloaded 73 times
Bildschirmfoto von 2020-02-29 14-43-04.png
Bildschirmfoto von 2020-02-29 14-43-04.png (2.67 MiB) Viewed 1269 times

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: [0.18.9] Green train signal with train on both sides

Post by disentius »

Interesting.
Tried to trace what happens, came up with this.

On a normal railsegment, the train default stop point is here.(small red circle)
Train stop point - railsegment.png
Train stop point - railsegment.png (872.94 KiB) Viewed 1239 times
If you put a station next to a signal the behaviour changes.
1. if the signal next to the station is not reserved(yellow) the train stop point changes to here, after the signal:
train stop point - signal not reserved yet.png
train stop point - signal not reserved yet.png (120.9 KiB) Viewed 1239 times
2. two ticks after the signal is reserved the train stop point is moved to here make sure the train aligns with the station:
train stop point - two ticks after signal reserved.png
train stop point - two ticks after signal reserved.png (211.18 KiB) Viewed 1239 times
This point is exactly on the boundary between the station segment(?) and the segment guarded by the rail signal. The rail signal changes from reserved to green when train speed reaches 0 (parked at the station)

3. one tick after the train is starting to leave it reserves the signal (yellow) and a tick later it crosses the segment line and the signal becomes red.

Test setup:

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

Re: [0.18.9] Green train signal with train on both sides

Post by boskid »

To get train properly aligned with pumps there is part of a train movement logic that makes sure train is not closer than 2 (arriving distance) from train stop because it would not be possible to align to a given train stop by only moving forward. Since train moves up to a point where it will have distance of 2 from train stop, there is exactly 1 straigh rail that is not going to have train on it when train stops. Signal was first reserved because train path was going through it but when train stopped, signal turned green because of no train on a rail. There is not much value added for fixing this, i do not want to make train move forward a little to start occupying next block since it could cause alignment issues and i do not want to provide extra condition for a signal to turn red when there is no train in next block when there is immediately a train stop that has train stopped.

Moving this to not a bug. In the end, train (head joint of head rolling stock) did not pass a signal so when train is stopped, block ahead is not occupied and so green signal is a correct value.

Post Reply

Return to “Not a bug”