1. Cities: Skylines II
  2. News

Cities: Skylines II News

Managing Traffic

[previewyoutube][/previewyoutube]

🚧Roads, Roundabouts & all things traffic AI!🛵

In today's episode of Developer Insights, we're highlighting new features that differentiate how traffic simulation & pathfinding works in Cities: Skylines II.đźš—

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.

[previewyoutube][/previewyoutube]


[h2]DIFFERENCES BETWEEN CITIES: SKYLINES AND CITIES: SKYLINES II[/h2]
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.

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


[h2]PATHFINDING COST[/h2]
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.

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


[h2]LANE USAGE[/h2]
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.

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


[h2]TRAFFIC SIMULATION, AGENTS, AND PERFORMANCE[/h2]
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.

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


[h2]ROUNDABOUT BEHAVIOR[/h2]
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.

Vehicles are always ready to take advantage of an opening


[h2]TRAFFIC ACCIDENTS[/h2]
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.

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


[h2]PARKING[/h2]
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.

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


[h2]INFOVIEWS[/h2]
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.

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.

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


[h2]SERVICE VEHICLES[/h2]
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).

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


[h2]TRAFFIC BETWEEN OTHER CITIES[/h2]
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.

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.


Behind The Road Tools

[previewyoutube][/previewyoutube]

We're taking you behind the scenes into the making of the Road Tools, with the Developers from Colossal Order. 👨‍💻

Watch the very first episode of #DevInsights to learn more about Road Tools & features that have been improved, enhanced & expanded for you to get more creative and build advanced Road Networks. đźš§

Road Tools

Hi everyone! Welcome to the exciting world of Cities: Skylines II development diaries! Over the next few months, we will take you through everything the game has to offer, ranging from familiar features which have been expanded, to elements brand new to the franchise. Let’s take a look at the development of the game, its improvements compared to Cities: Skylines, and the new and exciting features added to make building your dream city better than ever! Below you will find the Feature Highlight video with a quick overview of the different road tools, check it out to see them in action before diving into the details of the Road Tools.

[previewyoutube][/previewyoutube]

Roads are the backbone of a city, so naturally, we start the development diaries by looking at how the road tools have been expanded for Cities: Skylines II. Our goal was to keep the experience familiar for returning players, ensure the tools are easy to learn for new players and expand the options with wished-for features like roundabouts, cut-and-fill roads, and parking lots.

How many new features can you spot?

[h2]ROAD TOOLS - OVERVIEW[/h2]
Building roads in Cities: Skylines II is more flexible than its predecessor, and allows for more creative use of the tools to help you realize your vision for the perfect road layout. You will find a variety of both new and returning options with road angles and enhanced curve tools to help you to create the road network of your dreams.

As a new feature, the Grid mode allows you to create seamless city blocks with just three clicks! First, you place the starting corner of the road grid. Then, moving the mouse and clicking for the second time, you define its width and, finally, the third click sets the road grid’s length. The grid layout becomes visible when adjusting the length of the grid in the final stage.

Creating grids is both easy and fast

The new Replace tool is similar to the old Upgrade tool but allows you to change existing roads more freely, and fine-tune the road network by adding grass, trees, wider sidewalks, or sound barriers!

Parallel mode makes it possible to automatically build two roads, such as highways, in parallel, at a fixed and customizable distance. With Parallel mode, all other road tool modes are still usable so creating beautiful, smooth highway curves is not only possible but easy.

Drawing parallel roads is as easy as drawing a single road

Road tools include multiple different snapping options and a comprehensive road guide system to make it easier to build the desired road layout, even in challenging terrain. The road guides include information about elevation angle, displaying a numerical value of the slope steepness from the starting point of the road segment to the desired endpoint.

New snapping options make roadbuilding easier than ever

Each step of road-building can be easily canceled by pressing the right mouse button, while already-built roads can be removed by using the Bulldoze tool.

[h2]ROAD BUILDING OPTIONS[/h2]
Road building has been designed to be faster and more flexible by allowing you to build roads across existing roads, creating intersections in places where the roads cross each other. This also makes it possible to place large intersections on existing road layouts easier and faster. More on them later!

Intersections are automatically created where roads intersect

Road placement options have been expanded to include cut-and-fill construction for roads digging through the terrain and elevated roads running on top of other roads. Cut roads are built using the road elevation options where the first negative values create cut roads before the road turns into a tunnel. Elevated roads on the other hand require sufficient clearance below them; using the road elevation to raise them up allows building them across roads that run parallel to them. Building elevated roads is as easy as building a bridge or an overpass.

Stack roads to save space or when adding a highway to an existing part of the city, and cut through the terrain with the cut-and-fill roads

The roads are also more flexible to build in Cities: Skylines II. Connecting different sizes of roads together can create interesting intersection options, for example splitting a small two-way road into entering and exiting highway ramps is now fast and easy. However, one of the most exciting new features in the road system is the ability to create entry and exit ramps for highways with proper acceleration and deceleration lanes that merge with the highway itself. This is achieved by first building a portion of the highway with a highway type that has one additional lane and then connecting that additional lane with a single-lane highway, forming a ramp.

Split roads and merge lanes easily to create realistic-looking highway roads

