Page 1 of 1

[kovarex] [0.17.66] Adding a rail signal causes waypoint stops to malfunction

Posted: Sun Aug 18, 2019 12:09 am
by rain9441
I'm using waypoint stops pretty extensively on a map. Waypoint stops are train destinations that have no wait condition - the train simply drives past it. As of one of the most recent patches, my trains have randomly been stopping at the waypoint stops and no-pathing.

I did some testing and found the cause. When you place a rail signal on the map (anywhere, does not have to even be a connected rail), and at the same time a train is passing by its waypoint stop, it will malfunction. This only happens if the train has a destination stop with no orders and it is currently directly adjacent to that stop the moment the rail signal is placed. When this happens, the train pases by the destination stop but continues to have it's order set to the waypoint station it had just passed. In my case, there was no way to route back to the way point station so it would stop and no path.

Here is a short 1 minute video that shows how to reproduce this: https://youtu.be/J07TbHzy4Es

I would expect that the moment a train can successfully path to a train stop that it is traveling to without wait conditions it immediately changes its destination to the next train stop that is on its schedule, regardless of how many rail signals I place.

Re: [0.17.66] Adding a rail signal causes waypoint stops to malfunction

Posted: Sun Aug 18, 2019 6:03 am
by boskid
Ha! i see the bug. This is tightly related to fix of 73653

Issue is around when stations are reached. By fix of above issue, regular stations are reached when point in 1/6 of locomotive distance from head of train reaches station. However what i see, waypoints are reached when 1/2 of locomotive distance from head of train reaches station. This creates this bug that when train repaths when station is in between of 1/6 and 1/2, it will repath trying again to reach waypoint A/B and because it is already ahead, it cannot back of.

Here is my reproduction based on your video:
74678-t-rain-s.zip
(488.79 KiB) Downloaded 108 times
Just load and play, at some point in time they will enter no path

-- edit:
Here is abuse of this issue: train will go past "Almost B" train station, but not enough to mark it as reached. When train waits on chain signal it still is marked as going for "Almost B" when it is already on route to "B". After 5 seconds of waiting on chain signal, it repaths and this forces train to perform one circle to again go for "Almost B" station
74678-issue-escalated.zip
(273.42 KiB) Downloaded 115 times
74678-loop.gif
74678-loop.gif (2.54 MiB) Viewed 2879 times

Re: [kovarex] [0.17.66] Adding a rail signal causes waypoint stops to malfunction

Posted: Thu Aug 22, 2019 7:14 pm
by Stevetrov
https://www.reddit.com/r/factorio/comme ... d_no_path/ seems to be another example of the same problem.

Re: [kovarex] [0.17.66] Adding a rail signal causes waypoint stops to malfunction

Posted: Mon Aug 26, 2019 1:44 pm
by kovarex
Thanks for the report, the fix was more obvious then I thought, and the bugfix just uncovered slight problem in the logic.

Fixed for the next release.
changelog wrote:
  • Fixed that train schedule waypoint was considered to be passed when train departured the related rail rather when it entered it.