Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Oct 18, 2017 12:18 am

All times are UTC




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Oct 10, 2017 5:44 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Dec 01, 2013 1:11 am
Posts: 10
This is for everyone that would like to leverage the Routing Restrictions patch (you can find it in JGR's Patch Pack), but isn't doing so due to lack of documentation or examples.

We will build an overtake lane, i.e. a simple track layout that allows faster trains to overtake slower trains. The idea of this guide is to present an easy solution to a common problem (trains overtaking), and at the same time get players started with Routing Restrictions. As such, there may be better ways to do this, with or without the patch.

Let's start with the overall situation.

Image

And the basic layout. 6 tiles signal spacing is used here, but any value should work.

Image

Red tracks will be the overtake lanes, blue tracks will be the lanes used by the slower trains. This is slightly counterintuive (overtaking on the inside rather than the outside), but it keeps fast trains on the main line and makes the signal programming more understandable.

Image

We first implement the overtaking aspect of the system. This means forcing trains slower than a threshold (112 km/h in our case) to the outer lanes. We do this by restricting the inner lane route: the two signals marked in red Deny the overtaking lane to all trains whose max speed < 112 km/h (ignore the Long reserve for now); this forces slower trains to take the only other available lane. Note the inversion of control: the inner lane signals control what trains go the the outer lane, and vice-versa.

Image

What happens though if the slower train is only slightly slower than the faster one, or if the latter is too much behind than the former when they both reach the overtaking area? For example, the slow train (in red) will reenter the main line before the faster train (in blue) had any chance to overtake it.

Image

We solve this by reserving a path through the whole overtaking lane for the faster train to use. Reserving the track up until the first signal not in the layout (reserving in grey) means that any train in the outer lane (in red) will have to stop at the last signal and wait for any trains within the overtaking lane to pass.

Image

We do this with the Long reserve command: this tells YAPF that the path should be reserved up to the following signal, instead of stopping at the current one. Chaining the signals within the overtake lane implements exactly the behaviour we wanted.

Image

Now another problem arises: if two fast trains are closely following each other, the one behind will take the slow lane because YAPF sees that lane as free.

Image

We avoid this by denying entry to the overtake lane to all trains faster than the threshold speed.

Image

This layout scales well, and works wonderfully with most other features (like the improved breakdowns patch). You can also have overtaking lanes on your overtaking lanes, with different speed tiers. Also keep in mind this example was done with a speed acting as the deciding threshold, but you can use any property provided by the patch: e.g. give priority to full trains over half empty ones, passengers over freight, express over local, and so on.


Top
   
PostPosted: Fri Oct 13, 2017 10:42 am 
Offline
Engineer
Engineer

Joined: Sat Feb 18, 2017 5:47 pm
Posts: 23
Thank you for the great explanation on how to use Routing Restriction on an example :)
Maybe it will help introduce this awesome feature to whom by now was clueless how to use it effectively.

Myself I haven't thought of laying out the overtake track in the middle, but on the contrary it's a great and realistic idea to do so. Thank you for sharing this, I think I'll introduce this to my track layouts as well :mrgreen:

Maybe some additions on my behalf, I rarely use 'allow' and 'forbid' in my layouts, but use a 'pathfinding penalty' to dynamically force trains to their tracks. The advantage of that is, that a medium fast train can overtake a slow train, but a fast one can overtake both. Your track layout is nevertheless totally efficient for use of two train classes, slow and fast.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.