How to optimize railsetup

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
User avatar
planetmaker
Fast Inserter
Fast Inserter
Posts: 180
Joined: Mon Jan 21, 2019 9:30 am
Contact:

How to optimize railsetup

Post by planetmaker »

Consider the setup as in the screenshot:

one train is waiting at the entrance to the station complex while there are accessible free stations. Is there a way to make it favour the non-occopied but open stations instead of waiting for an occupied one? The difference is the open, but un-occupied are behind a circuit-controlled closed station. I consider this a bit strange behaviour on behalf of the path finder... alas.

More combinators and closing station as soon as one train is loading might be an option but is not my preferred solution as it costs space which I don't have.
Bildschirmfoto von 2020-03-20 18-45-04.png
Bildschirmfoto von 2020-03-20 18-45-04.png (227.49 KiB) Viewed 2862 times

astroshak
Filter Inserter
Filter Inserter
Posts: 597
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: How to optimize railsetup

Post by astroshak »

IIRC trains choose their routes based on “percieved distances”, and it measures that percieved distance based on the number of signals (rail and chain) it must pass, picking the shortest distance.

Things like trains occupying a station add a certain amount of weight, or “percieved distance” to the calculation. So do circuit-closed stations. In fact, I believe that circuit-closed stations add the most to that distance calculation.

I understand what you are trying to do, to load the train directly from the miners, and to account for the fact that different wagon spaces will have different depletion times for the overall mine. I just don’t know what you should do about it. I tried it once, and at a very low Mining Productivity level did not care for it. I have personally scrapped the idea, but if you can get it to work well, more power to you.

User avatar
5thHorseman
Smart Inserter
Smart Inserter
Posts: 1193
Joined: Fri Jun 10, 2016 11:21 pm
Contact:

Re: How to optimize railsetup

Post by 5thHorseman »

This is just a thought. I've never used this particular setup but I have had multiple stations with the same name at the same outpost.

Try putting a station right where your train is waiting. Name it "Enter [iron ore]" or something. Have all trains path to it with no conditions, then "[iron ore] pickup". They should pick an unused station at that time, no?

If that doesn't work, maybe disable stations based on if a train is at them.

If that doesn't work, try both together :)

User avatar
Ghoulish
Filter Inserter
Filter Inserter
Posts: 461
Joined: Fri Oct 16, 2015 8:40 am

Re: How to optimize railsetup

Post by Ghoulish »

Optera wrote:
Fri Jan 24, 2020 6:15 pm
Too bad you didn't also "fix" that trains waiting at signals can accumulate infinite penalties.
A simple cap on the waiting penalty would make trains path into stackers a lot more reliable.
Think this is the same issue? Quote from Friday Facts #331 - 0.18.0 release & Train pathfinder changes
See the daily™ struggles with my Factory! :D https://www.twitch.tv/repetitivebeats

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: How to optimize railsetup

Post by Zavian »

Quoting https://wiki.factorio.com/Railway/Train_path_finding
When the path includes a train stop that is not the destination -> Add a penalty of 2000.
My guess is that penalty will result in a train preferring to wait for an open but occupied train station to be available rather than pass a train stop that is closed. (I'm not certain that a closed station applies that penalty, but I think it probably does).

Maybe try closing the other stations as soon as a train arrives. (I've never used such a setup, but from memory of other forum threads closing a station as soon as a train arrives shouldn't result in the just arrived train having to leave). With only one open station, the train will hopefully use that despite the penalty.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: How to optimize railsetup

Post by Optera »

Ghoulish wrote:
Fri Mar 20, 2020 9:07 pm
Optera wrote:
Fri Jan 24, 2020 6:15 pm
Too bad you didn't also "fix" that trains waiting at signals can accumulate infinite penalties.
A simple cap on the waiting penalty would make trains path into stackers a lot more reliable.
Think this is the same issue? Quote from Friday Facts #331 - 0.18.0 release & Train pathfinder changes
No my post in FF331 was a reference to an issue with stackers here: viewtopic.php?p=382712#p382712

What's happening in the op is the train waiting would have to pass through closed stops getting to open stops so it prefers the occupied stop.
For this setup to work 4 closed stops must have less penalty than one occupied open stop.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1647
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: How to optimize railsetup

Post by Pi-C »

Zavian wrote:
Fri Mar 20, 2020 9:29 pm
My guess is that penalty will result in a train preferring to wait for an open but occupied train station to be available rather than pass a train stop that is closed. (I'm not certain that a closed station applies that penalty, but I think it probably does).

Maybe try closing the other stations as soon as a train arrives.
How about enabling a waypoint stations shortly after a switch instead, so the path behind it gets a bonus (i.e. decreased penalty)? I'm using that method in my game to enforce certain routes. The station needs to be enabled only until the train has crossed the switch:
main_depot.png
main_depot.png (49.42 KiB) Viewed 2758 times
Trains come in from the left and stop at the station with the yellow box. The station on the bottom right is open by default (overflow). I use combinator logic to determine which exit should be opened. The signal behind that switch is set to green, the signals behind all other exits are set to red. The "Node" stations immediately behind those signals are enabled when the signal in front of them is green. The waypoint will always be the closest station of that name the train can reach, so it actually chooses that path. Once the head of the train has passed the signal, it will turn red, so the waypoint station will be disabled again and the train moves on to the next station behind it, without coming to a halt.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

User avatar
ZlovreD
Fast Inserter
Fast Inserter
Posts: 129
Joined: Thu Apr 06, 2017 1:07 pm
Contact:

Re: How to optimize railsetup

Post by ZlovreD »

Just try to use both signals before each junction. Chain+regular like this:
Image
I've made some tests trying to solve another problem, but conclusions may be helpful and in your case.

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

Re: How to optimize railsetup

Post by Impatient »

Zavian wrote:
Fri Mar 20, 2020 9:29 pm
... Maybe try closing the other stations as soon as a train arrives. (I've never used such a setup, but from memory of other forum threads closing a station as soon as a train arrives shouldn't result in the just arrived train having to leave). ...
Deactivating a station immediately makes a train leave (if it has more stations on its schedule).

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

Re: How to optimize railsetup

Post by Impatient »

Pi-C wrote:
Sat Mar 21, 2020 12:26 pm
How about enabling a waypoint stations shortly after a switch instead, ... The "Node" stations immediately behind those signals are enabled when the signal in front of them is green. ... Once the head of the train has passed the signal, it will turn red, so the waypoint station will be disabled again and the train moves on to the next station behind it
Very smart idea

I also had the idea for nodes stations on each track that are active if one station after them is active. But linking those node stations directly to the entrance signal of that track is just too smart.
Pi-C wrote:
Sat Mar 21, 2020 12:26 pm
... without coming to a halt.
"Not coming to a halt" also happens if there are no conditions set for that station in the trains schedule.
planetmaker wrote:
Fri Mar 20, 2020 5:49 pm
Consider the setup as in the screenshot ...
One thing that comes to my mind is the following: If there is more than one "PICKUP" station activated on one track, the trains will always go for the right most one of those stations, I think. Emptying the ore patch from right to left.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1647
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: How to optimize railsetup

Post by Pi-C »

Impatient wrote:
Wed May 13, 2020 1:54 am
Pi-C wrote:
Sat Mar 21, 2020 12:26 pm
... without coming to a halt.
"Not coming to a halt" also happens if there are no conditions set for that station in the trains schedule.
That wouldn't work in my game: All my stations have the same name, and all trains have the same schedule (goto station, wait for X seconds inactivity + circuit signal "green"). Routing is completely done via circuit network. To be frank, I don't know how it will behave with lots of trains, I've just concentrated on the logic part, neglecting most of my factory during that time. Couldn't continue playing even if I had the time because the one mod crucial to my setup still crashes reliably whenever I touch a locomotive. :-D
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Gameplay Help”