Skip to content

Giving way at junctions

Wira Bandar PC is a fork of OpenTTD: OpenTTD's code with changes, free software under the GNU GPL v2. About and credits

In OpenTTD, road vehicles drive straight through each other at junctions, so a junction never holds anyone up. In Wira Bandar PC they give way: a vehicle waits until the crossing road is clear, and at a busy junction vehicles take turns. Junctions become the bottlenecks they are in a real town, and traffic lights become worth building.

There is nothing to build: it is on by default. The rules apply at every junction of plain road, a T-junction or a crossroads, and to every road vehicle: buses, lorries and trams.

  • Wait for the crossing road. A vehicle only drives onto a junction when no vehicle that came in over the crossing road is on it. Vehicles coming along the same road, from either side, can be on the junction together. A vehicle turning around on a junction holds up everyone.
  • Take turns. At a junction without lights, when vehicles wait on both roads, the one that has waited longest goes first.
  • Don’t block the junction. A vehicle stays out of a junction, with or without lights, when the road it would leave by is backed up right behind it. So it rarely ends up standing in the middle, in the way of the crossing traffic.
  • Nobody waits forever. A vehicle stuck on a junction for a while stops holding up the crossing road, and one that has waited very long goes anyway. Jams clear up; no gridlock lasts.
  • Traffic lights decide first. At a junction with lights, red always means stop. On green the rules above still apply: a vehicle waits for a crossing vehicle still on the junction, and for room on the far side.
  • Routing around jams. The road pathfinder sees junctions where vehicles are held up: each vehicle held up on or right in front of a junction makes it count as two tiles longer. Where there is another way, vehicles take it.

The cars, vans and people of street life are only drawn: they stop at red lights and queue behind buses, but they never hold up your vehicles.

A crossroads without traffic lights in Gredinghall. Two blue buses come in from the top left, the first already on the junction; a car is on the crossing road just beyond it, and people stand on the pavements at the corners.
A crossroads without lights in Gredinghall. Each vehicle waits until nobody from the crossing road is on the junction.

A quiet junction costs almost nothing: vehicles rarely meet there. A busy one serves its two roads one vehicle at a time, and the queues grow on both sides. Traffic lights change that: on green, a whole queue drives through, and smart lights switch once the queue has gone or the other road has waited long enough.

In a test town with two crossing bus lines and 30 buses, giving way without any lights cost the buses about a quarter of their profit compared with OpenTTD. Lights on the three busiest junctions won all of it back and a little more. Routing around jams helped too: without lights, the same buses earned about 30% more once they drove around held-up junctions.

To find the junctions that hold traffic up, open the traffic map: a junction in orange or red is a candidate for lights.

  • Give the junctions where bus lines cross traffic lights first.
  • Let vehicles turn around somewhere else than on a busy junction, for example in a loop or at the end of a road: a vehicle turning on a junction blocks it for everyone.
  • Long queues at a junction without lights mean it is time for lights. Give the busier road the longer Longest green.
  • Bus lanes and bus signals help buses through town traffic and traffic lights.

SettingRoad vehicles give way at junctions

Main toolbar: Options and settings (the gear) → Game options → Advanced tab → Vehicles → Routing. It only shows with Category: Advanced (show most settings) at the top of the tab. Or type its name in the Filter box.

Choices: On, Off. Default: On. Choose Off for the game as in OpenTTD.

With it off, vehicles drive through each other at junctions again, as in regular OpenTTD. Traffic lights still work: red still means stop. The setting is stored in the save, so each game keeps its own.

The Game Options window on the Advanced tab, with Category set to Advanced (show most settings) and give way typed into Filter. The list shows Vehicles, Routing, Road vehicles give way at junctions: On, and the help text below.
Type give way into Filter: to find the setting. It only shows with Category: Advanced or Expert.

For experts, how much the pathfinder avoids held-up junctions is a number in openttd.cfg:

openttd.cfg[pf] yapf.road_junction_queue_penalty

Not in the settings window: set it in Documents\Wira Bandar\openttd.cfg while the game is closed (for new games), or in a running game with the console command setting pf.yapf.road_junction_queue_penalty <value>. Default: 200. See the settings reference.

How much longer the road pathfinder counts a junction for each vehicle held up on or right in front of it. The default, 200, is two tiles (100 is one tile). Higher values make road vehicles avoid busy junctions more; 0 switches the routing around jams off.

Wira Bandar PC is a fork of OpenTTD. It is OpenTTD's code with changes, not a game made from scratch. OpenTTD is made by the OpenTTD team and contributors and is free software under theGNU General Public License version 2; Wira Bandar PC keeps that licence, OpenTTD's credits and copyright notices.Source code ·OpenTTD ·About and credits

Wira Bandar PC is not made or supported by the OpenTTD team, so please don't report its bugs to OpenTTD (see FAQ and troubleshooting).