News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Incentive to place a road traffic light

Started by THLeaderH, June 16, 2018, 11:12:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

THLeaderH

In current simutrans, there is almost no advantage in placing a traffic light in an intersection. This is mainly because road vehicles can get into an intersection without reducing their speed. Think about road traffic in the real world, and you'll notice the fact that traffic lights are placed to make traffic smooth and safe. In an intersection without a traffic light, in general, a vehicle must slow down or stop because the driver cannot confirm the safety by the sight. A traffic light ensures safety of the intersection and the vehicle can get into the intersection without reducing its speed.

So, a simple solution is that we impose every road vehicles to stop once before entering an intersection without a traffic light. However, this restriction makes impossible the simulation of a merging point of a highway and an intersection of a prior road and a narrow road.

Therefore, it is reasonable to introduce the prior direction in intersections. Vehicles that come from the prior directions do not have to reduce their speed. Vehicles from non-prior directions must stop before entering the intersection, with some exemption to replicate the merging point. To reduce players' effort, the prior directions are determined by the amount of traffic.

I think this suggestion gives players the incentive to put traffic lights and makes simutrans-extended more realistic.

jamespetts

I am not sure that this is the function of traffic lights in reality or in Simutrans - is the point not rather to prevent deadlocks and congestion at junctions (and, in reality, also to improve safety)?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Andyh

I agree with THLeaderH that there's no benefit in placing traffic lights in Simutrans.  In fact traffic lights in Simutrans impede the efficient flow of traffic.  A couple of years ago, I ran some side by side tests of identical routes with and without traffic lights.  The non-traffic lights scenarios were more efficient in every case in terms of the volume of traffic a road was able to handle.


Could I suggest a slight tweak to THLeaderH's first approach?  Make it the rule that every vehicle needs to stop at a non-traffic-light intersection if the max-speed of the road is lower than the road it intersects with, or if either of the roads is defined as a City Road.  That would allow for highway-style intersections (no stopping required), minor to major road junctions (minor road traffic would have to stop, but not the major road traffic) and city intersections (all traffic would need to stop unless the intersection is protected by traffic lights).

THLeaderH

Quote from: Andyh on June 17, 2018, 12:46:19 AM
Could I suggest a slight tweak to THLeaderH's first approach?  Make it the rule that every vehicle needs to stop at a non-traffic-light intersection if the max-speed of the road is lower than the road it intersects with, or if either of the roads is defined as a City Road.  That would allow for highway-style intersections (no stopping required), minor to major road junctions (minor road traffic would have to stop, but not the major road traffic) and city intersections (all traffic would need to stop unless the intersection is protected by traffic lights).

This sounds good. However, in simutrans, it's common that traffic is only heavy for one direction and there is no traffic for the other. For example, in the intersection, all vehicles that pass the intersection go north or south, and there is no east-west traffic. In such case, there is no need to put a traffic light and we should let north-south bound vehicles to pass the intersection without stopping. Unfortunately, Andyh's proposal does not work.

ACarlotti

I think there are several reasons for using traffic lights in reality that aren't currently represented in Simutrans.
1. Junctions with restricted visibility and/or tight corners (the latter requiring large vehicles to use both sides of the road when making turns). Also narrow roads, often on bridges or through tunnels.
2. Junctions where the flow of traffic is sufficiently heavy that if the junction were set up with minor side roads giving way to a major through road, then vehicles on the minor road wouldn't be able to pull out into the major road often enough (particularly if the 'minor' road is also quite busy). This could also be handled with four way stops, but these aren't generally used in the UK (although I have encountered a few examples used with traffic calming in 20mph zones).
3. Cyclist/pedestrian safety/convenience.
4. Junctions involving roads with multiple lanes. (Sometimes this is mitigated by the traffic flowing in bursts due to nearby traffic lights, rather than due to traffic lights at the junction itself).

1. Is not likely to be a feature in Simutrans.
2. Simutrans currently uses something resembling 4-way give-ways with good long-distance visibility, with no option of configuring major/minor roads as is normally used in reality. Actually, this sounds a bit like a mini-roundabout, except without the extra road width needed for a mini-roundabout. Maybe future changes could make the behaviour more realistic. The 'intersection_t' object Turfit has mentioned elsewhere could be used to implement this change. Another useful feature might be allowing vehicles to share a tile, and it might be sensible to account for this in designing an 'intersection_t' object.
3. Pedestrians/cyclists are not simulated to a sufficient extent for this to become relevant, and it would probably be too computationally expensive to do so.
4. This is a feature that has been requested before, and its implementation would probably also be based around the aforementioned 'intersection_t' object.

So in summary, I think the behaviour of traffic lights could be improved in the long term as part of replacing the existing code for intersections, and perhaps also vehicle movement in general. It would be interesting to hear what plans Turfit (and perhaps others) has considered for implementing these features.

jamespetts

I think that the history of traffic lights in Simutrans is that there was a time when it was very easy for deadlocks to occur on intersections and thus for large traffic jams/gridlock to form in towns. A few years ago, the algorithm for handling intersections changed, ans the need for traffic lights diminished. However, they can still be helpful in giving priority to one road over another.

In the long term, A. Carlotti's suggestions seem sensible.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.