• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Development Diary #2: Traffic AI

Hi everyone! We are back with another development diary for Cities: Skylines II and today is all about the new and improved traffic AI. Managing traffic in a growing city was a core part of Cities: Skylines and going into the sequel we knew we wanted to bring you a more advanced system, both to address the feedback you have shared over the years and to make the city feel more realistic and alive.

Citizens and traffic are a core part of a living and breathing city. Where do people live, where do they work and what places do they visit in their free time? Where are businesses located and how do they get the goods they sell? Are their customers citizens or other businesses? How do their customers find them and are there other, better shopping options closer by? All of this and more factor into how traffic moves around the city.

In this development diary, we look at how the traffic simulation works and what features the agents (citizens, services, and resources moving around in the city) take into account when making pathfinding decisions. Check out the highlight video below before diving into all the details.



DIFFERENCES BETWEEN CITIES: SKYLINES AND CITIES: SKYLINES II
Pathfinding works in a different way in Cities: Skylines II than its predecessor. In Cities: Skylines pathfinding was proximity-based, meaning agents would calculate their destinations or order services by straight line distance without taking the existing road network into account. In the case of a fire, this could mean the fire truck responding would come from the closest station even if it had a longer route because of how the roads connected it to the destination. Longer response times could in turn mean the fire truck would not make it in time to stop the fire from spreading or save the building from collapse. Agents would take the fastest route to their destination and stick to it, patiently sitting in a traffic jam if one occurred, only changing their route if the road network was modified in ways causing their original path to no longer be viable.

In Cities: Skylines II agents choose a route based on a pathfinding cost. This cost is calculated using multiple factors such as the city’s road network, traveling time, travel cost, agent preferences, and more which we will cover in more detail below. Furthermore, agents will adjust their route based on events along the way. They may change lanes to avoid a car accident or a stopped service vehicle or make room for a vehicle responding to an emergency.

1 Layout.png

Your city layout is only part of the equation when agents decide how to get around


PATHFINDING COST
The core of pathfinding calculations is the four aspects: Time, Comfort, Money, and Behavior.

Time is an important factor when calculating a path. While other factors affect pathfinding, time is usually the most important as all agents tend to seek the quickest route to their destination. When considering only the travel time, a small road can be shorter but its travel speed is lower than the longer highway’s travel speed so the agent chooses the highway in most scenarios if the highway is overall a quicker route.

Comfort is an important factor in pathfinding and includes planning the route to be as smooth as possible, avoiding unnecessary turns at intersections as well as finding a suitable parking spot or public transport stop to get off at. Comfort is calculated directly to the pathfinding cost with each option adding to the overall cost.

Money comes into pathfinding choices in the form of fuel usage and potential parking fees. Citizens weigh travel and parking costs and compare them to other travel options as well as walking to see which option is quick, comfortable, and affordable. In the case of delivery vehicles, the cost of resources they transport increases the further away they are delivered. As a result, selling resources and goods locally is more cost-efficient for the companies as the delivery costs are lower than hauling the cargo to an outside connection.

Behavior refers to agents’ willingness to make “dangerous” decisions in traffic, such as making a U-turn. Citizens and delivery vehicles are less likely to make dangerous decisions in traffic to cut pathfinding costs, while emergency vehicles have a more lenient behavior model so that they can navigate the road network during emergencies and make dangerous pathfinding decisions if necessary.

Pathfinding also accounts for the traveler's age group. For teens the most important factor is Money: they seek out cheap options when traveling, be it the means of transportation or parking behavior. Adults value Time, so the quickest route is usually the best for them. And Seniors prefer a high Comfort level. As long as the Comfort cost is small, seniors tend to choose that option.

Citizens weigh all pathfinding factors when making decisions, aiming for the lowest overall pathfinding cost.

Service vehicles are ordered based on the lowest overall pathfinding cost and when new orders are made, they take into account the distances of all applicable vehicles now and in the near future (as in: where will the vehicles end up after they have fulfilled their previous service order). As an example, a road maintenance service vehicle is ordered to repair a road segment. The simulation checks where all available vehicles are at the moment and where their current orders are taking them. A currently closer vehicle might not be selected for the new order if another vehicle is on its way to a nearby location shortly as it finishes its current service order.

Resource transportation is affected by the length of the route as distance increases the costs, so companies try to ship cargo as close as possible to increase their own profit margin. Transporting resources and goods out of the city is costly and can greatly decrease the profitability of companies.

2 Transport.png

The further you ship resources, the more expensive for the companies


LANE USAGE
In Cities: Skylines II vehicles use more lanes. They try to optimize road usage to allow as smooth traffic as possible, occupying all available lanes as they travel to their destination. This means that if one lane in a multilane road is filled with vehicles waiting at the traffic lights, new cars arriving at the intersection choose the other empty lane(s) to fill the intersection evenly.

On multilane roads, vehicles can overtake slower vehicles when the simulation notices that the other lanes are less used. Vehicles also switch lanes to avoid completely blocked lanes due to a traffic accident, a traffic jam, or a stopped vehicle, such as an ambulance picking up a patient. Additionally, vehicles will try to give room for the emergency vehicle by switching to other lanes when possible.

3 Lane usage.png

Vehicles adapt to traffic on the roads to improve the traffic flow


TRAFFIC SIMULATION, AGENTS, AND PERFORMANCE
The traffic simulation is complex in Cities: Skylines II. In addition to calculating their path, all vehicles and pedestrians take into account all nearby agents at all times as they navigate the streets and pathways in the city. The agents make decisions affecting traffic flow multiple times while traveling, separate from their pathfinding decision. These include accelerating along the traffic, braking to slow down, avoiding oncoming traffic when making turns, switching lanes to optimize traffic flow, and making pathfinding decisions when an unexpected event such as a traffic accident occurs on the route originally planned.

This means pathfinding calculations are more numerous and more in-depth than in Cities: Skylines as the agents have more features affecting their decisions. However, the calculations are more efficient, resulting in higher performance across the board as the pathfinding and simulation among other calculations take advantage of all the available processing power of the multicore CPUs.

Also, as a major improvement to the first game in the series, Cities: Skylines II doesn’t feature hard limits for agents moving about in the city. Overall, the performance of the simulation and pathfinding is vastly improved which means larger populations are possible. The only real limits to the simulation are the hardware limitations on the platform running the game.

4 Large city.png

Build large cities and watch your citizens travel them for work or leisure


ROUNDABOUT BEHAVIOR
We talked about roundabouts in the last development diary covering how they’re built, but that isn’t the only improvement. Traffic simulation also takes into account the rules regarding roundabout entry and exit. Vehicles entering the roundabout give way to those already on it, however, just like in real life, vehicles might cut in front of another vehicle already on it, if a suitable opportunity arises. This is part of the agents’ behavior which is always looking for suitable spots to improve the traffic flow, by changing lanes or sneaking through an intersection at the last minute.

5 Roundabout traffic.png

Vehicles are always ready to take advantage of an opening


TRAFFIC ACCIDENTS
The game features traffic accidents where vehicles lose control and crash into traffic or buildings. The likelihood of an accident happening is calculated per road segment and is increased by features such as road conditions, lighting conditions, weather, and disasters. Keeping roads in good condition by using road maintenance services and having streetlights is a good way to decrease accident probability on the road.

When an accident check succeeds on a road segment, a vehicle on the segment is selected randomly to “lose control”. The vehicle is pushed in a random direction, gaining simple collision and physics to allow it to hit obstacles on its way. If a vehicle collides with another agent, it also gains collision and physics for the duration of the accident.

Accident sites need to be secured and cleared by the police and road maintenance, respectively. The simulation halts traffic on the lanes that are affected by the accident and vehicles wait until the road is cleared before continuing on their way. Ambulances might also be called to the site if the accident was severe enough to cause serious injuries. If clearing the site of the accident causes traffic jams for a prolonged period, agents might recalculate their pathfinding, resulting in “dangerous” behavior and making U-turns to find alternative routes circumventing the blocked lane.

6 Accident.png