[h2]ROADS & INTERSECTIONS[/h2]
Roads are organized into familiar categories: small roads, medium roads, large roads, and, of course, highways. Each category features multiple different options from two-way roads to one-way roads and asymmetric variations. In addition to the elevated versions of each road, there are various bridges in different styles. There are no grass or tree-lined versions of the roads as these, among others, are added using the Replace tool.

Build your city using the different road options and customizations

Roads can be customized by adding bus lanes and tram tracks to them using the additional network building tools. You can also create dedicated roads that only allow buses and service vehicles to operate on them, and tram tracks can be built separately bypassing road traffic altogether.

Upgrade your existing roads with bus lanes or tram tracks to provide public transport for your citizens

Walkable areas in the city can be created using the pedestrian street along with the pedestrian path and bridges. The pedestrian street prohibits all other vehicular traffic except for service vehicles and delivery trucks bringing resources to local businesses.

Put pedestrians in focus with pedestrian roads or paths with multiple pedestrian bridge options

In Cities: Skylines II the intersection system has been overhauled to use easier placement rules. The game features a collection of premade intersections, which can be placed in empty areas or over existing roads, connecting the intersection to the existing road network automatically. The premade intersections include complex highway intersections as well as premade transition pieces that can be placed between highways and regular roads.

Place a premade intersection or build your own

A brand new feature in road building is roundabouts, which are built on existing intersections simply by selecting the preferred size and placing it on the intersection. There are multiple different size options from small suburban roundabouts to large roundabouts fitting multiple lanes. The placed roundabout adopts the lane configuration of the connecting roads, adjusting the lanes to suit all exits. The vehicles follow roundabout traffic rules when entering and exiting the intersection.

Roundabouts come in 4 different sizes

[h2]PARKING LOTS[/h2]
Vehicles have to park somewhere when citizens aren’t driving them, and in Cities: Skylines II this is handled through designated parking lots and parking structures. In addition to traditional roadside parking, you are able to provide the citizens with parking lots and parking facilities. When citizens plan their way around the city, their decision-making is affected by the availability of parking in a manner similar to public transport options.

Citizens have different preferences regarding time management, comfort levels, and usage of money; some want to find a parking spot as close as possible regardless of the cost, while others are willing to spend more time walking from a faraway but affordable parking spot or public transport stop. The Roads Infoview shows the availability of parking in the city as well as its usage level, allowing you to make decisions based on the information. Maybe your city needs more parking lots, or perhaps additional public transport options are in order.

Parking lots and parking garages provide your citizens with places to park

[h2]ROAD MAINTENANCE[/h2]
Other expanded road-building options include the Road Maintenance Depot, which sends out vehicles to keep roads in good condition, fighting wear and tear and decreasing the chances of traffic accidents. During winter, snowplows are deployed to keep the roads clear of snow.

The Roads infoview shows data about the condition of the roads, coloring them from green (good condition) to red (poor condition). Poor road quality or excess snow can slow down traffic and cause traffic jams. Road conditions also affect the chance of traffic accidents occurring, which halt traffic and cause gridlocks until they are secured and cleared. Road Maintenance takes care of these traffic accident aftermaths, clearing out the debris and allowing traffic to continue safely after the police have secured the site of the accident.

Road Maintenance Vehicles and Snowplows keep your roads in pristine condition

[h2]ADDITIONAL ROAD OPTIONS[/h2]
You can also place and remove traffic lights, crosswalks, add stop signs, and control turn lanes directing the flow of traffic. Too many pedestrians cross a busy intersection? Remove crosswalks and build a pedestrian overpass circumventing the vehicle traffic!

Roadside decorations are no longer separate road types but tools that add or remove the decoration features from the roads, which have both a visual and a mechanical effect. Sound barriers can be added to highways to decrease the noise from high-speed traffic. Wide sidewalks create more space for pedestrians but remove roadside parking. And Trees can be added to the sidewalks to control the noise pollution in residential areas - or just beautify the roadsides! Road features can be easily removed by clicking the right mouse button when hovering over the additional road feature.

Control which options your roads should have

That concludes this first development diary focused on the new and improved road tools. We’re excited to hear your impressions and see the city layouts and intersections you build with the new tools! Which road features are you looking forward to? Let us know below. And don’t forget to check back next week where we discuss how citizens and vehicles make their way through your city.


Coming October 24 2023 I Pre-Order Now I Cities: Skylines


[previewyoutube][/previewyoutube]
If You Can Dream It, You Can Build It! 🏗️


Create and manage your own city without restrictions. Offering a deep simulation and a living economy, Cities: Skylines II will challenge your decision-making skills and allow you to build the cities of your dreams. Get ready for a new epic scale in the most realistic city builder - ever.
Here your city will evolve and react to your decisions.

A dynamic and ever-changing world that is both challenging and rewarding. Use your creativity and strategic planning skills to grow your city into a thriving metropolis that will attract businesses, residents, and tourists alike.

From residential neighborhoods to bustling downtowns, the possibilities are endless. Navigate through the complexities of running a city and keep up with the needs and demands of your citizens.

See your city grow and transform over time. With stunning graphics that are as beautiful as they are detailed, Cities: Skylines II will bring your city to life.

[h3]Coming October 24 2023🏗️ [/h3]


Set your City apart with 9 Unique Buildings based on famous landmarks from around the world. Included is also a map, based on the geography of Tampere, home of Colossal Order.

https://store.steampowered.com/app/949230/Cities_Skylines_II/