Cities: Skylines

Cities: Skylines

466 valoraciones
Multi-lane traffic
Por Maestro
Why traffic often appears to only user a single lane of your fancy multi-lane road system and how to prevent it.
2
   
Premiar
Favoritos
Favorito
Quitar
Traffic uses all lanes ...
.. when you build your roads right.

tl;dr - If you see your traffic all waiting in a single lane, there is always a reason and that reason is usually easy to find :-)

I see a lot of posts about how the traffic is "broken" and how so often traffic always sticks to one lane and multi-lane roads are "broken" and blah blah on it goes. I've even seen plenty of strategically cropped screenshots of single-file traffic "proving" this point.

Well, I disagree. I would like to postulate that in ALL of these instances, you are merely witnessing the majority of cars wanting to go in the same direction and the drivers actually behaving themselves and using the correct lane to do so. Surely you've all been on busy motorways when the exit is blocked by heavy traffic and so lane 1 becomes full pretty quickly. Doesn't it annoy you when people go down lane 2 and try to butt in at the last minute? Usually people in Audis. And what happens when reasonable people refuse to let them in? lane 2 gets blocked then before you know it you have gridlock. This is why traffic looks like its all queuing in a single lane: they're following the Highway Code (or whatever equivalent in your country).

Here's what the developers had to say on the issue:

Publicado originalmente por "Co_Karoliina":
[vehicles] also like to choose lanes early to avoid switching lanes and blocking off two lanes in the process if they are trying to push their way into a line of cars and have to wait.

Let me show you a few examples I hope will highlight this :-)
Example 1 - using 3 lanes
Here's a load of traffic happily using multiple lanes. This is because ahead of them are multiple options and multiple destinations and so their are a multitude of routes being taken:
Example 2 - using 6 lanes
How about a 6-lane road? here you can see all the way back down the lane, vehicles are using all 6 lanes because they have multiple routes:


And from overhead this whole area has plenty of traffic and it's all using multiple lanes.



Example 3 - highways
Well what about highways, I hear you ask. Here's a highway junction with cars turning left (I'm from the UK so it's left hand lanes) and turning straight into lane 3! Why? Because they're going to travel a good way on the next stretch before they need to exit left:



And this is what happens and what vehicles will do. If they need to turn soon, they will plan accordingly and move to the appropriate lane but if they don't have to turn soon, they use all lanes as seen on this other highways shot with vehicles clearly using all lanes:

Where it goes wrong
Now that doesn't mean my current city is all sweetness and light! A quick look at the traffic map showed an angry red patch near a large mixed district of all 4 zones. Here's what I could see:



Now this is actually just a little further down the highway from the previous picture. You can actually see vehicles using all the lanes further up the road then starting to filter as they need to exit left. What you can't see from the picture, however, is the fact that these cars are barely moving. Here's why:



Yes, a 6-exit roundabout :-D imagine if this were a normal junction with lights! Oh yea gods! Here's a wider shot so you can see that this is a mix of zones, spread out quite narrowly due to the tight spaces in Yosemite Valley:



The industrial goes about twice that distance to the left and the residential/commercial about the same to the right. I just want to give you context for what traffic is trying to flow through this roundabout. At the far end of the industrial is another motorway exit (the first pics were from the other end of this estate) and likewise the other end of the res/com also has a motorway exit but what you see here is roughly what is relevant to this exit.

Here's what's happening:


Now most of the traffic you can see affecting this roundabout is trying to exit onto the highway. Because you've effectively got 6 roads emptying into one junction, the roundabout moves very slowly - and I tried with and without traffic lights and it made very little difference in this case. With the roundabout moving so slowly, traffic from the highway can't get onto it effectively and the whole thing backs up. When you get queues, you get single file traffic. All of the roads in this example have single file traffic because they're all trying to go the same way.

But there must be a better way right? Of course.
Solutions...
A couple of minutes later and the 6 lane roundabout gets replaced with a 3 lane highway, the connection to the main highway roundabout changed into on and off ramps using the proper connectors and a load of the connections to the roundabout changed to one-way streets. Result? Moving traffic:




The exit to the north now only flows north and is the only way into the housing and retail estate to the north so all of the traffic for the north of this picture exits the roundabout immediately. The north-east exit I removed altogether since that road is accessible from within the estate so it was a superfluous exit. The exit to the east is now the only way into the industrial estate to the south and the associated office space. All of the exiting traffic from the residential and commercial estate is also funnelled down this road. Why? It means that from the main highway, all of the incoming traffic is gone in the first two exits. Nothing goes round the roundabout to hold up the traffic getting back on the highway. What is again not very clear from the pictures is that this time, the traffic is moving. I removed the lights from the T-Junction to the east and so everyone merges on their own and the traffic flows heavily but smoothly. And have you noticed ... they're using all the lanes.



From this final wide shot, you can see that the gridlock is gone on the highway, gridlock is gone from the entire estate and now all lanes are being used. All is well in the world. Yes, it cost me a few buildings but they'll be back in a jiffy and, well, problem solved :-)


That change literally took me a few minutes observing who was going where and coming up with a solution to prevent gridlock.
The detail
What did I do?

1) Observe.
The problem was too much traffic leaving two large estates via a single roundabout.

2) Analyse.
Roundabouts are great - this wouldn't have even been feasible without one and the whole estate would have been gridlocked. However, they have their limits. With a much, much larger roundabout this would probably have worked but with a reasonable sized roundabout, traffic gets stuck on the roundabout itself and before you know it, traffic can no longer enter the roundabout because someone is already in their way. Traffic lights on roundabouts help to alleviate this (we do this in real life in the UK on busy motorway roundabouts) but ultimately there is a finite capacity and in this case it has been exceeded. in my case, there was also a superfluous junction that need not be there since traffic from that road could just as easily use another path.

3) Understand.
In order to alleviate roundabout congestion, you need to make understand where people are try to go. If a tonne of people need to get both to and from what the roundabout provides access to (in this case, an estate and a highway) then you have to control that flow. Roundabouts fail, as stated above, when traffic cannot filter onto them because someone is already in their way. So stop people getting in the way! How do you do this? You make sure that nobody enters the roundabout in such a way that their journey will take them across someone else's entrance and block their path.

4) Plan.
Right, so we need to get all these people off the highway and onto the estate without getting them in the way of people getting out of the estate and onto the highway - and vice versa. The solution is simples. For UK and left-handed roads, simply count clockwise and make sure all you exits come before your entrances. For the rest of the world, count counter-clockwise: EXIT - EXIT - ENTRANCE - ENTRANCE. Only local traffic should ever violate these rules. Local services might not want to either enter or exit the estate but travel across it. In the below diagram, I don't think there are any circumstances in which traffic will travel through the red star. I could probably delete that section road but then it would look a bit miserable, right? As for the red circle, local traffic travels through there from time to time. Service vehicles travel from the industrial estate to the residential estate via this path and also, from time to time a cargo train arrives and a tonne of wagons pile out to feed the commercial zones.

5) Build.
I chose to use highway sections for the new roundabout. The reality is that you don't need 6 lanes for a roundabout and each road segment is not long enough to warrant so many lanes and traffic simply won't use it. Three is plenty for some serious traffic flow. I also chose to use on-ramps to connect the highway system to the roundabout. I did this because the game logic is designed to allow cars to filter on and off on-ramps smoothly and it does it very well. More testing is required to fully understand the interactions between all road types to see if there are even better solutions but I'll leave that for another day. Notice the arrows on the roundabout here. Lanes 1 & 2 can both turn left and lanes 2 & 3 can both go straight on. A 6 lane roundabout has exactly the same arrows on lanes 1 to 3 but then has three further straight on arrow for lanes 4 to 6 that nobody will ever use because nobody ever needs to.



For the one-way systems, the first thing I did is to change the connecting segment for exit 1 on my roundabout to exit only and observed the results. How much traffic was exiting cleanly here and where was everyone else now going? What I found was that people trying to exit the northern estate now had to turn right across the flow of traffic in order to join the roundabout at exit 2. Bad idea. When trying to create a free-flowing traffic network, having traffic turn across another lane is never a good idea (that's right turns in the UK and left for everyone else). Now I could have made exit 2 an entrance only but then that's a lot of traffic entering the roundabout before all of the industrial traffic had exited. Bad idea. No-brainer then. Exit 2 had to be a one-way exit and so it only made sense to make the entire 6 lane avenue by the river one way heading south.

That's the residential and commercial traffic sorted - they can now reach their destinations with ease. But the corollary of that is that they're now all piling into the industrial estate on the way out. With both they and all of the industrial traffic now exiting the estate, I made the two remaining exits entry-only, making the industrial traffic now all take exit 2. Removing the traffic lights at this junction made the traffic flow nicely at this exit and so all that was left to do was control the flow through the estate. Changing a few roads to one-way streets to control the flow but still allow easy access to all the buildings wasn't a big task. this whole process, whilst taking a whole lot of words to fully explain, probably took me five minutes in total to execute.

6) Repeat
After being satisfied that this was working, my attentions went to other parts of my city and I continued building. Later on I returned to the area to see how it was getting on and observed that very little traffic was actually leaving the industrial estate via exit 3 and nearly all of it was flowing nicely from exit 4 to the highway. With this in mind, I changed exit 3 back to two-way traffic and that alleviated some of the flow at exit 2 and allowed some of the industrial traffic a more direct route without causing any problems. I think this nicely highlights that just because you've solved a problem, it doesn't mean that there isn't a better solution :-)





In the real world
For what it's worth, I thought it appropriate to talk about a real world example right on my doorstep. This is the infamous M1 Junction 24; a major roundabout close to my home where two dual-carriageways, two main A-Roads, the M42 and one of the busiest stretches of the M1 motorway all come together. It is a convergence of the main route North to South, the main route to the North East, the main route to the North West and the main route to the Midlands and the South West. It's a nightmare; believe me. One thing quickly of note is that this is ostensibly a three lane roundabout with extra lanes only added in a couple of places for direct filter lanes.


But there's more to this little tale. The A453 used to be the main road from Nottingham to Birmingham and the final stretch (in the NE of the picture) is still heavily used. Here's a pic courtesy of Wikipedia:


It's like that every day. All day. So what are the nice people of Nottingham Transport doing? They're making the whole thing a dual carriageway. In Cities Skylines terms, they're upgrading the single, two-way small road to what is effectively two one-way small roads acting as a mini-highway; just without highway regulations and including things like junctions, roundabout and traffic lights.


That's all very nice and will make the journey to Nottingham better but the problem on the way back is that all this traffic still has to get through a single roundabout and, as we've seen, adding more lanes doesn't make a difference - it's access and right of way that matters. There are traffic lights to help keep things moving and to help prevent mayhem but it's still rubbish. This is what traffic is like when it's light - imagine what it's like at rush-hour!


So what are they doing about it? They've gone through exactly the same process I've described to you. They've analysed who's going where and come up with a solution. The motorway is what it is: a motorway and therefore has priority and can't really be messed with. The other roads, however, can. As explained above, this stretch of the A453 carries most of the traffic from Nottinghamshire and Lincolnshire to the Midlands and also to the South of England - all of it. That's a lot of traffic that needs to get onto the roundabout and exit via all exits, albeit mostly the M1 south and the A50 west (top left). the A6 is the least busy road and only a single lane but gets massively congested at rush hour from all the local traffic from surrounding villages trying to get onto the main trunk roads via this roundabout. That's the two eastern junctions backing up because they can't get onto the roundabout.

The A50 is a major, probably the major east-west trunk road in the north of England. It runs from Stoke in the north of the midlands to this roundabout - it does carry on after but only as a minor road. Nearly all traffic arriving from the west along the A50 wants to get on the motorway and likewise, a tonne of northbound M1 traffic and the northbound M42 traffic wants to go down the A50 westbound.

With this in mind, two extra motorway junctions were created: Junctions 23a and 24a. From the M1, 23a is exit only Northbound and entry only Southbound and 24a is entry only northbound and exit only southbound. J24 remains bi-directional. Motorway relief roads were then created to join the three junctions and provide what are effectively massive, miles long filtering lanes


In addition to this, there are roadworks currently underway to join up the two relief roads and keep them from going round the roundabout:


You can see this already marked on the Google Maps satellite view overlay as a yellow road marked A50 A435 link road. Once this is completed, it will finally have achieved something marvellous. The only reason for someone to actually go round the roundabout at Junction 24 will be access to or from the A453 and the A6! Magic! All traffic performing all possible interchanges between the M1, A50 and M42 are dealt with by relief roads and the extra junctions. This will make a huge difference and enable the A453 and A6 to empty onto the roundabout much more effectively and keep the traffic flowing.


So as you can see, the very fact that playing Cities Skylines means you get nightmare traffic and have to come up with novel solutions, including additional on-ramps, bypasses, filters, relief roads and, let's not forget, lots of roundabouts, doesn't mean that there's anything wrong with the game - quite the contrary. This shows you that there's everything right with the game and that a bit of thought and problem-solving can turn a traffic nightmare into a thing of beauty. It happens in the real world just as much :-)
Conclusion
In conclusion, I'd say that the traffic AI in this game is amazing - it works. It excels in its simplicity and the virtual drivers obey the law, stick to their lanes and drive respectfully of one another.

So I hope this has been helpful and illustrative for you all and next time you think the traffic is broken, take another look at your road layout and ask yourself "why are all my vehicles in one lane?" Look at the arrows on the lane containing all your traffic. What junctions do you have coming up and what can you do about it? The answer will be there and the solution will present itself to you - or post your save on the board and ask for help.

:-)

And I'll leave you with a sunny, peaceful afternoon in Yosemite National Park:

Appendix - useful mods
I thought I'd list a few mods I find incredibly useful :-)

The traffic analyser is amazing. it shows you everything you need to know about traffic for any particular section of road or destination. Amazing!

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

The extended public transport UI. A great tool to show you loads more info and give you finer control over your public transport infrastructure.

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

Toggle traffic lights. I honestly don't know where I'd be without this one. Cities Skylines spawns traffic lights everywhere like it's an American city - hardly the paragon of traffic management or city layout ;-) Allows you to add or remove traffic lights at any kind of intersection.

http://steamcommunity.com/sharedfiles/filedetails/?id=411833858
78 comentarios
Doog #bansoundsmith 21 MAR 2024 a las 15:15 
saying that the ai is fine in this game is like saying overwatch is better than tf2, its just not true
maobe 17 MAR 2021 a las 9:56 
in every game of cities there are two options: just build and add one block after the other and watch how you city grows until it start to suffocate on its own traffic; or have a close look at the map, check the local resources and landscape, the connections and highways and rails. THEN start to PLAN. this game is about PLANNING. thats all. i like it. and my "cities world" is full of choked towns ... ;)
jaibertech 4 MAR 2021 a las 12:12 
Thank you for your explanation. It does clear things up in the way the AI works and behaves in traffic. I just wish in my country people would have that highway/traffic ethic LOL. Probably that is why it was harder to understand how the AI uses lanes.
Kudos for your Skylines and UK example!
gouldy1557 21 JUN 2020 a las 3:32 
Brilliant summary! Great work @Maestro, I completely agree that the AI isn’t broken at all (except in the sense that all the drivers obey the law which admittedly is not realistic)!

@Wolvyreen the highway is actually more realistic! No country in the world would put pedestrian crossings into the centre of a busy roundabout! They’d build pedestrian under/overpasses! Highway let’s you avoid that, as well at the lights as @shadow mentioned.

I also know J24 quite well (*waves from Rutland) and it used to be impossible at certain times of day, now even in rush hour (as long as no-one breaks down or hits another car, something we don’t worry about in C:SL) it flows really well. We can learn a lot from real world traffic management *because the AI works so well*.

Hopefully no one is complaining about the lack breakdowns and accidents! I’ve never seen a mod to add that (not that I’d want it but I’m sure some would) I can imagine that would be pretty CPU draining!?
davetreadwell 9 ABR 2020 a las 9:26 
Was pleasantly surprised to see that junction used as an example! *waves from Hucknall*
Qtwigg 14 ENE 2020 a las 22:07 
In conclusion, I'd say that the traffic AI in this game is amazing - it works.

What are you smoking?
Qtwigg 14 ENE 2020 a las 22:02 
The traffic is broken! Stop saying it is not. I have no idea how any one can say it is not. It is. I can prove it. https://1drv.ms/v/s!ArXmGzW0FYlHwR8BQBCzs-lHLG9i?e=P3FmsT A video, not a screenshot. You can clearly see that there is two open and free lanes the entire length and they only use one lane. In real life you do not see one lane traffic and butt in at last minute statement is irrelvant. Makes no sense and is a poor defense. Nobody says well my destination is in 49 miles and I have to drive on 16 different roads but because my desination is on the right I will drive in right lane only the entire length. No! Watch my video, proof is there. They only use one lane. The game is flawed, ruined because of it.
Professor Hardknocks 22 FEB 2019 a las 6:24 
Also, in USA, the left lane in many areas is now designated as a "fast lane" and you can be fined for going the speed limit. In the left lane, you must "keep up with traffic or merge right", so as long as there's someone behind you riding your tail when you're going 90 in a 55, you're still not "speeding".
Professor Hardknocks 22 FEB 2019 a las 6:23 
Wolvyreen - this game has weird rules about road priorities and right-of-way, so by making the highway roundabout you avoid traffic lights and give those on the roundabout priority to move off before giving others off the roundabout priority to move on.
ECV 20 FEB 2019 a las 1:35 
"Doesn't it annoy you when people go down lane 2 and try to butt in at the last minute? Usually people in Audis"

This is actually a law in Germany. You switch lanes at the latest possible moment, it's called "Reißverschlussverkehr" (zipper traffic?). You can be fined if you switch early on a busy road ^^