Factorio

Factorio

View Stats:
Wylder Jul 21, 2022 @ 11:06am
Train routing w/o LTN
I've got a megabase going with circuits on all stations that call trains when there is demand or supply. One issue I'm running into is that a full copper plate supply depot had enough copper for 3 trains thus it calls 3 trains (2 that are waiting to fill one actively filling), but a full depot next to it is waiting for trains (some of which are sitting empty in the queue to fill at the first station. This artificially slows my base down as the drop points are now waiting for the plates while that one train fills. I've tried adding more trains but that seems to create a new issue where an empty train is waiting on a drop point and a full train at the load point, but since neither clear they can't move.

My question is, is there a way to more dynamically call empty trains to full stations without stacking all my trains at the first depot that's full, leaving the other depot waiting as it fills up shortly after? Would prefer to do it without LTN or other mods, but don't know if that's possible. Thoughts?
< >
Showing 1-15 of 30 comments
RiO Jul 21, 2022 @ 1:54pm 
Set up depot stops dedicated to hold trains not in active use.
(You can also use these as centralized refueling locations.)

And then configure your trains with a schedule like:

<<Provider station>>
Wait until : Full cargo
<<Depot>>
Wait until : 2 sec inactivity
<<Requester station>>
Wait until : Empty cargo
<<Depot>>
Wait until : 2 sec inactivity

This will keep your provider and requester stations unblocked.
The 2sec inactivity is to allow for refueling at depots. (Any fuel being inserted into the loc counts as activity; at which point the timer resets.)
shadain597 Jul 21, 2022 @ 2:03pm 
Sounds like you are, paradoxically, ending up with both too many available slots at train stations and not enough. I'm not sure that you need an individual train station to allow more than 2 trains to be parked there at any one time, but I'm not really a megabase person. Silly question: do all of your supply and demand stations of the same type have the same name, and take up the same slot in the train's route planner? I.e., does one of your routes look something like:
Copper Plate Supply
wait until full
Copper Plate Demand
wait until empty

Or do you have long routes with lots of unique station names? I'm assuming you are dynamically setting train limits, instead of enabling/disabling stations?

I suppose one solution to the second issue is to mimic LTN: have intermediate stations just outside of regular stations with a short wait condition; it'll slow things down a bit, potentially, but it'll ensure that trains don't get "stuck" in stations.
knighttemplar1960 Jul 21, 2022 @ 7:59pm 
Trains try to route to the closest available station. The solution to having only one train at a loading station is to set the station to request a single train when it has enough (or more) material instead of multiple trains and then have a train stop with a stacker that can handle all of the trains of that type needed in that area set to handle that number of trains with a clear path (ie: a train doesn't have to pass through an occupied station to get to another station) to all stations of that type in that area. Do that for both loading and unloading stations and set your consist up the way Rio has suggested but with 4 stops.

Load waiting depot
Loading station
Unload waiting depot
Unload station

The trains will automatically try to take the shortest path each time and brownian motion will disperse the total number of trains required by each area into that area.

You will be able to tell at a glance of the stackers where you need more ore or more plates/intermediate products.
Wylder Jul 21, 2022 @ 7:59pm 
Great, thanks for the suggestions all!
Hedning Jul 22, 2022 @ 12:50am 
You don't need any condition at all at depots, that way trains can even drive straight through if they have a station afterwards.

What I prefer is to not dynamically set both ends, but just 1 so that for example my copper trains for red circuits are only for red circuits and my copper train for green circuits are different trains. This way all trains can have easy 2 station schedules with no issues and you don't need to artificially increase traffic congestion by adding massive depots.
AlexMBrennan Jul 22, 2022 @ 6:33am 
The solution to having only one train at a loading station is to set the station to request a single train when it has enough (or more) material
I don't like that idea at all - trains spend most of their time travelling and only a couple of seconds loading/unloading so your stations will now be idle 99.99% of the time.

Making sure that you have enough trains seems like a better idea because you don't cripple your throughput.
Hedning Jul 22, 2022 @ 8:08am 
Originally posted by AlexMBrennan:
trains spend most of their time travelling and only a couple of seconds loading/unloading so your stations will now be idle 99.99% of the time.
I agree, with an exception for mining stations or any other slow production station. If it takes a while for a train to get there all that should happen is they get full again sooner for the next train. Unless the attached mine can mine more than enough to always request a train it doesn't really matter if the station itself goes idle waiting for trains.
Last edited by Hedning; Jul 22, 2022 @ 8:08am
knighttemplar1960 Jul 22, 2022 @ 8:44am 
Originally posted by AlexMBrennan:
The solution to having only one train at a loading station is to set the station to request a single train when it has enough (or more) material
I don't like that idea at all - trains spend most of their time travelling and only a couple of seconds loading/unloading so your stations will now be idle 99.99% of the time.

Making sure that you have enough trains seems like a better idea because you don't cripple your throughput.
If your loading station doesn't have enough material to fully load a train the station is set to 0 and will be idle most of the time anyway. To make that not be the case you would have to unload all most twice as much ore and smelt it all in the time it takes to load a plate train. In my experience that simply doesn't happen. You can always add more trains. All you have to do is make sure that the stacker for the waiting station has as many lanes as trains needed and make sure that the waiting station is only a few seconds away from the loading station(s).

It solves the problem of routing without using LTN. Which was what the OP was looking for.
Last edited by knighttemplar1960; Jul 22, 2022 @ 8:45am
Hedning Jul 22, 2022 @ 10:09am 
Originally posted by knighttemplar1960:
make sure that the waiting station is only a few seconds away from the loading station(s).
That only works if they are not spread out and I think for this scenario we are assuming they are spread out. If they are all together you don't need depot stations, you can just hold them in the stacker with chain signals.
Limit every supply depot to 1 slot and stack your trains at a parallel array of refueling stations with 1 slot each. When a supply station has enough buffer to fill one train - enable it. There will be a delay but ultimately every supply depot will work non-stop - trains will travel and load much faster than even the biggest ore deposits can produce materials. Also consider attaching electric furnaces directly to drills and carry plates instead (unless you play mods that require a lot of intermediates to smelt). This will double your train throughput.
Also if you really need to speed up item transportation - create another station with 1 slot just before the one with chests, and enable it if there is enough items for two trains. Once the first train leaves - second will immediately move in to load, and a third one will depart, assuming there's still enough items for 2+ trains.
Last edited by Нагризолич; Jul 22, 2022 @ 11:02am
knighttemplar1960 Jul 22, 2022 @ 12:10pm 
Originally posted by Hedning:
Originally posted by knighttemplar1960:
make sure that the waiting station is only a few seconds away from the loading station(s).
That only works if they are not spread out and I think for this scenario we are assuming they are spread out. If they are all together you don't need depot stations, you can just hold them in the stacker with chain signals.
No, it works if they are spread out as well, because the trains will always route to the nearest available destination. That tends to cause them to clump in the areas they are serving provided you are using sufficient trains. You can just build multiple small holding depots if you are spread out. You are just arguing against a system that will work the way that the OP wants it to work without offering a better solution.
Hedning Jul 22, 2022 @ 1:36pm 
Originally posted by knighttemplar1960:
You can just build multiple small holding depots if you are spread out.
If you are having multiple depots then you will have the exact same problem as with multiple primary stations. You haven't really fixed anything and now you have extra journeys and risk calling a train that went to the wrong depot because trains can't plan ahead, so you'll still get the long arrival times.

Originally posted by knighttemplar1960:
You are just arguing against a system that will work the way that the OP wants it to work without offering a better solution.
Solutions have already been posted, by me and others.
knighttemplar1960 Jul 22, 2022 @ 1:53pm 
Originally posted by Hedning:
Originally posted by knighttemplar1960:
You can just build multiple small holding depots if you are spread out.
If you are having multiple depots then you will have the exact same problem as with multiple primary stations. You haven't really fixed anything and now you have extra journeys and risk calling a train that went to the wrong depot because trains can't plan ahead, so you'll still get the long arrival times.

Originally posted by knighttemplar1960:
You are just arguing against a system that will work the way that the OP wants it to work without offering a better solution.
Solutions have already been posted, by me and others.
You are typing like you haven't tried it. Oh yeah! Because you haven't. You have never tried non-standard non-optimal things so you have no clue how those things work.

Your solution is not what the OP wants because the trains aren't flexible which is one of the things the OP mentioned is not desirable. With so many different trains having specific stops you will have a long list of trains all with different routes. You will get bogged down in the logistics in a megabase with a set up like that (I know because I've tried it). It won't work unless you have all the deliveries timed and all it takes is one missed or slow delivery to put the entire factory behind.
Hedning Jul 22, 2022 @ 2:43pm 
Originally posted by knighttemplar1960:
You are typing like you haven't tried it. Oh yeah! Because you haven't. You have never tried non-standard non-optimal things so you have no clue how those things work.
That's right, I don't generally try things I think is pointless or don't believe will work. If you say it does work then tell me how. How is having multiple, spread out depots not running into the same problems as having multiple, spread out stations in the first place?

Originally posted by knighttemplar1960:
Your solution is not what the OP wants
Depots are fine. I'm not against depots. AlexM objected specifically to setting the limit to only 1 train and your solution to the issue he raised is not a working one, at least not that I can see. His solution of adding more trains is a working one, as I already said in my reply to him.

Originally posted by knighttemplar1960:
You will get bogged down in the logistics in a megabase (I know because I've tried it). It won't work unless you have all the deliveries timed and all it takes is one missed or slow delivery to put the entire factory behind.
You might. I'm not. For me it is easy to just add trains where they are needed and give offloading stations unique names. I have a convention where I name them after the product they will produce, so the copper train station for red circuits is named "red circuit copper". It's very easy and needs no timing. Trains getting stuck on route to deliver is a problem regardless of system. This is basically how everyone did it before we had train limits, so it's what I originally learned.

By not having depots I have less distance traveled and therefore less congestion. The actual drawback of "my" way is that with more unique schedules I need more total trains and my trains will idle more waiting to deliver. Like I said I have no objection to people using depots, as long as they use them correctly. Actually right now I use depots for ore trains and unique names for everything else, so a mixed system.
Last edited by Hedning; Jul 22, 2022 @ 2:50pm
Vyndicu Jul 22, 2022 @ 3:25pm 
Oh boy, here we go again.

Why do people treat other people's opinions as something to disapprove of, like 'X' is the only way to do it when there is more than one valid way to accomplish the same goal in-game?
< >
Showing 1-15 of 30 comments
Per page: 1530 50

Date Posted: Jul 21, 2022 @ 11:06am
Posts: 30