If more lanes are free, vehicles will use them to avoid the site of the accident


PARKING
Parking is a new feature in Cities: Skylines II and one of the four main aspects of pathfinding. Agents consider available parking spaces when they calculate pathfinding and decide how they travel to their destination. Usually, the most comfortable option for an agent is to be able to park on the lot of the building they are traveling to. If that is not possible, they will choose either another parking option or a different transportation method. The lack of parking can lead to citizens preferring other places for their activities such as choosing different locations for shopping or leisure time.

Citizen age groups have different preferences when it comes to travel comfort, time, and money spent on traveling. Parking affects all of these aspects in one way or another. Seniors prefer comfort and if there are parking spaces near their destination, they will most likely choose them regardless of the potential parking fee. Adults are most concerned about time and choose places that are along the quickest route, while teens have the least money so they choose cheap parking options, even if it means they have to walk longer distances or use other means of transportation to complete their travel.

Parking choices and pathfinding cost calculations for agents can be affected by fees set for individual parking lots and buildings as well as roadside parking fees added to districts. Low or nonexistent fees encourage parking for all citizen groups while high parking fees favor wealthier citizens.

6 Parking structure.png

Parking lots come in multiple sizes along with multistory and underground parking structures


INFOVIEWS
Cities: Skylines II features two infoviews, the traffic infoview, and the road infoview, to help keep an eye on traffic and address problems early on.

TRAFFIC INFOVIEW
The traffic infoview shows traffic flow and volume in the city as a whole, making it easy to spot problem areas in the road network quickly as traffic jams color the roads in red. Traffic flow indicates how smoothly traffic flows in the city. A higher number means that no jams are forming while a lower number indicates that potential bottlenecks can appear. Lastly, traffic volume shows how many vehicles travel on the road network at different times of the day. High volumes of traffic indicate rush hours.

7 Traffic volume.png

Switch between Traffic Flow and Traffic Volume to see how your network is handling traffic

ROAD INFOVIEW
Road infoview shows more in-depth information about a single road, covering the road’s condition as well as its traffic flow and volume. With these tools available it is possible to enhance the road network very precisely. If a particular road has a large volume of traffic, it is most likely a main road and you might need to keep an eye on it as the city grows, and upgrade it to a bigger road to alleviate traffic congestion in the future.

The road condition affects accident probability and travel speed negatively, increasing the risk of accidents and slowing down traffic. Road maintenance vehicles keep the roads in good condition and free of snow during the winter season allowing smoother traffic and safer travel.

8 Road condition.png

Check the condition of your roads and find your Road Maintenance vehicles with the Road Infoview


SERVICE VEHICLES
When service vehicles receive orders from buildings and road segments, they calculate a suitable path to their destination. As the vehicles travel to their destination they affect the traveled path and/or its surroundings, for example, when a garbage truck receives an order to travel to the next destination to pick up garbage, they also pick up garbage along the way. Similarly, road maintenance vehicles will repair the segments of road as they travel to their current destination.

Emergency vehicles, such as police cars and fire trucks, have additional rules affecting their pathfinding. Their behavior is “more dangerous” compared to citizens, other service vehicles, and delivery vehicles: they are able to make “illegal” U-turns if it shortens their route to their destination. If possible, other vehicles will give way to the emergency vehicles by switching lanes on multilane roads.

Police patrols have additional rules to their behavior as they can override their patrol duties (decreasing crime probability in areas they travel through) if an emergency, such as a robbery or traffic accident, takes place.

Public transportation vehicles travel on the designated lines with the exception of taxis which are able to freely select their routes according to pathfinding rules similar to private vehicles. Initially, they pick up fares at taxi stands but with the taxi depot upgraded, they can pick up fares anywhere in the city.

Service vehicle operations can be limited to player-created districts. In these cases, the vehicles only answer orders and respond to emergencies within their designated districts. Any city service can service one or more districts as well as the entire city (by default).

9 Service vehicles.png

Other vehicles give way if possible so emergency vehicles can reach their destination faster


