3-Trains-at-a-time traffic lights

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
frankie609
Engineer
Engineer
Posts: 7
Joined: 17 Aug 2008 02:55

3-Trains-at-a-time traffic lights

Post by frankie609 »

Image

If you had a heavy traffic of two lanes merging as one lane before, you must have thought of things like it might be faster if you could just make the trains give way for at least 3 trains to pass before it takes its way, the same goes for the other lane. The concept behind this is the less interruption the better throughput.

Image above shows an example of improvised concept. If there's at least three consecutive trains on Lane B, chances are they will pass the merging point in the lane before a train in Lane A interrupts. The dummy rail works as detector for the Lane A. It detects if there's a train on Lane B. If there's 3 consecutive trains on Lane B, the combo signals at Lane A ticks a green light for a second or fraction of a second in which for every tick lets a train on Lane A move a little closer to the merging point. Until a train on Lane A has reached the last traffic signal, trains at Lane B will try to get past beyond the merging point.

But the problem here besides it requires a dummy rail is that the trains on Lane B will never let at least 3 consecutive trains on Lane A get pass through the merging point. It's only the other way around.

What I wanted to happen is for every three consecutive trains on Lane A that got past through the merging point, Lane A should let at least 3 consecutive trains to get past through the merging point and vice versa.

Merging point is the point where Lane A and Lane B meets.

Please leave comments.

Thanks.
Attachments
3 trains at a time
3 trains at a time
3trains at a time.JPG (151.92 KiB) Viewed 1085 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: 3-Trains-at-a-time traffic lights

Post by Zuu »

Maybe you could use a clock (a train driving around on it's own loop-network) to block trains from either A or B. It won't be yielding but more of a traffic light.

You might even be able to add delaying of switching green phase depending on if there are traffic on either direction using the technique you've just demonstrated.


Edit: After some investigation here is my clock-based traffic light for two joining tracks. Thanks to time tables the clock don't need to have a long and twisty track. And tweaking green times becomes as easy as modifying the time table.

In addition to stopping the traffic that should yield I've added tracks so that trains coming from the yielding direction "looks" if there are a train on the other direction, and if not it goes ahead. One might want to tweak the distance of the other direction that trains should look at depending on how important it is to not slow down the flow of the lane that has right of way.

Here is a clean implementation of it:
TLConcept.png
TLConcept.png (46.53 KiB) Viewed 3015 times
And here is my real implementation that I first made in a real network from a save-game: (as you can see it is nowhere as clean as the above screenshot :D )
HugeNetwork Inc.png
HugeNetwork Inc.png (80.51 KiB) Viewed 3014 times
Last edited by Zuu on 25 Aug 2008 13:20, edited 1 time in total.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: 3-Trains-at-a-time traffic lights

Post by Wolf01 »

Give a look at "priority lanes" or "priority signals" results: http://www.tt-forums.net/search.php?key ... mit=Search
Maybe you can find something useful
frankie609
Engineer
Engineer
Posts: 7
Joined: 17 Aug 2008 02:55

Re: 3-Trains-at-a-time traffic lights

Post by frankie609 »

Looks cool huh Ill give it a try 8)
frankie609
Engineer
Engineer
Posts: 7
Joined: 17 Aug 2008 02:55

Re: 3-Trains-at-a-time traffic lights

Post by frankie609 »

Zuu that's genius it's really working! But is there a way to exclude that clock train from being counted in the min profit score criterion? I hope for a new feature such as an automatic yielder traffic manager will be made. Just wishfully hoping lol.
frankie609
Engineer
Engineer
Posts: 7
Joined: 17 Aug 2008 02:55

Re: 3-Trains-at-a-time traffic lights

Post by frankie609 »

So here's the modifications I made:
Image

I have lengthen the detection area without lengthening the response time of the rail by creating short allowances for the signals. This feels like coding :roll:

@Zuu
By the way, how did you come up with this idea?
Attachments
123456.PNG
123456.PNG (59.92 KiB) Viewed 756 times
Last edited by frankie609 on 27 Aug 2008 01:15, edited 1 time in total.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: 3-Trains-at-a-time traffic lights

Post by Zuu »

frankie609 wrote:@Zuu
By the way, how did you come up with this idea?
I've seen trains being used as control mechanism in OpenTTD before (on the tt-forums and in #openttdcoop). I've not seen exactly this construction before. But I started by building the clock using a loop of track that I had to extend long and curvy enough so that I got long enough green times. I cut the loop in two pieces using two one-way signals and connected each part of the loop to each entry-point, so that I got a traffic light solution. Then I realized that now that we have timetables that is not necessary anymore. So I got rid of the ugly loop and could simplify the construction quite much. After that I though perhaps maybe I can somehow turn off the red-light on the side that is blocked if there are no trains on the other side. And it did not take to much time to figure that out.

I can add that I've built traffic lights in Arena (a generic simulation toolbox software) using pretty similar technique as how I built it in OpenTTD. But I actually did not realize that fact until after I built my OpenTTD traffic light. In Arena you don't have to have a car/train instead you can have a signal man entity or whatever you like to call it, but the principle is the same.


As for minimal income, I don't have a solution to that other than simply ignoring the company performance or write a patch that perhaps exclude trains with total capacity = 0 from the minimal income stats.


Edit: And by the way, would you mind to use png-files next time? Jpg removes the higher frequencies from the picture giving loss of quality and especially important for OpenTTD it makes it harder to discriminate between the signal types than if you used png which is a lose less compression format. And with OpenTTD not being photo-realistic it don't give that big file-sizes using png.

Just press ctrl+s and you get a png-file in your OpenTTD directory with the screenshot. Open it up in paint and remove unnecessary parts and you are done.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
frankie609
Engineer
Engineer
Posts: 7
Joined: 17 Aug 2008 02:55

Re: 3-Trains-at-a-time traffic lights

Post by frankie609 »

Did I use a JPG? Just kidding :flashytooth: there you go it's in PNG now. Yeah I noticed too it's hard to know if it's a combo signal or an exit signal if I use JPG.
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 4 guests