Red train signal set by circuit only has 1000 penalty?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
User avatar
MEOWMI
Fast Inserter
Fast Inserter
Posts: 202
Joined: Wed May 22, 2019 12:21 pm
Contact:

Red train signal set by circuit only has 1000 penalty?

Post by MEOWMI »

I finally encountered this problem when using trains.

So, as we know,
Factorio wiki on train pathfinding wrote:When [a] rail block is guarded by a rail signal set to red by the circuit network -> Add a [path finding] penalty of 1000.
Why is this penalty only 1000 again? Wouldn't you almost always want for a red-signaled path to be extremely undesirable to choose?

Context:
I have a train going to stations A and B, stations have signals controlled by circuits. Even when the signals are red at A and green at B, trains still try to path to A presumably because it's so much closer. I can't see any other reason for the train not going to B other than A still somehow being more favorable despite having a literal red signal (which is going to be there for a long time no less).

Troubleshooting:
  • I cannot simply disable stations with circuits to work around this. That was my initial approach actually, but it causes the problem that if all stops are disabled, the train will simply skip the station, effectively running around in circles pointlessly because no other stations exist to stop it.
  • I cannot add a "waiting station" because there is no condition to wait for, the "conditions" are either the stations being enabled/disabled or the station signals being enabled by circuits, neither which are available at such a waiting station.
  • Station B is definitely reachable by train, I checked by giving a temporary station at B to go to.
Any idea how I can solve this, to make trains path to station B when A is not ready? I could obviously add tons of red signals at A, but that sounds like the wrong way to do it, like an ugly hack, and isn't even guaranteed to not break at some point.

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

Re: Red train signal set by circuit only has 1000 penalty?

Post by Nosferatu »

I used to use 3 red signals when I did something like that and I allways made sure that there is a failsafe in case a train still wanted to go the wrong way ;)

But in your case their might be a cleaner solution:
MEOWMI wrote:
Mon May 10, 2021 7:35 pm
I cannot simply disable stations with circuits to work around this. That was my initial approach actually, but it causes the problem that if all stops are disabled, the train will simply skip the station, effectively running around in circles pointlessly because no other stations exist to stop it.
If you add an unreachable station with the same name the train will "no path" instead of skipping.

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1080
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Red train signal set by circuit only has 1000 penalty?

Post by ptx0 »

Nosferatu wrote:
Mon May 10, 2021 8:33 pm
If you add an unreachable station with the same name the train will "no path" instead of skipping.
that's a great way to cripple the game performance over time as the No Path trains will all check for a path every time you change a signal or place rail, even disconnected from the main rail network.
My Mods - Fish Per Minute base size metric - Use your crashed spaceship as a belt balancer?
• • •
Base: Bob's @ 1 Million SPM
• • •
Linear search and overflows are indicative of sloppy coding practices.

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

Re: Red train signal set by circuit only has 1000 penalty?

Post by Impatient »

How far is "far" away? Can you reproduce this and show us a sandbox example? This might be useful for troubleshooting the problem.

User avatar
MEOWMI
Fast Inserter
Fast Inserter
Posts: 202
Joined: Wed May 22, 2019 12:21 pm
Contact:

Re: Red train signal set by circuit only has 1000 penalty?

Post by MEOWMI »

I've been testing adding extra red signals and it's a huge hassle to add it to everything if your stations don't have the exact same rail shape at the entrance. The chained signals require multiple different circuit conditions as well...

Nosferatu wrote:
Mon May 10, 2021 8:33 pm
MEOWMI wrote:
Mon May 10, 2021 7:35 pm
I cannot simply disable stations with circuits to work around this. That was my initial approach actually, but it causes the problem that if all stops are disabled, the train will simply skip the station, effectively running around in circles pointlessly because no other stations exist to stop it.
If you add an unreachable station with the same name the train will "no path" instead of skipping.
This is a nice idea! As mentioned by ptx0, I do wonder how much lag this could potentially cause. Will definitely keep it in mind as an option.

Impatient wrote:
Mon May 10, 2021 8:43 pm
How far is "far" away? Can you reproduce this and show us a sandbox example? This might be useful for troubleshooting the problem.
I'm not sure, as I don't know of an easy way to measure rail lengths, but I think currently the furthest ones are about 2000 units at most, though I feel like it would be quite wise to attempt to future-proof this kind of system as well, making me think I want at least 3000-4000 penalty if I go for such a system.


My rail network is currently fairly low traffic, but I feel like for a high traffic network you would almost have to use station disabling...

Zanthra
Fast Inserter
Fast Inserter
Posts: 206
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Re: Red train signal set by circuit only has 1000 penalty?

Post by Zanthra »

What are you trying to accomplish with the circuit controlled signals? It's possible the best way to solve the problem is to find an alternative means of accomplishing that objective without using them.

If it's just controlling when the train goes to a given station, it's possible you can largely accomplish what you want with the stations by using the circuit network to set the trains limit to 0 instead of disabling them, as a train with a station in it's schedule, but no free slots gives a "destination full" message instead of skipping the station (as long as it sees all stations of that name otherwise a "no path" message). This would not require a circuit controlled rail signal to control access.

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

Re: Red train signal set by circuit only has 1000 penalty?

Post by Pi-C »

Perhaps something like these waypoint stations may work for you as well?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Trific
Fast Inserter
Fast Inserter
Posts: 122
Joined: Thu Dec 31, 2020 7:57 pm
Contact:

Re: Red train signal set by circuit only has 1000 penalty?

Post by Trific »

MEOWMI wrote:
Mon May 10, 2021 7:35 pm
I cannot simply disable stations with circuits to work around this. That was my initial approach actually, but it causes the problem that if all stops are disabled, the train will simply skip the station, effectively running around in circles pointlessly because no other stations exist to stop it.
Use a train limit of 0 instead of disabling the stops. Then the trains will wait with "Destination full" instead of skipping the stop.

jape3
Inserter
Inserter
Posts: 25
Joined: Tue Aug 15, 2017 10:31 pm
Contact:

Re: Red train signal set by circuit only has 1000 penalty?

Post by jape3 »

Was wondering why trains were avoiding an intersection where I built a circuit-network optimized traffic lights.. no wonder if there is a penalty like this :)

User avatar
NotRexButCaesar
Smart Inserter
Smart Inserter
Posts: 1044
Joined: Sun Feb 16, 2020 12:47 am
Contact:

Re: Red train signal set by circuit only has 1000 penalty?

Post by NotRexButCaesar »

jape3 wrote:
Tue May 11, 2021 8:08 pm
Was wondering why trains were avoiding an intersection where I built a circuit-network optimized traffic lights.. no wonder if there is a penalty like this :)
They don't like to be told what to do. :lol:
: Alea jacta est. Determine what you intend to accomplish with an action before execution.
Have you ever heard the gospel? Most have not.

User avatar
MEOWMI
Fast Inserter
Fast Inserter
Posts: 202
Joined: Wed May 22, 2019 12:21 pm
Contact:

Re: Red train signal set by circuit only has 1000 penalty?

Post by MEOWMI »

Trific wrote:
Tue May 11, 2021 5:36 pm
MEOWMI wrote:
Mon May 10, 2021 7:35 pm
I cannot simply disable stations with circuits to work around this. That was my initial approach actually, but it causes the problem that if all stops are disabled, the train will simply skip the station, effectively running around in circles pointlessly because no other stations exist to stop it.
Use a train limit of 0 instead of disabling the stops. Then the trains will wait with "Destination full" instead of skipping the stop.
This does sound like a much better solution! I will have to try it, thanks.

Post Reply

Return to “Gameplay Help”