TRAFFIC BETWEEN OTHER CITIES
The game also features traffic between other cities, from one outside connection to the next. This traffic does not contribute to the city’s economy but the traffic can become part of the overall traffic flow as the city grows and the highways are integrated into the city’s road network. If the player builds a shorter route between two outside connections, the traffic between those cities will change to use the newly created option if it is more cost-efficient in regard to pathfinding.

10 Outside connection.png

You can add new Outside Connections when you reach the edge tiles

With that, we find ourselves at the end of this development diary. We hope this provides insight into how traffic behaves in Cities: Skylines II and will help you design your ideal cities. Traffic AI has been reoccurring topic with Cities: Skylines and we’re looking forward to hearing your feedback on the more advanced and realistic traffic simulation in Cities: Skylines II. Next week we cover the topic of Public and Cargo Transportation and how it integrates with your city.


cs2-devdiaries-schedule-forum.png
 
  • 48Love
  • 45Like
  • 4
  • 2
Reactions:
Having said all that, I'd like to provide some data supporting my original comment. My central claim is that one car per teen/adult(?) agent is an unrealistic model for developing the traffic AI. I think I understand the choice ... it leads to a more dynamic and challenging simulation of traffic flow, and there needs to be a way to set a baseline for constructing a simulation that players can learn to manage and navigate.

But it's not realistic at all.

Attached is a JPG of a data set showing per capita and per household car distribution across G20 countries. I chose the G20 members as a representative data set on the basis of two premises.

The first is that there is a direct positive correlation between development and urbanization. The most developed countries are the most urbanized. This is a city-building game, so it makes sense that we would want to apply patterns of auto ownership in the urbanized world. Thus, the patterns of car ownership across the G20 countries works as a representative, "realistic" sample that should drive distribution of autos across households in the game.

My second premise is that these 20 states are also sufficiently diverse that they further provide a representative sample of auto ownership across the developed world. The minimum car ownership rate is .27 per household in India and the max is 2.06 per household in the United States. Having said that, it's worth noting that the distribution of this sample falls across a standard bell curve with a relatively low standard deviation (see the CV)--the SD and CV of the sample also demonstrate that it's a useful representative sample for establishing a benchmark criterion of ownership across households in the game.

