Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dedicated turning lane policy #1102

Closed
kianzarrin opened this issue May 5, 2021 · 6 comments · Fixed by #1104
Closed

dedicated turning lane policy #1102

kianzarrin opened this issue May 5, 2021 · 6 comments · Fixed by #1104
Assignees
Labels
discussion Contains debate on certain topics feature A new distinct feature LANE ROUTING Feature: Lane arrows / connectors MASS EDIT The mass edit tool
Milestone

Comments

@kianzarrin
Copy link
Collaborator

kianzarrin commented May 5, 2021

there should be an option that all jun intersections would have dedicated turning lanes by default.

edge cases:

  • bus lanes
  • 2 lane roads with 3 directions to go

image

related: #716


basically what this mod does: https://steamcommunity.com/sharedfiles/filedetails/?id=2119310640
I don't know why is this not in TMPE.

UPDATE:
I handled the bus lanes like #1102 (comment) which is different than the Improved turning lanes mod. the bus lanes still have forward+right but the non-bus lanes have dedicated turning lanes where possible.

@kianzarrin kianzarrin added feature A new distinct feature triage Awaiting issue categorisation LANE ROUTING Feature: Lane arrows / connectors Settings Road config, mod options, config xml labels May 5, 2021
@kianzarrin kianzarrin self-assigned this May 5, 2021
@kianzarrin
Copy link
Collaborator Author

Bus Lanes

Bus lanes normally work work good .
image

But if even in vanilla mode the bus lanes can only turn right (not forward). then the results are less than ideal.

Before

image
image

###After:
image
image

This is because I don't touch bus lanes if there is only one lane. But now I understand that I should. I might need to write some dedicated code for buses rather than using the old code.

But if I do that then I cannot call it dedicated turning lanes any more but rather improved turning lanes.
Or maybe I should just copy paste the code from the existing mod.

@kianzarrin
Copy link
Collaborator Author

delta-5 The way bus lanes are implemented in the game is that cars are allowed to use them, but prefer not to, unless they need to. There are two reasons why cars may need to use a bus lane: (1) on the next junction they want to go in a direction that is only reachable from the bus lane (as dictated by lane arrows/connections) or (2) to access a roadside building. The mod eliminates the 1st reason for them to use bus lanes, as it always provides them with the option to turn into whatever lane they need to from "normal" car lanes. That alone is enough to eliminate most cars from bus lanes.

With regards to what delta-5 said and #1102 (comment) can I have some 2nd opinions on this matter?

@kianzarrin kianzarrin added the discussion Contains debate on certain topics label May 6, 2021
@kianzarrin
Copy link
Collaborator Author

I think All I have to do is to add forward arrow (where applicable) to the bus lanes and we will be fine

@kianzarrin
Copy link
Collaborator Author

kianzarrin commented May 6, 2021

how is this?
image
(some bus arrow props are not visible because I didn't find a good network ... but they are consistent with the rest of the picture)

@kianzarrin kianzarrin linked a pull request May 7, 2021 that will close this issue
1 task
@kianzarrin kianzarrin added MASS EDIT The mass edit tool and removed Settings Road config, mod options, config xml labels May 7, 2021
@kianzarrin
Copy link
Collaborator Author

kianzarrin commented May 7, 2021

The first column shows in which direction vehicles can turn at the segment end.
- eg:  LFR means Left+Forward+Right as in a "+" intersection
- eg2: LR means Left+Right as in a "T" intersection.

The other columns show lane configuration
- eg: CAR BUS means two-lane road with a bus lane.

image
TMPE lanes.txt

@kianzarrin
Copy link
Collaborator Author

just for feature sake to separate car lanes from bus lanes when there is enough lanes you can do this:

                if (busLanes.Count > 0) {
                    // this optional piece of code imrpoves the lane arrows a little bit in some edge cases.
                    // see https://github.com/CitiesSkylinesMods/TMPE/pull/1104#issuecomment-834145850
                    int numLanes = GetCarLanes(segmentId, nodeId).Count;
                    int numDirs = CountDirections(segmentId, nodeId);
                    if (numLanes >= numDirs) {
                        // if there are enough lanes, try to have dedicated bus lanes.
                        SeparateSegmentLanes(
                            segmentId,
                            nodeId,
                            out res,
                            NetInfo.LaneType.Vehicle,
                            LaneArrowManager.VEHICLE_TYPES,
                            builtIn: builtIn,
                            alt2: alt2,
                            alt3: alt3);
                    }
                }

@originalfoo originalfoo added this to the 11.6.0 milestone Jan 3, 2022
@originalfoo originalfoo removed the triage Awaiting issue categorisation label Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Contains debate on certain topics feature A new distinct feature LANE ROUTING Feature: Lane arrows / connectors MASS EDIT The mass edit tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants