Failing to understand train behavior

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Summoner99
Burner Inserter
Burner Inserter
Posts: 7
Joined: Thu Jun 04, 2020 5:33 pm
Contact:

Failing to understand train behavior

Post by Summoner99 »

Hello,

I have been doing a lot of things with trains and the circuit network recently, and I set up this simple dropoff station. The goal is to have the station close if there is no space in the stacker or the station itself. The way I figure it suffices to turn the station off if the stacker is full because if the station is empty then there must be a train leaving the stacker.

On the bottom entrance to the stacker, each of the (regular) rail signals is connected to the station. So in the picture, the station is getting a signal of 3 red and 1 green signals. So as a result, the station is open.

Obviously all relevant trains have the same schedule.

The issue then is that I can't get another train to fill into the last spot of the stacker. The last train when it leaves its pickup station it sets a course to go through the stacker, but once it approaches the intersection, it changes course for the pickup station, but I can't seem to understand why.

There are more copies of this dropoff station so bear that in mind.

All advice is appreciated.
TrainIssue.PNG
TrainIssue.PNG (1.34 MiB) Viewed 1489 times

User avatar
valneq
Smart Inserter
Smart Inserter
Posts: 1243
Joined: Fri Jul 12, 2019 7:43 am
Contact:

Re: Failing to understand train behavior

Post by valneq »

Even if you get the last train to enter the stacker, the circuit condition will turn the station off, correct? Then all trains in the stacker trying to go to this station, as well as the one waiting at the station will re-route to the next station with the same name. Is that what you want?

Summoner99
Burner Inserter
Burner Inserter
Posts: 7
Joined: Thu Jun 04, 2020 5:33 pm
Contact:

Re: Failing to understand train behavior

Post by Summoner99 »

Yes if the stacker becomes full, the station turns off. Upon further testing, I discovered that if the tracker becomes full while a train is at the station, nothing happens immediately. Once the train at the station leaves, then the trains in the stacker simply skip by the station which is not what I wanted.

What I want to happen is when the stacker is full, I do not want new trains to be able to enter this dropoff station and instead they reroute to a station with the same name if there exists an enabled one. Otherwise go back to the pickup station.

I want any train in the stacker already to just proceed to the station in this dropoff station.

Does that make sense?

Summoner99
Burner Inserter
Burner Inserter
Posts: 7
Joined: Thu Jun 04, 2020 5:33 pm
Contact:

Re: Failing to understand train behavior

Post by Summoner99 »

So I determined the issue of a train going right past when there was a spot in the stacker available. It was because as a train approached the intersection with only one spot available, it'd turn the lone green chain signal to yellow, and then the station would disable for a split second causing the train approaching to reroute.

This issue I had at that point with a full station and stacker was that the train at the station would carry on till it was time for it to leave which once it was gone, the trains in the stacker would simply leave the station altogether because the station was disabled so they rerouted.

Of course, I don't want that behavior. I want the trains in the stacker to carry on to the station itself. So I think a good choice is to just not disable the station ever.

I tried tying regular rail signals to red near the entrance and tying them to be closed when the entire outpost was full, but either the train would start to pull into the station blocking the mainline, the train would wait on the mainline which is also blocking the mainline, or I don't know where I should place the signals.

User avatar
valneq
Smart Inserter
Smart Inserter
Posts: 1243
Joined: Fri Jul 12, 2019 7:43 am
Contact:

Re: Failing to understand train behavior

Post by valneq »

Just to understand the purpose of this.
  • The screenshot shows what should become a dropoff station. There are no inserters taking items out of the trains just yet.
  • You have a stacker for four trains that can wait right there with full cargo.
  • The train schedule is a simple "Wait for full cargo" at pickup station and "wait for empty cargo" at dropoff station.
  • You are worried that there will be situations where more than four trains with full cargo will try to drop off their cargo at this station at the same time. Therefore you want to limit the number of trains that try to enter this station.
If that is the case, why are there more than four trains in your system providing this item? Why not increase the size of the stacker so it could potentially accomodate all trains that could possibly try to arrive at the station?

Another option that actually scales a bit better is to modify the train schedules, so they are called to the dropoff station only when the station requires items. This is possible if you put the condition you need onto a signal wire that stretches across large distances. Then trains could wait at a generic depot for full trains until they see the correct circuit condition.

If you don't want to bother with any of this, use Logistic Train Network or similar mods that do this kind of stuff for you.

Summoner99
Burner Inserter
Burner Inserter
Posts: 7
Joined: Thu Jun 04, 2020 5:33 pm
Contact:

Re: Failing to understand train behavior

Post by Summoner99 »

I like that idea about the depot. Quick google search brings up many options so I will look into those. Thank you very much for your guidance.

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: Failing to understand train behavior

Post by Impatient »

valneq wrote:
Thu Jun 04, 2020 7:29 pm
...
Another option that actually scales a bit better is to modify the train schedules, so they are called to the dropoff station only when the station requires items. This is possible if you put the condition you need onto a signal wire that stretches across large distances. Then trains could wait at a generic depot for full trains until they see the correct circuit condition.
...
That caught my eye. Let's say we have a dropoff station, a stacker of size 0 (ss = 0 ) and 2 potential trains waiting at their loading stations (t = 2). Now you set the signal that signifies, that the station needs resources. What happens? See my point?
That problem will always happen in your "signaling that station is open" solution, as long as ss<(t-1), which means that station and stacker together can not acommodate all potential trains.

Post Reply

Return to “Gameplay Help”