Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post pictures and videos of your factories.
If possible, please post also the blueprints/maps of your creations!
For art/design etc. you can go to Fan Art.

Bobins
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri May 08, 2020 3:40 am
Contact:

Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Bobins »

While in the midst of fixing multiple supply issues within my latest factory, since returning after a sabbatical... Running around like a near headless chicken, from one issue to another after starting to launch rockets, which kicked the full factory into production... showing up all the supply issues I had to fix... I was Maliciously Mowed down by own of my own trains!!!!!

Its something I knew to expect sooner, or later... having had multiple Train deaths in the past, but it wound me up a treat after dodging lots of trains so far this play-through and having my shields save me a few times... To actually Die... Grrr... well it side tracked me completely from what I was doing... As often happens within Factorio, when identifying issues whilst working on something completely different :)...

I just couldn't let this happen again!!! So I spent some time and created a Level-Crossing traffic light system, to hopefully give me a heads up and prevent further Train deaths going forwards...

I've seen other gated/logic systems which guarantee protection when using a level crossing, I may try and build one in future, but I'm proud of my simple warning solution none-the-less :) Now, no matter the zoom level - If I ignore the Traffic lights, its my own fault if I Die! :)


Factorio_Level_Crossing_Traffic_Lights.gif
Factorio_Level_Crossing_Traffic_Lights.gif (7.01 MiB) Viewed 7679 times

theolderbeholder
Fast Inserter
Fast Inserter
Posts: 135
Joined: Wed Sep 20, 2017 5:45 pm
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by theolderbeholder »

Not that I really need this, just out of couriosity: How did you make this? Just wire up the preceeding signals? How will this cope with edge cases like nuclear fuelled LC trains?

Eketek
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Mon Oct 19, 2015 9:04 pm
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Eketek »

Trains are really just thinly disguised biters. If you really want train-safety, wall off all of your tracks, set up gated crossing points, and wire up all of your train stops to disable the moment you enter a crossing point anywhere in your system.

Bobins
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri May 08, 2020 3:40 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Bobins »

Hey theolderbeholder,

Aye, it's not necessary, but since I've put it in place its saved my skin on countless occasions already :)

Pretty much:
  • My Rail Signals are placed along side the Big Electric Poles; The Rail signals at the first 2 poles preceding the Level-Crossing are wired up with Red wire, then the Rail signals along side the 3 poles further down the track are wired up with Green wire, so all in all 5 poles and adjacent rail signals preceding the crossing are wired up. (I've done it this way to account for different speed trains but you could always wire up more, say 6 poles for Amber & 3 for Red, if you have crazily fast trains flying around your railway, giving you a longer Amber lamp activation and slightly longer Red.)

    Rail Signals
    Rail Signals
    LevelCrossingSetup_Signals.jpg (115.08 KiB) Viewed 7595 times
  • The wires are all then strung to the level crossing using the Big Poles and then fed into 3 Decider Combinators (DC) (each direction of travel is on its own circuit network/set of combinators so 6 DC's used in all).

    Signals Recieved
    Signals Recieved
    LevelCrossingSetup_Signals_Recieved.jpg (139.89 KiB) Viewed 7595 times
  • The Red Wire is connected to a DC for setting lamps to Red, Green Wire into the 2nd DC for setting lamps Yellow/Amber and both Green & Red Wires are connected to the DC for setting the lamps Green.
  • Its then just a bit of logic within the combinators based on the signals being received:
    • Red Combinator: In my setup with 2 Poles (4 rail signals) preceding the Level-Crossing being fed into the Red combinator.
      • Set to output a Red signal of 1 whenever the Green Signal received from the Red wire drops below 4.

        Red Decider Combinator
        Red Decider Combinator
        LevelCrossingSetup_Combinator_Red.jpg (60.57 KiB) Viewed 7595 times
    • Yellow/Amber Combinator: 3 Poles (6rail Signals) fed into the Yellow/Amber combinator
      • Set to output a Yellow signal of 1 whenever the Green Signal received from the Green wire drops below 6.

        Yellow/Amber Decider Combinator
        Yellow/Amber Decider Combinator
        LevelCrossingSetup_Combinator_Amber.jpg (43.91 KiB) Viewed 7595 times
    • Green Combinator: Both Green and Red wires being fed into the Green combinator - 5 Poles (10 Rail Signals)
      • Set to output a Green signal of 1 whenever the combined Green Signals received from both Red&Green wires is > 9.

        Green Decider Combinator
        Green Decider Combinator
        LevelCrossingSetup_Combinator_Green.jpg (43.58 KiB) Viewed 7595 times
  • All three combinators are then strung, with the same colour wire, to a Medium Electric Pole and onto the lamps being used for the colour warnings, the lamps being set to Use Colours, when Anything (*) is > 0 :)

    Lamps
    Lamps
    LevelCrossingSetup_Lamps.jpg (89.74 KiB) Viewed 7595 times


Hope you find the setup & walk-through useful, if you decide to setup something similar :) Enjoy.