On the basis of this dataset, it seems to me one can claim that a model of one car per teen/adult(?) is not correspondent with actual usage patterns across the ENTIRE developed/developing (i.e. URBANIZED) world (note-- it isn't clear to me when agents in the game acquire an auto, however). The average auto ownership in the developed world is 1.2 autos per household (the median is 1.25). Depending on when the game assigns an auto to a cim (and assuming the average household size is 3), hypothetically, households in the game will likely possess two autos and possibly three (a household with two adult parents and a car-possessing teenager).

I would only propose that there be some correlation between wealth status, density of population in a simulation, availability of mass transit options, etc., and/or some randomization that brings the average auto ownership in game to a level more correspondent with actual urban ownership patterns.

I really appreciate the dedication, creativity and hard work the creators and developers have put into the game--and I absolutely can't wait to play CS2!!!
Some more data, centered on Europe:
Thanks partially to a strong transit system, Berlin has the lowest car ownership of any of Germany's major cities: 350 cars per 1,000 residents, according to the EU-funded group Civitas, compared with the national average of 574 per 1,000, and with 570 per 1,000 in Munich, the most car-heavy major city.
About Paris:
Separate research released by the Parisian Urban Planning Workshop (Apur) found the number of cars in the city has fallen -- more and more quickly -- every year since 2012. That means that while nine out of ten French people have a car, only three in ten Parisians do.
About London, one of the most congested cities in the world:
69 per cent of households in outer London have access to or own at least one car or van, compared to 42 per cent in inner London.
Let's travel to Japan:
Overall car ownership in Japan is about 590 vehicles per 1,000 people (1.06 cars per household), which is less than American's rate of about 800 per 1,000. However, Tokyo is a big exception with only 0.32 cars per household.
Hong-Kong?
Hong Kong's car ownership rate is relatively low compared to that of its neighboring regions. According to the survey conducted by Rakuten Insight, only about 34.1 percent of the respondents in Hong Kong stated they owned a car.
So I'm all for realism but "hypothetically, households in the game will likely possess two autos and possibly three (a household with two adult parents and a car-possessing teenager)" is definitely NOT realistic. ;)
 
  • 1Like
Reactions:
Parking is a new feature in Cities: Skylines II and one of the four main aspects of pathfinding. Agents consider available parking spaces when they calculate pathfinding and decide how they travel to their destination. Usually, the most comfortable option for an agent is to be able to park on the lot of the building they are traveling to. If that is not possible, they will choose either another parking option or a different transportation method. The lack of parking can lead to citizens preferring other places for their activities such as choosing different locations for shopping or leisure time.

I'm concerned about this — but hope the last sentence is only part of the equation, not an overwhelming factor. Will people drive a longer distance to a restaurant with parking in preference to one with no parking but great access by public transit?
 
I'm concerned about this — but hope the last sentence is only part of the equation, not an overwhelming factor. Will people drive a longer distance to a restaurant with parking in preference to one with no parking but great access by public transit?
I think, this will probably be a matter of overall travel cost. Depending on the personal preferences of your citizens, the parking (or the lack of it) accounts more or less to their decision to visit the restaurant. So, instead of adults, in the specific case the restaurant's clientele could rather be teens, using the cheaper public transport, or it may be more seniors, who value comfort the most. And adults, who don't live close by, choose a different restaurant offering better parking options.
 
In both developer videos all the people are white. There are no black people (I appreciate more nuanced tonal variety maybe negligible at the extreme zoomed -in levels, I do not know). Yet you have different breeds of dogs.

I am assuming that this is because the videos are made from a non final build?

I appreciate that this is not a game breaking issue, that my comment might be seen as pedantic, or even "woke" by certain individuals (I hate that word, but this is unfortunatly the world we live in), but I make it out of the belief that should this be an oversight it can be rectified quickly so as not to cast shade on what is shaping up to be the ultimate city builder. Otherwise, it will be used as a criticism that could have easily been avoided.
It's saddening how many people clicked "dislike" on your comment. What does that show? It is an important observation to register.

I don't want to seem like an apologist, but I'm fairly certain I've seen people of color populating my current cities in CS1 (not sure if that is a mod I picked up somewhere or in one of the patches)--so one might hope the developers will update the game aesthetics before they release in October. Ironically, a game like this requires a certain resource level to be able to play, so it makes sense this cognitive blind spot might appear in marketing videos because, sadly, race tends to correlate with economics (at least in the United States).
 
  • 2Like
  • 1Love
Reactions:
It's saddening how many people clicked "dislike" on your comment. What does that show? It is an important observation to register.

I don't want to seem like an apologist, but I'm fairly certain I've seen people of color populating my current cities in CS1 (not sure if that is a mod I picked up somewhere or in one of the patches)--so one might hope the developers will update the game aesthetics before they release in October. Ironically, a game like this requires a certain resource level to be able to play, so it makes sense this cognitive blind spot might appear in marketing videos because, sadly, race tends to correlate with economics (at least in the United States).
It is telling indeed.

However the devs have confirmed what I had hoped they would which all the post was really ever about - that these are just place holder characters and something that is being worked on.
 
  • 2Like
Reactions:
TRAFFIC ACCIDENTS
The game features traffic accidents where vehicles lose control and crash into traffic or buildings. The likelihood of an accident happening is calculated per road segment and is increased by features such as road conditions, lighting conditions, weather, and disasters. Keeping roads in good condition by using road maintenance services and having streetlights is a good way to decrease accident probability on the road.

When an accident check succeeds on a road segment, a vehicle on the segment is selected randomly to “lose control”. The vehicle is pushed in a random direction, gaining simple collision and physics to allow it to hit obstacles on its way. If a vehicle collides with another agent, it also gains collision and physics for the duration of the accident.

Accident sites need to be secured and cleared by the police and road maintenance, respectively. The simulation halts traffic on the lanes that are affected by the accident and vehicles wait until the road is cleared before continuing on their way. Ambulances might also be called to the site if the accident was severe enough to cause serious injuries. If clearing the site of the accident causes traffic jams for a prolonged period, agents might recalculate their pathfinding, resulting in “dangerous” behavior and making U-turns to find alternative routes circumventing the blocked lane.

View attachment 998334
If more lanes are free, vehicles will use them to avoid the site of the accident

Hi, everything looks great! I congratulate your team on the generally great impressions so far for Cities: Skylines. That being said, I hope I am not too late here, but I do have a question regarding traffic accidents. You mentioned ambulance as responding to traffic accidents, but what about fire truck? It is very common for fire trucks to also respond to traffic accidents, at least in the United States. I personally do not drive, but my understanding is that traffic accident can potentially carry fire risk, hence the precaution of calling fire department to such accidents.

Also, can we have a screenshot showing the police blocking off the traffic accident site? Ever since watching Live PD where it would sometimes show police handling the traffic accident scene, I have been fascinated by how the entire traffic accident scene are handled. I even made a traffic accident scene in Grand Theft Auto V on PC with Menyoo, a trainer. It had a wrecked car, a dead ped (no other way to make them lie down on the surface :x ), a couple of emergency service personnel attending to the ped and a couple other scribbling down on a notepad (using animations), a bunch of emergency service vehicles parked with lights going off, and all emergency service personnel randomly walking around on a freeway. Lol :p
 
Hi, everything looks great! I congratulate your team on the generally great impressions so far for Cities: Skylines. That being said, I hope I am not too late here, but I do have a question regarding traffic accidents. You mentioned ambulance as responding to traffic accidents, but what about fire truck?
 
  • 1Like
Reactions:
Question for the developer: It was mentionied that traffic AI will make full use of multi core CPUs. I plan to upgrade my AMD CPU. What is the better option in the AMD world, a CPU with X3D gaming architecture (like 5800X3D, 7800X3D 8/16 cores) or one with as much as cores available (5950X, 7950X with 16/32 cores) ? I am still on AM4 platform, so normally I would prefer a Ryzen 5950X because I am not 100% convinced stablitty-wise by the AM5 platform.
What benefits the game more, the fast L3 cache of the X3D CPU's or as many cores as possible?
I don't know if you ever got an answer from a dev, but it is near certain that X3D chips will be better for CS2. It's fundamentally a simulation processing large amounts of data so get as much data as possible into the CPU (using the greater cache of X3D) is always going to be the bigger issue.
 
No, never got an answer, disappointing. A developer should have the knowledge to answer this. But as they mentioned for their traffic AI they will make full use of all available CPU cores, so the answer is not so simple as it appears maybe. It's the first time that a game developer announces full use of all available CPU cores. Until now we all know that all existing games only use a few CPU cores while the majority of the CPU cores are doing nothing. So that would definitely be a new approach by CO and would put the focus on the number of cores and not necessarily on bigger L3 cache - of course, a bigger L3 cache doesn't hurt at all ;-) I think only a developer can really tell us what's better.
 
