CitiesSkylinesMods / TMPE

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

Under certain conditions, traffic will yield to traffic that doesn't cross it's path #1462

Open Drift91 opened 2 years ago

Drift91 commented 2 years ago

Describe the problem

I have a specific lane-connector and junction restriction setup that seems to have issues with traffic yielding unnecessarily.

Steps to reproduce

Load up the save below. Observe the traffic and check the lane connectors and junction restrictions. For demonstration purposes, I've closed down the two leftmost lanes closest to the camera to ensure the junction after has no traffic to yield to. Watch as traffic occasionally yields entering the junction/roundabout when all the other traffic is leaving the roundabout.

Log files

output_log.txt TMPE.log

Savegame?

https://steamcommunity.com/sharedfiles/filedetails/?id=2777515781

Screenshots?

https://steamcommunity.com/sharedfiles/filedetails/?id=2777519160

Notes or questions?

You'll need to have these two networks enabled to load the save: https://steamcommunity.com/sharedfiles/filedetails/?id=2135345213 https://steamcommunity.com/sharedfiles/filedetails/?id=2094491511

kianzarrin commented 2 years ago

is it an issue of simulation accuracy? you can increase accuracy in the options at the cost of increasing CPU usage

originalfoo commented 2 years ago

@kianzarrin I'm not sure that's a simulation accuracy problem given the lane connetions; there's no way those vehicles on the roundabout can cut across the vehicles wishing to enter the roundabout - specifically as shown in screenshot - those vehicles can only leave at the exit:

image

This issue will potentially be fixed by the work @krzychu124 is doing in https://github.com/CitiesSkylinesMods/TMPE/issues/1229 (see vids / pics in that thread).

@krzychu124 Does the junction management stuff take in to account lane connectors (ie. so it can ignore certain lanes of traffic for collision tests)?

krzychu124 commented 2 years ago

Not visible on screenshot, but is "enter blocked junction" enabled? Intersection is big enough to block the traffic if that feature is off

Drift91 commented 2 years ago

Not visible on screenshot, but is "enter blocked junction" enabled? Intersection is big enough to block the traffic if that feature is off

Here's the junction restrictions: 20220412171001_1 I did find that enabling the "enter blocked junction" feature while entering the roundabout did fix the problem, but as expected it eventually led to the roundabout getting clogged.

Also here's a screenshot of the lane restrictions I mentioned in my original post: 20220412170508_1 Those are there purely for testing/demonstration purposes to show that they're yielding to absolutely no traffic.

Edit:

is it an issue of simulation accuracy? you can increase accuracy in the options at the cost of increasing CPU usage

I have simulation accuracy maxed out on "very high" and reckless driver percentage on "0% holy city".

Drift91 commented 2 years ago

It seems the recent update to stable branch may have aggravated the issue. I'm now experiencing this on another intersection that I don't recall was an issue previously. The outside lanes of the roundabout aren't intersecting/merging with any traffic, yet they frequently yield for a moment like with the previous intersection. 20220817090443_1 20220817090453_1 20220817090500_1

@krzychu124 Has there been any progress with the improvements mentioned in #1229? Some of the video clips you posted look really promising. Did you ever come up with a solution to the short segments behaving oddly that doesn't impact performance too harshly?

krzychu124 commented 2 years ago

Not much changed but I'll create draft PR probably tomorrow so all interested users could test if my concerns about performance are valid or the change is not that bad overall. On screenshots I can see that situation is much worse compared to previous ones. I would only expect they may wait longer that they should because segments are pretty short. Real segment length is more or less between start and end points of the lane connections, barely fits one vehicle. Another problem with priority simulation is it does not take into account that vehicles are not moving straight but follow the curve of the roundabout which makes their movement path longer and that missing additional length can potentially trigger more yield behaviour. Anyways it still does not explain why they stop when they shouldn't. Have you tired removing all lane connections from that roundabout and creating new ones? There was a bug in last Stable version which could lead to problems with saving lane connections - removed connections were not actually removed and reappeared again on next load. Personally I'd give it a try, maybe some orphaned connections left and they see vehicles which they should ignore while computing give way <-> go decision.

Do you have a savegame I could test and experiment a little bit?

Drift91 commented 2 years ago

Save file for my current city: Kyle 2-9.zip You'll need these roads subscribed: https://steamcommunity.com/sharedfiles/filedetails/?id=2135346749 https://steamcommunity.com/sharedfiles/filedetails/?id=2094491511 https://steamcommunity.com/sharedfiles/filedetails/?id=2089707787

There's more assets like water pumps and such, but I believe that's the main road networks covered. Also most, if not all, of the cargo traffic is custom assets. So it might take some time for the traffic to respawn and re-congest.

I've also made this a few months ago, but I see a lot of traffic despawning now so it may not be fully functional. https://steamcommunity.com/sharedfiles/filedetails/?id=2777515781 I'd recommend messing with the Node Controller mod to test different lengths of the segments. [Edit: Forgot that this is the one I'd linked previously. You'll need to remove the lane restrictions for it to function correctly.]

Real segment length is more or less between start and end points of the lane connections, barely fits one vehicle.

Alright, so I need to be more careful with Node Controller then. Because that's the reason the junctions are so oversized.

Have you tired removing all lane connections from that roundabout and creating new ones?

I'll try that out now, as I've redesigned both roundabouts numerous times via the upgrade tool as well as messing with the lane connectors constantly. I'll also try readjusting things with Node Controller as mentioned above.

Not much changed but I'll create draft PR probably tomorrow so all interested users could test if my concerns about performance are valid or the change is not that bad overall.

How would I go about testing this? Would I have to compile the code myself or would there be some kind of dev build I could download? I should be able to merge and compile it myself if it's fairly simple or there's instructions. Also I get around 25fps in C:S on my 165Hz g-sync monitor, so if the performance decrease is that noticeable with my city I'll probably see it. My city isn't even that large though so others might see a larger impact based on city size as well as city design.

Drift91 commented 1 year ago

Got another funky intersection that's doing all sorts of crazy stuff right now. https://steamcommunity.com/sharedfiles/filedetails/?id=2915173416

For this you'll need Big Roads and Node Controller to get the networks and the same effective intersection layout, and optionally, Intersection Marking Tool to get a better idea of the lanes.

This one's doing all sorts of wonky stuff, that I'm assuming is from the compact size of the layout again. Running reds at full speed, yielding to greens with no one making any left turns, etc. I'm assuming the running of reds is due to the speed limit being 60km/h. Is there anything that can be done to fix these behaviours other than making larger junction layouts?

kianzarrin commented 1 year ago

yeah if segment is too short then it won't work. unless if you reduce the speed.