Page 1 of 1
[0.16.51] Wired-closed-signal path penalty not applied?
Posted: Tue Jul 03, 2018 1:56 am
by quyxkh
Load up the attached save and watch which path the next train to arrive (about ten seconds in) picks.
The three stacker lanes each have a single close-on-condition signal on them, set to close on Anything=2. The two other connected signals on each lane are short-train detectors, with signal 1 (left) 2(middle) or 3(right) sent on red forward and green behind so signal 1's value is 2 if there's a short train in the left lane. It's all one circuit, either all three lanes have a wired-closed signal or none of them do.
The incoming train had three lanes to pick from on departure, and picked the lane with the short train, rejecting the shorter path through the empty lane.
Re: [0.16.51] Wired-closed-signal path penalty not applied?
Posted: Tue Jul 03, 2018 11:21 am
by Rseding91
Thanks for the report however the signal closed by circuit network is being applied. You can see the logic the game uses here:
https://gist.github.com/Rseding91/c0d4d ... r-cpp-L148
Re: [0.16.51] Wired-closed-signal path penalty not applied?
Posted: Tue Jul 03, 2018 12:52 pm
by betrok
One day we will have the complete source code consisting of gists.
Re: [0.16.51] Wired-closed-signal path penalty ignored?
Posted: Tue Jul 03, 2018 3:21 pm
by quyxkh
I added a constant combinator with Signal_1=3 Signal_2=3 Signal_3=3 to the circuit.
With the combinator on, nothing ever equals 2, the condition's never met.
Turn the combinator off, with the short train in the stacker the green condition-met light on all three signals turns on, they're all wired closed, so 1000 _should_ be added to the length of all three paths.
But if that were the case, the path length comparison results wouldn't change, and the route selection wouldn't change. But it does.
Whatever's actually producing the symptom here—and there's a reason I put a question mark in the title—it's _behaving as if_ the penalty is unpredictably not being applied.
Re: [0.16.51] Wired-closed-signal path penalty ignored?
Posted: Tue Jul 03, 2018 9:57 pm
by Rseding91
quyxkh wrote:
I added a constant combinator with Signal_1=3 Signal_2=3 Signal_3=3 to the circuit.
With the combinator on, nothing ever equals 2, the condition's never met.
Turn the combinator off, with the short train in the stacker the green condition-met light on all three signals turns on, they're all wired closed, so 1000 _should_ be added to the length of all three paths.
But if that were the case, the path length comparison results wouldn't change, and the route selection wouldn't change. But it does.
Whatever's actually producing the symptom here—and there's a reason I put a question mark in the title—it's _behaving as if_ the penalty is unpredictably not being applied.
You're free to look at the linked gist - that's the full logic for what trains use to find paths. From everything I've tested they're working correctly.