One basic question I forgot about -- I may have missed this -- does the base game allow for turning OFF despawning -- i.e. "hard mode", as Biffa calls it?
As the ai is different and can find alternative routes there will be much less despawning by default, however it is still necessary when no path is avaliable for example when deleting roads. Don't expect it to be toggleable without mods
 
  • 1Like
Reactions:
Emergency vehicles might make a U-turn and find a different route to approach the accident from the other direction. If they cannot reach the site of an accident, they will get as close as possible, and even if they cannot reach it at all, the site will eventually clear so traffic won't be stuck forever.

Vehicles can make a U-turn and find a different route if they get stuck in traffic and there is room enough to turn around. You can see an example of this at 2:18 in the video where a small car turns around as the road is blocked by service vehicles.
Already cleared, but it will look funny when car is stuck on right side of avenue, by hitting another car. In this scenario the service vehicle cannot reach in from behind, so it will make U-turn and follow the entire block to reach crashsite from frontal direction. But it is literally 25m in front, so described vehicle better to perform S-turn around the bush divider and follow that 25m on opposit lane (obeying actual traffic conditions). Can we override lane direction mechanics by mods or it's hardcoded?
 
Last edited:
  • 1Like
Reactions:
@Avanya--thinking about the bike question more last night.

I was wondering... Is the inclusion of bikes basically a programming and pathfinding problem? Essentially a bike is another kind of vehicle. Cims carry pocket bikes the same way they carry pocket cars. So if you eliminate pocket cars then you have to find a different programming solution for incorporating bikes in the game?
 
