AWay to totally lock a track path.

Post your ideas and suggestions how to improve the game.
User avatar
Hyenna
Inserter
Inserter
Posts: 40
Joined: Mon May 14, 2018 6:49 am
Contact:

AWay to totally lock a track path.

Post by Hyenna » Mon Oct 01, 2018 4:31 pm

Hi there im missing a way to totally block a track path even when there is no train on it - so that the train doesnt try to enter the path when the signal is red and there are other pathes it could stack behind other trains.
It could be done relatively simple by giving us control over signal strength in the traffic light or maybe a checkbox to give it a very high penalty when it is red.
If that is not an option to implement it could be a rail disconnector or something that can be controlled by combinator network signals.
It really would help to solve some problems in traffic management.

User avatar
tobsimon
Fast Inserter
Fast Inserter
Posts: 101
Joined: Wed Apr 29, 2015 10:58 am
Contact:

Re: AWay to totally lock a track path.

Post by tobsimon » Mon Oct 01, 2018 5:18 pm

If I understand you intention correctly, than it could be solved with the chain signal. As the chain signal only lets a train through, if it can enter a following block with a regular block signal in front of it, it is not only perfect for preventing a train stopping in an unfortunate position, such as on track switches and crossings, but also acts as a distributer to free tracks. When the train approaches a chain signal, the pathfinder will recalculate the best path to the next stop. If there are several possible paths (parallel tracks) and one is blocked, the penality of the red signal on that path will cause it to chose another path, even if it is longer. So the new path avoids the blocked track for a free one and the chain signal goes green, because the exiting block signal of this path is green as well.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 3048
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: AWay to totally lock a track path.

Post by eradicator » Mon Oct 01, 2018 6:03 pm

Circuit controlled signals have a penalty 20 times higher than normal red signals. Also signal penalties stack, so having more on the same path will increase the penalty. I'm not really sure what you're trying to do. Some sort of special stacker? Are you fully aware of how chain signals work? For signaling questions it's always best to describe your problem (instead of your solution) and post pictures of it, that makes helping a lot easier.

If you just wanted to block a split for a manually steered train you could use something like this:
1) All other trains will wait at the chain signal and regularly try to repath to the green signal even if they initially aimed at the branch.
2) The branch has a penalty of over 9000 so unless you have a huge network trains are higly unlikely to ever even attempt to go there.
Ofc the two approaches can be combined.
screenshot_28973.jpg
screenshot_28973.jpg (113.34 KiB) Viewed 1482 times
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Tekky
Filter Inserter
Filter Inserter
Posts: 996
Joined: Sun Jul 31, 2016 10:53 am
Contact:

Re: AWay to totally lock a track path.

Post by Tekky » Mon Oct 01, 2018 6:31 pm

OP's suggestion has already been suggested and discussed in the following thread:

viewtopic.php?f=6&t=58395 Block rail section based on train condition

The OP of that thread first suggested blocking routes completely. Later in that thread, I suggested that it should also be possible to add a pathfinder penalty, instead of only being able to block the route completely.

User avatar
Hyenna
Inserter
Inserter
Posts: 40
Joined: Mon May 14, 2018 6:49 am
Contact:

Re: AWay to totally lock a track path.

Post by Hyenna » Mon Oct 01, 2018 11:33 pm

The red signal doesnt prevent the pathfinder from leading a train on track when the other track is blocked by another train.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 3048
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: AWay to totally lock a track path.

Post by eradicator » Tue Oct 02, 2018 9:28 am

Hyenna wrote:
Mon Oct 01, 2018 11:33 pm
The red signal doesnt prevent the pathfinder from leading a train on track when the other track is blocked by another train.
It does if you use chain signals.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Hyenna
Inserter
Inserter
Posts: 40
Joined: Mon May 14, 2018 6:49 am
Contact:

Re: AWay to totally lock a track path.

Post by Hyenna » Tue Oct 02, 2018 7:21 pm

There is chain signals on each end (where the train start one in the middle and one just beside the big light) how come the train is acting like this when it has a green signal to go behind the other train? the clear lanes schould be reserved for long trains (8 waggon) as long other lanes arent filled or the train doesnt fit in. the pathfinder leads the train to a lane that is signaled red by wire network its something that shouldnt be because it can lead to a deadlock.
Wire network lets green for the lane to stack behind but the train doesnt go there.

it seems to happen with longer lanes and/or lot of small trains stacking behind another. I tried with some shorter lane and it didnt happen there.
Attachments
20181002023833_1.jpg
20181002023833_1.jpg (501.01 KiB) Viewed 1411 times

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 3048
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: AWay to totally lock a track path.

Post by eradicator » Tue Oct 02, 2018 7:55 pm

Because the train is inheritly trying to get to the target as fast as possible. It doesn't "know" about the other trains, and it doesn't chose to "wait in line" by itself. Your picture is too small to properly see the signals, but if that is a chain signal at the entry to the stacker, then the train should wait there for a few seconds and then correctly go into the lower bay (assuming the signaling is correct). Trains precalculate their path when leaving the last station, and do not change their path until they hit a red signal. If you want the lower bays to be preferred you could try making them the shortest route by changing the rail layout to exit downwards out of the stacker (or adding fake stations on the upper ones).

Though i do remember that i saw a thread before about this sort of multi-length stacker...you just gotta find it ^^. Also there was some magic involving two signals in a row where the first one switches the second one to green when it becomes red... but i don't remember the details.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Hyenna
Inserter
Inserter
Posts: 40
Joined: Mon May 14, 2018 6:49 am
Contact:

Re: AWay to totally lock a track path.

Post by Hyenna » Tue Oct 02, 2018 8:21 pm

In opposide point of view i could argue the train doesn't know how long the signal will stay red. It could get closer to its target by following the way where the signal is green and stack behind the other train. Which path is clear or not depends on how the trains come in it could be bottom or something in the middle too the layout wouldn't change that point here.
I know the problem of my stacker setup i made some changes to it but it doesnt really solve the problem just exchanges one for another which is less problem kind. i put a timer there which open the clear line when the train doesnt want to stack behind then it may block a path which should be reserved for a long train but is better then blocking all traffic. and what the other linked there i didnt understand it seemed to be something else or their signaling was possibly wrong somehow, but i dont know what there was trying to do exactly.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 3048
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: AWay to totally lock a track path.

Post by eradicator » Tue Oct 02, 2018 8:39 pm

Hyenna wrote:
Tue Oct 02, 2018 8:21 pm
In opposide point of view i could argue the train doesn't know how long the signal will stay red.
I'm not "arguing". I'm describing how the trains are coded to behave. And that is to look for the best path *right now* and not to speculate about how signals might change in the future. I'm sorry if that doesn't help you ;).
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

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

Re: AWay to totally lock a track path.

Post by Zavian » Tue Oct 02, 2018 11:13 pm

Read https://wiki.factorio.com/Railway/Train_path_finding . 3 stopped trains can have a larger pathfinding penalty that waiting for a circuit controlled signal.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 3048
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: AWay to totally lock a track path.

Post by eradicator » Wed Oct 03, 2018 8:05 am

Zavian wrote:
Tue Oct 02, 2018 11:13 pm
Read https://wiki.factorio.com/Railway/Train_path_finding . 3 stopped trains can have a larger pathfinding penalty that waiting for a circuit controlled signal.
The problem is that those three small trains might not have been there when the train chose its path.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
tobsimon
Fast Inserter
Fast Inserter
Posts: 101
Joined: Wed Apr 29, 2015 10:58 am
Contact:

Re: AWay to totally lock a track path.

Post by tobsimon » Wed Oct 03, 2018 10:16 am

The route from the entry chain signal through the lowest lane to the exit of the stacker (destination somewhere down the line) has 4 red signals. The routes through the two topmost lanes only have two red signals (one set by circuit condition). Looking at it like this, it makes sense for the pathfinder to choose one of those lanes. Also it can got farthest until it hits the first red signal on the cosen route.

Your expectancy would be, that the train enters the green signal. To achive this, you argue that the penalty for a circuit controlled red signal should be much higher, since you can't expect that it gets red anytime soon. I'm not to convinced by that argument, since this is true for any red signal. There could be a manually stopped train behind it.

Have you tried getting your desired result, if you wired up all signals in the blocked lane and turn them all red?

User avatar
Hyenna
Inserter
Inserter
Posts: 40
Joined: Mon May 14, 2018 6:49 am
Contact:

Re: AWay to totally lock a track path.

Post by Hyenna » Sat Oct 06, 2018 12:21 am

tobsimon wrote:
Wed Oct 03, 2018 10:16 am
Have you tried getting your desired result, if you wired up all signals in the blocked lane and turn them all red?
yes when i turn them all red it does things like that:
Attachments
20181003210426_1.jpg
20181003210426_1.jpg (418.01 KiB) Viewed 1302 times
20181003210131_1.jpg
20181003210131_1.jpg (523.47 KiB) Viewed 1302 times

