Trains and Circuits

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
rcp27
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Wed Apr 26, 2017 3:34 pm
Contact:

Trains and Circuits

Post by rcp27 »

I'm giving a rail based setup my first serious attempt, and I'm trying to go with a "wait at a central depot" method of dispatching trains. The way I have it set up is every source of a given product has a station with the same name and every destination likewise, for example "iron plates pickup" and "iron plates drop-off". I have a dedicated refuelling station and a set of "wait here" depot stations. The trains are scheduled like this:

refuelling (inactivity) > depot (circuit condition) > pickup (full cargo) > depot (circuit condition) > drop-off (empty cargo).

I have combinators to count the items in the chests at each station and if a pickup station has enough for a full train, it generates a signal, likewise for drop-off stations if it has enough space to accept a full train. I put the signals on wires that span the whole rail network, and the pickup and drop-off stations are set to activate/deactivate based on the signal, and the same signal is used for the depot circuit condition.

Apart from the odd bit of traffic jam, everything works except for one thing. When a signal is sent to open a station, the train receives the signal but sees the station as "closed", so skips that stop on its schedule. My guess is that because the station takes 1 "tick" to register as open and the train and station receive the signal at the same instant, the station is still closed at the moment the train activates, it skips the stop.

I figured a way to fix this would be to pass the signal wire between the wider network and the depot station through an arithmetic combinator set to each * 1 = each, so that there is a one tick delay in sending the signal to the train. This does not appear to be fixing the problem. Am I misunderstanding what is going on? Is there a better way to achieve what I want (I am aware of mods like LTN, but I would rather make this work in vanilla).

torne
Filter Inserter
Filter Inserter
Posts: 341
Joined: Sun Jan 01, 2017 11:54 am
Contact:

Re: Trains and Circuits

Post by torne »

Is the global signal connected directly to the pickup/dropoff train stops, or are there combinators involved? If there's any combinators you might need to delay by more than one tick, since each combinator delays the signal by one more tick.

rcp27
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Wed Apr 26, 2017 3:34 pm
Contact:

Re: Trains and Circuits

Post by rcp27 »

The system is set up with all the chests for a single car at a station on the green wire as input to a decider combinator. That combinator reads the contents and if the levels are right to trigger the station, it sends a green square on the red wire. The red wire for the whole station is input to a second decider combinator by the station that, if it receives x green squares where x is the number of cars, sends a signal for the relevant item. To keep it simple, for supply stations 1x the item being supplied, for demand I pick a letter or colour signal and send that. The output signal for the station is connected to the station with a red wire and to the global network with a green wire, so that signals on the global network won't feed the local station. The station is set to activate on the signal, and at the depot station, the global wire is connected to the station, and the trains are set to depart when signal > 0, where the signal is the relevant item for the part of the journey for the particular train. Basically the signal is sent to the station to be activated and to the train to be dispatched with no other intermediate combinators or circuit logic

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Trains and Circuits

Post by sparr »

Do you have a plan to prevent multiple trains from being dispatched to service the same need?

rcp27
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Wed Apr 26, 2017 3:34 pm
Contact:

Re: Trains and Circuits

Post by rcp27 »

I have thought about setting it up so that the second train is dispatched with the signal is >=2 and the third on >=3 etc, so far I haven't done that as the train network is coping with the extra traffic of just sending them all out, but that might become an issue as I scale up

Post Reply

Return to “Gameplay Help”