@Avanya--thinking about the bike question more last night.

I was wondering... Is the inclusion of bikes basically a programming and pathfinding problem? Essentially a bike is another kind of vehicle. Cims carry pocket bikes the same way they carry pocket cars. So if you eliminate pocket cars then you have to find a different programming solution for incorporating bikes in the game?
I gonna say about packing your bike into your pocket. But just game rules... BTW it might be possible, but you NEED to adjust its behavior. It is not motorbikes and cannot be driven exactly, it might use sidewalks and parkways = not inheritable from common transport easily..
 
TRAFFIC BETWEEN OTHER CITIES
The game also features traffic between other cities, from one outside connection to the next. This traffic does not contribute to the city’s economy but the traffic can become part of the overall traffic flow as the city grows and the highways are integrated into the city’s road network. If the player builds a shorter route between two outside connections, the traffic between those cities will change to use the newly created option if it is more cost-efficient in regard to pathfinding.
One question this kind of brought up to mind is there a way to influence traffic through other means such as tolls. One idea I had is building a sort of belt-way around my city for lower-priority traffic such as crossthrough traffic on the outskirts of my city, which would obviously be a longer route. I would then build a sort of straight path straight through the center of my city to facilitate lots of cross city transport. If we have tolls and such, I could conceivably place them on the ends of the "shortcut" to limit the congestion from non-city vehicles while and improving traffic flow within my city, while still keeping it connected to the main highway system for easy flow of traffic out of the city.
 
  • 1Like
Reactions:
I understand accidents depend on factors independent from how drivers react and it is already written as an algorithm.

It would be more realistically however if those citizens who act more dangerously (as with predefined behaviour of each individual that is already bult-in) would be more likely to create an accident so when game must pick up sb to make a crash it would be more likely to be that person than sb who acts safer.
 
So incredibly excited for these changes, particularly the dynamic pathfinding, parking, and crashes (not accidents!).

On AI & trip generation... one thing I've always thought would be neat for games that start in the past is if the routing AI were to change over time based on changes in users' access to information. This is all well beyond the scope of what y'all are doing... but if this were to be a DLC.......
  • [Pre-1930] - Trip generation more focused on non-auto trips. Motor vehicles generally follow high-capacity routes only.
  • [1930-1950] - Auto trips become more of an option in trip generation.
  • [1950-2007] - Growth of news radio & traffic reporting improves routing, allowing traffic to be slightly smarter in avoiding congestion.
  • [2007-2015] - Users increasingly have access to full traffic info. Users begin overwhelmingly using shortest-time paths rather than highest-capacity paths.
  • [2015-2030] - Ridehail & e-commerce begin to take off, resulting in higher shares of motor vehicle trips & more freight-to-residential trips.
  • [Post-2030] - Automated vehicles begin to appear en masse, optimizing travel by taking shortest-time paths & narrowing headways between vehicles, but at the risk of increasingly overall vehicle volumes due to circulatory roaming.

