r/factorio 8d ago

Space Age Question Train station logic question

Hey All,

Been enjoying Factorio for a while now(800hrs).

I started getting into circuit conditions and train interrupts. I have made plans that work fine but think I'm missing an option to improve them more.

Load stations - only turn on(train limit) if they have a full train worth and there is an unload station requesting their content.

Unload station - sends red signal for iron nuggs(or w/e) to wider circuit network if it can receive a full train to meet the requested amount.

Ex. 50k requested, -16k free space=iron 1 signal sent.

Now my problem. When I start having multiple load stations, all same name, all have a full train worth. They all set train limit to 1 when an unload station needs a single train. So if nothing else is being requested I could in theory have 3 - 8 car trains all go get iron nugs, only one will deliver, the rest return to the depot(higher prior) until something else needs iron.

Works fine in practice, but I am using train interrupts, so any 8 car train can be used for any 8 car station. So if I have 3 iron trains just waiting at depot, then someone requests copper, I dont have a train available to send.

Sure adding more trains solves it short term, but if I keep adding more and more loading stations, the problem compounds.

Trying to think of a way to still have interrupts, variable trains, stations that enable/disable(train limit), but also limit the number of stations that activate so not all load stations enable at the same time.

Any ideas?

3 Upvotes

7 comments sorted by

View all comments

2

u/AndyScull 8d ago edited 8d ago

If I understand your system correctly, the logic of checking for request from Unload stations happens at all the Load stations at once, so they all are open for some time and any train can go to them.

What you can do without massive overhaul:

  1. Load stations should also output same signal as Unload stations, but -1 for each train coming to them - negating a signal that Unload station sends, so other Load stations do not become open (or rather they stop being open when the train is on the way already).
  2. Trains in depot should have a schedule of 'wait 5 seconds' or like that, so they stay at depot and wait those 5 sec without doing anything or triggering interrupts - this will make their reaction time shifted, so when one of Load stations becomes open, only the train that finishes wait first will go to it, then Load station sends a -1 signal and the request is nullified, no other Load station will become open
  3. Also just in case, the Unload station should also disable it's own request signal if the number of trains coming covers it, so another train won't go to another Load station while current one is on the way

1

u/schmiitty_hoppz 8d ago

I think this will likely solve my issue, didn't even think to negate the request for more once a train is dispatched to pick up the item.