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

shortcut to fix traffic rules where minor road joins a main avenue #541

Closed
kianzarrin opened this issue Nov 1, 2019 · 19 comments · Fixed by #621
Closed

shortcut to fix traffic rules where minor road joins a main avenue #541

kianzarrin opened this issue Nov 1, 2019 · 19 comments · Fixed by #621
Assignees
Labels
discussion Contains debate on certain topics enhancement Improve existing feature JUNCTION RESTRICTIONS Feature: Junction restrictions LANE ROUTING Feature: Lane arrows / connectors PRIORITY SIGNS Feature: Stop / Yield / Priority signs Usability Make mod easier to use
Milestone

Comments

@kianzarrin
Copy link
Collaborator

kianzarrin commented Nov 1, 2019

in real life and also in simcity when a small road joins a main avenue, the separation barrier in the middle remains unbroken and people can only turn right (the only advantage of simcity over cities skylines!!!). we already have an asset that visually conserves the junction barrier in such situations

previewfile_1319965985

But TMPE is required to make it function as it should. It can be a bit tedious to apply all the traffic rules particularly when fixing cities where many minor roads are joining one avenue.

so i suggest a shortcut: choose junction priority tool then press ctrl+click on a junction to set all rules regarding the above scenario:

  • remove zebra crossings on the avenue
  • cars on the avenue can enter block junctions
  • no left turns
  • give way entering the avenue

Let me clarify I prefer this feature apply to all big roads such as this:
median rules

@kianzarrin kianzarrin added feature A new distinct feature triage Awaiting issue categorisation labels Nov 1, 2019
@krzychu124
Copy link
Member

Ok, that will be the hardest of all you've posted.
We still don't have algorithm which would properly detect road medians, also I am not sure how do you want properly distinguish road types (I know that we have 'levels' but still, not trivial task.

@kianzarrin
Copy link
Collaborator Author

I think the same concept can work on a scenario like this. Except that highway ramps do not need to give way.
highway fork

@kianzarrin
Copy link
Collaborator Author

@krzychu124 We don't need algorithm to detect road median. if the user uses ctrl-click, then we assume that there is.
Also the smaller road is going to be the one which gives way.
if there are three segments the smalls segment gives way.

@kianzarrin
Copy link
Collaborator Author

@krzychu124 even if there is no junction median it still does not mean people wouldn't want to ban left turn.

@krzychu124
Copy link
Member

I've had to read again description to got the point. Please format it using markdown
I assume you will apply 'no left turn' to all lanes of clicked segment, what if user click at segment which he shouldn't?
Will it aplly rules to any segment you click or you are going add filter with requirements(number of lanes, segment type etc.) when applying rules.

@krzychu124 krzychu124 added discussion Contains debate on certain topics enhancement Improve existing feature JUNCTION RESTRICTIONS Feature: Junction restrictions LANE ROUTING Feature: Lane arrows / connectors PRIORITY SIGNS Feature: Stop / Yield / Priority signs Usability Make mod easier to use and removed feature A new distinct feature triage Awaiting issue categorisation labels Nov 1, 2019
@kianzarrin kianzarrin changed the title shortcut to fix traffic rules where minor road joins a main avenue with continues junction media. shortcut to fix traffic rules where minor road joins a main avenue ~~with continues junction median~~ Nov 1, 2019
@kianzarrin kianzarrin changed the title shortcut to fix traffic rules where minor road joins a main avenue ~~with continues junction median~~ shortcut to fix traffic rules where minor road joins a main avenue Nov 1, 2019
@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Nov 1, 2019

@krzychu124

I've had to read again description to got the point. Please format it using markdown

sorry for bad description. I hope its a bit better now.

I assume you will apply 'no left turn' to all lanes of clicked segment,

CTRL-click on a NODE to be more accurate.

what if user click at segment which he shouldn't?

Accidental CTRL+click will make accidental changes.
I can ask the same question in the junction priority tool what if the user accidentally presses Shift+Click on a long road and messes up his whole road?

Will it apply rules to any segment you click or you are going add filter with requirements

as for requirements and special case situations we need to decide the following:

  • should I check for road angles?
  • should I require the road that gives way to be smaller?
  • etc
    I am open to ideas!

We still don't have algorithm which would properly detect road medians, also I am not sure how do you want properly distinguish road types

the Vanila 6 lane boulevard does not have junction median but I still want to be able to ban left turns.
median rules

I think checking for junction median is possible though a bad Idea. I can check if there is a central lane with no vehicles on it. or I can check for the 'Can cross lanes' property.

@kianzarrin
Copy link
Collaborator Author

#7 and #539 are related.

@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Nov 4, 2019

I wrote the code that works in basic circumstances.
https://github.com/kianzarrin/TMPE-kian/tree/PriorityRoad

My UI is a bit more whack than #77 so that might need some fixing.
Also I noticed that the Overlay update functionality is also whack. It does not refresh view soon enough. I have to close and open TMPE tool to see the changes. That also needs some fixing.

My current code can handle some simple and moderately complicated cases:
Screenshot (6)
Screenshot (7)
Screenshot (8)

but it fails when it is very complex. I will work on that.
Screenshot (9)

The junction to the right does not ban turning into the small road because it is straight. I don't think I can do anything to fix that unless if I use lane connector tool which I think is too complicated for the scope and objective of this issue. also the small road should not have a right turn arrow but rather a forward arrow. That also introduces a problem that I cannot fix without the use of lane connector and that problem is if there is another minor road on the other side of the road, cars can go to it crossing the main road.

The problems of the junction to the left are obvious. I am wondering should I even handle such a case where the main avenue has a right angle?

@kianzarrin
Copy link
Collaborator Author

@krzychu124 @aubergine10 Give me some ideas. any more complicated cases you can think of.

I can think of this one and I am not sure what should happen.
Screenshot (10)

@kianzarrin
Copy link
Collaborator Author

I always can exclude cases where it gets too complicated or nonsensical. I already have decided to exclude one way main road (that is if any of the biggest roads are one way, I return without doing anything).

@kianzarrin
Copy link
Collaborator Author

I did some more thinking and changed my opinion:

  • I will handle the case where the big road is one way, but only if both segments are one way in the same direction.
  • if the two biggest road segments are angled, then I will exclude them. I don't want to make the code too complicated.

@originalfoo
Copy link
Member

remove zebra crossings on the avenue

Would be cool if we could hide the crossing decal/prop too, although not sure if it's possible.

We don't need algorithm to detect road median. if the user uses ctrl-click, then we assume that there is.

I agree with this in principle, essentially we're offloading "median detection" work to the end-user.

However, on a long road with lots of junctions, it could quickly become tedious to click each junction in turn. That being said, auto-median detection is something that could be investigated as separate task at some point in the future.

@originalfoo
Copy link
Member

originalfoo commented Nov 13, 2019

What if instead of doing it based on user click, we just make vanilla 'Priority Routes' more intelligent?

Currently, with vanilla functionality, if you set a route to be priority route the result is that side roads get "Stop" signs on them, which is often very annoying and bad for traffic flow.

TM:PE could do something much better; just as we have "highway rules" stuff in mod options, we could have "priority route rules" stuff that gets applied to any priority route? We could treat a priority route as if a user has Ctrl+Clicked all the junctions along it, but allow user to override any setting at any junction as usual.

If road names are displayed (vanilla game setting), user can quickly get to the relevant info view by clicking the road name. From that info view they can draw the routes, and any they mark as "Priority road" (or whatever the vanilla option is called) will get updated with enhanced TM:PE goodness.

@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Nov 13, 2019

I have added the following options to make this more like the options of the roundabout mod:
change lanes minor road
change lanes major road
enter blocked minor road
enter blocked major road
yield minor road

brainiac
This should help a bit with your request too:
Screenshot (55)

In any case its a cool Idea to be able to select multiple segments and change all options together for the junction restriction tool. or otherwise be able to ctrl-click on a junction select all connected segments to perform mass edits.

@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Nov 18, 2019

I am trying to decide which options to include:

* I want to add
< I want to remove
*< does not exist and I don't think I should add
//rabout_DecicatedExitLanes
//rabout_SwitchLanesYeildR<
//rabout_SwitchLanesMainR*<
//rabout_StayInLaneMainR
//rabout_StayInLaneNearRabout
//rabout_NoCrossMainR
//rabout_NoCrossYeildR<
//rabout_PrioritySigns*

//avn_NoCrossMainR
//avn_NoCrossYield*<
//avn_NoLeftTurns*<
//avn_EnterBlockedMain*<
//avn_EnterBlockedYeild*
//avn_StopEntry*
//avn_PrioritySigns*
//avn_SwitchLanesMain*<
//avn_SwtichLanesYeild*<

There is a trade off between usability and complexity.

This is a bit in contradiction to what I said here in the comment above.
This also concerns #539
And here are the options in roundabout builder for comparison:
Screenshot (67)

EDIT: I wonder if a state machine could be utilized in a meaningful and useful way.

@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Nov 21, 2019

Progress report:
code: https://github.com/kianzarrin/Cities-Skylines-Traffic-Manager-President-Edition/tree/PriorityRoad
test city : https://steamcommunity.com/sharedfiles/filedetails/?id=1917803358
do not forget to go to mass edit options and turn on everything :)
Please shift click on different road segments and see what happens.

I handle all these cases:
Roundabouts

  • straight roundabouts screenshot 1
  • semi roundabouts screenshot 2
  • half roundabouts. screenshot 3
  • Choose best path when there are multiple paths that create a loop.

Priority road:

  • small road joining main road gives way screenshot 4B
  • If avenue has acceleration lane, small road joining ave does not yield and does not keep clear of the junction. (I do not use lane connection though mass edit of lane connections might be a good idea in feature). This also works with SPUI Screenshot 4C
  • road splitting: 4A

Screenshot (74)
ScreenshotA
Screenshot (74) - Copy
Untitled

EDIT: Note: the difference between a roundabout and priority road is sometimes a gray area. The half roundabout code for example is handled by my priority road class.

PS: As much as I am proud of this in future maybe it is best to have all these rules by default. that is TMPE would use such road rules by default so that the user does not even need to mass edit. Although I am not sure if it is even possible.

@originalfoo
Copy link
Member

PS: As much as I am proud of this in future maybe it is best to have all these rules by default. that is TMPE would use such road rules by default so that the user does not even need to mass edit. Although I am not sure if it is even possible.

This could be very confusing for a lot of users. For example, we get regular issues where people have set up crazy customisations and then wonder why their traffic is broken. So I think it best to avoid automatically applying customisations; if user has to manually apply (including manual bulk application) and something goes wrong, at least they have some idea of what they did to make it go wrong.

Also note that there is a 16 MB limit (link to old repo) to the amount of data TM:PE can store in save games, and automatically applying customisations could potentially push over that limit on large cities; and even if not, might cause general performance issues.

@Sipke82
Copy link

Sipke82 commented Nov 27, 2019

If it's possible i would also vote for changing the default..

@kianzarrin
Copy link
Collaborator Author

maybe we should put this pictures in the wiki some time:
Screenshot (979)
Screenshot (984)
Screenshot (983)
Screenshot (982)
Screenshot (981)
Screenshot (980)

@kianzarrin kianzarrin mentioned this issue May 7, 2020
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 enhancement Improve existing feature JUNCTION RESTRICTIONS Feature: Junction restrictions LANE ROUTING Feature: Lane arrows / connectors PRIORITY SIGNS Feature: Stop / Yield / Priority signs Usability Make mod easier to use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants