Trains all go to the same station

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
<X>
Inserter
Inserter
Posts: 22
Joined: Tue Oct 27, 2020 7:14 pm
Contact:

Trains all go to the same station

Post by <X> »

Hello,

I'm building my first late game base. I'm producing about 600 science/minute + what's coming out of my early and mid game base, that doesn't work properly at the moment^^ mostly because the old ore patches are getting smaller and smaller.

In order to not constatly change the stations of my trains, because ore patches get smaller, I've started to rename most stations, so they all have the same names (for example "iron ore" - "Eisenerz" in german). The unloading stations keep their unique names. In order to prevent long waiting times of a train in an old station, where the ore patch is small, I've started to activate and deactivate stations. In my case, if there's more than 1,500 ore for each waggon the station opens for trains. Until the train is there and getting filled it usually gets up to 2,000.

Unfortunately all (or most) trains go to the same station (the closest one). In some cases there are 6 trains waiting. And while they're waiting the others get filled until the point has come, where there's less than 1,500 ore for the waggons. So the station shuts down and the trains leave to get to another station. After they've travelled 1 or 2 City Blocks the station turns back on and some of the trains turn around to get back to the station. And because there were many trains waiting others came back quicker, and they need to wait again until the station turns off again and they leave once again without being filled.

This leads to a long time until they finally come back to their unloading station, and even to traffic jams already.

So there are a few questions: How do trains pick their station? How often do they update their picking? And how can I influence that?

In the uploaded picture you see the part of my base where that happens most. The "Eisenerz" Station in the south is the biggest problem. But also the "Kupfererz" station in the south-west, that is currently shut down.
factorio-train-stations.jpg
factorio-train-stations.jpg (307.33 KiB) Viewed 3331 times

Loewchen
Global Moderator
Global Moderator
Posts: 8308
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Trains all go to the same station

Post by Loewchen »

By giving multiple stations the same name you tell the train: "I don't care to which one you go, go to what is fastest for you to reach"
See here for the pathfinder documentation: https://wiki.factorio.com/Railway/Train_path_finding

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

Re: Trains all go to the same station

Post by valneq »

You may be interested in the announcement of reservation limits for train stops for the next release:
https://factorio.com/blog/post/fff-361

<X>
Inserter
Inserter
Posts: 22
Joined: Tue Oct 27, 2020 7:14 pm
Contact:

Re: Trains all go to the same station

Post by <X> »

ok. That helped me understand how it works. I've already thought so, even though its more complex. But it's really weird, that even a penalty of 500 for each train makes them all go to the same train station.

I already love 1.1. This is gonna be huge. But is there any way to do so with circuits? Ive thought about reading train signals, but didn't come to a good idea yet.

[EDIT] Just the idea of setting the train limit to 0 instead of closing the station, so that all trains with reservation may stay at the station is great :)

MassiveDynamic
Filter Inserter
Filter Inserter
Posts: 260
Joined: Sun Sep 16, 2018 10:44 pm
Contact:

Re: Trains all go to the same station

Post by MassiveDynamic »

I have been working on a similar project for my crude oil trains. I have a working solution that is almost there. It does only open the station when the oil level is sufficient for a train and close the station when it is low on fluid. The issue I haven't completely overcome yet is that multiple trains can be sent to a "ready" station. My working solution is to hold the trains at a stop AFTER their delivery and wait for a unique new "open" signal, then open the holding station with a pulse which allows only one train to leave. The system is working well with 5 fill stations and 2 trains.
I am including screenshots and blueprints. You will have to edit the combinators to match your needs.

This is the HOLDING Stop - after the delivery stop
Screenshot (51).png
Screenshot (51).png (3.57 MiB) Viewed 3257 times
This is the In stop and the holding stop
Screenshot (50).png
Screenshot (50).png (179.39 KiB) Viewed 3257 times
This is the Loading Station - The lights are indicating load level (green means full)
Screenshot (52).png
Screenshot (52).png (4.34 MiB) Viewed 3257 times


Holding Station


Loading Station

<X>
Inserter
Inserter
Posts: 22
Joined: Tue Oct 27, 2020 7:14 pm
Contact:

Re: Trains all go to the same station

Post by <X> »

I'm not sure, if I really understood how it works. you mean your trains go to following stations:
- holding station
- filling station
- emptying station
Right? They don't do anything at the holding station? Just going there and leaving as soon as a filling station opens?

And as soon as a filling station opens one train gets sent there? How do you manage to only send one train? And what do you mean by "wait for a unique new 'open' signal"

If you close the holding station the trains won't leave the delivery, will they? And when it opens all trains start to go to the holding station, and then will lose their "path" once it closes

MassiveDynamic
Filter Inserter
Filter Inserter
Posts: 260
Joined: Sun Sep 16, 2018 10:44 pm
Contact:

Re: Trains all go to the same station

Post by MassiveDynamic »

<X> wrote:
Thu Oct 29, 2020 10:34 pm
I'm not sure, if I really understood how it works. you mean your trains go to following stations:
- holding station
- filling station
- emptying station
Right? They don't do anything at the holding station? Just going there and leaving as soon as a filling station opens?

And as soon as a filling station opens one train gets sent there? How do you manage to only send one train? And what do you mean by "wait for a unique new 'open' signal"

If you close the holding station the trains won't leave the delivery, will they? And when it opens all trains start to go to the holding station, and then will lose their "path" once it closes
The train schedule is pick up, drop off, holding.

The reason for the holding station is to allow both trains to unload completely if possible. I use a pulse generator to open the holding station only once per new open signal. And I also send a virtual “1”,”2”,”3”... with the green “open” signal which provides uniqueness.
The holding station never closes. It provides a parking place for trains to wait for an open loading station.

The pulse generator stops the second train from going to the same station as the first train.

I am working on a few improvements for my system which I will post when I finish.

MassiveDynamic
Filter Inserter
Filter Inserter
Posts: 260
Joined: Sun Sep 16, 2018 10:44 pm
Contact:

Re: Trains all go to the same station

Post by MassiveDynamic »

Ok, so I reworked the system a little bit to make it much better. I ended up posting it in the Combinator Creations thread, so here's a link to that thread...
viewtopic.php?f=193&t=90849&p=518448#p518448

<X>
Inserter
Inserter
Posts: 22
Joined: Tue Oct 27, 2020 7:14 pm
Contact:

Re: Trains all go to the same station

Post by <X> »

Thank you very much. But honestly I haven't understood it yet. I'll read your post in the other thread later.

But I've come up with my own idea. I read the signal right in front of the station. Then a clock starts running. And as soon as the clock reaches 200 the station gets shut down. Within this time the train has already reached the station and gets loaded, so that's no problem. Then I also read the signal right behind the station. As soon as that gets red (train leaves the station) it resets the clock, so the station opens again for other trains. Then I've combinated this with the boxes. Now every bundle of 6 boyes creates a green signal (4 in total), if there's more that 1,500 ore in it, and the train signals create a green signal, if there's no train in the station. And if there are 5 green signals, the station opens. It seems to work well.

To explain it, here's a little screenshot of the logic behind this:
station.jpg
station.jpg (378.96 KiB) Viewed 2822 times
The combinator at the lower right is a plus-combinator with input red signal and output red signal. It gets the input from the train signal at the right
The combinator at the top left is a comparator. If input red = 0 it sends out a green signal. It gets the signal from the train signal at the left
The combinator at the upper right is a multiplier. It multiplies the red signal with the green signal and outputs the red signal. This red signal goes into the first combinator again. So the first combinator adds red signal to itself, as long as the train is not behind the left train signal. It counts as long as the train stays in the station
The combinator at the lower left is a comparator. It checks, if the red signal from the clock is below 200. As long as it is, it sends out a green signal
The green signal goes into the lamp and into the station. As long as the green signal is 1 the lamp is on, and the station is open.

I hope this works with the blueprint:

User avatar
Nosferatu
Fast Inserter
Fast Inserter
Posts: 228
Joined: Fri Jan 20, 2017 4:48 pm
Contact:

Re: Trains all go to the same station

Post by Nosferatu »

I would not spend to much time on this problem.
Whatever you come up with: As distances grow the problem will get bigger again.
1.1 is coming "soon" and then you don't need to worry about all this.
If you can't wait till it comes use this mod: https://mods.factorio.com/mod/Concurren ... estriction
It does the same and all the circuits that you build to control your stations will still work once 1.1 comes out.

That said - I used to do the following:
1.) Make sure that you have a lot more mines then needed
2.) Deactivate Station when the station can not fill a train
3.) Place "Penalty signals" before your mines - these are signals that are turned red by circuits based on how many resources are in the station.
I had 2. The first flashed when there where only enough resources for 3 trains. The second when there where only enough for 2.

The big advantage:
Not all trains will be sent away if the stations resources get lower.
When a penalty signal triggers Trains that are still far away will repath to a different mine that has more resources.
But trains that are already near will most likely still stay on course and will be serviced.
This minimizes the problem.

<X>
Inserter
Inserter
Posts: 22
Joined: Tue Oct 27, 2020 7:14 pm
Contact:

Re: Trains all go to the same station

Post by <X> »

Thank you. I'll keep that in mind, if I have issues later. But my solution seems to work fine. I've checked it for a few minutes now and there were no problems. Now I can open new stations and I know that trains will go there

Post Reply

Return to “Gameplay Help”