r/factorio • • 3d ago

Question How do I avoid train snake?

Post image
39 Upvotes

61 comments sorted by

18

u/PruneMammoth1286 3d ago

R5: I have no idea what I'm doing with trains and have ended up with a bunch of different train systems, because when i've tried anything more complicated than a loop I inevitably brick the whole thing.

6

u/UnderPressureVS 3d ago edited 2d ago

All you need is chain signals and one-way rail. Build rail like roads, with two parallel sides going in opposite directions (signals go on the right-hand-side, so outside signals for right-hand-drive, inside signals for left).

Build signals at regular intervals. Use only chain signals in intersections. This is not optimized and you can look into how chain signals actually work, but if you replace every single signal in and approaching an intersection with chain signals, it will basically never ever jam. Chain signals check to see if the next block of a train’s route is clear before letting it in, so using them in intersections means trains won’t enter the crossing if they can’t safely leave the crossing.

Too many chain signals will slow your system down because trains will wait when they don't actually need to, but you need a lot of trains before that's actually a problem. With enough chain signals, it is literally impossible for a system to get stuck unless every single block has a train in it.

2

u/Effective_Working567 2d ago

"all you need is chain signals"
"Build signals at regular intervals."

So you use both signals, right? All you need is chain signals at intervals and rail signals on the main loop between intersections.

2

u/UnderPressureVS 2d ago

Yes, sorry. I meant, like, all you need in addition to the basics.

1

u/cdp181 2d ago

Chain signals going into any junction and rail signals exiting the junction and along straight rails. Rail signals shouldn’t really be closer together than your longest train. Ie the train should fit between rail signals.

That way trains will only enter a junction if they can exit it. Will stop a lot of deadlocks.

4

u/Abe_Bettik 3d ago

You can still do loops if its easier to visualize it. Just make a really big loop around your base that "branches" off to stops that then rejoin the main loop.

Also, for any intersection (loop method or not) the rule of thumb is: Chain Signals for trains entering the intersection and Regular Signals leaving it.

2

u/Employee_Agreeable 2d ago

Why?

About the signals

2

u/InstanceFeisty 2d ago

Deadlocks, if you use regular signals for intersection you are at risk of multiple trains entering it and getting stuck. Not all intersections are prone to this but it’s easy to avoid with chain signals - you block any train entering the intersection until the other one leaves it

1

u/ORLYORLYORLYORLY Someone needs to make an openTTD mod for Factorio 23h ago

Rail signal = green if the next section is empty.

Chain signal = green if the next rail signal is green.

Entering an intersection should only occur if the train can also exit the intersection in the same motion, otherwise trains will park across the intersection and block other trains.

The chain signal at the entrance ("chain in") will only go green if rail signal at the intersection exit ("rail out") is green.

2

u/Avenja99 3d ago

All the train lines where I live are laid out spaghetti style so they can run through all these small towns across my state.

1

u/InstanceFeisty 2d ago

Honestly loops are just fine to finish the game. If you want efficiency or better looks the. Do as others suggested, make pairs with one sided trains.

Few extra tips, you can make stations with same name so trains will go to any station with the same name, this way for example you can have multiple drop off stations for iron as well as multiple pick up stations for iron in your system (also works for loops, you can add multiple pickup stations to a single loop to scale it)

1

u/Conscious-Ball8373 2d ago

One thing I did in my current save is grab a book of rail blueprints and make myself use them for everything, right from my first train. Even before I had robots, when I had to place the blueprint and then fill it in by hand. It makes it heaps easier to expand later on because you don't have random rails snaking across the factory.

1

u/Fishinabowl11 2d ago

Build rails in pairs. Pick either left have drive or right hand drive and STICK TO IT. Trains always go a given direction on a given section of track. Build 'trunk rails' as the main line and then fork off of that rail to reach resources and your unloading stations. Don't worry about making your rails go the shortest distance. Keep them vertical or horizontal as much as possible. Chain signals into and within an intersection, rail signals leaving the intersection and approximately equally spaced along straight sections of track.

49

u/Shwayne 3d ago

