CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
575 stars 85 forks source link

Option to set default behaviour of road junctions based on max turn angle or lanes? #689

Open originalfoo opened 4 years ago

originalfoo commented 4 years ago

This is separate to tracked lanes (monorail, tram...) which would visually 'break' when > max turn angle. Here we are only discussing road vehicle lanes.

For some road networks, it would be useful to have mod option that, when enabled, prevents traffic taking far-side turns (cutting across oncoming traffic) in certain situations:

This would improve traffic on most medium, large and highway roads by limiting vehicles to only take near-side turns. It would also save asset authors the hassle of having to explain to their users the need to use TM:PE lane connectors to prevent far-side turns.

Note that, for road traffic at least, the user should still be able to choose to override the default on junction by junction basis when using either lane arrows or lane connectors. (real life example in https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/pull/684#issuecomment-583920725)

However, when using lane arrows/connectors, it would be nice (but not essential) if we could somehow remind users about the default setting (if it's enabled) - for example they might be wondering why traffic isn't using a certain route through a junction. This could perhaps be a subtle (yellow?) bar across the exit road indicating "from your selected icoming lane/segment, this outgoing route is blocked by mod option".

Better still would be some way to visualise the normally allowed turning arc for given incoming route of a junction. That sort of UI would also be useful for lane arrows to depict the "arc of allowed exits" of a given arrow direction.

kvakvs commented 4 years ago

Get sketching (luckily i have now a pen tablet, but unluckily i didn't yet fully understand what you need here)

Will this coexist/coincide with lane arrows/lane connectors? How to visualise this if it does coexist with those features? What to do if the settings of this and those other features are conflicting? Show as "no left turn" or "no right turn" sign? Can this be reliably stored/cached for a junction+segment pair? (i think it can) If you want to show turning arcs, this render feature is a useful idea for all our junction tools

originalfoo commented 4 years ago

Asset authors can define the max turn angle of their roads. If a road has too big/small (can't remember which) angle, then the main road shouldn't connect to it by default.

Basically this, bsaed on junction angle defined by roads (and/or mod setting):

median

There's also median road (and single-segment two-way highways) situations like this that can be filtered based on angle:

image

So, lane arrows should not, by default, point to a side road that has too sharp an angle to reach. Likewise, the sideroad should not, by default, point to a main road direction that is too sharp to reach.

Random thought: Some asset authors won't configure their roads properly, so we could have mod option that lets user define their own 'override default vanilla value' max turn angle?

We should ideally visualise to user (in lane arrow/connector tools) why a route through a junciton wasn't facilitated by default (eg. a thin bar or arc depicting turn angle limits).

As always, there are gotchas like this lurking around (this would need filtering by median detection instead):

image

Random thought: I don't know what's computationally faster - median detection or using angles. Whichever is faster should be tried first, but then again, whichever situation is most common should be tried first?

However, in real life sometimes sharp angles do get connected, for example:

irlam

So, user should be able to override default lane arrows if desired, and, by extension, also create sharp turns with lane connectors too.

Tagging related issues: #89, #503, #684

kvakvs commented 4 years ago

For medians we can crowdsource that by hardcoding a list of most common road ids (do they have unique ids? i hope they do) which for sure have medians. And by allowing users to override/customise median setting by flagging their own assets as having or not having medians, and then submitting a text export snippet to TM:PE for updating our list.

kvakvs commented 4 years ago

As i learn more how you want this UI to look i will sketch some ideas. But most of what you listed above doesn't need an UI. Namely: Default no lane arrow to a very sharp connecting road. An UI will be required to override road turning angles. And possibly another UI to override medians on/off and export a text snippet for submission. Ideally that text snippet would contain image URLs or Steam links to assets which we can verify manually.

originalfoo commented 4 years ago

CSUR team have provided some great info on medians here: https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/issues/503#issuecomment-583993461

scottmcm commented 4 years ago

This sounds great! If I'm connecting a road at 45°, I can't think of a single time I've wanted the car to take the 135° corner -- especially not if that involves crossing multiple lanes of traffic. It would probably fix the infamous 2 one-way streets converging to a two-way street U-turn problem too.

Does the enhanced pathfinder look at angles at all today? It would seem plausible to have a small penalty for a >100° corner and a large penalty for a >125° corner, as a step towards this...

kianzarrin commented 2 years ago

I will need to update my mods if this gets done.