[0.16.51] Wired-closed-signal path penalty not applied?

Bugs that are actually features.
Post Reply
quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

[0.16.51] Wired-closed-signal path penalty not applied?

Post 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.
Attachments
wired-closed-penalty-not-applied.zip
(3.73 MiB) Downloaded 74 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13173
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] Wired-closed-signal path penalty not applied?

Post 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
If you want to get ahold of me I'm almost always on Discord.

betrok
Fast Inserter
Fast Inserter
Posts: 101
Joined: Wed Feb 28, 2018 12:08 pm
Contact:

Re: [0.16.51] Wired-closed-signal path penalty not applied?

Post by betrok »

One day we will have the complete source code consisting of gists.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: [0.16.51] Wired-closed-signal path penalty ignored?

Post by quyxkh »

Rseding91 wrote: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
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.
Attachments
wired-closed-penalty-not-applied-switchable.zip
(3.78 MiB) Downloaded 67 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13173
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] Wired-closed-signal path penalty ignored?

Post by Rseding91 »

quyxkh wrote:
Rseding91 wrote: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
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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”