make multiple trains use the same rails. use one headed trains only. rails are built in pairs, one rail goes forward, another goes backwards. think of them like roads. pick left or right hand drive. signals are dead simple. at the beginning you can just use rail signals for everything. build rails horizontally, vertically or diagonally, even if it means that the route is longer. that will help with organization tremendously.

5

u/IncoherentToast 2d ago

Sometimes I cut down on trains by running long belts to the factory.

1

u/ImInYouSonOfaBitch 2d ago

I've been doing this in my current save. All the way to legendary quality so far and I'm still yet to place a single train on Nauvis.

The megabase is gonna need 'em though

1

u/Independent_Ad8889 2d ago

I’ve done this on every save I’ve ever done except my current one. Nothing wrong with some long ass belts shits just work

4

u/The_Sky_Render 3d ago

Personally I just use hub-and-spoke design, have a central point that all trains go to. When resource patches get added, a new line gets added. When a patch dries up, an old line gets retired and its track redirected to the nearest ore patch. I have yet to have that become a problem. On the rare occasion that overlap between tracks may occur, I just use Space Age elevated rails.

4

u/elfxiong 3d ago

Build orthogonal rails, and only make 90℃ turns and intersections etc.. Make some blueprints first will help a lot - straight rail, turn, and intersection with snap to absolute grid feature.

6

u/UnderPressureVS 3d ago

I’m confused, I set up my trains so they’re only allowed to turn at 90°C like you said, and now trains only work on Vulcanus. What am I doing wrong?

3

u/caseyfw 3d ago

I think with sufficient friction you could make this work on Nauvis and Fulgora. Maybe not Aquilo - you’d need to run heat pipes along the tracks to keep them above 90°C.

7

u/Moist-Snow-8127 3d ago

Nothing wrong with this before late game megabase. This natural stuff is cool

14

u/ChaseyMih 3d ago

All my problems solved the moment I decided to use rail blueprints.

5

u/InstanceFeisty 2d ago

Dang I was fixated on doing it myself, but gave up on intersections, after like million issues with deadlocks. With blueprints I figured it out in the end and have a very simple my own blueprint since then.

2

u/nasaboy007 2d ago

I took a nice hybrid approach. Used intersection blueprints but made my own blocks and depots/etc.

2

u/Ok-Vegetable-204 2d ago

I never gave up, figured out how some of the intersections worked, tried to do a chunk perfect sized one too etc etc

And here I am still refusing to use blueprints while 90% of my playtime is spent figuring out rails, and I still have nothing lmfao

1

u/InstanceFeisty 2d ago

That’s the spirit!

1

u/ChaseyMih 2d ago

Same, I do everything on my own. Spaghetti belts everywhere!

But trains, those are all blueprints.

2

u/Teh___phoENIX 2d ago

Rails are like roads -- just add signals

2

u/Spencigan 2d ago

Your train snakes are beautiful. I love the big loopties they each take. It’s so cute.

2

u/kevin5lynn 2d ago

Nice beautiful city blocks for your main base. Then outposts based on your city block for ressources.

2

u/Ceras836 2d ago

Don't. Embrace the chaos :3

1

u/GinTamago 3d ago

After way too much time trying to make spaghetti railways work in my first run, I just gave up and made a proper train station at the edge of my production line replacing the mines where the initial resource nodes are since I'm not expanding there anyway. Made uniform pathways and just diverging to make a station for gathering resource nodes. Standard uniform T- intersection and crossroads. Keep in mind this is after cliff bombs, I was just really pissed off that I get run over randomly every time I go from one side to another

1

u/MauPow 3d ago

Snappable rail blueprints will change your life.

1

u/Nb4Taco 3d ago

I would recommend to try double track design like one of the comments propose and after you get hold of it and want something fancy switch to blueprints

1

u/ProbablyHe 3d ago

i love how you tried hard to keep them all seperate and then just blipped that one corner in there just to add some signals.

1

u/ResearcherFantastic7 3d ago

Nothing wrong with bit of organic. Even if you start shifting structured grid you still want to keep some organic shapes just for the fun

1

u/bpleshek 2d ago

Use 2 lanes for trains. Like when you drive you have an oncoming lane and an ongoing lane. That'll help a bit.

