AWay to totally lock a track path.

Post your ideas and suggestions how to improve the game.
Tekky
Filter Inserter
Filter Inserter
Posts: 998
Joined: Sun Jul 31, 2016 10:53 am
Contact:

Re: AWay to totally lock a track path.

Post by Tekky » Sat Oct 13, 2018 3:16 pm

Optera wrote:
Sat Oct 13, 2018 5:50 am
OTTD trains still get lost easily if you build junctions where you have to turn left to go right.
That is only true when using very old versions of OpenTTD which used the original pathfinder from Transport Tycoon or the NTP pathfinder. Since the introduction of the NPF and the YAPF pathfinder, trains actually do calculate their entire route to their destination, so they cannot get lost.

With the YAPF pathfinder, the only thing that is limited to near distance is whether dynamic information such as red signals and tracks reserved by other trains are taken into account when deciding which route to take. For the rest of the route to the destination, the YAPF pathfinder uses cached pathfinder costs, which do not take dynamic information such as red signals and reserved tracks into account. Since it can be assumed that red signals and reserved tracks are only temporary, it is meaningful that the pathfinder only takes these up to a certain distance into account. The exact amount of this distance can be configured in the YAPF pathfinder settings.

Another advantage of OpenTTD over Factorio is that you have more control over the route the trains take by using waypoints (i.e. stations where trains do not stop). These waypoints can be multi-tile, so that they span several parallel train tracks. In this suggestion thread, is has been suggested that Factorio should also implement waypoints.

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 » Sun Oct 14, 2018 3:24 pm

Thanks to Optera mentioning the mod Pathological. As I see it, the relevant parameters for this case are
  • A segment ending in a circuit-closed signal is lengthened by adding Signal Reserved By Circuit Network Penalty (1000)
vs.
  • A segment in a currently-occupied block is lengthened by adding (2*length)/(1+distance of block from start)
  • A segment, which is in a new block along the path, that has a train in it is lengthened by
    • Train Waiting At Signal Penalty (100)
    • Train Waiting At Signal Tick Multiplier Penalty (0.1 for every tick the train has already waited)
(default values from the Wiki)

That means with the trains waiting in the stacker for a long time, at some point their penalty will supersede the penalty of the red signal closed by the circuit network. So you could drastically increase the Signal Reserved By Circuit Network Penalty and/or set the Train Waiting At Signal Tick Multiplier Penalty to zero.

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 15, 2018 12:05 am

This would do well i think:
Lock Path.jpg
Lock Path.jpg (53.14 KiB) Viewed 868 times
The pathfinder would not prefer that path with red signals where the checkbox is active.
Instead it would try to use another path if possible.
When the checkbox is active the red signal penalty would be extremely high so that waiting train penalty may never hit the value of it.
Last edited by Hyenna on Tue Oct 16, 2018 7:50 pm, edited 1 time in total.

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

Re: AWay to totally lock a track path.

Post by Optera » Mon Oct 15, 2018 8:15 am

tobsimon wrote:
Sun Oct 14, 2018 3:24 pm
Thanks to Optera mentioning the mod Pathological. As I see it, the relevant parameters for this case are
  • A segment ending in a circuit-closed signal is lengthened by adding Signal Reserved By Circuit Network Penalty (1000)
vs.
  • A segment in a currently-occupied block is lengthened by adding (2*length)/(1+distance of block from start)
  • A segment, which is in a new block along the path, that has a train in it is lengthened by
    • Train Waiting At Signal Penalty (100)
    • Train Waiting At Signal Tick Multiplier Penalty (0.1 for every tick the train has already waited)
(default values from the Wiki)

That means with the trains waiting in the stacker for a long time, at some point their penalty will supersede the penalty of the red signal closed by the circuit network. So you could drastically increase the Signal Reserved By Circuit Network Penalty and/or set the Train Waiting At Signal Tick Multiplier Penalty to zero.
I just had exactly this behavior. When demand dropped trains waiting in the stacker accumulated absurdly large penalties.
The fix for my stackers was to set Train Waiting At Signal Tick Multiplier Penalty to 0.
Together with my previous change of stop penalty from 500 to 100 Trains queue up in stackers almost as nicely as in TTD.

The only drawback of these changes would be trains no longer try to evade congestions, but to me that's even beneficial. My network is so sparse the way around often takes longer than waiting at a junction.

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

Re: AWay to totally lock a track path.