Bobs
Last edited by Bobins on Tue May 19, 2020 4:20 am, edited 9 times in total.

Bobins
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri May 08, 2020 3:40 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Bobins »

Hey Eketek,

I wasn't aware that was how those gated setups worked... thanks for the info, it seems a little over the top mind to "No Path" your entire network of stations, even if only for a few seconds and even then i don't see how that could provide 100% protection as momentum of a traveling train could potentially kill you as they nopath... I maybe misunderstanding tho :)

I thought it would be possible to setup a guaranteed safety system with gates by linking them to Rail signals close to the Level-Crossing, with some logic... I'm tempted to play around and setup a guaranteed Level-Crossing system in time... but sooo much else to work on within my factory atm and my current traffic light system seems to be saving my life as it is lol :)

Bobins
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri May 08, 2020 3:40 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Bobins »

Hey theolderbeholder

An Update on the query in your reply:
How will this cope with edge cases like nuclear fueled LC trains?
During my play time last night/early hours or this morning, I've got to the stage where I've upgraded my Railway to use Rocket Fuel... which has the same maximum speed as Nuclear Fuel, just a slower acceleration bonus. If anything with faster trains the system I've implemented could be linked upto less, not more Big Electric Poles and their Rail Signals (although this may not be as effective if you have a mix of Fast and Slow trains within your network... as I've not tested a heavily laden, potentially slow/accelerating train for timings).... This appears to be as a result of the way Rail Signals are programmed to work within Factorio itself... I.e. changing their state earlier based upon the speed of an approaching Train, to prevent collisions.

After upgrading my Railway's fuel source to Rocket Fuel I noticed I seemed to be getting a longer lamp lighting when using my Level-Crossings, without changing the setup I've explained above. For clarity, my trains are currently running as small, fast trains with a 1x2 setup... Therefor I quickly tested the warning system before posting this with a 1x0 on Rocket fuel and a 4x0 on rocket fuel... The system I've implemented gives ample warning of an approaching train at maximum speed... also because of the way I've created this warning solution, to be based upon when the Rail Signals around the monitored Big Poles change from a green state, the ultimate length of a train will have no affect on the Warning. This is because the Rail signals initially change to Red as soon as the first locomotive enters the block and doesn't go back to green until the last wagon has cleared the block, so I'm confident the length of a train won't have any effect on the pre-arrival warning/changing of lights... the lights will just stay Red longer, until the last wagon has cleared the last monitored block :)

Cheers Bobs

User avatar
Ranger_Aurelien
Fast Inserter
Fast Inserter
Posts: 170
Joined: Thu Apr 25, 2019 1:53 pm
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Ranger_Aurelien »

