Wired Parking lot and train pathing

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
McDougla
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jun 22, 2025 5:30 pm
Contact:

Wired Parking lot and train pathing

Post by McDougla »

UPDATE:

I figured it out. I set up a clock to repeatedly count to 200 and put a rail signal just past the entrance.
When the count is < 1, disable the entrance signal.
This flickers the chain signal and when a train is in the block that reads the chain signal, the repath happens.
I was reading the wiki that they recently changed some things about repath events.

Repath event I found that made me try this:
The train is preparing to stop at a signal (chain or regular) that changes so that the train can now continue
But then I found these that make it seem like I should never have ran into this issue:
The train has waited at a chain signal for a multiple of 5 seconds and there are multiple train stops with the same name as the destination
The train is pathing to a train stop that gets disabled.
There are 4 trains stops with the same name who are cycling through being disabled and the train was sitting at a chain signal... Seems like I meet all of that criteria. Either way it's working now!

Arrow is where the clock and rail signal are:
1.png
1.png (44.92 KiB) Viewed 222 times


I created this parking lot for 3x4 trains. The idea was to wire it so the trains would balance and not fill some lines while other lines had just one train.

So I have 12 lines(A-L), each with 4 slots(0-3).
if the first slot(0) is NOT full
send the signals of each line(0.A-L) to the entrance signal
if it is full, don't pass the signals from slot 0
go to slot 1 and repeat

I also have a clock running that that will cycle the train stops off except one every second. This is an attempt to balance out which train stop the train will select when pathing here. This may or may not be related to the issue.

Ok so the issue I'm facing is that when the trains path here, a lot of times the parking spot they're pathing through will be open, but then closes by the time they get here so they sit outside of the parking area. This isn't a huge problem when I am using a lot of iron because generally as soon as any train leaves any parking spot, the train waiting will re-path to an open spot. However until a parked train leaves, the train waiting to come in will sit outside the parking spots and thus backs up all the other trains behind it. Here is a picture of my train pathing through the closed signal and waiting.

Mind you I did have to switch the bottom 2 end signals to green to demonstrate the issue.
TrainStop.png
TrainStop.png (121.03 KiB) Viewed 322 times
Last edited by McDougla on Mon Jun 23, 2025 5:13 am, edited 2 times in total.
Tertius
Smart Inserter
Smart Inserter
Posts: 1304
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Wired Parking lot and train pathing

Post by Tertius »

Difficult to comment, since it's probably not what you want to hear.
I thoroughly investigated the behavior of such setups for weeks in the map editor. Exactly what you try to setup: multiple unloading stations with possibly extremely fast train unload with a stacker in front of them for buffering, all for the same material. I also investigated how to micro manage (circuit-control) signals for traffic control at input and output to maximize input and output.

My observations (or better: "don't do's") were:
  • Your problem can only be solved if the train is able to fully proceed to the lane it is pathing to. Any signal in between must not be switched to red by circuit. Might possible by reading the signals and check for yellow and never switch a yellow signal to red.
  • a stacker with lanes where trains wait in a line with multiple slots will prevent trains leaving to empty stations. Trains will eventually leave, but it can take so long the buffer chests in the unloading station will run empty. This is because it can happen a train in the back slots is targeting a station and reserving it instead of the front train. It can happen the next train that's elected by the train path finder is again some train in a back slot, so it again takes time until a repath happens.
  • the huge stacker size serves no purpose. All the fully loaded waiting trains are wasted resources. If you have enough mines to support the demand, your stacker just needs as many train places to ensure to have at least one (1) train whenever a station runs empty. If you intend to have less mines but buffer trains for demand spikes, forget that. Your factory continuously grows, so grows demand, so you have to increase the number of mines anyway. So just increase it to satisfy the current demand. Just one or two mines more enables you to use an extremely simple stacker system without any logic.
    From my observations, a train limit of 2 or 3 for an ore unloading station is sufficient. That means 1 place is the unloading station itself, and 1 or 2 more places are in a stacker. If you have 4 unloading stations with train limit 3 to make sure, build a stacker with (3-1)*4=8 places. So build a stacker with 8 lanes and just 1 slot each.
  • The distance between the exit of the stacker and the entry of your unloading stations is too long. It must be guarded by chain signals, so if a station becomes empty, the next train can leave the stacker no sooner than the empty train left the station area. In this time, the buffer chests can run empty, so it limits the station throughput. To minimize this latency, the stacker exit must be directly connected to the station entry. I talk about the long track beginning with the U-turn and ending with the switch at the first unloading station.
  • In the bottom right corner we see your outgoing empty trains cross the rail with the incoming full trains. The outgoing trains just accelerated and will come to a grinding halt here. The same with the incoming trains. This crossing is totally killing your throughput and producing traffic jams.