1

u/stycfy1 2d ago

If it works it works. It's better to play spontaneously if your game time isn't limited

1

u/HeliGungir 2d ago edited 2d ago

Trains going to different stations can share the same rail infrastructure. Like, see those four diagonal rails all next to each other in the upper right? Those can be merged down to two rails - one for each direction of travel. A pair of one-way rails. And along these one-way rails, you can place rail signals (ie: not chain signals) spaced regularly to let multiple trains follow each other in sequence. Much like traffic on an automobile road.

Okay, but what if you want trains to share a single bidirectional rail, not a pair of one-way tracks? While that will be worse throughput, signaling is easier: Just use paired chain signals everywhere. Surround every crossing, split, and merge with chain signals. Use chain signals at every entrance to the shared track. Exits from the shared bidirectional track can be regular rail signals if and only if that exit leads to one-way track.

1

u/FogeltheVogel Slow and steady 2d ago

Setup a highway system, and trains can merge on and off at stops.

1

u/Illustrious_Cod8464 2d ago

How come you don't have biters anywhere baby?

1

u/kondorb 2d ago

Why avoid it? Embrace the snake!

1

u/rosen123 2d ago

Think of rails as roads, roads have 2 lanes (or 2 directions) and are all connected. This is how rails should be as well.

1

u/trollisme_iamtroll 2d ago

Take the time to make your own rail blueprint book. Bonus points if you can figure out aligning on grid - then placing down blueprints is smooth and easy.

1

u/IronmanMatth 2d ago

You stop trying to take the shortest direction from A to B, and instead build highways that connect more straight.

1

u/senotara 2d ago

squares

1

u/SirLightKnight 2d ago

Straight lines, structured pathing and good signaling all can help prevent train snaking. You also may need a significant amount of landfill if you want to maintain this structure setup and you do not have a mega continent.

1

u/obsidianih 2d ago

Build a "mainline" so pick a direction -north south or east west direction. Build two tracks with some space between them. Run power poles down the centre add default signals (I go for power pole spaced lengths). 

Once you're happy with a rail segment design, create a blueprint of it. 

Now the hard part - design an intersection so east west and north south can cross but also change to any direction. (I tend to make a single corner then rotate it for each direction so I can get symmetry) This can be huge or compact depends on train length and if you want to reduce contention or just want it to work. But signals are important to learn. 

Once you get some blueprints start laying track (I use a train and personal roboports) then start laying in a single direction until the next one patch etc. Sometimes just head one direction maybe 1000 rail lengths, then explore the blocks area and find a decent ore patch. Clear biters etc and expand. 

As you expand add blueprints of things you always make, eg a spur line to new resources.

Or just embrace the spaghetti rails and have fun. 

1

u/Little-Bed2024 1d ago

Old advice says to hold a hat pin in your lips when you enter a tunnel.

Ymmv

1

u/Mesqo 1d ago

Figuring railroad was probably the hardest part of the game for me, but it payed off the most compared to anything else.

0

u/Imightbutprobablynot 3d ago

Roundabouts and two rails.

4

u/UnderPressureVS 3d ago

Nilaus converted me. Rather than roundabouts you can just only ever build T-junctions. The throughput is much better.

1

u/Imightbutprobablynot 2d ago

I'll have to try that next time.

0

u/Atomic_Fire 2d ago

City blocks for me. Grab an easy blueprint. Simple roundabouts are plenty efficient intersections and allow u-turns

0

u/twistermonkey 2d ago

Embrace the train spaghetti. This is the way.

0

u/CaptainFit9727 2d ago

One way circle and bypasses on every stop.

0

u/4pigeons 2d ago

i made some blueprints, for mid game, for different patterns, like a straight line, T or + and a cul-de-sac, if you place the signals and rpeaters correctly, you shouldn't have any problem with your trains sharing the same rails

0

u/superbakedveteran 2d ago

I reverted back to spaghetti rails because it's more challenging and fun to watch. 

0

u/NewtonTheNoot 2d ago

You can make functional intersections so long as you use signals correctly. A very simple rule to use is to put chain signals at the entrance and rail signals at the exit.