Bobins wrote:
Mon May 18, 2020 11:33 pm
Aye, it's not necessary, but since I've put it in place its saved my skin on countless occasions already :)
Bobs
I just recently added gate safety to my busiest area. First I realised the wall gate anchor sides both give a signal when a human/vehicle is near as well as can react to a signal. Simplest use is to activate both (e.g., run a wire from a pole to the end of the gate (yellow square), so on SIGNAL , emit G=1. Then on incoming G=1, open the gate. Then also wire in from the incoming rail signal, emit G= -1 when a train is in the block.
Tada!
The gate will close when train is coming, even if a human is near.

Image


Another train safety tip: enable the Train Stopping Distance indicator which will put a red dot a short ways in front of a train to show you a train is coming:
Press F4 for overlay layers, then check beside:
"show-train-braking-distance"

https://wiki.factorio.com/Debug_mode


Image

You may also like
"show-train-stop-point" to help around areas where trains are prone to stop...
-
Ranger Aurelien
"Knowledge Brings Fear" -- Motto of Mars University, Futurama

User avatar
Ranger_Aurelien
Fast Inserter
Fast Inserter
Posts: 170
Joined: Thu Apr 25, 2019 1:53 pm
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Ranger_Aurelien »

Bobins wrote:
Tue May 19, 2020 3:35 am
After upgrading my Railway's fuel source to Rocket Fuel I noticed I seemed to be getting a longer lamp lighting
After posting what I did re-reading your post made me ponder the RAIL gate timings (e.g., a wall gate over rail line). I have nuclear trains and I remember pondering the gate across the rail is down a few seconds before the train enters the screen. I was frankly a bit concerned as you can see in my screenshot sometimes the way I linked the Gate G signal to a rail control light was not reacting fast enough...

So aha, I have now added the gate over rail detection to the input.

Image


I have found one flaw -- it will open the gate a short time if the player is not there.

Work continues...
-
Ranger Aurelien
"Knowledge Brings Fear" -- Motto of Mars University, Futurama

Bobins
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri May 08, 2020 3:40 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Bobins »

Hey Ranger_Aurelien

Thanks for sharing your gate safety build, I'm glad to see its coming along nicely and you've been ironing out bugs :).

I'll definitely be implementing a gated system in my busy areas going forwards! I'll likely use a combination of gated systems for the ultra busy spots and warning lights for the high speed branches of my network that i nip across now and then :)

Cheers Bobs

User avatar
Ranger_Aurelien
Fast Inserter
Fast Inserter
Posts: 170
Joined: Thu Apr 25, 2019 1:53 pm
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Ranger_Aurelien »

Alrighty. One corpse on the track later, I'm at 3 logic circuits (Was hoping to do this with fewer), but at least it will keep the bugs out while the trains zoom by.


First we take signals from either the train's gate (GREY) (as warning), or the rail signal (RED) (train currently in the block). If either are 1, (RED OR GREY) then return T(Train)=1.

The second combinator reverses the signal. (e.g., T=1 returns N=0, T=0 becomes N=1), by T XOR 1.

The human gates will return the proximity sensor of Human H=1.
The combinator will send the Gate Open Now (G=1) signal only if H=1 AND the Notrain signal =1 (N=1).

I know I could compact these closer, but kept them apart for clarity and debugging.

Image

What do you think, sirs?
-
Ranger Aurelien
"Knowledge Brings Fear" -- Motto of Mars University, Futurama

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Optera »

Am I missing some requirement other than gate closes light goes on when train passes through?

I can do that with 0 combinators:
train reserves, or is on, the piece of track of the crossing - the lamps go red and the gate locks
player triggers the gate - lamp turns green and the signal blocks trains from entering

2020-05-23 210341.png
2020-05-23 210341.png (357.28 KiB) Viewed 7333 times

Edit: Fixed bp for vanilla, Dectorio messed up gate output signals.
Last edited by Optera on Sun Jun 21, 2020 9:39 am, edited 3 times in total.

User avatar
Ranger_Aurelien
Fast Inserter
Fast Inserter
Posts: 170
Joined: Thu Apr 25, 2019 1:53 pm
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Ranger_Aurelien »

Optera wrote:
Sat May 23, 2020 7:08 pm
Am I missing some requirement other than gate closes light goes on when train passes through?
But, but, you're stopping the trains! :)
More seriously, suddenly raising the gate can cause the train to crash into the gate, causing both to be damaged. (This happened as I was testing on a test track with trains going around...)


Also, the BP you posted seems too small to permit rails... Did I do something wrong importing it? I tried orienting it as in your picture with the lights stopping foot traffic.
Image



Here is the BP for my setup for others to try:
Image



If the technology survives peer review I'll clean it up and repost.

Thanks!
-
Ranger Aurelien
"Knowledge Brings Fear" -- Motto of Mars University, Futurama

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Optera »

Ranger_Aurelien wrote:
Sat May 23, 2020 11:36 pm
But, but, you're stopping the trains! :)
There's no other way to prevent trains from running you over when you are on the crossing.
Ranger_Aurelien wrote:
Sat May 23, 2020 11:36 pm
More seriously, suddenly raising the gate can cause the train to crash into the gate, causing both to be damaged. (This happened as I was testing on a test track with trains going around...)
Look at my screenshot, the gate don't go across the track.
Ranger_Aurelien wrote:
Sat May 23, 2020 11:36 pm
Also, the BP you posted seems too small to permit rails... Did I do something wrong importing it? I tried orienting it as in your picture with the lights stopping foot traffic.
Place the blueprint over existing tracks.
I never include tracks in such blueprints so they can be moved back and forth by 1 tile instead of being locked to the tracks 2 tile grid.

theolderbeholder
Fast Inserter
Fast Inserter
Posts: 135
Joined: Wed Sep 20, 2017 5:45 pm
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by theolderbeholder »

Thanks big time. As soon as I have a PC which is fast enough again I will try to replicate your setup.

Bobins
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri May 08, 2020 3:40 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Bobins »

Ranger_Aurelien wrote:
Sat May 23, 2020 3:27 pm
What do you think, sirs?
Brilliant solution!

I've finally got to the state within my Factory where my traffic lights on certain sections are just not good enough! The rail branch is now sooo busy that at times its still like playing chicken with the trains, so I will be implementing a gated solution as my next project.

You've created what seems to me to be a truly elegant solution, preventing train deaths whilst seeming to give approaching high speed trains priority, preventing momentum collisions & damage just to prevent a train death... Nicely Done! :)

Cheers Bobs
Last edited by Bobins on Fri May 29, 2020 10:00 pm, edited 5 times in total.

Bobins
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri May 08, 2020 3:40 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Bobins »

Optera wrote:
Sat May 23, 2020 7:08 pm
Am I missing some requirement other than gate closes light goes on when train passes through?

I can do that with 0 combinators:
train reserves, or is on, the piece of track of the crossing - the lamps go red and the gate locks
player triggers the gate - lamp turns green and the signal blocks trains from entering

2020-05-23 210341.png
Hi Optera

I believe this would work in maybe 90-95% of cases, but as Ranger_Aurelien has mentioned it would stop trains... (my understanding of Ranger_Aurelien solution is that it will only stop trains when a player is on the tracks, if there is an approaching train the gates which allow a player to cross, will not open despite player proximity) but more importantly I believe there may still be a potential for death from the momentum issue with approaching trains (this is why signals go yellow, to reserve rail blocks when there isn't enough time for an approaching train to stop, if another train & in this situation person enters the block) as there doesn't appear to be gates on the rail line in this setup.

I've not re-created the solution provided by Ranger_Aurelien, however it appears to provide a guaranteed safe crossing; in my mind a 100% safe crossing will always require the use of the Logic System provided by combinators etc :)

Cheers Bobs

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Optera »

Bobins wrote:
Fri May 29, 2020 9:29 pm
Hi Optera

I believe this would work in maybe 90-95% of cases, but as Ranger_Aurelien has mentioned it would stop trains... (my understanding of Ranger_Aurelien solution is that it will only stop trains when a player is on the tracks, if there is an approaching train the gates which allow a player to cross, will not open despite player proximity) but more importantly I believe there may still be a potential for death from the momentum issue with approaching trains (this is why signals go yellow, to reserve rail blocks when there isn't enough time for an approaching train to stop, if another train & in this situation person enters the block) as there doesn't appear to be gates on the rail line in this setup.

I've not re-created the solution provided by Ranger_Aurelien, however it appears to provide a guaranteed safe crossing; in my mind a 100% safe crossing will always require the use of the Logic System provided by combinators etc :)

Cheers Bobs
You seem to have written that without either testing my design nor reading my description.
1) Gates will be locked when the entrance signal is either red (train in section) OR yellow (train has reserved section).
2) Player proximity to the gates can only lock entrance signal if not in state 1.