Alternative more compact example:

Its stacker has 17 lanes. Some stations have limit 2, some have limit 3. Dunno which has which, I guess iron ore and copper ore and oil has 3, the others 2. The total of all train limits must not exceed 17 (from the stacker + 10 (from the stations themselves).
This setup has no circuit control at all and never congests. The time from one station getting empty and the next full train having arrived is about 5-10 seconds, depending on what stacker lane is going to what unloading station.
The output (not shown here) is split into 2 or 3 separate rails leading back to the general rail network, so not the whole outgoing traffic is sent to one single rail there. After unlocking elevated rails, it's easier to build a crossing free output of course, because you can replace the crossing by a bridge.
06-22-2025, 23-22-36.png
06-22-2025, 23-22-36.png (167.21 KiB) Viewed 294 times
06-22-2025, 23-55-42.png
06-22-2025, 23-55-42.png (3.25 MiB) Viewed 278 times
McDougla
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jun 22, 2025 5:30 pm
Contact:

Re: Wired Parking lot and train pathing

Post by McDougla »

The one thing that is probably going to keep me trying to pursue this is the fact that, when a train is waiting on the main line, if ANY train leaves the stacker, the train waiting will re-path and pick one of the open spots. I'm not sure what is causing this. I'll will test around and see if I can make it work.


I do think you're right about throughput, and this is an evolving design but the reason I have such a large stacker is because I have 50 trains per resource and a ton of mines that are 10+ minute away(with legendary nuclear fuel). The way I cycle every second and only have 1 station open at a time, the trains coming in are randomized to the point where I don't have any station favoritism. I'm pretty sure when the station is disabled, the priority of which train is reserving the station gets changed to the closest one. And I say that because I've been trying to force that scenario but I can't. But I could just be really lucky and haven't had it happen yet.

You are right about the signals, I will definitely optimize that area...

Thanks for the response, I will probably end up switching to something similar to what you built if I can't get it to work the way I want.

Do you know how people usually deal with their mines being so far away? I burned through most mines close enough with any decent amounts and just decided to go out for the really big ones with 500 million+ resources(default settings). I thought about splitting the distance with multiple stop/pickup locations but that seemed like a waste of time/resources.

The exit is going over the other rail btw
06-22-2025, 19-46-36.png
06-22-2025, 19-46-36.png (3.76 MiB) Viewed 254 times
Tertius
Smart Inserter
Smart Inserter
Posts: 1304
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Wired Parking lot and train pathing

Post by Tertius »

McDougla wrote: Sun Jun 22, 2025 11:59 pm Do you know how people usually deal with their mines being so far away? I burned through most mines close enough with any decent amounts and just decided to go out for the really big ones with 500 million+ resources(default settings). I thought about splitting the distance with multiple stop/pickup locations but that seemed like a waste of time/resources.
10+ minutes away is a very long way. No doubt there are really rich mines. When I planned a megabase (with 1.1), I realized starting with some high mining productivity, mines essentially become infinite. I planned with huge amount of mines, however when I built I realized the existing mines don't really deplete any more. I see you have mining productivity 130, this should be visible for you as well. It becomes even more visible if you research more of that. If you check the real throughput of your mines (for example with a mod like Resource monitor you see it will take months to years to deplete some mine, even if it has just 5-10M.

I found amounts of 25-50M are sufficient for a very long map. No need to go farther than 3-4 minutes train driving. Just start with the nearest mines and find the next nearest one whenever one depletes. Then mines will practically stop depleting with a sufficiently high mining productivity. At the same time their output (ore per second) will increase, so you need even less mines. Not more. The time to get more far away can also be spent to build one more mine more near, then deconstruct if depleted. And deconstructing a depleted mine is also a kind of satisfying experience. It's proof you accomplished something.

For that base I used a train limit of 4 at the unloading stations to deal with the larger train latency, but the stacker was always full. If it was not full, it was due to bad rail planning that lead to congestion out in the field, but not due to not enough mines.

If you have elevated rails, you have Space Age. I don't know how your base looks like, but with the new production machines (Foundry etc.) ore demand is significantly lower than with a 1.1 base due to the inherent foundry productivity of 50% and of all the other advanced Space Age machines. The big mining drill also has a resource drain of 50%, that means every mine gets double of what you can get with electric mining drills. You need just 1 mine where you previously needed 3-4.
If you start using quality-increased productivity modules in the factory, the ratio is even lower. And if you start using quality big mining drills, the mines essentially cannot run out due to their even smaller resource drain.

For that big base I used 1-8 trains. 8 wagons double the throughput for the same amount of trains with just 4 wagons. Today I would recommend 2-8 trains, but having just 1 locomotive and not having elevated rails in 1.1 made me think hard about how to design a congestion free railway. That base was 20k SPM with 1-8 trains and it was congestion free. You try to cheat this by using 3 locomotives for just 4 wagons, but really getting rid of congestion issues is a design challenge that comes up with larger setups, and the solution is not to add more locomotives for better acceleration. The solution is to design a railway with as few crossings as possible and material flows that doesn't cross each other.
mmmPI
Smart Inserter
Smart Inserter
Posts: 4519
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Wired Parking lot and train pathing

Post by mmmPI »

McDougla wrote: Sun Jun 22, 2025 6:49 pm UPDATE:

I figured it out. I set up a clock to repeatedly count to 200 and put a rail signal just past the entrance.
When the count is < 1, disable the entrance signal.
This flickers the chain signal and when a train is in the block that reads the chain signal, the repath happens.
I was reading the wiki that they recently changed some things about repath events.

Repath event I found that made me try this:
The train is preparing to stop at a signal (chain or regular) that changes so that the train can now continue
But then I found these that make it seem like I should never have ran into this issue:
The train has waited at a chain signal for a multiple of 5 seconds and there are multiple train stops with the same name as the destination
The train is pathing to a train stop that gets disabled.
Good to hear you've got a working solution, and sorry if this is too late or you already know or using it : you can use debug settings in game to show train "repath" and it would make some flying text pop next to trains when they do repath, i found it very useful to investigate those behavior.

For the train situation, I've used myself and seen other players use something that may be could be of some use for those situations, or if you want to try something else, it's a dummy waypoint placed between the stacker and the real unload station :
TrainStop.png
TrainStop.png (95.31 KiB) Viewed 176 times
Just a station with the name of "dummy1" or "waypoint1" and in the train schedule no particular condition.

The aim for the waypoint 1 is mainly to make sure a train select a spot in the stacker/parking just before entering it, so it makes an "optimal" choice regarding the already parked train at the last moment, and not "too early" when situation can still change with other trains arriving in the meantime. Which can help to guarantee that the trains that should fit in the stacker will fit properly into the stacker and not "overflow" in the main line. Just by being there.

It can also be used with some extra wire reading signals in the stacker to "limit" the number of iron train going to this particular stacker, more useful in cases where you have several stacker for the same ressource with the same name to share trains but in different locations. ( limit of incoming train in waypoint1 = number of trains that can fit in theory - number of "red signals" ) That imply adding 1 extra connected signal per parking area, which should turn red if a train is parked, that would make the limit of "waypoint 1" being 0 if the stacker is full.

It should also be possible to use the new priority settings on the waypoint1 dummy train stop, to manage traffic between different stackers, even if they are not "full", train would try to "fill" the stacker with the highest priority first but i haven't needed that yet, nor seen it used in practice. But since this is about wired parking lot ... ^^ It's more like know/feel it's the purpose of this setting and i would use it there when using such stackers that serve several unload stations instead of using priority on each of the actual unload area, that would serve other purpose.

The aim for the waypoint 2 is similar, but this time to make sure a train select an unloading station just before entering it. The exact location may differ if you are using 1 ressources, or several ressources. Here is only 1 because it's all iron train. Now it can cause a train to "wait" at this dummy stop, which isn't problematic in the case of only iron train because it just means the next train for "any" iron station is already selected, and it's not blocking other ressources.

But in cases like those shown by Tertius in the compact setup where there are several different ressources being unloaded at the same area it shouldn't be used.( i think Tertius setup is also a "good" one , there are several "good" way to do)
Tertius wrote: Sun Jun 22, 2025 9:37 pm The distance between the exit of the stacker and the entry of your unloading stations is too long. It must be guarded by chain signals, so if a station becomes empty, the next train can leave the stacker no sooner than the empty train left the station area. In this time, the buffer chests can run empty, so it limits the station throughput. To minimize this latency, the stacker exit must be directly connected to the station entry. I talk about the long track beginning with the U-turn and ending with the switch at the first unloading station.
I think this is a point that is the more valid the higher the expected throughput per unloading station. In what would be measured as "belt per wagons". If you are extracting only a yellow belt per wagon when unloading, then you have "more time allowed" between 2 trains unloading, for them to switch their position, if you are extracting 2 green belts, or 3 green belts of stacked ore, then you have "very limited time allowed" between 2 train unloading. ( the stacksize of the item has a similar effect , iron ore require more "frequent" trains than green circuits).

In cases where throughput matters a lot,( 2 or 3 green belts of stacked item per wagon ) i found it much much easier to have 2 trains following each other per unloading station. The 2nd being right behind the first one. In order to minimize the most this downtime between 2 trains. The stacker then being used for every "other" train, the 3rd 4rth 5th and so on when they replace the "2nd" trains. Though such situation can be a little frustrating if you don't have enough trains, as you could have 2 trains queued in the same unloading lane, and 0 in another, instead of 1 in each with setups that don't use 2 trains per unloading area. That's a downside which makes me choose those designs again, in situation where high throughput is the goal, as it's also taking a bigger footprint.

McDougla wrote: Sun Jun 22, 2025 11:59 pm Do you know how people usually deal with their mines being so far away? I burned through most mines close enough with any decent amounts and just decided to go out for the really big ones with 500 million+ resources(default settings). I thought about splitting the distance with multiple stop/pickup locations but that seemed like a waste of time/resources.
Are you using Space Age ? ( because that influence the answer a lot to me)

Are you researching mining productivity ?

Now wether or not you're using elevated trains and other planet's ressources there's a thing for Nauvis and far away mine and/or modded similar situation that i found work well for me, or that i like doing is transforming some ressources before transporting them, in particular iron, made into steel or even just plate require much less logistic because they each require several iron, and you can fit more in a train. Plus if you are at mining site that contain 500 M ore, they must be very "dense" so a mining drill there could take weeks or even month to deplete its area( especially if they don't overlap) , which to me can make it an optimal choice to just build the furnaces there at the same time as you build the drills.

