Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Ignoranus
Jun 3, 2006

HAPPY MORNING

kiwid posted:

Using a red wire works. It all makes sense now that it's hooked up. I wonder how the original managed to do it without red wire though.

I got the setup working based on the design but it seems more effective to handle outside bounds instead.

Combinator 1: "Is liquid < 500?" (under threshold) then output red to light and combinator 3;
Combinator 2: "Is liquid > 2000?" (into safe zone) then output green to light and combinator 3;
Combinator 3: "Are neither combinator 1 nor combinator 2 outputting signals?" (we're between threshold and safe zone) then output yellow to light.

The problem arises when the signals from the front of combinator 3 (the one checking for 'no signal' is looped back into its own input. I'm not sure the best way to sanitize that, if not through using different color wires.

The original arrangement may in fact have relied on light-color priority.

Adbot
ADBOT LOVES YOU

Solumin
Jan 11, 2013
Either it relies on that ordering or it always ensures only 1 signal reaches the light.

I'd have to check the special signals again to see if there's a way to avoid the flickering while still using their wiring scheme. But a perfect copy isn't necessary, as long as you get the desired behavior.

Also, contents > upper limit is not the safe zone, because you're at risk of filling the tank and backing up your whole oil processing system.

Ignoranus
Jun 3, 2006

HAPPY MORNING

Solumin posted:

Either it relies on that ordering or it always ensures only 1 signal reaches the light.

I'd have to check the special signals again to see if there's a way to avoid the flickering while still using their wiring scheme. But a perfect copy isn't necessary, as long as you get the desired behavior.

Also, contents > upper limit is not the safe zone, because you're at risk of filling the tank and backing up your whole oil processing system.

Fair enough! I was thinking in terms of not running out, but if we're talking oil production, you're definitely right.

Solumin
Jan 11, 2013

Ignoranus posted:

Fair enough! I was thinking in terms of not running out, but if we're talking oil production, you're definitely right.

Thinking about it more, it depends if you want to know how the tank is doing individually or as part of the whole. By itself, more full is better, so green for full makes sense. But as a component of the whole oil processing pipeline, completely full is not good, so yellow makes sense.

The third option is to measure the rate of change of the tank's contents and output red if it's falling, yellow if it's rising and green if it's relatively stable.

M_Gargantua
Oct 16, 2006

STOMP'N ON INTO THE POWERLINES

Exciting Lemon
I've played around with different styles of differentiating circuits and none work well. The good ones require extensive use of counters which gets complex and overuse slows UPS very quickly, even on a 6700K. I ended up using only four. One each for iron ore, copper ore, crude, petroleum, and green circuits. Everything downstream of that had nice and simple logic latches to startup or shutdown when needed.

little munchkin
Aug 15, 2010
what's the difference between red and green wire?

Ignoranus
Jun 3, 2006

HAPPY MORNING

little munchkin posted:

what's the difference between red and green wire?

They're functionally identical but signals don't cross from red to green and vice versa, so you can have two separate networks that physically overlap without mixing.

kiwid
Sep 30, 2013


This is definitely the best setup: http://imgur.com/a/BWEZ5

Ignoranus
Jun 3, 2006

HAPPY MORNING

kiwid posted:

This is definitely the best setup: http://imgur.com/a/BWEZ5

Are you presenting this as a different setup or agreeing with me? It looks like you've arrived at the same pattern that I was describing, but I could be missing something.

Poil
Mar 17, 2007

Circuits are really cool but kinda tricky and severe headache inducing with complicated stuff. I tried to set up a secure rail crossing with gates and while it turned out to be very safe it was only because of the gates across the tracks closing and nearby trains smashing into them. Fortunately I had the perfect solution to fix it, doing nothing as a nearby roboport kept repairing the damage. :v:

Ignoranus
Jun 3, 2006

HAPPY MORNING

Poil posted:

Circuits are really cool but kinda tricky and severe headache inducing with complicated stuff. I tried to set up a secure rail crossing with gates and while it turned out to be very safe it was only because of the gates across the tracks closing and nearby trains smashing into them. Fortunately I had the perfect solution to fix it, doing nothing as a nearby roboport kept repairing the damage. :v:

My favorite rail crossing setup is one that is just gates laid across the track itself - not on the players' path - because the gates will automatically open when a train is nearby and pathing through them. I guess you can turn on/off rail signals using circuits but it does some odd things to the pathfinding or something.

kiwid
Sep 30, 2013

Ignoranus posted:

Are you presenting this as a different setup or agreeing with me? It looks like you've arrived at the same pattern that I was describing, but I could be missing something.

Agreeing.

Ignoranus
Jun 3, 2006

HAPPY MORNING

kiwid posted:

Agreeing.

Huzzah, I got something right for once! :unsmith:

M_Gargantua
Oct 16, 2006

STOMP'N ON INTO THE POWERLINES

Exciting Lemon

Ignoranus posted:

My favorite rail crossing setup is one that is just gates laid across the track itself - not on the players' path - because the gates will automatically open when a train is nearby and pathing through them. I guess you can turn on/off rail signals using circuits but it does some odd things to the pathfinding or something.

or...



When the Player approaches either gate, the gate outputs signal G which causes the signal on the entry to the crossing to close.



When a train approaches the crossing, the entrance signal turns yellow, and when it is yellow or red its output signal blocks the gates, preventing the player from running in while a train is coming.




I have the signal output the red color signal for both non-green states which tie into the completely cosmetic lights.

ShadowHawk
Jun 25, 2000

CERTIFIED PRE OWNED TESLA OWNER
Will a train going at full speed actually stop if a signal right in front of it suddenly changes due to some circuit condition?

M_Gargantua
Oct 16, 2006

STOMP'N ON INTO THE POWERLINES

Exciting Lemon

ShadowHawk posted:

Will a train going at full speed actually stop if a signal right in front of it suddenly changes due to some circuit condition?

No, but if its right in front of it then it will be in the intersection before you are, even if you ignore it completely and keep running.

Poil
Mar 17, 2007

ShadowHawk posted:

Will a train going at full speed actually stop if a signal right in front of it suddenly changes due to some circuit condition?
It will however stop if a gate closes right in front of it. :eng101:

Truga
May 4, 2014
Lipstick Apathy
I think the signal goes yellow once a train is past the point of no stopping?

Solumin
Jan 11, 2013
I'm pretty sure trains reserve the block they're in and the next block. The circuit conditions on signals explicitly say that the train won't stop if the signal changes while the train has the block reserved, if I'm remembering it correctly. If you set up your signals with any semblance of sanity, there should be enough room for the train to stop if the signal 2 blocks ahead suddenly changes. I think.

Poil
Mar 17, 2007

Solumin posted:

If you set up your signals with any semblance of sanity
Um, is there a guideline for that? Asking for a friend.

Catberry
Feb 17, 2017

♫ Most certainly ♫
I have never managed to get trains to work. To the point where they saved me effort I mean. I just went nuts with five wide blue transport belt networks all over the map. Trains are cool for sure but I found it a headache to make new stops and expand the networks to new sources of materials.

Nuclearmonkee
Jun 10, 2009


Catberry posted:

I have never managed to get trains to work. To the point where they saved me effort I mean. I just went nuts with five wide blue transport belt networks all over the map. Trains are cool for sure but I found it a headache to make new stops and expand the networks to new sources of materials.

You need to use blueprints for maximum train efficiency. If you just stamp out stations and track sections it's way more efficient and also TRAINS.

sharkbomb
Feb 9, 2005

Catberry posted:

I have never managed to get trains to work. To the point where they saved me effort I mean. I just went nuts with five wide blue transport belt networks all over the map. Trains are cool for sure but I found it a headache to make new stops and expand the networks to new sources of materials.

You should really try again - they are extremely useful! Keep it very, very simple your first time (ie ignore all of this posting about automated gating).

Generally, when I start a railroad, I look at my map and see which general direction has the most useful resources, which is usually oil. All you need to do is set up a "loop" so that you have 2 stations, with the long distance between the stations just being 2 parallel tracks. Then you just program the train to go from Station 1 --> Station 2 and it will run forever. I stay organized from the very beginning by giving my stations very simple names that are numbered based on how many new stations I could add later. For example: N-00-Hub (main base station on the north side), N-40-Oil (this is a northern oil station with about 40 other possible stations between it and the hub). If I decide later I need a station immediately before N-40-Oil I can just create N-39-Stone and the train automation will be easy to set up and understand.

Another organization tip is to guess which direction important resources will be coming from via train. For example, in my current game, I am using my west bound train to deliver iron-- that means I have my furnaces oriented on the west side of the base.

Trains are great!

Dirk the Average
Feb 7, 2012

"This may have been a mistake."

Catberry posted:

I have never managed to get trains to work. To the point where they saved me effort I mean. I just went nuts with five wide blue transport belt networks all over the map. Trains are cool for sure but I found it a headache to make new stops and expand the networks to new sources of materials.

Use FARL.

Telarra
Oct 9, 2012

Solumin posted:

I'm pretty sure trains reserve the block they're in and the next block.

Even better. Trains constantly track the point where they'd be able to come to a stop if they slammed on the brakes, and factor this into all signal decisions.

Renegret
May 26, 2007

THANK YOU FOR CALLING HELP DOG, INC.

YOUR POSITION IN THE QUEUE IS *pbbbbbbbbbbbbbbbbt*


Cat Army Sworn Enemy
I love trains

RyokoTK
Feb 12, 2012

I am cool.
Trains are amazing and excellent and fun to operate once you get a system going.

The easiest suggestion I have for minimizing conflicts is to dedicate each rail to one-way traffic. Have the trains return on a different rail. And any time you have an intersection, fork, or merge, use chain signals at the entrance to the intersection and regular signals at the exit.

Nevets
Sep 11, 2002

Be they sad or be they well,
I'll make their lives a hell
Circuits, logistics networks, beacons & modules, and trains are all great and made even more awesome because you can beat the vanilla game without ever touching them. Then you come back a couple months later and say, "this time I'm going to do it with robots!"

super fart shooter
Feb 11, 2003

-quacka fat-

RyokoTK posted:

Trains are amazing and excellent and fun to operate once you get a system going.

The easiest suggestion I have for minimizing conflicts is to dedicate each rail to one-way traffic. Have the trains return on a different rail. And any time you have an intersection, fork, or merge, use chain signals at the entrance to the intersection and regular signals at the exit.

I should probably follow this advice, I tried to do a two-rail multi-directional rail line where all the trains could get on or off in either direction and pick their own rail, but the signals for that are just too complicated, and eventually it would always lead to some kinda traffic jam. Although admittedly a lot of my problems are probably because I always forget to take into account the length of my trains when I build intersections, so I end up with a train sitting at a red light, while the rear end is blocking the previous block, and that always causes issues.

RyokoTK
Feb 12, 2012

I am cool.
Oh yeah, the other thing that made it easier for me was using a standard train length for every route. My train lines are always the locomotive plus two wagons; that's still a lot of materials and it keeps everything relatively compact and fast.

seravid
Apr 21, 2010

Let me tell you of the world I used to know

super fart shooter posted:

Although admittedly a lot of my problems are probably because I always forget to take into account the length of my trains when I build intersections, so I end up with a train sitting at a red light, while the rear end is blocking the previous block, and that always causes issues.

Chain signals, son

M_Gargantua
Oct 16, 2006

STOMP'N ON INTO THE POWERLINES

Exciting Lemon

super fart shooter posted:

I should probably follow this advice, I tried to do a two-rail multi-directional rail line where all the trains could get on or off in either direction and pick their own rail, but the signals for that are just too complicated, and eventually it would always lead to some kinda traffic jam. Although admittedly a lot of my problems are probably because I always forget to take into account the length of my trains when I build intersections, so I end up with a train sitting at a red light, while the rear end is blocking the previous block, and that always causes issues.

Two rail multi directional is impossible. Even in reality it is rarely done.

RyokoTK
Feb 12, 2012

I am cool.
It's so much easier to just do one way rails that there isn't a point to do anything else unless you want to melt your brain.

Rails are incredibly cheap to build and you have infinite operating space so who cares!

Onean
Feb 11, 2010

Maiden in white...
You are not one of us.
I've only been playing Factorio for couple months, so for my first very small, very simple 3-4 train setup I found this older reddit post to be fairly helpful getting started.

I then decided to try and put together a much larger station than I would possibly ever use for my first game, and I was messing with signals off and on all the way up until I decided to abandon this game and start a new one.



I think it's largely functional, though I've got a feeling the loop intersection sitting where it's at would cause an issue if I ever had more than a dozen trains running.

Solumin
Jan 11, 2013

Poil posted:

Um, is there a guideline for that? Asking for a friend.

There's two situations to consider: signals along a stretch of unbroken track and signals at an intersection.

The first case is the simplest: the spacing of your signals determines how densely your trains will be on the tracks. If all of your signals are 1 cargo wagon-length apart, a train with 2 cargo wagons will take up 3 blocks minimum, 1 for the train and 1 for each car. (Or really 4 blocks plus any space it needs to slow down.) If each block is instead 20 wagon-lengths long, a train with 2 cargo wagons will have reserved the block it's in, plus the next block if it needs the space to slow down.

Because blocks can only be reserved by 1 train, having overly large blocks means your trains will be more space out. This isn't a huge issue, really -- maybe there's tiny efficiency/throughput gains to be made by making smaller blocks, but it doesn't really matter. Just make sure long stretches of track are broken up by signals, and you'll be fine.

The second case, using signals at intersections, is more complex. You have one goal: Only one train is ever in the intersection at a time. That is, if a train enters the intersection, the tracks it must cross will be empty and will remain empty. To be honest, it's not the hardest thing in the game to get a handle on, especially if you use a guide to get started. Once you've constructed a few intersections, you start to see the pattern of signals and see how the whole assembly works together to make a functional intersection.

For a more detailed guide, I recommend this: http://guide.factorio.com/10-trains.html
For examples of intersections, check out this album: http://imgur.com/a/CxXxd

Moddington posted:

Even better. Trains constantly track the point where they'd be able to come to a stop if they slammed on the brakes, and factor this into all signal decisions.

This is really good to know and I have incorporated it into the advice above!!

Catberry posted:

I have never managed to get trains to work. To the point where they saved me effort I mean. I just went nuts with five wide blue transport belt networks all over the map. Trains are cool for sure but I found it a headache to make new stops and expand the networks to new sources of materials.

I'm wondering how you set up your rail networks. The easiest way is to have a main trunk that stations peel off of. Here's an example:

The rail at the bottom is the "main trunk", where any through traffic goes. The upper rail is for the station. Trains that stop at the station just pull off the main trunk, stop, and when ready to go wait for the signal ahead of them to be green so they can safely re-enter the main trunk. So adding new stations is easy.

Unless you mean it's a headache to do all that for a new station, then get the inserters and things you need to load/unload a train, then add the stop to the train schedule... that's definitely a pain, but blueprints can help.

Ignoranus
Jun 3, 2006

HAPPY MORNING

Onean posted:

I've only been playing Factorio for couple months, so for my first very small, very simple 3-4 train setup I found this older reddit post to be fairly helpful getting started.

I then decided to try and put together a much larger station than I would possibly ever use for my first game, and I was messing with signals off and on all the way up until I decided to abandon this game and start a new one.



I think it's largely functional, though I've got a feeling the loop intersection sitting where it's at would cause an issue if I ever had more than a dozen trains running.

I agree about removing the circle - I also like to add chain signals to the (vertical part of the) incoming branch between each of the (horizontal) stacker lanes, so that in theory, at least, it goes faster. The other detail is that it's helpful to try to place the actual unloading stations and stacker in such a way that you can add more capacity by building onto it instead of redesigning - so, like, having another lane that they converge into after unloading there, so another station can just be bolted on.

FAKE EDIT: I spotted one signalling change you could make: the signals after the stations, where the three lanes converge into one, should be chain signals instead of regular signals. That way, a train won't get into that little one-lane section unless it can actually completely enter the main highway. Also, if I don't miss my understanding of things, with the signalling as it stands all of the (currently-blue) stacker chain signals will turn red whenever a train is in that one-lane section. I'd probably swap the bottom-left-area chain signals for regular signals, that would resolve the problem completely.


ACTUAL EDIT for some train signal stuff: Chain signals go at the beginnings of 'contested areas' (intersections and such) and regular signals go after those areas.

Ignoranus fucked around with this message at 02:15 on Mar 18, 2017

Onean
Feb 11, 2010

Maiden in white...
You are not one of us.
Yeah, I'm about to work on a full train station in my second factory now that I've got robots up and running. I completely ignored the factory aspect of bots in my first factory, only using them for de/construction, and I'm looking forward to setting up a bot-based sorting station since a bunch of the ore spots around my factory are overlapping multiple ore types.

Thanks for the tips!

ShadowHawk
Jun 25, 2000

CERTIFIED PRE OWNED TESLA OWNER

M_Gargantua posted:

Two rail multi directional is impossible. Even in reality it is rarely done.
I decided to try a 3 rail setup with two one-way lanes and the middle lane going either direction. My thinking was that trains that are pulling off into a stop usually slow down and I'd often get traffic build up in my 2 track games -- this would give the trains a passing lane.

RyokoTK
Feb 12, 2012

I am cool.
Even then, I feel like I'd rather have four rails (two in each direction) just to be sure.

But trains in this game stop on a loving done compared to irl trains so unless you have a massive amount of trains, or really short pull-offs for stops, I can't see that being an issue.

Adbot
ADBOT LOVES YOU

Evilreaver
Feb 26, 2007

GEORGE IS GETTIN' AUGMENTED!
Dinosaur Gum
Yea, my old rocket/minute builds used to have 20-50 1-car trains running (before the train manager window). 4-lane highways worked wonders, but it was always "funny" when a traffic jam happened for some reason and all 50 trains backed up (usually a train hitting a behemoth or two and stopping/getting eaten, leaving a dead car).

Nowadays that you can say "stop/go as you're empty/full" and use Stack Inserters to pack belts, a single three-car train station (in near-constant use) almost provides more ore than I can handle, which is a crapload easier than trying to get a 8-10 station railyard working.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply