TMPE icon indicating copy to clipboard operation
TMPE copied to clipboard

Improvements to far turn on red

Open Elesbaan70 opened this issue 2 years ago • 4 comments

Current Behavior

Far turn on red currently only applies to a very narrow use case in which traffic is turning from a one-way road to another one-way road:

image

This is enforced here, regardless of how the junction restrictions are configured: https://github.com/CitiesSkylinesMods/TMPE/blob/2a4c1040cec7c06aa7bbc97e800361630e4fbb56/TLM/TLM/Manager/Impl/TurnOnRedManager.cs#L210-L243

Proposed Enhancement (MVP1)

The most basic use case that could be supported is turning from a two-way road onto a one-way road:

image

This can be supported by a simple enhancement to the logic referenced above.

In addition, the default and configurable junction restrictions should be updated to reflect actual traffic AI behavior. I recommend:

Incoming Segment Outgoing Segment Configurable Default
Two-Way Two-Way false false
Two-Way One-Way true* false
One-Way Two-Way false false
One-Way One-Way true true

*Assumes that we make the change described above

Advanced Use Cases (MVP2)

Some traffic lights allow a far turn on red on any intersection when oncoming traffic has a green light and the far-turning driver has a clear view of the oncoming lanes. The driver is informed that this type of turn is allowed by the presence of a flashing yellow arrow below the solid red light.

image

These use cases would require the following enhancements:

  1. When the far turn is into a two-way segment, TurnOnRedManager looks for an incoming segment in the forward direction. If one (and only one) is found, it records this information and allows the turn.

  2. VehicleBehaviorManager checks whether TurnOnRedManager has reported an incoming segment to test. If so, then the traffic light states are examined to ensure that it is the only one with green forward or far-turn lights. Only then is the far turn on red allowed.

  3. Default and configurable junction restrictions would be revised as follows:

    Incoming Segment Outgoing Segment Configurable Default
    Two-Way Two-Way true false

A distinction between this and the first enhancement needs to be made. Possible way of achieving this include a new junction restriction, or a new Options setting.

Elesbaan70 avatar May 31 '22 21:05 Elesbaan70

Although MVP1 is quite easy, it might be best to just drop that one from consideration, so the feature doesn't get too confusing. It's actually very rare. Hardly any states allow it at all, and even then I think only at specific intersections. But MVP2, the flashing yellow arrow, is everywhere.

Elesbaan70 avatar May 31 '22 21:05 Elesbaan70

Ok.. so it requires improvements to priority detection at intersection with traffic lights anyways 🤔

krzychu124 avatar May 31 '22 23:05 krzychu124

Does that fall under that side project I've seen videos of?

Elesbaan70 avatar May 31 '22 23:05 Elesbaan70

Hmm, no it will be added here, just need to solve few issues first (not to mention finding free time for that...)

krzychu124 avatar May 31 '22 23:05 krzychu124