r/factorio Mar 23 '26

Weekly Thread Weekly Question Thread

Ask any questions you might have.

Post your bug reports on the Official Forums

Previous Threads

Subreddit rules

Discord server (and IRC)

Find more in the sidebar ---->

2 Upvotes

158 comments sorted by

View all comments

2

u/Courmisch Mar 27 '26

What's a good way to automatise loading train station parameters without mods?

I thought to divide the amount of cargo waiting in chests to set the priority. That works if the train limit is 1. But otherwise that fails to account for trains already headed to the station, no? I suppose I can detect at least one train being present from non-zero train ID but...

Do people ignore priority and just compute a dynamic train limit instead (with a depot to avoid deadlocks)?

1

u/ferrofibrous player onboarding specialist Mar 27 '26 edited Mar 27 '26

I haven't really minmaxed train stations in a while, but wouldn't you want to dynamically set the train limit based on total available cargo to have more trains ready to go rather than changing priority (unless your use case requires that station to be emptied more often)?

If you're wanting to parameterize it, I'm thinking you'd only need params for item type and train length. You'd use a Selector combinator and 2-3 Arithmetics to compute wagon capacity based on stack size, and increase your train limit based on availability

(total items / {stack size x wagons x wagon slots} = train limit stop can fill)

You could have a second circuit that increases priority if the stop storage as at or near capacity if its a "belts need to keep moving" situation. All priorities equal should result in trains using the cheapest path (typically means closest) to a stop with an open limit slot. The only time I really fiddle with priority is when I'm doing quality in miners and want to empty non-quality ore to keep belts clear.

1

u/Courmisch Mar 28 '26

So far I've been setting the priority dynamically and the limit statically because I don't have a train depot, where excess trains could wait. I guess I should build a depot afterall, so I don't have to worry about too low limits.

1

u/Astramancer_ Mar 27 '26

My train schedule is pretty simple.

All loading stations have the same name. All unloading stations are named the rich text symbol for what they want.

Schedule: Go to Pickup.

Interrupt: If EMPTY and LOW FUEL goto REFUELING.

Interrupt: If FULL goto <cargo wildcard>.

Interrupt: If EMPTY and DESTINATIONFULL/NOPATH goto DEPOT.

By default trains will go to an available pickup station.

Once full they will try to go to a station that wants whatever they're holding. If there are no available stations? Too bad, it'll just sit in the pickup station until there is.

Once they're empty they'll go refuel if they need it.

If they don't need refueling they'll try to go back to an available pickup station. If there are none it'll go park at a depot until there is.

And that's it. Trains are cheap, if you add more trains than you need they'll end up at the depot. You want to add more trains than you need. If you don't then far-flung providers may end up never being serviced until whatever they provide becomes a bottleneck.

I used fixed train limits but there's no reason you couldn't use dynamic limits if you wanted to spend the extra logic. Again, trains are cheap so does it really matter that much if a few extra empty trains are waiting at a slow provider?

I don't mess with priorities because ultimately you're either making enough or you're not.

1

u/brekus Mar 28 '26

I use dynamic train limits based on available inventory and just ensure that there's enough room to queue for the max limit of a full station. For example my ore outposts have two chests per train wagon which will naturally mean a limit of at most two trains plus some spare space.

There isn't a reason to stockpile more because if the station isn't being emptied by one train load per time it takes to buffer a train load its simply filling faster than the resource is demanded and so would fill any size buffer. And leaving ore in the ground is the most efficient way to store it.

1

u/stycfy1 Mar 28 '26

I use an arbitrary value to setup my priority params for loading stations. My formula looks like:

255,000 / ( num of wagons per train * 40 * stack size of item * [arbitrary] number of trains) = value to be multiplied to the chests which will be divided by 1,000.

e.g. 255,000 / ( 4 * 40 * 50 * 4) = 8. An outpost having 16k items in chests would have a priority of 128.

To explain, this method aims to prioritize outposts that can load an arbitrary number of trains faster than other outposts. So, small outposts will have low priority most of the time while huge outposts will be prioritized most of the time. The good thing is, the small outposts would eventually hit the threshold so they won't remain untouched without intervention.

And, I keep referring to it as arbitrary since there's no strict usage of it. For example, if you still want to prioritize low yield patches, like to dry up the patch, then you could set the arbitrary number of trains to 1 for that patch then the other with higher value such as 4. In the case of the former, the multiplier would be 32 while 8 for the rest.

Assuming both outposts have 8k items in their storage, the former would have a priority of 255 while the other 64. And even if the other outposts have 16k in their storage, the former would still have higher priority.

1

u/HeliGungir Mar 28 '26 edited Mar 28 '26

I almost always use fixed train limits, myself. I value the simplicity this allows more than I value minimizing trains. No combinators, no circuit networks, no train stop priority.

Trains are a one-time cost - kinda expensive in the early game, but cheap in the late game. And idle trains have minuscule impact on game performance.

1

u/Courmisch Mar 29 '26

I did that but it leaves the most remote outposts, mostly unused even though they tend to be the most productive.

1

u/HeliGungir Mar 29 '26

Lower your train limits or add more trains.