Why do trains get stuck at this chain signal?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
thatguy321
Inserter
Inserter
Posts: 47
Joined: Tue Jul 19, 2016 1:35 pm
Contact:

Why do trains get stuck at this chain signal?

Post by thatguy321 »

I have a train station layout with multiple train stops of the same name ("Iron Smelting"). I have combinators hooked up so that the signal leading to the lane with the least amount of ore will be green and the rest red which will always force the trains to unload at the station with the least amount of ore. Unless the station with the least amount of ore currently has a train at it, then they will turn the signal green going to the station with the second least amount of ore, etc.

This system worked flawlessly while I was running it with 8 lanes. But I have expanded it to 20 or so lanes and now every so often a train will get stuck at the chain signal seen in the pics. It will be working fine and randomly a train will get stuck there. As you can see from the pic, the chain signal is blue indicating that there is an open lane ahead and indeed you can see that bay N has a green signal. Why won't the train go? Thanks!
Attachments
problem.jpg
problem.jpg (313.45 KiB) Viewed 3608 times
train problem 2.JPG
train problem 2.JPG (198.61 KiB) Viewed 3608 times
"I have come here to smelt iron ore and kick biter ass.....and I'm all out of iron ore." -me

User avatar
MalcolmCooks
Filter Inserter
Filter Inserter
Posts: 253
Joined: Mon Apr 06, 2015 8:32 pm
Contact:

Re: Why do trains get stuck at this chain signal?

Post by MalcolmCooks »

see this topic for a solution: viewtopic.php?f=18&t=34321

Fish
Inserter
Inserter
Posts: 26
Joined: Thu Mar 24, 2016 1:20 pm
Contact:

Re: Why do trains get stuck at this chain signal?

Post by Fish »

Yeah, this is annoying
I hope they do a rework of train pathfinding

User avatar
MalcolmCooks
Filter Inserter
Filter Inserter
Posts: 253
Joined: Mon Apr 06, 2015 8:32 pm
Contact:

Re: Why do trains get stuck at this chain signal?

Post by MalcolmCooks »

Fish wrote:Yeah, this is annoying
I hope they do a rework of train pathfinding
The fix could be as simple as having trains recalculate their path when they stop at a chain signal :/

User avatar
mexmer
Filter Inserter
Filter Inserter
Posts: 869
Joined: Wed Aug 03, 2016 2:00 pm
Contact:

Re: Why do trains get stuck at this chain signal?

Post by mexmer »

MalcolmCooks wrote:
Fish wrote:Yeah, this is annoying
I hope they do a rework of train pathfinding
The fix could be as simple as having trains recalculate their path when they stop at a chain signal :/
which will not work.

mind that if there is multiple signals (crossing), after then you don't know which one of them will change color of signal you stop at. so what you want to recalculate? path to free station? but what if in that time comes other train, from different direction?

recalculation of path, whem you pass signal is one of best approaches you can have (unless you plan to make heuristic logic network).

thatguy321
Inserter
Inserter
Posts: 47
Joined: Tue Jul 19, 2016 1:35 pm
Contact:

Re: Why do trains get stuck at this chain signal?

Post by thatguy321 »

MalcolmCooks wrote:see this topic for a solution: viewtopic.php?f=18&t=34321
Thanks for the link, that sheds some light on what each train is "thinking". I didn't know any of that before. That faux chain signal doesn't quite work for my design though. I want the trains to pick the station which has the least amount of ore in its buffer in order to keep things balanced out, but they always pick whichever station they feel like even if I make the signal before the station go red and they have another route to get to a station where the signal is green. In fact even if you don't want to balance out the stations, how do you get a large amount of trains to unload simultaneously without having different station names? It seems to me that if you have more than 10 or so stations of the same name, the trains will just end up parking behind a station which is already unloading a train leaving multiple other stations empty and idle.

Any thoughts? Solutions?
"I have come here to smelt iron ore and kick biter ass.....and I'm all out of iron ore." -me

thatguy321
Inserter
Inserter
Posts: 47
Joined: Tue Jul 19, 2016 1:35 pm
Contact:

Re: Why do trains get stuck at this chain signal?

Post by thatguy321 »

Ok, one thing I think I just found out is that trains seem to look for a route that is all green, however, they will treat a signal which you have artificially turned red via circuit conditions as a green light (yes, they will stop at it, but they don't factor it into their route planning)! They seem to treat a signal that is red because a train is in the way differently than a signal which you have set to red.
"I have come here to smelt iron ore and kick biter ass.....and I'm all out of iron ore." -me

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Why do trains get stuck at this chain signal?

Post by Deadly-Bagel »

Pretty sure the train has no idea why a signal is red. It might be if you're setting them both in the same tick? I would set the stations and faux-signal separately, let the faux-signal work based solely off the colour of the lights rather than any other logic.

Connect the faux-signal on say a green network, then you'll want to set up a separate circuit (connect the signals with red wires) across the loading bays that enables access to only an empty station with the least amount of ore. Easiest way is like a loading station, enable any station that is equal or less than average. To enable JUST one station, see this Reddit post, seems to do what you want, just remember to keep it separate from the faux-signal.
Money might be the root of all evil, but ignorance is the heart.

Post Reply

Return to “Gameplay Help”