[1.0.0] [Minor] Train with only one stop in schedule shows Time Passed conditions being met imediately

Bugs that are actually features.
Post Reply
robot256
Filter Inserter
Filter Inserter
Posts: 607
Joined: Sun Mar 17, 2019 1:52 am
Contact:

[1.0.0] [Minor] Train with only one stop in schedule shows Time Passed conditions being met imediately

Post by robot256 »

This might be intended behavior, but I couldn't find it documented yet.

To reproduce:
  1. Create a train, track, Train Stop #1 and Train Stop #2.
  2. Add Stop #1 to the train's schedule.
  3. Add a "Time Passed = 30 seconds" condition to Stop #1 in the schedule.
  4. Send the train to Stop #1 in automatic mode.
  5. When the train arrives, see the "Time Passed" condition appear satisfied immediately.
  6. Add Stop #2 to the schedule.
  7. See the condition in Stop #1 reset and start counting time from zero, no matter how long it waited with the "Time Passed" condition appearing to be met.
  8. Remove Stop #2 from the schedule. See the condition appear satisfied immediately again.
  9. Shift-click the track to create a Temporary Stop.
  10. See the train immediately depart for the Temporary Stop without waiting 30 seconds.
Or, just load the following save file and open the train menu before the train you are riding reaches its destination. https://www.dropbox.com/s/32n5nqpbxn7dw ... n.zip?dl=0

What I expected: First, that train schedule conditions would behave the same when only one stop is in the schedule, counting time from arrival at the Stop, even when there is no subsequent Stop for it to go afterwards. Second, that the departure behavior would be the same when either a Train Stop or Temporary Stop are next added to the schedule.

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

Re: [1.0.0] [Minor] Train with only one stop in schedule shows Time Passed conditions being met imediately

Post by boskid »

Thanks for the report. That behavior is intended as the train ignores quite a lot of the schedule logic when there is only one, non temporary schedule record. Not a bug.

robot256
Filter Inserter
Filter Inserter
Posts: 607
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [1.0.0] [Minor] Train with only one stop in schedule shows Time Passed conditions being met imediately

Post by robot256 »

Thanks for the explanation! I didn't realize there were places it treats temporary stops differently than real stops. Also, it looks like "Inactivity" conditions don't get ignored the way Time Passed conditions do in a one-stop schedule.

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

Re: [1.0.0] [Minor] Train with only one stop in schedule shows Time Passed conditions being met imediately

Post by boskid »

For the temporary stops the logic is not skipped so the schedule record at some point expires properly as otherwise it would have to wait extra 5 seconds when the second temporary stop would be added.
Time passed condition uses the value that counts how many ticks train spent in the train stop and when there is only one record this value is immediately forced to very high as it is not being updated because of the part of the logic that is skipped that was incrementing it.
Inactivity condition is measured differently as there is a variable that holds the tick when last entity was interacting with any rolling stock so using current tick the inactivity time can be determined even without the train being updated.

Post Reply

Return to “Not a bug”