News for hackers. Stuff that matters.
Re:Factorio: Space Age by mmastrac on Friday August 25, 2023 @09:48AM (#37261701)
I wouldn't put trains and smooth in a single sentence. The signals required a lot of patience to learn and I'm not entirely sure I still understand them.

They are by far one of the most painful parts of factorio for me.

Re:Factorio: Space Age by pmoriarty on Friday August 25, 2023 @10:00AM (#37261829)
I just use city-block blueprints and never really worry about signals.

However, the foolproof advice I've gotten from r/Factorio has been to put chain signals at the entrance and exit to every junction, and to make sure there's enough space for your longest train to stop behind a rail signal (and you wouldn't mind having it stop there).

I can also recommend the cybersyn mod (or LTN). Once you understand one of these mods it makes dealing with trains much less of a hassle.

Re:Factorio: Space Age by red_admiral on Friday August 25, 2023 @10:20AM (#37262035)
Not necessarily at the exit.

Normal signal: train stops if there's a train in the section ahead (or it's reserved for another train on a conflicting path), otherwise train goes.

Chain signal: train stops here until it can get a mutex on a path past another non-chain signal.

So if you have rail sections (small letters) and signals (capitals) a - A - b - B - c - C - d in a row on a plain line and A/B are chain signals and C is regular, then trains from the left will stop at A until the train can grab all sections b, c, d in one go.

That's why chain signals at the entrance to a junction are good (prevents a train stopping on the junction) but you want regular ones at the exit, at least if some plain line follows.

Re:Factorio: Space Age by pmoriarty on Friday August 25, 2023 @10:28AM (#37262125)
"Chain in, rail out" is the standard advice. However, if you search around r/Factorio you'll see there's debate about whether that's the best advice for beginners.

Chain both in and out is supposedly the foolproof method, and apart from stations, rail signals are just an optimization.

Though I've played a lot of Factorio, I've never really felt the need to dive deeply in to signals, and I'm happy to just use the foolproof method and leave more optimized solutions for those who need them.

Re:Factorio: Space Age by mcv on Friday August 25, 2023 @10:46AM (#37262318)
I prefer to see it as regular signals designate the next segment as a segment where trains are allowed to wait. If you don't want trains to stop in that segment, don't put a regular signal in front of it.

And of course you don't want trains stopping on intersections, because they'll block everybody, so you always put chain signals in front of intersections.

Re:Factorio: Space Age by kzrdude on Friday August 25, 2023 @10:56AM (#37262435)
The train needs to reserve the whole next contiguous sequence of chain signals to be able to go, so the foolproof method makes it sound like each train reserves the whole path from one station to another. It makes sense, but I like to do the optimizations, then, and allowing trains to stop in longer stretches where they can.
Re:Factorio: Space Age by mcv on Friday August 25, 2023 @10:42AM (#37262261)
Trains are my favourite part of the game, and I always make myself a massive bowl of train spaghetti. I love watching my trains automatically find their way across my messy maze of train tracks.

My simple rules:

* Trains can only stop on the section after a regular signal. If you don't want a train to be able to stop in a certain place (like on an intersection), don't use a regular signal in front of it.

* Make sure trains have places where they can stop. This will mostly be stations, but that's not enough. Actually, I've been wondering if it might be enough for stations that are only visited by a single train; then the train would only go if it has a clear path straight to its destination. Maybe I should give this a try. For me, however, the straights outside the intersections are usually fine places for trains to stop. But for better throughput and less blockage, there should probably multiple tracks, and special tracks for trains waiting to enter a station currently occupied by another train.

* Trains cannot pass a signal on their left if there's not also a signal on their right. You can use this to make certain tracks single-direction. Single-direction is good and easier than double-direction, so of course I mix them, because I'm not playing this game because I like things easy.

* Don't forget to give your trains a place to refuel! This is actually the part I mess up the most.

Re:Factorio: Space Age by pmoriarty on Friday August 25, 2023 @10:49AM (#37262349)
For refueling I've recently been using the cybersyn mod, which let's you easily create a refueling stations that your trains will automatically go to when they're low on fuel (with exactly how "low" they need to be being configurable in the mod settings).

I just plop down a refueling station, and a requester station next to it that refuels the refueler and I'm done. Don't have to worry about it again.

Re:Factorio: Space Age by mcv on Friday August 25, 2023 @11:40AM (#37262950)
I always make them refuel at one of their regular stops. There's usually a source of fuel nearby, so I just route a small part of that along all the engines.

But sometimes I forget, and sometimes there's no fuel nearby.

Re:Factorio: Space Age by knome on Friday August 25, 2023 @03:31PM (#37266082)
My most complex train system had every train carry a single item type, and a large central trainyard. trains won't leave without an active destination. so all of the destinations for dropping off a type had the same name, and similarly the pick ups and would be disabled by circuits if their dropoffs were more than a quarter or so full. so if something needed green electronics, it would activate its DropOffGreenElectronics, the train would leave the yard, or sometimes 2-3 as at the time I didn't have any way of limiting it and one train wasn't enough to service all of the delivery points with my single car trains. the thundering herd problem[1] was real. the first train would get there, rest would go home. everything refueled at the home terminal, which had a stop for the coal train on it. each train had (dropoff(X) -> pickup(X) -> rest(X)) for their instructions. it worked pretty well.

[1] https://en.wikipedia.org/wiki/Thundering_herd_problem

Re:Factorio: Space Age by mcv on Friday August 25, 2023 @07:10PM (#37268176)
Interesting approach. I do give multiple pickup points for the same name (so while my old coal field is slowly running out, trains increasingly move to the new coal field by themselves), but I hadn't considered doing the same with the drop-offs.

And I haven't yet figured out how to disable drop-offs that don't need anything. I often have a single train bring stuff to a couple of drop-offs, but that always feels sloppy. I have to use timeouts on the trains so they don't linger at a station that's too full to empty them. Disabling those stations and giving them all the same name might be a better alternative.

Re:Factorio: Space Age by knome on Friday August 25, 2023 @09:19PM (#37269032)
>And I haven't yet figured out how to disable drop-offs that don't need anything

look into your circuit networks. you can make them quite complex if you want

Re:Factorio: Space Age by dbt00 on Friday August 25, 2023 @08:40PM (#37268793)
Newer versions of factorio have a per-station limit on the number of trains that can be in + routing to that particular stop. very helpful for this kind of problem.
Re:Factorio: Space Age by moviuro on Friday August 25, 2023 @09:58AM (#37261798)
> The signals required a lot of patience to learn and I'm not entirely sure I still understand them.

Chain signals before an intersection; regular signals after those, and on the track to split the track for multiple trains simultaneously.

See: https://wiki.factorio.com/Tutorial:Train_signals if you haven't already.

Re:Factorio: Space Age by drewmate on Friday August 25, 2023 @10:07AM (#37261907)
Another major stumbling block for train signals once you get the basics down is segment length. Signals indicate whether the next segment is occupied, not whether any given train will fit in there (and potentially block a segment or intersection behind it.)

I frequently set up tracks with segments as large as my longest train, but then end up having to add an intersection here or there, breaking up segments into smaller sizes. This is the root of most of my train woes (aside from LTN issues, which are a whole other issue!)

Re:Factorio: Space Age by jcranmer on Friday August 25, 2023 @10:11AM (#37261946)
> Signals indicate whether the next segment is occupied, not whether any given train will fit in there (and potentially block a segment or intersection behind it.)

That's what chain signals are for. If a train waiting at a signal causes issues, replace the previous signal with a chain signal to prevent the train from problematically waiting at the signal.

Re:Factorio: Space Age by Aeolun on Friday August 25, 2023 @09:55AM (#37261761)
They’re sort of understandable. When someone described it to me as the blue signals checking the status of the next signal (blue or colored) and doing that, everything made a lot more sense. They’re still sometimes hard to debug because there’s no visualization but I always end up feeling that the issue was my fault
Re:Factorio: Space Age by freeone3000 on Friday August 25, 2023 @10:41AM (#37262252)
The stuck train is your visualization :P
Re:Factorio: Space Age by pmoriarty on Friday August 25, 2023 @10:53AM (#37262398)
Blue signals just mean that some, but not all, segments ahead are blocked by a signal.

Also, this video[1] by Soulless Gaming on "How to Fix Train Path Errors" has a lot of useful tips on train/signal troubleshooting.

[1] - https://m.youtube.com/watch?v=gmsep-xJXkI

Re:Factorio: Space Age by xedrac on Friday August 25, 2023 @09:58AM (#37261794)
There's certainly a learning curve - it's a form of programming that must be learned.
Re:Factorio: Space Age by mmastrac on Friday August 25, 2023 @10:54AM (#37262404)
That's like saying brainf*ck is a form of programming. I'm happy to learn, but some tasks are masochistic.
Re:Factorio: Space Age by TuringTourist on Friday August 25, 2023 @11:15AM (#37262649)
I would argue that train signalling is not intentionally obfuscated as brainfuck is however. Just a different form of thinking.
Re:Factorio: Space Age by bombcar on Friday August 25, 2023 @12:46PM (#37263903)
I think it's pretty clear from the blog posts that they tried to make trains as simple as they could, and it's as complex as it is now because that's the simplest it can be without having actual errors and bugs.
Re:Factorio: Space Age by guhidalg on Friday August 25, 2023 @10:11AM (#37261953)
Repeat after me: "Chain IN, Rail OUT" https://www.youtube.com/watch?v=IZDmzFKhPI0

It's basically a visual version of the classic deadlock conditions. Chain signals create dependencies between locks, and the locks themselves (the rail signals) have to be granular enough to keep large sections of the rail network available to acquire. The confusing part about the chain signals is the blue state: the train will use its pathfinding to read forward of the signal and it will move if the path it needs to take is available. You have to look forward of the signal to see if the rail signal for the path the train wants to take is green or not.

Re:Factorio: Space Age by wbl on Friday August 25, 2023 @09:54AM (#37261756)
Try logistic train network mod
Re:Factorio: Space Age by oefrha on Friday August 25, 2023 @11:11AM (#37262603)
Vanilla trains are absolutely pitiful for megabases, and annoying even for midsized bases. I simply consider LTN part of the base game.
Re:Factorio: Space Age by bombcar on Friday August 25, 2023 @12:45PM (#37263894)
LTN is really nice, but it is "fun" (for some people, like me) to build a LTN-like network in vanilla before using LTN going forward.

Once you've "figured it out" it's much easier to drop down "smart stations" instead of building them yourself each time.

Just like I recommend players who want to do city blocks build their own blueprints instead of just loading up someone's (even if you later switch to someone's standard blueprint, you'll at least understand the why).

And of course, it's a sandbox game! You could just download a completed map, but there's no fun in that.

Re:Factorio: Space Age by polski-g on Saturday August 26, 2023 @09:15AM (#37272593)
I switched to Cybersyn, same functionality as LTN but way less complexity setting it up.
Re:Factorio: Space Age by dimava on Friday August 25, 2023 @12:28PM (#37263607)
The best available explanation, think "20% of things that cover 80% of cases", is DoshDoshington's [Factorio Trains Explained in Less Than Three Minutes](https://youtube.com/watch?v=DG4oD4iGVoY)
Re:Factorio: Space Age by EMM_386 on Friday August 25, 2023 @03:24PM (#37266014)
> I wouldn't put trains and smooth in a single sentence.

I had over 500 hours in Factorio before I felt comfortable with signalling. I got so frusturated with it originally I just ignored it as best I could.

But the "chain in, rail out" thing as others are mentioning really is the key. It's not always as perfectly simple as that, but it's a very good starting point.

You break everything up into blocks ... if you place a chain signal right before an intersection and a rail signal on the way out, you'll be there for most situations.

Most.

My most complex map has about 50 trains running and all intersecting each other and so far, everything is running smoothly on that one. No trains slamming into each other and everything running efficiently as far as I can tell. Almost all of it is just that "chain in, rail out" thing.

Re:Factorio: Space Age by TylerE on Friday August 25, 2023 @08:45PM (#37268823)
Also; Bidirectional trap is a massive moon trap. Avoid it at all costs.
Re:Factorio: Space Age by infogulch on Friday August 25, 2023 @05:11PM (#37267087)
If you just want to have trains and move on, I made a complete tiling rail kit a few years ago:

https://www.reddit.com/r/factorio/comments/i2szgb/tiling_uti...

> 2-way 6-wide right hand rail system on a global 60-tile grid with interoperable 90° & 45° variants. Intended to be simple, complete, & hard to misuse.

> Features: rotational symmetry, red&green wired poles, landfill, blueprints for Through, Turn, Tee, Junction, and U-Turn for both 90° & 45°, 90°/ 45° transition blueprints

> Tiling is based on large power poles, 60 is the max distance between 3 poles in a straight line, or 5 poles diagonally.

Here's a big example with all the rail components slapped together for a demo: https://i.imgur.com/84P9nO0.png

I also made the simplest tiling nuclear blueprint kit: https://www.reddit.com/r/factorio/comments/gp0jmb/infogulchs...

Re:Factorio: Space Age by animal531 on Saturday August 26, 2023 @06:35AM (#37271498)
I'm not even sure how many hours I have in the game, but I've never bothered with trains, I just didn't enjoy their gameplay for some reason.

Fortunately this is totally fine, you can get by without them.