Cities: Skylines

Cities: Skylines

View Stats:
Hexx Jun 7, 2015 @ 9:04am
Traffic AI problems with multilane roads
The traffic AI does not utilize multilane roads properly. They tend to stack up in long one lane wide columns which creates traffic problems (blocked intersections) despite the fact that they have free lanes right in front of them to use. Often I see 3 lanes of incoming cars to a 6 lane one way road trying all to merge into one central lane only to split again in different ways at following intersections. I'd like to point out that while it is true that I'm not the best urban designer in the world and my street design is probably less than optimal this is clearly a bug that in my opinion could be fixed by giving the AI traffic few simple rules like :
1) if you see a free lane in front of you going in the same direction as you want to go - use it
2) don't change lanes unless you have to for your upcoming turn
3) change lanes gradually, one lane at a time unless you have to to make your next turn
It is really silly to see my whole center blocked by this long column of all cars in one lane on a 6 lane one way road. And they don't all want to go in the same destination - as I said they later split again but for some reason they ignore the rest of the lanes and just all have to get into that one. I tried to use traffic manager mod to designate lanes, create timed intersections and create priority/give away signs and all that which helps to a certain extent but in the end there's still this problem. I'd like to ask the devs to try to make the traffic to utilise multiple lanes more efficiently.

Like for example I have a lanes that go L/Fw, Fw, Fw/R. Almost all cars tend to stack up in the last Fw/R lane and only couple use the central Fw lane yet at least 1/3 of the cars in the Fw/R lane go forward at the intersection anyway doing nothing but blocking the lane which makes no sense sice they can just switch to the lane left of them which is almost free to get where they're going. If they used common sense rule 1 (if you see a free lane in front of you going in the same direction as you want to go - use it) the traffic would flow much smoother.

Also often you see cars aggressively chaging lanes from one side to another, blocking everyone, because 5 blocks down the road they want to make a turn in that direction, instead of moving there gradually which would again make traffic flow much smoother.

Also often you see cars do crazy things like driving from lane 2 into lane 5 only to go into lane 1 after the following intersection which makes the lane change pointless, blocking everyone in the process - busses are experts at this.

So please devs, take a look at the traffic AI. I think that the AI is fine for the most part but it needs a couple of tweeks in mentioned situations to make it less dumb which would make the game more enjoyable to play as the traffic is major component of the gameplay. The whole game revolves around the traffic simulation and this makes it a bit frustrating.
Last edited by Hexx; Jun 7, 2015 @ 9:58am
< >
Showing 1-15 of 18 comments
maobe Jun 7, 2015 @ 12:52pm 
The suboptimal Traffic-AI is already known, but somewhere i read that it wont adressed for sometime cause it would be a very major change to "fix" it.
mlind1981 Jun 7, 2015 @ 1:05pm 
these problems you describe can be dealt with most of the time by setting up the infrastructure to make sure cars / trucks / busses etc. have places to go in all available directions. I'd has been said many times by the devs that traffic works as designed.. Do you have any idea how much power you would need to be able to handle millions upon millions of calculations constantly if traffic was given the ability to recalculate the route over and over again.

The added tunnel feature is very good to help "bypass" heavy congestion and / or a lot of traffic lights by giving them a "freeway" underground if most of the traffic is going to one specific area.. I know its hard to learn and master traffic.. but its doable.. look at some real world city designs and how they deal with massive amounts of traffic and try to get an understanding how it works and "copy" it to your own cities :) It works very well.
Max Plane Jun 7, 2015 @ 1:16pm 
Originally posted by mlind1981:
-snip-

Read the OP again: the problem isn't that the traffic is travelling in one direction, it's that it travels in one lane, cuts each other off in manners that add to congestion, all to simply diverge once they reach the point they were travelling to. Basically, most traffic is in Lane-group C, where many of them will need to merge to Lane-group B and Lane-group A to get to where they need to go, once they reach a terminus along the stretch they're travelling. The fact that they all congregate into Lane-group C when they need to merge, later on, into different Lane-groups is what the OP is addressing. Further, the OP is raising the point that, if travel requires that the vehicle must merge in order to be able to continue to its destination once it reaches the terminus of the current stretch of road, the vehicle should gradually work toward the lane it must be in, rather than shove into a huge cluster of vehicles which have no business lumping into that single lane.
mlind1981 Jun 7, 2015 @ 1:49pm 
So travelling in one lane is not traveling in one direction or? its still the same thing you need to do in order to avoid it.. first of.. if cars do these insane lane changes and cause congestion it's mostly likely due to the intersections are put way to close to each other (same reason why so many avoid using roundabouts) cause the same will happen if the roundabout is not large enough. about the going from lane 6 to lane 2 on a one way setup.. that is most likely an indication of that the 6 lanes are not needed at all.. or again intersections are to close.. simply not giving the cars enough time to lane change without the crazyness.

I'm currently working on a 160k city where I have absolutly none of these "scenarios" due to the traffic is being merged, split, rerouted and spread out over enough space to get maximum traffic flow across the network..

Long story short.. if traffic is given enough space they will gradually lane change without slowing traffic from behind.!
Max Plane Jun 7, 2015 @ 1:55pm 
Originally posted by mlind1981:
-snip-

If you can provide examples of how you work with the system, it might help OP to understand what to do and what not to do.
Colin Jun 7, 2015 @ 2:35pm 
You can actually use Traffic++ to force traffic to merge one lane at a time. There are certain points along the road that appear as an intersection, that really aren't intersections that you can configure which lanes have access to other lanes. For instance, if you have 3 lanes going in one direction, you can configure one of these seudo-intersections so that lane one can only stay in lane one or move to lane 2, lane 2 can stay in lane 2 or merge to lane 1 or lane 3, and lane 3 can stay in lane 3 or merge to lane 2. This allows for traffic to flow more realistically instead of traffic cutting across from lane 1 to lane 3 or from lane 3 to lane 1.
mlind1981 Jun 7, 2015 @ 2:59pm 
Ofc..First of.. Traffic report tool is excellent to track the movement of a vehicle and see if they do any funky lane switching. I have just taken a few screenshots to show an example of how I avoid the cross lane bs.

We are following the brownish van from the moment it gets of the highway

Pic 1
http://steamcommunity.com/sharedfiles/filedetails/?id=457210733

Pic 2 here it just did a delivery on the right side.. for some reason the shot didn't get saved.

http://steamcommunity.com/sharedfiles/filedetails/?id=457210779

Going from lane 5 into lane 3

Pic 3 http://steamcommunity.com/sharedfiles/filedetails/?id=457210814

Going from 3 to 1

http://steamcommunity.com/sharedfiles/filedetails/?id=457210842

Pic 4

http://steamcommunity.com/sharedfiles/filedetails/?id=457210874

And this is the stretch of road it used..

Now it shouldn't be to difficult to understand that the shorter distance the vehicle has to get into the right lane the more crazy the switching will become.

This one here is a fine example of what happens when there's not enough room to lane change.

http://steamcommunity.com/sharedfiles/filedetails/?id=444863035

Everyone is fighting for the same lane.. If the roundabout was larger they would simply merge or lane change later on..

I hope this makes some kind of sense regarding the issue. I have spent so much time figuring out how to use certain road types efficiently without doing more harm than good.
Max Plane Jun 7, 2015 @ 3:06pm 
Originally posted by mlind1981:
-snip-

Nice. I'd love to see your full city.
Saber Kitsune Jun 7, 2015 @ 3:16pm 
First off, devs have already attempted to make traffic use more lanes:
During development we tried for example allowing cars to change lanes more often, which resulted in total traffic chaos as cars trying to join a crowded lane blocked two lanes and made traffic grind to a halt. (source: http://www.gamasutra.com/view/news/239534/Game_Design_Deep_Dive_Traffic_systems_in_Cities_Skylines.php )

Second, traffic won't use the extra lane if they don't have a reason to use said lane. They won't change out of a lane only to change back into it again. The route is pretty much set in stone once the car spawns, and rarely does the pathfinder recalculates it midtrip.

And just cause, here's an old screenie from before I reworked my industrial area:
http://s12.postimg.org/ee0xaqjks/laneusage.jpg
All 3 lanes of incoming traffic pretty much maxed out on capacity. No mods used.
Maruge Jun 7, 2015 @ 5:30pm 
I found out that if traffic is in the third lane on a highway and there is an exit coming up they freak out and wont use the lane, sometimes literally making a 90 degree turn into the first lane, cutting off traffic. All traffic ive ever had is always related to highways, vehicles all want to use the first lane RIGHT until their exit, causing massive problems. I also found out that you never put an onramp right before an exit or cars will go from the onramp straight to the first lane of the highway and clog the entire road system sometimes.
shadowwolftjc Jun 8, 2015 @ 12:55am 
Same old rant about how traffic is broken, same old rant about how traffic doesn't use up all of the lanes of a 6-lane road, blah, blah, yadda, yadda, yadda...

Look, until they can develop an acceptable fix to this issue, here's a dirty trick that I found on YouTube: https://www.youtube.com/watch?v=Ysr0w4PzARc

That's just one out of several helpful guides that I've looked at online. Here's a few more for studying traffic behavior in general in-depth:

https://www.youtube.com/watch?v=3kPeat9GGMw
http://steamcommunity.com/sharedfiles/filedetails/?id=410236188

I also have a few tips of my own that I posted in the comments sections of both links. They go into further depth on how traffic could be potentially manipulated, since they all tend to have pretty predictable behaviors (go to work, go shopping, go home, drop off goods, pick up goods, etc.).
Hexx Jun 8, 2015 @ 4:51am 
Hmm, okay. Thanks for replies.
I think the issue is that while in most city builders the cars in the streets are simply a visual representation of a traffic congestion calculated at each road/intersection in CS they try, to a certain extent, actually simulate the cars individually which naturaly creates believable traffic patterns. This however creates a new set of mentioned problems as it is not a viable option, performance wise, to make a real time path finding calculations for each individual vehicle. I can understand that. Still I believe that some tweaking of the existing system might be sufficient to reduce these issues, maybe not in the exact ways I suggested earlier though.

It seems to me that when a route for a vehicle is being calculated it does not take into an account the current traffic situation and a "optimal" route a is selected. The problem is, that while in theory the selected route might be optimal for each individual vehicle, when it's all put together it creates mentioned situations (all vehicles following their "optimal" routes, determined by the same algorithm, trying all to merge into one lane). It seems to me that some form of controlled randomnes would solve the issue.

For example when a new vehicle is spawned and a calculated route takes it through a multilane road the vehicle should make some "random" variations in which lane it would take, biased towards the direction of where it needs to go. By "random" I mean some combination of randomized behavior and perhaps also a check of the other vehicles taking also this road and selecting a lane that is least used and still in the correct direction. With such trick there would be no real time calculations needed and yet the situations when all the traffic is stacking up into a single lane could be reduced significantly.

Now I'm not saying that I know all the answers right from the top of my head but it seems to me like a resonable tweak that should not be very hard to implement.
Also from reading the forum link I see that there are more people who point out these issues so hopefully devs might do some tweaking in this area.
Last edited by Hexx; Jun 8, 2015 @ 5:24am
Saber Kitsune Jun 8, 2015 @ 6:08am 
Originally posted by LanmanCZ:


It seems to me that when a route for a vehicle is being calculated it does not take into an account the current traffic situation and a "optimal" route a is selected.

The pathfinder does take traffic into account:
They take into account if they have a vehicle of their own, if there are congested roads and if there is public transport available. Based on these factors they walk, use public transport or their own vehicle. (source: http://www.gamasutra.com/view/news/239534/Game_Design_Deep_Dive_Traffic_systems_in_Cities_Skylines.php )

Also from the same link:
During that process, the pathfinding establishes the best driving path for the vehicle by calculating a score out of the segments/lanes data considering congestion level, speed limit and direction.



For example when a new vehicle is spawned and a calculated route takes it through a multilane road the vehicle should make some "random" variations in which lane it would take, biased towards the direction of where it needs to go. By "random" I mean some combination of randomized behavior and perhaps also a check of the other vehicles taking also this road and selecting a lane that is least used and still in the correct direction. With such trick there would be no real time calculations needed and yet the situations when all the traffic is stacking up into a single lane could be reduced significantly.

Like I posted earlier, the devs have already tried out a similar tactic. All it effectively did was just swap a jams length with width. So now your turning traffic is blocking your straight through traffic because they can't get into the turn lane. In addition, the more randomness added, the harder traffic becomes to predict, and therefore, the harder it is to manage. Surely you'd want it easier to manage?

Also from reading the forum link I see that there are more people who point out these issues so hopefully devs might do some tweaking in this area.

There are a lot of us who don't see it as a major issue, and therefore, we don't post about it. Why would we? Traffic is easily manipulated to use all lanes if you take the time to understand it. Also, I'll have to hunt down the link, I also beleive the devs have stated they're not going to change traffic at this time.
mlind1981 Jun 8, 2015 @ 6:11am 
Well its there actually.. optimal routes are being calculated.. or else if you had 2 roads leading to the exact same place.. one of them would never ever be used.. but thats not the case :)

I did for fun and for testing purposes make an 18 lane toll plaza.. highway splits into 9 lanes in each directions and the ai does infact (not perfect or completly equal) spread out traffic through all lanes and merging on the other side without any problems.

Im really not sure how the devs should tweak the way cars interact on the roads when its already possible to avoid most of these problems by intelligent road planning and layout. I still advice you to take a look at the mod "traffic report tool" it show the exact route of a car.. and then use that informations to minimize these annoying situations. You will see in time that most if not all the traffic issues and problems are quite easy to get rid of.

Also traffic manager for arrow changing is quite useful.. but not really needed as the traffic will make the most use of a good well planned road network.
< >
Showing 1-15 of 18 comments
Per page: 1530 50

Date Posted: Jun 7, 2015 @ 9:04am
Posts: 18