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

Traffic honoring separated lanes #196

Closed
andreharv opened this issue Jul 16, 2018 · 5 comments
Closed

Traffic honoring separated lanes #196

andreharv opened this issue Jul 16, 2018 · 5 comments
Labels
feature A new function has to be created

Comments

@andreharv
Copy link

Hi, this is Lazarus Man, author of NExt2. As the title implies, I would like to add an enhancement (possibly as an option) to allow pathfinding to recognize split lanes. The game kinda already does this if the NetInfo.m_CanCrossLanes = true. This prevents cars from crossing oncoming traffic on roads with medians such as the vanilla medium road. However, I wanted to take this a step further and prevent traffic from switching into any lanes that are separated by a barrier.

Currently I am working on https://streetmix.net/-/723477. There are 4 lanes in the middle of the road with a detached parking lane on each side. This enhancement would only allow the detached park lane to be accessed at junctions. Since these parking lanes are a bit slower than the center four lanes, cars would only enter this lane to park, bus stop, or make a right turn at the next intersection. I have already developed a POC where cars cannot jump the barrier (except emergency vehicles) and LaneConnections cannot be made over the barrier. Roads with center barriers also will prevent users from making U-turn LaneConnections, UNLESS NetInfo.m_CanCrossLanes = false. While I watched this road mechanic under heavy traffic I realized that it would be very useful for situations where plenty of hand drawn LaneConnections would be needed to separate heavy local and express traffic. I am also experimenting with a similar concept for MOM stations.

There are obviously a lot of variables to consider. The biggest one would be your interest in the idea. It's main goal is to open up a new road mechanic and since this mod basically completely overhauls pathfinding, it would make more sense to add this enhancement to your mod rather than build something new which would reuse a lot of the existing mechanics.

@VictorPhilipp VictorPhilipp added the feature A new function has to be created label Jul 16, 2018
@VictorPhilipp
Copy link
Owner

Have you developed your POC by extending TM:PE or how have you achieved it?

A feasible approach to automatically detect forbidden lane changes might be to check if the lane adjacent to a vehicle lane has m_laneType=None or m_laneType=Pedestrian. What do you think? I guess it would not be hard to implement this.

@andreharv
Copy link
Author

andreharv commented Aug 3, 2018

I finished it weeks ago but got lost in github lol. I don't want to screw with your work and so I decided to continue with testing instead. I was wondering if you could provide me a branch to commit to or if you had an idea of how to commit it in such a way you could take a look. Unfortunately, it would be hard to test without roads that needed the functionality but I am currently building such roads.. Basically it is two part. It checks both in the laneconnectortool and routingmanager. In so many words, lanes are grouped by their continuity. If two lanes have a gap between them (their edges aren't contiguous or overlapping) then they are separated into groups and both the laneconnectortool and the routingmanager will bypass that connection.

Edit: I may use the way you suggested and check if there is a non car lane between the two car lanes to decide groups.

@andreharv
Copy link
Author

Sorry I know this has been a while. I got diverted with getting an update out for MOM mod. I will probably just release the road first so everyone can get their hands on it and I can get this really annoying 'New Roads for Network Extensions' issue put to bed. Then I will continue getting this together. Alternatively, I suppose I could just create a new branch and put the POC in there but after your inputs it gave me pause to reconsider my approach.

@originalfoo
Copy link
Collaborator

@andreharv we're investigating issues relating to medians, etc., in new fork of the mod - if you get time, could you let us know your thoughts here: CitiesSkylinesMods/TMPE#89

@VictorPhilipp
Copy link
Owner

moved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new function has to be created
Projects
None yet
Development

No branches or pull requests

3 participants