Post by bobingabout » Tue Oct 16, 2018 8:27 am

Tekky wrote:
Sat Oct 13, 2018 3:16 pm
Optera wrote:
Sat Oct 13, 2018 5:50 am
OTTD trains still get lost easily if you build junctions where you have to turn left to go right.
That is only true when using very old versions of OpenTTD which used the original pathfinder from Transport Tycoon or the NTP pathfinder. Since the introduction of the NPF and the YAPF pathfinder, trains actually do calculate their entire route to their destination, so they cannot get lost.
oh god, I remember the controversy over weather or not you should turn on the new experimental NPF or not due to it's increased CPU usage, then years later the same again with YAPF, but it was more of a no brainer because it was more optimised.

I didn't look at any of your links there, so if I'm wrong, I'm wrong. but that's what I remember.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.

User avatar
disentius
Fast Inserter
Fast Inserter
Posts: 231
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: AWay to totally lock a track path.

Post by disentius » Tue Oct 16, 2018 9:01 pm

removed.
Last edited by disentius on Sun Feb 10, 2019 10:29 am, edited 2 times in total.

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 » Fri Oct 19, 2018 6:43 pm

disentius wrote:
Tue Oct 16, 2018 9:01 pm
Made a concept which seems to work most of the time evenly distributing the trains (1-1).
Test and shoot please.
What your setup does in my test is stacking litle trains one side by side which means it doesnt keep the rails clear for long trains:
Stacker1.jpg
Stacker1.jpg (486.34 KiB) Viewed 832 times
My target is to stack small trains behind as long they fit behind before open a new (clear) lane because i want to keep rails clear for long trains to fit in.
That requires a way to lock a path with red signal not to get considered by the pathfinder to go (only if there is no other way to go). See the diffrence between them?
Stacker2.jpg
Stacker2.jpg (530.97 KiB) Viewed 832 times

User avatar
disentius
Fast Inserter
Fast Inserter
Posts: 231
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: AWay to totally lock a track path.

Post by disentius » Sat Oct 20, 2018 7:36 pm

i do now:) Mmisunderstood your original goal. thanks!

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 » Sun Oct 21, 2018 12:35 pm

To lock a track path for the pathfinder could also be useful to reserve tracks for player controlled train to keep a rail clear from automatic driving trains so that a player can drive in without the chance to crash into automatic trains.

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

Re: AWay to totally lock a track path.

Post by Zavian » Sun Oct 21, 2018 12:44 pm

Hyenna wrote:
Sun Oct 21, 2018 12:35 pm
To lock a track path for the pathfinder could also be useful to reserve tracks for player controlled train to keep a rail clear from automatic driving trains so that a player can drive in without the chance to crash into automatic trains.
Just place signals on both sides of the track to prevent any automatic trains from using it.

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 » Sun Oct 21, 2018 12:49 pm

Zavian wrote:
Sun Oct 21, 2018 12:44 pm
Hyenna wrote:
Sun Oct 21, 2018 12:35 pm
To lock a track path for the pathfinder could also be useful to reserve tracks for player controlled train to keep a rail clear from automatic driving trains so that a player can drive in without the chance to crash into automatic trains.
Just place signals on both sides of the track to prevent any automatic trains from using it.
It wouldnt prevent the Pathfinder from considering it to be a valid path if the other lanes have more penalty on it due to red signal or waiting train blocking so the train would be waiting for a lane to open where it shouldnt enter.

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

Re: AWay to totally lock a track path.

Post by Zavian » Sun Oct 21, 2018 12:53 pm

Hyenna wrote:
Sun Oct 21, 2018 12:49 pm
It wouldnt prevent the Pathfinder from considering it to be a valid path if the other lanes have more penalty on it due to red signal or waiting train blocking.
If you place signals on both sides of the track (but not directly opposite each other) then you make a section of track that automatic trains can't enter from either direction. And the automatic pathfinder should understand that.

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 » Sun Oct 21, 2018 1:00 pm

Zavian wrote:
Sun Oct 21, 2018 12:53 pm
Hyenna wrote:
Sun Oct 21, 2018 12:49 pm
It wouldnt prevent the Pathfinder from considering it to be a valid path if the other lanes have more penalty on it due to red signal or waiting train blocking.
If you place signals on both sides of the track (but not directly opposite each other) then you make a section of track that automatic trains can't enter from either direction. And the automatic pathfinder should understand that.
That may work for a fix setup but you cannot switch it on/off by wire network so that it works for other track reservation. (no automation there)

User avatar
dog80
Fast Inserter
Fast Inserter
Posts: 220
Joined: Thu Dec 08, 2016 11:57 pm
Contact:

Re: AWay to totally lock a track path.

Post by dog80 » Sun Oct 21, 2018 2:30 pm

can you rename the topic it is misleading because it suggests that there is a way

- to make the long story short: as long as there is no activate/deactivate button on a rail signal so you can make a 1 way signal OUT OF a 2 way signal --- there IS NO WAY to TOTALLY LOCK a path... how is this so hard to understand?

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

Re: AWay to totally lock a track path.

Post by Tekky » Sun Oct 21, 2018 5:20 pm

dog80 wrote:
Sun Oct 21, 2018 2:30 pm
can you rename the topic it is misleading because it suggests that there is a way
Because the thread is in the "Ideas and Suggestions" sub-forum, it is obvious from the name of the topic that the original poster (OP) is suggesting that there should be a way to lock a path and not that there already was a way to lock a path.

Since this has already been implemented in OpenTTD using the optional routing restrictions patch, it should certainly be possible to implement this also in Factorio.

User avatar
dog80
Fast Inserter
Fast Inserter
Posts: 220
Joined: Thu Dec 08, 2016 11:57 pm
Contact:

Re: AWay to totally lock a track path.

Post by dog80 » Sun Oct 21, 2018 6:34 pm

Tekky wrote:
Sun Oct 21, 2018 5:20 pm
dog80 wrote:
Sun Oct 21, 2018 2:30 pm
can you rename the topic it is misleading because it suggests that there is a way
Because the thread is in the "Ideas and Suggestions" sub-forum, it is obvious from the name of the topic that the original poster (OP) is suggesting that there should be a way to lock a path and not that there already was a way to lock a path.

Since this has already been implemented in OpenTTD using the optional routing restrictions patch, it should certainly be possible to implement this also in Factorio.
too hard to add a "add" or "?" to the title - sry didnt know

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 22, 2018 6:53 pm

dog80 wrote:
Sun Oct 21, 2018 2:30 pm
...there IS NO WAY to TOTALLY LOCK a path...
Thats why im suggesting it here in the suggestions section.

User avatar
dog80
Fast Inserter
Fast Inserter
Posts: 220
Joined: Thu Dec 08, 2016 11:57 pm
Contact:

Re: AWay to totally lock a track path.

Post by dog80 » Tue Oct 23, 2018 12:10 am

so why have a discussion about possible workarounds - that do not exist ... and just leave it as suggestion thread? -- You can still discuss workarounds in general forum or so under a different topic name

AnthonyForPOTUS
Inserter
Inserter
Posts: 20
Joined: Wed May 02, 2018 12:28 am
Contact:

Re: AWay to totally lock a track path.

Post by AnthonyForPOTUS » Sat Oct 27, 2018 1:32 pm

The two signals are a bit confusing at first. Mostly they are misnomered. The 3 light signal will be red if there is a train in the path following it, green if there is no train is the next block. It can also be yellow or blue in certain situations. The singe light signal will copy the state of the next signal or signals. So if all signals in the next block are green it will be green. If all signals after it are red or there is a train in the block it will be red, and if even one signal after it is green and there is no train in the block it will be blue. So a (1 light) chain signal at the entry to a stacker prevents a train from entering the stacker unless it can path to a green signal. A chain signal at the entry to each stacking slot signals if that slot is oen. A 3 light signal at the exit of each slot properly signals to the entry signal of each slot whether the slot is occupied or not, btu will not block a slot if the exit block is occupied or there is no free path out of the slot, as long as the slot is empty a train can proceed into the stacker and park in that slot.

AnthonyForPOTUS
Inserter
Inserter
Posts: 20
Joined: Wed May 02, 2018 12:28 am
Contact:

Re: AWay to totally lock a track path.

Post by AnthonyForPOTUS » Sat Oct 27, 2018 1:33 pm

Hyenna wrote:
Mon Oct 22, 2018 6:53 pm
dog80 wrote:
Sun Oct 21, 2018 2:30 pm
...there IS NO WAY to TOTALLY LOCK a path...
Thats why im suggesting it here in the suggestions section.
Circuit network can send red signal = 1 to a light to lock it red.

Post Reply

Return to “Ideas and Suggestions”

Who is online

Users browsing this forum: Google [Bot]