this post was submitted on 11 Jun 2023
6 points (87.5% liked)

Factorio

1710 readers
53 users here now

Dreaming of transport belts

Rules

Last updated: 2023/06/05

Useful links

Purchase

Factorio has never been on sale and will (probably) never be on sale

founded 1 year ago
MODERATORS
 

After making my starter base, I was working on a train system using train limits, circuits, and bidirectional 3-8-3 trains. I realized the scale was too large for me, and I wanted something smaller and simpler. I had also messed up the fueling system, and wanted to redesign it.

I nuked the old system (literally and figuratively), and I want to switch to unidirectional 1-4 trains, but still using train limits and circuits to calculate the limits. I also want a single fueling (maybe adding multiple as the factory grows) station that is visited by all trains.

Any suggestions for planning or designing something like this? The only mega base I have ever made was a spaghetti mess and I'm trying to be a bit more organized in the creation of this one (the initial goal is 2.7k spm)

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 1 year ago (1 children)

This is the simplest I'd do:

  • Have a dedicated refueling line. This one is a bit special and probably with a 1-1 train it'll be enough. This line should go from "fuel pickup -> fuel drop off". Maybe, down the line, more than one refueling train will be needed. Your fuel drop off should refuel this line first. This way, as you progress you just need to change what's in "fuel pickup" and all your trains will (eventually) use your new fuel.

  • Have a* refueling area where all your trains are refueled. Think of having 5-10 (as many as you need) stations in parallel, all canned exactly the same (i.e "Refuel") *These stations might become a traffic bottleneck so you might want to have a few returning areas scattered around. For automatic schedule you can use a few seconds of inactivity as a condition.

  • Have a parking area. Think of 10 stations all named exactly the same (i.e. "Parking"). These might also become a traffic bottleneck so you might want to have a few of these areas scattered around. Use no condition in the schedule, so trains won't stop unless they have nowhere to go. It's important to consider these areas, as you don't want a train which can't pickup anything blocking a refueling station.

  • Name every pickup station type exactly the same (i.e. 1-4 Iron Ore Pickup) Use amount of material in the station as a condition to set train limit (and not enable/disable station). You can use circuits to set exactly the number of trains you can serve but I usually don't bother. If you can request 3 trains, you need to make sure that there's space to park 2 trains by the station where they won't interrupt traffic. I did it simpler to just have multiple pickup stations in parallel and depending on waiting material request 1 or 0 trains. As multiple trains would be waiting anyway, I prefer them being loaded. This might not be the most efficient way but I think it's simpler. For the scheduler you'd use full cargo OR Time passed. If a couple of minutes have gone by, have the train depart and not wait anymore.

  • Name every drop of station exactly the same (following the iron ore example, 1-4 Iron Ore Drop Off) As schedule conditions you'd use Empty Cargo OR Time passed. If a couple minutes go by, have the train depart and not wait anymore. You'd use circuits to keep requesting trains until the station has stopped as many material as you want. Keep in mind that if you request more than one train, you'll need space for the remaining trains to wait without interrupting traffic.

Your train schedule should look like (adjust times add needed):

  • Refuel: Inactivity > 5 sec
  • Parking: No conditions
  • 1-4 Resource Pickup: Full Cargo OR Time Passed > 60
  • 1-4 Resource Drop Off: Empty Cargo OR Time passed > 60

You can repeat parking, pickup, drop off a few times to minimize refueling (be careful not to do this too many times so your trains spend all their fuel before refueling) If you do, remember that after drop off you should always go to parking.

Once you have the schedule set up for a train, you can copy it with shift+right click and paste with shift+left click.

Finally, it's important to use train limit instead of enable / disable.

Using the former, over a train has departed, if the station changes and requests 0 trains, the train will keep going.

If you use disable, if a train departs and the station becomes disabled, the train will stop in the middle of nowhere, potentially causing a gridlock.

PS: I usually name my stations with the type of train, so if later I decide to bring ore from an outpost far away, I can make a few exchanging hubs with 3-8, 4-16, ... bringing materials and 1-4 distributing then around the base

[–] [email protected] 1 points 1 year ago

This was very in-depth, thanks a lot!

If I am reading this correctly, the parking area is only to serve as a buffer for trains that have nowhere to go, right? For example, if there are no stations that have enough resources for a train to pickup, the train will be forced to wait at parking. This is one of the problems that I had been running into with my old system, and this will definitely solve it.

And yes, I had been using train limits instead of enable/disable. I especially like your idea of

If you can request 3 trains, you need to make sure that there’s space to park 2 trains by the station where they won’t interrupt traffic. I did it simpler to just have multiple pickup stations in parallel and depending on waiting material request 1 or 0 trains.

Also, I will be sure to include the train type in my stations, i can see this being very useful if I want to scale up in the future!

[–] [email protected] 1 points 1 year ago

Hmmm, it’ll be hard to do what you want, most notably the single refuelling station, with just vanilla trains. I used to have refuelling on every stop in a base (main base, big outposts). Then the trains would go between them and mining outposts for example. I’d name all similar stations the same so that it’ll go to the nearest activated station. (Deactivate them when demand has been met). That worked fine for me. Nowadays, however, I use LTN to achieve something very similar to what you have. Instead of trains waiting at the iron smeltery waiting to be dispatched, they now wait in the depot and can go anywhere as long as the wagon type matches the cargo. Gave me the benefit of centralised refuelling in the depot and fewer active trains at any given time. Really worth looking into LTN if trains are your thing. I promise it’s not as complicated as it may look at first. :)

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

I thought bidirectional trains would be easy to deal with but it seems to just cause lots of traffic problems. I lay two parallel tracks everywhere with roundabouts so I don't really have to think about direction at all. Trains can get anywhere so as long as they have somewhere to get out of the way and I keep them at four cars or shorter.

If you design it like that it would be easy to add a refueling station that all the trains can visit. I just use a requestor chest at each dropoff station with a bit of solid fuel since I tend to overproduce it to keep oil types balanced.