Bobins
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri May 08, 2020 3:40 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Bobins »

No offense intended Optera... indeed I wrote my reply without actually testing your design in game - I aimed to word my reply to imply as such - and based my reply purely upon reading and viewing your supplied image... Truth be told, I've been too busy lost in my current addition to the game and developing my latest factory to actively test the solutions you and Ranger_Aurelien have provided to the Level-Crossing scenario.

All ideas are of course welcome, and great to see! If your solution is indeed infallible and guarantees 100% safety, it's a brilliant solution.

Cheers Bobs

P.S Great tip with regards to not including rails in blueprints to allow free placement anywhere along the track :)

foamy
Filter Inserter
Filter Inserter
Posts: 432
Joined: Mon Aug 26, 2019 4:14 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by foamy »

@Opetra: I tested it. Your design fails in the case of a player being on the tracks when a train comes. It, in fact, traps them by raising the gates; there is no lock on the trains entering if the gates detect a player. I presume you didn't intend that.


Here's my crack at this problem, which I'm using in a MP 1 RPM base:

Image



It does use combinators, but only two. I have managed to break it by cycling back and forth rapidly -- which with enough movement speed can put you on the far side of a gate before it can close -- but that's a malicious use case. And even in that scenario, there's a one tile gap on each rail, so's the player can still avoid being flattened :v

(EDIT: With some timeout circuitry prohibiting a state change in the signals/gates directly after a prior one I could probably eliminate that behaviour, but it'd complicate the wiring a fair bit)

Crossing gates are wired to output a P signal if the player's near them, and open on a G signal. Rail signals output red signals if they're either reserved or closed, green otherwise, and are set to close on a G signal. Combinator 1 outputs the value of the P signal if and only if there's no red signals; Combinator 2 outputs a G signal if there's a P signal. Train gates are set to open if G is 0.

Thus:

The crossing gates will open if, and only if, there is both a player nearby and no trains in or approaching the crossing. They will then stay open until the player exits, by virtue of the overlapping sensors. If the crossing gates are open, the rail signals are forced closed, as are the train gates. That's done so that a player can't wander out of the safe crossing.

There's a speaker and lamps wired in as well; the lamps will display green if the crossing is safe, white if a player is in it, and red if a train is using it. The speaker will trigger if a train tries to use it.

BP includes RHD track; it's designed to drop into a 1-4 block layout. Altering for LHD is trivial, just requires moving the signals and then reconnecting the wires. Likewise adjusting the block length to whatever your rail net uses -- slide the signals to the appropriate distances, then connect 'em back up.


User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Train Death Prompted circuit solution :) (Level Crossing Warning Lights)

Post by Optera »

foamy wrote:
Fri Jun 19, 2020 9:48 pm
@Opetra: I tested it. Your design fails in the case of a player being on the tracks when a train comes. It, in fact, traps them by raising the gates; there is no lock on the trains entering if the gates detect a player. I presume you didn't intend that.
Would be interesting how you tested.
I assume you either changed my design or stepped on the track while the gates where raised. Otherwise it's not possible to have trains and players on the crossing at the same time.

Post Reply

Return to “Show your Creations”