I feel like Parking could be a whole Dev Diary in its own right, as I have so many questions about how private development determines their own parking needs, especially when combined with municipal parking options, and especially if there's any peak-modeling (like retail getting a surge of trips during holidays). Depending on how that works, one potential policy idea that comes to mind if there can be some way to make it user-friendly & meaningful:
  • [Finding Parking] - Will motorists automatically know where directly where to go to park? Is there an element of "first come / first served" where two motorists might go for the same spot, or is there a hidden reservation that occurs when a trip begins so that a car always knows precisely where it's headed? Or if motorists don't have a spot waiting for them: does the game factor in motorists that are circulating looking for parking? This can be a pretty substantial share of the traffic volume in many real-life cities!
  • [Other Modes' Parking] - Will other modes need parking? Like needing hangars at airports, or docks for ships, or railyards for trains? (or maybe bike racks & corrals... but I get that this might be getting too detailed at this stage)
  • [Parking Mins/Maxs] - The ability to set policies affecting how much parking a development is required to provide by setting parking minimums & maximums. These would affect how much on-site parking a new development includes and might have a slider of Relaxed-to-Stringent, with a default option of Unrestricted.
    • Minimums might require a development to provide parking even when they may not have, reducing municipal parking needs but increasing development footprints & costs.
      • Unrestricted - A development provides however much parking they feel is needed after considering customer base & municipal parking supply.
      • Relaxed - Some developments may have to provide more parking than they might have.
      • Stringent - Requires peak-of-peak parking be provided; like a store with enough parking to fit in winter holiday traffic.
    • Maximums might bar a development from providing parking that they might've preferred to have, increasing reliance on public parking options and encouraging more urban footprints.
      • Unrestricted - A development provides however much parking they feel is needed after considering customer base & municipal parking supply.
      • Relaxed - Some developments may be capped on parking & will be unhappy if they don't have convenient parking for their users.
      • Stringent - Requires no parking other than the barest minimum for a building to physically function.
Thanks!! :)
 
Last edited:
So incredibly excited for these changes, particularly the dynamic pathfinding, parking, and crashes (not accidents!).

I feel like Parking could be a whole Dev Diary in its own right, as I have so many questions about how private development determines their own parking needs, especially when combined with municipal parking options. One potential policy that comes to mind:
  • [Parking Mins/Maxs]- The ability to set policies that might set parking minimums & maximums, even if they're just on a scale of None / Low / Med / High. These would affect how much on-site parking a new development includes.
    • Minimums might require a development to provide parking even when they may not have, reducing public parking needs but increasing development footprints & costs. With Minimums: "High" is the most impactful on a development.
    • Maximums might bar a development from providing parking that they might've preferred to have, increasing reliance on public parking options and encouraging more urban footprints. With Maximums: "Low" is the most impactful on a development.
Thanks!! :)
I dont really follow you min max idea, but from what i understand a lot of structures will have built in parking to serve its population. Whether you might need more in addition to that, i dont know. but the buildings do appear to have garages that probably just send cars into an imaginary parking garage. IE +/- 1 on a available spots counter
 
Question: thought I might as well ask in this thread since the DD is about traffic AI.

Could it be possible to add a setting in the map editor to make certain vehicles more desirable for agents? For example if I make a map set in the USA or Canada, where culturally people gravitate towards cars (to be fair, this is also because of a lack of viable alternatives, But Still), or a map set in Viet Nam where a much larger portion of the population drives scooters and motorbikes?

In fact, now that the devs have more of the basics down, it'd be awesome to see a greater variety in settings and themes in general, like Africa, South East Asia, etc. (pardon the generalization), and a greater variety of vehicles like rickshaws and whatnot where appropriate, but I digress.
Totally agree this idea. It would be more realistic to have cities with more population riding motorcycles and scooters. The video shows that Cities: Skylines 2 already have motorcycles on the road and in the parking lots. However, in some countries it is more common to have them dominating the traffic.

Also, C:S2's design seem to treat motorcycles more like cars, for example parking only one motorbike per parking space, or occupying the same area on the road as cars does.
cs2-1-bike-per-space.png
cs2-bike-occupy-whole-lane.png

Yet, in real world, a single scooter usually does not occupy the whole lane.
It is common and often legal that people riding scooters share the same lane with cars or other scooters.
And they also park with other scooters/motorbikes -- perpendicular to the road.
jp-bike-share-lane.png
jp-bicycle-share-lane.png
uk-scooter-road-side.png


Such behavior may be harder to design/implement. However, it will strongly affect the numbers of bicycles/scooters/motorcycles a city may have and how they contribute to the traffic (which may be chaotic, though).

Image source:
1.
2.
 
Last edited:
  • 2Like
Reactions: