Page 1 of 1

Chain-Signal Circuit Connectivity

Posted: Sun Aug 21, 2016 7:54 pm
by phi1010
I didn't see it in Circuit network features for 0.14 or find it on the search, i hope i didn't miss it:

I'm a bit of a safe rail crossing fanatic: I want to be able to run over a rail junction without getting run over. ^^

Normal signals already output their status; presignals currently don't seem to be able to be connected. On a four-way junction with 8 tracks (4 in, 4 out) I can find out where the train is going by looking at the last (normal) signals, but I don't see where the train is coming from or which path it will take, since I can't connect those presignals. (Which path is relevant if there are multiple trains on the crossing, they might be both turning left or both turning right, only looking at the two ingoing signals and the two outgoing signals doesn't make those two situations distinct.)

Turning presignals red by wire could probably have the same behaviour as with normal signals.

To get as much Information as possible, the output might be a bit different from just passing green/yellow/red/blue to the wire. Or offering two radio buttons to select the desired simple/advanced behavior?

Somewhat advanced and not necessarily intuitive behavior: Look up the status of all paths to any exit (normal) signal, and output the sum of those data signals. (Ignore the configuration of other signals, only the signal status -> data signal mapping of the currently calculated presignal should be used. This avoids changing the presignal output when another signal is reconfigured, or not configured, because it's not attached to any network. Otherwise we could use train tracks as really long wires...)

Every path from an presignal is also included in the path of an earlier presignal, thus we could subtract the output values of two different signals to get the information whether a path is safe.
  • Three exit paths, all free, presignal is green:
    Output {green: 3}
    -
  • One exit path get's blocked, presignal turns blue:
    Output {green: 2, red: 1}
    -
  • A train reserves one of the free paths, blue presignal turns yellow:
    Output {green: 1, yellow: 1, red: 1}
    -
  • The train passes the reserved presignal, presignal turns red:
    Output {red: 3}
List items as images
This might not work in a roundabout; they sometimes already seem to have difficulties when a presignal-path runs through the same section twice, as in a q-turn on a sailing boat. This case might be difficult to define without knowing the actual implementation.

EDIT: "Q-Turn" doesn't seem to be used in English that much, that's what I mean:
Image

Re: Pre-Signal Circuit Connectivity

Posted: Sun Aug 21, 2016 8:10 pm
by ssilk
Very cool, deeply worked out. :) I change the topic cause the pre-signals in Factorio are chain-signals. ;)

I think cause of that you didn't found the former discussion: viewtopic.php?f=6&t=28018 Make Chain Signal connectable to circuit network

Re: Pre-Signal Circuit Connectivity

Posted: Sun Aug 21, 2016 8:14 pm
by phi1010
ssilk wrote:I change the topic cause the pre-signals in Factorio are chain-signals. ;)

I think cause of that you didn't found the former discussion: viewtopic.php?f=6&t=28018 Make Chain Signal connectable to circuit network
Maybe change the "Pre-signals: search.php?keywords=pre-signals&fid=6" in the pinned "Frequently Suggested Ideas" too? (Or are there also "pre-signals", and I don't know what they are?)