User avatar
Hyenna
Inserter
Inserter
Posts: 40
Joined: Mon May 14, 2018 6:49 am
Contact:

Re: AWay to totally lock a track path.

Post by Hyenna » Sat Oct 06, 2018 12:40 am

Just to clarify all trains there are set to automatic on that litle test track going between two stations one in the left bottom and one in the bottom right just before the turn to the length check and there can be seen a long train just left on the first screenshot top left (sorry its half cutoff in the screen) so where should have been the litle 3 trains before if not on the stacker?

i thought it happened because the traffic light was still green when a train left so i changed something to switch the line red while a train is leaving.
it seems to happen less often now the trains are more often changing its path to where i want them to but doesnt really solve the problem.

Factoruser
Fast Inserter
Fast Inserter
Posts: 135
Joined: Tue Sep 16, 2014 5:48 pm
Contact:

Re: AWay to totally lock a track path.

Post by Factoruser » Sun Oct 07, 2018 1:56 pm

TL;DR - You have to place (red) signals at the entraces of the tracks and a chain signal BEFORE the branching. Then a train will wait for the first track where the signal at its entrace is turning green. The signals at the entraces should be chain signals too, otherwise trains could wait behind them.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 6661
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: AWay to totally lock a track path.

Post by bobingabout » Mon Oct 08, 2018 8:30 am

Basically, the signal the train you're complaining about not taking the green path is currently stopped at needs to be a chain signal. The one at the top of the bend too.

Chain signals basically look ahead and turn green if any after them are green, and also act as a "you may take any path after me" markers too. I'm not 100% on how they work to be honest, but I've told what I do know.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.

ikarikeiji
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jul 12, 2015 6:28 pm
Contact:

Re: AWay to totally lock a track path.

Post by ikarikeiji » Tue Oct 09, 2018 12:39 pm

bobingabout wrote:
Mon Oct 08, 2018 8:30 am
Chain signals basically look ahead and turn green if any after them are green, and also act as a "you may take any path after me" markers too. I'm not 100% on how they work to be honest, but I've told what I do know.
Nothing about a chain signal tells the train it may take any path, no more than a regular signal.

A chain signal acts exactly the same as a regular signal, except that it also prevents a train passing if the next signal that that train would encounter (based on that train's current path) cannot be passed by that train.

A chain signal is red and orange in the same conditions as a regular signal, and is also red if all possible "next" signals are red. In other cases it is green if all possible "next" signals are green, or blue otherwise.

When a chain signal goes orange due to the train reserving its route, the next signal the train will pass will also go orange, and this continues until a regular signal is reached. This prevents some other train interfering with the reserved path.

Tekky
Filter Inserter
Filter Inserter
Posts: 996
Joined: Sun Jul 31, 2016 10:53 am
Contact:

Re: AWay to totally lock a track path.

Post by Tekky » Tue Oct 09, 2018 6:45 pm

ikarikeiji wrote:
Tue Oct 09, 2018 12:39 pm
bobingabout wrote:
Mon Oct 08, 2018 8:30 am
Chain signals basically look ahead and turn green if any after them are green, and also act as a "you may take any path after me" markers too. I'm not 100% on how they work to be honest, but I've told what I do know.
Nothing about a chain signal tells the train it may take any path, no more than a regular signal.

A chain signal acts exactly the same as a regular signal, except that it also prevents a train passing if the next signal that that train would encounter (based on that train's current path) cannot be passed by that train.
I believe that is not quite correct. There is one other major difference. According to this post by Factorio developer Rseding91, a train waiting at a chain signal will, under certain conditions, attempt to repath every 5 seconds. I don't think that they do that with regular signals (but I haven't tested it).

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 6661
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: AWay to totally lock a track path.

Post by bobingabout » Wed Oct 10, 2018 7:49 am

ikarikeiji wrote:
Tue Oct 09, 2018 12:39 pm
A chain signal acts exactly the same as a regular signal, except that it also prevents a train passing if the next signal that that train would encounter (based on that train's current path) cannot be passed by that train.
That seems kind of pointless. They're supposed to be based on Pre signals and PBS signals from OpenTTD, where special logic applies.
in this case, they're supposed to allow the train to bypass blocked paths, such as trains stopped at a station.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.

Post Reply

Return to “Ideas and Suggestions”

Who is online

Users browsing this forum: No registered users