Then you may only have to carry "some" material next to the nearest copper patch, and not to your "main" base, because you could do the green circuits there. This would reduce by a lot the amount of potential congestion in a "central area". If it receive a train full of "green circuit" it replaces "many" ore trains depending on your use of modules.

The idea being that to me the increasing distance between mining areas and area where the mined things are used means an increasing number of train is required to maintain throughput. Reducing the number of trains by carrying more dense material and reducing the distance between where things are mined and used, by spreading production of most comonly used things , both used together can work well, leading to more "modular" base than "monolithic".
Check out my latest mod ! It's noisy !
Amarula
Filter Inserter
Filter Inserter
Posts: 618
Joined: Fri Apr 27, 2018 1:29 pm
Contact:

Re: Wired Parking lot and train pathing

Post by Amarula »

Glad you got your stacker working!

I set up my stackers so each lane has its own train stop with a train limit of one. That way I don't have to adjust any other limits when I add a stacker, and I can add in a new stacker block whenever and wherever. I also use separate stackers for full and empty trains, so full trains go to the full stacker on the way in to town, and empty trains go to the empty stacker on the way out of town, but that isn't necessary.

Starting at the empty stacker, interrupt triggers when there is room at a loading station to load. Once full, one interrupt heads to the full stacker if all the customers are full, the other interrupt heads to the next waiting customer. Once empty, one interrupt heads to the empty stacker if all loaders are full, the other to the loading station. One final interrupt to pick up fuel.
My own personal Factorio super-power - running out of power.
Post Reply

Return to “Gameplay Help”