Two pre-signal challenges.
Moderator: OpenTTD Developers
Two pre-signal challenges.
Okay, I've got two challenges which require some form of advanced pre-signalling (ie priorities and load balancers) - hopefully not horrendously complex (ie the counter someone made)
I'll try my best to explain these, but feel free to ask for clarification I'll put up some pics if it helps.
1) Enable a faster train to overtake a slower train
Situation:
For this situation, I'm going to assume that the train behind is at least as fast as the train in front. Take a single track line, with a faster train behind a slower one.
Create a setup which allows the faster train to overtake the slower one. Basically, it's a priority but checking BEHIND the train on the same line. The idea is that for any train, if there's a train behind it, divert into a side-line where it will wait until the train behind has passed.
Problem
The difficulty being, that if there are 3 trains in a row, the second train will also try to divert into the side line. To solve this, the train must only PREFER the side line over the main line if the line behind is occupied. I've got it working for two trains, but I can't avoid a deadlock if 3+ trains arrive consecutively.
2)Simulate "splitting" of trains at a station
Okay, this one's slightly trickier.
Situation:
Assume, for argument's sake, a small station - there's no need to expand this into a large station with multiple options.
Take a three platform station, two platforms are 3 tiles - the other 6 tiles. Three trains are involved with this operation. Two 6-car (3-tile) HSTs, and one 12-car (6 tile) HST - the longer train being the supposed combined train.
The aim is to copy the real-life situation where two trains from different lines combine into one train.
Real World Example:
On the west coast main line, First Transpennine Express runs services from Manchester to various destinations. A large number of these services (to Barrow, Windermere, Blackpool, Glasgow and Edinburgh) all travel up the west coast main line. To send the trains individually would be pointless, requiring more drivers and more "paths" (blocking other traffic) In reality, these trains are often run two or three together as one unit, splitting en route. Eg the trains for Blackpool and Glasgow may travel together from Manchester to Preston as a 6-car unit, at which point they split into two 3-car trains, one to Blackpool and the other to Glasgow. Similarly the Barrow and Windermere trains may split at Carnforth or Lancaster, the Glasgow and Edinburgh trains may split at Carlisle. The point being, that for a portion of the journey it is run as one large train, rather than multiple smaller ones, simplifying signalling requirements and allowing more trains to pass through a section of line.
Problem:
Well, it may be easy, but I can't get this to work at all. Essentially the problem should be quite simple - the train at any one platform can leave if, and only if, both of the other two ARE occupied. For the sake of argument, I assume that all platforms are bays (leaving the back of the platform available for signalling using monorail/maglev) but I can't get it working properly.
So, can any smarter man then I manage either of these problems?
Feel free to use absolutely any trick of tracks, stations, waypoints, signals and objects to accomplish them, although the ability to use tunnels to hide the "logic" away from the track would be a bonus
I'll try my best to explain these, but feel free to ask for clarification I'll put up some pics if it helps.
1) Enable a faster train to overtake a slower train
Situation:
For this situation, I'm going to assume that the train behind is at least as fast as the train in front. Take a single track line, with a faster train behind a slower one.
Create a setup which allows the faster train to overtake the slower one. Basically, it's a priority but checking BEHIND the train on the same line. The idea is that for any train, if there's a train behind it, divert into a side-line where it will wait until the train behind has passed.
Problem
The difficulty being, that if there are 3 trains in a row, the second train will also try to divert into the side line. To solve this, the train must only PREFER the side line over the main line if the line behind is occupied. I've got it working for two trains, but I can't avoid a deadlock if 3+ trains arrive consecutively.
2)Simulate "splitting" of trains at a station
Okay, this one's slightly trickier.
Situation:
Assume, for argument's sake, a small station - there's no need to expand this into a large station with multiple options.
Take a three platform station, two platforms are 3 tiles - the other 6 tiles. Three trains are involved with this operation. Two 6-car (3-tile) HSTs, and one 12-car (6 tile) HST - the longer train being the supposed combined train.
The aim is to copy the real-life situation where two trains from different lines combine into one train.
Real World Example:
On the west coast main line, First Transpennine Express runs services from Manchester to various destinations. A large number of these services (to Barrow, Windermere, Blackpool, Glasgow and Edinburgh) all travel up the west coast main line. To send the trains individually would be pointless, requiring more drivers and more "paths" (blocking other traffic) In reality, these trains are often run two or three together as one unit, splitting en route. Eg the trains for Blackpool and Glasgow may travel together from Manchester to Preston as a 6-car unit, at which point they split into two 3-car trains, one to Blackpool and the other to Glasgow. Similarly the Barrow and Windermere trains may split at Carnforth or Lancaster, the Glasgow and Edinburgh trains may split at Carlisle. The point being, that for a portion of the journey it is run as one large train, rather than multiple smaller ones, simplifying signalling requirements and allowing more trains to pass through a section of line.
Problem:
Well, it may be easy, but I can't get this to work at all. Essentially the problem should be quite simple - the train at any one platform can leave if, and only if, both of the other two ARE occupied. For the sake of argument, I assume that all platforms are bays (leaving the back of the platform available for signalling using monorail/maglev) but I can't get it working properly.
So, can any smarter man then I manage either of these problems?
Feel free to use absolutely any trick of tracks, stations, waypoints, signals and objects to accomplish them, although the ability to use tunnels to hide the "logic" away from the track would be a bonus
Jon
Re: Two pre-signal challenges.
No takers then? Shame, I was hoping to use one or both of these to eye-candy up my current game
Jon
Re: Two pre-signal challenges.
Hi,
With PBS, your first challenge is not that tricky. Just have a look at the picture. It works.
With PBS, your first challenge is not that tricky. Just have a look at the picture. It works.
- Attachments
-
- Fahrhaven Transport, 26 Jun 1940.png
- (299.38 KiB) Downloaded 573 times
Re: Two pre-signal challenges.
Done your second challenge, in order to work this also simulates the train splitting again, it's important that the splitting station does not supply passengers so only those fed in will be taken, its not 100% perfect but it works, I've used Jezukim's shed stations to hide the waiting trains.
If anyone can think of a more efficient way of doing this please tell me.
If anyone can think of a more efficient way of doing this please tell me.
- Attachments
-
- Rewood Transport, 4th Feb 2921.png (110.6 KiB) Viewed 1040 times
Re: Two pre-signal challenges.
Quite a nice idea for it, although I'd still love a pre-signal version. Couldn't the shorter trains steal off each other though? Thats why I was trying to check for the presence of the trains, rather than the passengers.
Looking at openttdcoop, it basically looks at needing a combination of the AND gate there, and and NOT (to reverse the input to red, ottdcoop blog assumes green = true). I've had a quick go, but I can't get it right yet - one works fine, but it's a bit harder to combine several
Looking at openttdcoop, it basically looks at needing a combination of the AND gate there, and and NOT (to reverse the input to red, ottdcoop blog assumes green = true). I've had a quick go, but I can't get it right yet - one works fine, but it's a bit harder to combine several
Jon
Re: Two pre-signal challenges.
This here would work if youd make the faster trains longer, just a sketch, for a efficient not-gate look in the led counter thread.
- Attachments
-
- Scheme
- Untitled.png (12.01 KiB) Viewed 6141 times
Re: Two pre-signal challenges.
I don't really understand that sketch - where do the trains come from etc?
Is the presumption that the first train takes the top track, the second train takes the bottom track and the top train is halted until the bottom train passes?
Is the presumption that the first train takes the top track, the second train takes the bottom track and the top train is halted until the bottom train passes?
Jon
Re: Two pre-signal challenges.
It would mean that if the shorter train is slower it would be diverted to the upper line, and if the faster train is longer itd be continuing on the bottom line, the trains are coming from the right side.
Re: Two pre-signal challenges.
With added priorities?
Re: Two pre-signal challenges.
Heyho!audigex wrote:I've got it working for two trains, but I can't avoid a deadlock if 3+ trains arrive consecutively.
Although i can't add anything useful regarding your problem, i'd like to see the solution for the two trains... Would you mind posting a screenshot?
Re: Two pre-signal challenges.
Muahahahaha, I've got it
It's essentially a backward-facing priority, so instead of giving priority to another line it just gives priority to the line behind it.
Pros:
+ Fast trains can overtake slow trains
+ Compact
+ Can be extended to any train length
Cons:
+ Trains of the same speed may bunny hop each other, wasting time
+ If a slower train waits for a faster train to pass, another, even slower train may pass the first train by catching up to the priority system before the first train leaves.
+ Reduces throughput for multiple trains of the same speed - can be fixed by having multiple "penalty" tracks, at the expense of space
As such, it's best used after a relatively long, junctionless straight - allowing fast trains to pull away from slower trains (and avoiding being overtaken) while catching up with slower trains in front of them.
Anyway, here it is. Basically make the section between the stop signal and pbs signal (where the penalty station is) 1tl, and the space for the train to stop 1tl. Extend the priority back along the mainline for more than one signal (I show one for simplicity) in order to allow for trains not being immediately behind or if the following train is not significantly faster than the one in front (in which case the signal may not catch it with one signal.
By placing the penalty on the other line, a true passing loop could be made, where the slower train diverts off the mainline - but fast trains would also divert off the main line if there is no slower train in front.
Enough text...
1: The slower train has been caught up by the following express trains 2: The slower train pulls into the passing siding, whereupon the signal in front of it turns red due to the presence of a following train, which proceeds to pass it on the other track. 3: The first train has passed, but the presence of a second train behind the first means the signal stays red, the second train passes the first.
It's essentially a backward-facing priority, so instead of giving priority to another line it just gives priority to the line behind it.
Pros:
+ Fast trains can overtake slow trains
+ Compact
+ Can be extended to any train length
Cons:
+ Trains of the same speed may bunny hop each other, wasting time
+ If a slower train waits for a faster train to pass, another, even slower train may pass the first train by catching up to the priority system before the first train leaves.
+ Reduces throughput for multiple trains of the same speed - can be fixed by having multiple "penalty" tracks, at the expense of space
As such, it's best used after a relatively long, junctionless straight - allowing fast trains to pull away from slower trains (and avoiding being overtaken) while catching up with slower trains in front of them.
Anyway, here it is. Basically make the section between the stop signal and pbs signal (where the penalty station is) 1tl, and the space for the train to stop 1tl. Extend the priority back along the mainline for more than one signal (I show one for simplicity) in order to allow for trains not being immediately behind or if the following train is not significantly faster than the one in front (in which case the signal may not catch it with one signal.
By placing the penalty on the other line, a true passing loop could be made, where the slower train diverts off the mainline - but fast trains would also divert off the main line if there is no slower train in front.
Enough text...
1: The slower train has been caught up by the following express trains 2: The slower train pulls into the passing siding, whereupon the signal in front of it turns red due to the presence of a following train, which proceeds to pass it on the other track. 3: The first train has passed, but the presence of a second train behind the first means the signal stays red, the second train passes the first.
Jon
Re: Two pre-signal challenges.
And finally, 4:
There are no trains in either the passing track or immediately before, at which point the signal turns green and the slower train moves off. Overtake complete. Edit:
In fact, I've just found an improvement in terms of realism.
Pro over last time: more compact, realistic layout
Con over last time: the third train waits for the second to completely clear the passing loop, reducing throughput.
There are no trains in either the passing track or immediately before, at which point the signal turns green and the slower train moves off. Overtake complete. Edit:
In fact, I've just found an improvement in terms of realism.
Pro over last time: more compact, realistic layout
Con over last time: the third train waits for the second to completely clear the passing loop, reducing throughput.
Jon
Re: Two pre-signal challenges.
Check this save out, take a look at the behavior of the slower train.
Re: Two pre-signal challenges.
That's bloody strange - the track layouts are, as far as I can tell, identical.
Presumably it's something to do with pathfinder settings, but I don't recall doing anything unusual to mine. What's your station penalty?
I'll describe the process, since I'm not sure what your experience level is.
Press the ` key (above tab)
Type:
patch pf.yapf.rail_pbs_station_penalty
And see what the result is, presumably 800
Presumably it's something to do with pathfinder settings, but I don't recall doing anything unusual to mine. What's your station penalty?
I'll describe the process, since I'm not sure what your experience level is.
Press the ` key (above tab)
Type:
patch pf.yapf.rail_pbs_station_penalty
And see what the result is, presumably 800
Jon
Re: Two pre-signal challenges.
Yes, I don't use patch, I usually use setting.
800 was for mine? That's weird, it should be 1500.
800 was for mine? That's weird, it should be 1500.
Re: Two pre-signal challenges.
The default value is 800.petert wrote:Yes, I don't use patch, I usually use setting.
800 was for mine? That's weird, it should be 1500.
Re: Two pre-signal challenges.
Yup, I was expecting yours to be lower. I'd guess that the train is working out the route to the END pre-signal, rather than the PBS signal ahead. I'll have another look later if I remember
Jon
Re: Two pre-signal challenges.
No, I checked and it was 800, could you submit a savegame of what you made?
Re: Two pre-signal challenges.
I didn't bother saving it as the premise was so simple, but here's a more complex version
Clean install of 0.7.2 (although some settings may be kept from my opentt.cfg file, presumably), no GRFs.
All trains prefer the inner line by default (I checked which line they preferred first, then built around that, figuring that it's easier than trying to force them onto another track with penalties), with a nice long "overtake priority" behind. You'll see the TGV and Asiastar both overtake the HST together, the asiastar overtake the TGV and HST seperately and the TGV overtake the HST. (It may start anywhere in this series of events, I can't remember where I saved)
One thing I changed was to place the exit signal behind the start signal, as the trains seemed to be getting a route to that first as it was closer. It makes no difference to the rest of the working.
Edit: Moving the exit signal also seems to solve the problem in your savegame.
Clean install of 0.7.2 (although some settings may be kept from my opentt.cfg file, presumably), no GRFs.
All trains prefer the inner line by default (I checked which line they preferred first, then built around that, figuring that it's easier than trying to force them onto another track with penalties), with a nice long "overtake priority" behind. You'll see the TGV and Asiastar both overtake the HST together, the asiastar overtake the TGV and HST seperately and the TGV overtake the HST. (It may start anywhere in this series of events, I can't remember where I saved)
One thing I changed was to place the exit signal behind the start signal, as the trains seemed to be getting a route to that first as it was closer. It makes no difference to the rest of the working.
Edit: Moving the exit signal also seems to solve the problem in your savegame.
- Attachments
-
- Overtakes.sav
- Overtaking example.
- (10.79 KiB) Downloaded 123 times
Jon
Re: Two pre-signal challenges.
Good job, but I still want to run some more tests on your theory to makes sure it holds under backwards pbs and such.
Who is online
Users browsing this forum: No registered users and 33 guests