Page 1 of 1

Is this a bug or a feature?

Posted: Mon May 23, 2022 3:26 pm
by SLB
Recently I found a problem while making a train scheduling system

After the wait condition is reached and Destination full
ddd2.png
ddd2.png (1.21 MiB) Viewed 312 times
As shown
TrainID signal disappeared but TrainCount signal still exists?

At this time, is the train still in the station or not in the station?

Re: Is this a bug or a feature?

Posted: Mon May 23, 2022 3:50 pm
by robot256
Train is no longer waiting at the station, but it has not departed yet, so it has not released its reservation at the stop yet. This is important so that another train does not path to the stop while there is no space for it. It does, however, mean that you cannot make two trains "swap stations" if both stations have a train limit of 1.

Re: Is this a bug or a feature?

Posted: Mon May 23, 2022 3:59 pm
by mmmPI
SLB wrote:
Mon May 23, 2022 3:26 pm

At this time, is the train still in the station or not in the station?
It depends who ask the question :)

At this time the train is not in the station for the purpose of inserters that would load material onto the wagon, or for the purpose of transmitting the train inventory to the wire network through the station.

However, the train is still at the station for the purpose of the train pathfinding that could otherwise send another train to a station if it was considered empty.

To make things less confusing the proper wording according to the wiki advise to use "train stop" when refering to the 2x2 piece of building, while "train station" is used for the schedule.

Here that would be the train stop, the train is still at the train stop, if the limit to that train stop is 1, the train count as 1. But if you set up the train departure condition to wait 20 sec, the inserter/pump will only be seeing the train for 20 sec even if the train stays at the train stop for 2 minutes before being allowed to move again.

Re: Is this a bug or a feature?

Posted: Mon May 23, 2022 4:03 pm
by SLB
robot256 wrote:
Mon May 23, 2022 3:50 pm
Train is no longer waiting at the station, but it has not departed yet, so it has not released its reservation at the stop yet. This is important so that another train does not path to the stop while there is no space for it. It does, however, mean that you cannot make two trains "swap stations" if both stations have a train limit of 1.
yes I found the problem when trying something like make two trains "swap stations"

Currently my solution is when the TrainID signal disappears
Send -1 TrainCount signal to destination station

Anyway, just make sure it's a feature

thanks