News for hackers. Stuff that matters.
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.