CitiesSkylinesMods / TMPE

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

[Request] Heavy Traffic find alternate path. + Designate Main roads #337

Open Taiine opened 5 years ago

Taiine commented 5 years ago

These two kind of go hand in hand. One issue I see a lot in every city I've made thus far, is I can have many a means for traffic to get from point A to point B, but even with all these extra options, most traffic ends up focusing on a single road. This becomes an issue when that single road ends up being a two way one lane, or a two lane road.

Case in point, my last city I had a small residential area with a two way one lane road cutting through it and split off into other areas that went from a main 3 lane road, and on the other side a 2 lane. Beside it just a little ways ahead there is a 'main' 2 lane road. But because that road was further down the road a.k.a the next intersection, the 'shortest' travel time from the 2 lane, to the 3 lane ended up being my single lane road, causing a huge traffic jam that could only be fixed by deleting one end of the road so the whole area became dead-end streets.

It would be nice if the AI took road size as a priority to travel along to get from point a to point b, and only if the traffic starts getting backed up, start using the smaller side roads to find alternate clear paths even if said paths may take them a little out of the way.

This may help clear up a lot of the common road jams I see and fix the need to rely on a lot of these 'tricks' I see in city fixer videos with all these cars piling up on a single road ignoring all the other roads available unless its the end destination.

Because I don't know about you, but if I see traffic at a near standstill and there's a perfectly good road to my side that I know will still get me where I'm going I'm not going to sit and wait for traffic to maybe start moving, I'm taking that side road.

originalfoo commented 5 years ago

We could potentially achieve this by adding a penalty based on road category:

That way traffic would have added incentive to use bigger roads.

Taiine commented 5 years ago

That would be great, but also just a means to aid against traffic jams, if away if cars start backing up that new ones pick a different path? like maybe a check that cars have been in a section of road for X time, find the next shortest path.

It's just annoying having all these roads to offer several means to get to places but they mostly all go ignored due to the ai always picking the shortest path to an area.

originalfoo commented 5 years ago

TMPE already includes that sort of thing, I think it's part of the Advanced Vehicle AI. checks...

Yup, see: https://tmpe.viathinksoft.com/wiki/index.php?title=Advanced_Vehicle_AI#Road_usage_optimization

Thing is the pathfinder will still generally want to find the fastest route, and if that's a small road that provides a shortcut then traffic will use it like IRL unless you encourage it otherwise by refactoring your road design or even just ensuring faster speed limit on the bypass road.

That being said, I do think TM:PE could add some improvements in this respect (like the aforementioned road-category penalties). Also there needs to be a clearer distinction between traffic density vs. traffic congestion. You could have high density of traffic that's still moving normally (little or no disruption to traffic flow), vs. low density traffic that's causing congestion (long wait times).

originalfoo commented 5 years ago

One other thing we could do - add a de-pentalty buff to "priority routes". That would give user direct way to say "I want traffic using this road".

originalfoo commented 5 years ago

BTW, you can also use district policies to keep heavy traffic out - Heavy Traffic Ban in particular.

VictorPhilipp commented 5 years ago

The problem is that paths are pre-calculated. Advanced Vehicle AI takes the current traffic situation into account but the statistics used to find the fastest route might be already outdated when a vehicle finally reaches a critical point. At that time it is not possible for a vehicle to deviate from its route (except for DLS, which is able to select a faster lane, but not a different segment).

Because paths are pre-calculated we can only use traffic statistics which are accumulated and averaged over a large time span (~5 minutes). If we dialed the time resolution up (say for example, to 1 minute) we would start seeing feedback effects where either one or the other road were jammed or completely free of vehicles.

In that sense, your idea to add a priorization system for roads would have exactly the opposite effect of what you would like to achieve. It would essentially force all traffic to ultimately prefer large roads which would cause massive traffic problems.

Since we are unable to use statistics with a high time resolution, we can only count on heavy randomization which comes with a certain drawback, namely that cars sometimes take routes that seem unlogical from an external point of view.

VictorPhilipp commented 5 years ago

Sorry to say, but for me that's a "wontfix". At least regarding the road priorization feature.

VictorPhilipp commented 5 years ago

If vehicles do not use your main road this for sure has a reason:

originalfoo commented 5 years ago

TODO: Add above comment to an FAQ page somewhere.