Development Diary #3 – Traffic & Pathfinding

Hello and welcome to Development Diary #3 for Metropolisim. I am really thrilled to be writing this and to be able to share new information about the game with you. I’d like to once again thank you for following and supporting the game. A special thank you to everyone who has Pre-Ordered the game. It is amazing to see the reception the game has already received even in it’s early stages. I am eager to show you as much as possible in the coming months as we move towards Early Access release.

Today I am going to be covering a lot of in-depth information surrounding the traffic and pathfinding systems in Metropolisim. For those who have been following my development diaries you will know that initially I planned to have a narrated gameplay video uploaded to YouTube to coincide with this post. However, I just haven’t had enough time to make that video. Since I have been seeing a lot of anxious fans awaiting more information on the game I decided to go ahead and post this diary today and continue to work on the video which will be released in the near-future.

The good news is, although I wasn’t able to create the narrated video in time for this post, I still have several gameplay videos embedded throughout this diary, including first looks at city traffic in action. Hopefully this is as exciting for you to see as it is for me to share! Without further ado, let’s go ahead and jump right into it.

Fast and accurate pathfinding, in my opinion, is one of the core foundational elements of a city building game. Traffic impacts almost every other system in the game and is incredibly important to get right but also incredibly difficult to get right. In order to simulate millions of living citizens with real lives that include families, jobs, and leisure interests each of these citizens need to be able to move around your city from point A to point B in a believable manner and on a schedule that makes sense. Traffic systems are a constant source of feedback for the player as the cars zoom to and from their destinations so getting it right is incredibly important. If paths take too long to create, are not accurate, or traffic behaves in a nonsensical manner it can break immersion and result in poor gameplay.

I have spent a significant amount of time creating the traffic and pathfinding systems for Metropolisim and I am very happy with where these systems are. With that said, the game is still in a pre-alpha state so I am continuing to work on fixing bugs and adding features and functionality. I have lots more planned to add as the game moves into Early Access and beyond.

In this Development Diary I am going to cover some of the points I think the community will be most excited about but keep in mind there is lots more still to share in the future.

#1 – Traffic – Rush Hours

Let’s start off with a bang. I’ve had the question posed to me multiple times – “will there be rush hours in Metropolisim?”

I am happy to say the answer is YES!

Rush hour traffic is a factor in any major real-life city and I am happy to say that rush hour traffic systems will be present at Early Access launch of the game. No mods required.

Dynamic traffic that changes throughout a normal 24-hour cycle was something I knew I wanted to have in the game from the beginning. Since citizens are all fully simulated and are constantly evaluating a set of priorities to make decisions about how they should behave it is a must that their travel cycles change throughout the day.

Each citizen of working age in your city who is able to find a job will need to commute to and from work using one of the many transportation options. These could be from anything to walking, driving, or using public transportation. Each citizen will have a maximum tile distance they are willing to commute to work, so don’t expect them to be willing to drive four hours each way to and from work. In addition, each transportation option will have a number of factors that influence the maximum distance a citizen is able to use that option. Citizens will not walk more than 20 tiles each way to work, and they will not walk more than 15 tiles to a bus stop, for example.

Careful city planning will be necessary to lay out your communities in the most efficient way possible to ensure citizens are able to use the most effective methods to reach their place of employment or leisure activities. Minimizing the use of cars will be important as you progress into the later stages of the game and begin to have higher density buildings appear. You’ll need to get as many citizens as possible to either walk or use public transportation when moving through the city to reduce traffic congestion and eliminate traffic choke points and traffic jams.

On a typical weekday you will see spikes in traffic as citizens commute to work in the morning, and then again, likely in the opposite direction, as they commute home from work. You will also see increased traffic on the weekends as citizens head off to enjoy leisure pursuits like going out to eat, to the movies, or to the park. And of course, late at night, traffic will wind down as your citizens get nestled into their beds for the evening.

What this means to you is increased usage on roadways at peak times depending on citizen desires, and depending on your city layout and the paths citizens choose to reach their destinations. So expect traffic jams and unhappy citizens if you don’t plan your road networks accordingly.

Excited yet?

#2 – Traffic – Actual Destinations, Real Paths

As I alluded to above one of my main goals with the traffic and pathfinding systems is to make the traffic behavior as close to real life as possible. That means full pathfinding and true routes for each citizen in the game. Every citizen and vehicle you see on the screen is moving along an actual path with intent to reach and objective for a purpose. You will not need to investigate charts or look at data overlays in order to understand how traffic is behaving in your city. You can simply look at what is happening on-screen. When you see a car driving on a road you will know that it is a real citizen with a real objective and not simply a randomized vehicle there to make you think there is traffic on the road.

But before you ask, I will still be providing lots of data, charts, and overlays for you to dig into as much as you’d like. Combined with the on-screen traffic you will be able to make informed decisions when deciding how to lay out your road networks whether you are getting ready to zone new communities or need to make improvements to alleviate congestion within existing communities.

#3 – Traffic – Full City, Fully Simulated

Another way to make the traffic as realistic as possible is to constantly be handling traffic throughout your entire city even when you aren’t observing it. In other words, just because you aren’t watching a citizen that doesn’t mean they’ve stopped going about their day.

Since every citizen is a simulated agent they’ll still go to school, work, or the park while you aren’t watching. This means you’ll need to continually be evaluating the paths they are taking and which roads they are using to ensure traffic is able to flow as smoothly as possible and citizens are able to reach their destinations in a fast and orderly fashion. No neighborhood is immune to traffic issues, so you’ll need to continually review each section of your city.

Too much time stuck in traffic will result in longer commute times and lead to unhappy citizens. Unhappy citizens will negatively impact a lot of things in the game from mayor rating and land value to the quality of businesses looking to move into your city.

#4 – Traffic – Lane Usage
This is another one I’m really excited about. A common complaint from other city building games is vehicles using lanes in ways that don’t make sense. In Metropolisim I have spent a significant amount of time developing logic to help your citizens make correct decisions regarding lane usage. It can be incredibly frustrating to watch vehicles all lining up in one lane while there are other options available. Vehicles in Metropolisim follow dynamic paths that understand the best lane to use based on each step in the path.

For road types that have more than one lane traveling in each direction citizens will follow paths that take them into the correct lanes depending on if they are going straight, left, or right at the next intersection. You will not have to deal with all citizens using one lane and creating needless slowdowns or traffic jams regardless of which way they are going. Right now none of the roads in the game have specific turn lanes, but I am still in the process of exploring turn lanes and how to best implement them to even further segment traffic on roads in a more efficient manner. More to come on this.

There are a number of different road types in Metropolisim with different lane compositions. Everything from two-lane streets to four-lane avenues to six-lane highways. You will see behavior that makes sense from your citizens as they move along their paths utilizing these different road types.

#5 – Traffic – Intersection Types & Settings

Yet another exciting feature I think you’ll appreciate. In order to manage your traffic more efficiently you will have the ability to change a number of variables for each intersection in your city. These variables range all the way from the actual type of intersection itself down to the timing and pattern of the traffic lights.

When they are constructed each individual intersection type will have a default “type” depending on the expected traffic volume on that road type. Examples of these include:

  • 4-Way Intersection with Traffic Lights
  • 4-Way Intersection with Stop Signs
  • T-Intersection (cross-traffic does not stop)
  • T-Intersection with Stop Signs
  • etc.

These intersection types can be changed at your discretion to whatever you require to manage your road networks and to ensure the best flow of traffic through your city. Initially a quiet residential street may be best served by a 4-way intersection with stop signs. This will ensure residents don’t have to wait too long when there may be very little traffic on the street. As that street grows over-time it may be re-zoned for medium or high-density residential. Once larger buildings begin construction there will be an influx of additional traffic. At that point you may want to change the intersections at each end of the street to be 4-way with traffic lights to better control the flow of traffic on the street.

Additionally, through inspecting the road type and bringing up the intersection panel you will be able to change the timing and pattern of traffic lights. This will be useful if you observe a street that has a significant amount of traffic flowing in one direction but not the other. If you have more traffic going north/south on a street than east/west you can set the traffic light to remain open for north/south traffic for twice the amount of time it remains open for east/west. This increased amount of time for traffic traveling north/south to flow through the intersection will alleviate potential traffic jams.

This is just the tip of the iceberg when it comes to the level of detail that will be present in Metropolisim when it comes to intersection management. Hopefully this gets you thinking about all the exciting possibilities. More to come in the future.

#6 – Traffic – Speed Limits & School Zones
Each road type will have a default maximum speed value at time of construction. These values can be tweaked within a clamped range of values to allow you to directly impact the flow of traffic within the city. However, keep in mind that faster traffic creates more traffic noise which directly impacts the happiness of citizens living on the streets you are modifying. So while you may be decreasing commute times for citizens who commute along those roads it will be important not to attempt to zone medium or higher wealth on high traffic and high-speed-limit streets as these citizens will quickly become unhappy.

Another feature I’d like to highlight to show just how in-depth I am going with traffic speed management is the implementation of school zones. Just like in real-life, schools will require cars to slow down as they pass by in order to protect the increased number of child pedestrians who will be present in the area surrounding the school. So plan accordingly. Probably best not to zone a school directly on an Avenue for example, as this slowdown on a main avenue will lead to increased commute times and unhappy citizens.

#7 – Traffic – Emergency Services
Just like in a real city emergency services should take priority over regular vehicles instead of getting stuck behind them. In Metropolisim police cars, fire trucks, and ambulances will cause vehicles in front of them to yield to them by moving to the side of the street allowing the emergency vehicle to pass by unimpeded when possible.

However, this will not be possible on congested roads or roads that are experiencing traffic jams. This is because other vehicles will not have the ability to move out of the way of emergency vehicles due to not having space. Another reason it is important to keep your traffic situation under control. If your emergency vehicles are not able to reach their destinations quickly it can lead to fires spreading, crimes escalating, and citizens dying. This can lead to a cascading amount of negative impacts on your city including everything from citizen unhappiness, to building destruction and abandonment as well as draining your budget.

#8 – Pathfinding – Shortest Path vs. Fastest Path
One of the things I’m most proud of concerning the pathfinding algorithm in Metropolisim is how it determines which is the best path for citizens to use for each of their routes. One critical aspect of this is the differentiation between “shortest path” and “fastest path”. Here is a definition of each:

  • Shortest path – Least amount of tiles between start point and end point
  • Fastest path – Most efficient route based on a number of factors including road types traveled and amount of tiles between start and end point

At first glance you might think that the shortest path is the best path but in the majority of cases it actually is not. An example of this would be traveling along a street vs. a highway. On a highway vehicles are able to travel at a higher rate of speed and with limited or no intersections which cause them unnecessary stops. On a street vehicles travel slower and are forced to stop at each intersection along the way.

Now imagine a scenario where a highway and street are running parallel to each other separated by five tiles and a citizen is attempting to travel 100 tiles from south to north on one of those road types. When the pathfinding logic is evaluating the options and trying to find the best path between either the street or highway it should be intelligent enough to know that highways are a more efficient means of travel. I accomplish this by assigning each road type a weight and performing calculations to return a value cost for each path option. The end result of this is that even if the street is closer to the starting point of the path the pathfinding algorithm will understand that it can simply travel 5 tiles further west and get on a highway to proceed the 100 tiles north that is required for the citizen.

This results in much more believable and realistic pathfinding and traffic patterns as citizens will prefer to use highways, avenues and one-way roads instead of surface streets.

I’m so excited about this.

#9 – Pathfinding – Route Views

Finally, I’d like to talk about route views. In Metropolisim you have the ability to see the route any citizen is on at any time simply be inspecting or querying the citizen as they move through the world. Just two clicks of the mouse will get you into their Citizen Detail panel and then to the ‘Show Route’ button. This will draw their path on the screen.

This gives you the ability to get detailed information about the citizens who are using your roads, what they are using them for, how long it takes for them to reach their destinations, and how they are contributing to the overall traffic patterns in your city. This tool can be incredibly powerful as a Mayor and it also adds a level of depth and realism that I feel is really fun and exciting.

#10 – Conclusion

If you’ve made it this far thank you for reading all of this. As I’ve said numerous times I remain excited about the future of this game and committed to my vision of creating the most deeply complex city building game available for Windows, Mac, and Linux. We are inching slowly closer to Early Access release later this year but I believe me when I say I have many years of content planned for Metropolisim. New content will not end when we enter Early Access or even after 1.0 release.

If you haven’t already please consider Pre-Ordering Metropolisim. 

Thank you again for your support. Signing off for now.

-Roy

14 Comments

  1. I just want to let you know that I check your website almost every week in hopes of more updates. I’m extremely excited about this game and the depth at which you are exploring the city builder genre. Keep up the amazing work.
    I can’t wait to play this game!

  2. Dude this is going to be epic. I haven’t been this excited for a game in years. Day 1 purchase.

  3. Sounds like the perfect morph of Simcity 4, Simcity 2013, and Cities Skylines. All had limitations and issues when it came to traffic agents, but it seems like your goal is to fix those limitations. I love it! Keep up the good work. I hope you take those same ideas for commercial and industrial agents as well. Make them dependent on each other for businesses/industry to run smoothly. Residential, commercial, and industrial should all work together in harmony.

  4. Jacob is ready to start testing. So can you move this along a little quicker. Shoot

  5. I really like your writing style, wonderful info, thanks for posting :D. “In every affair consider what precedes and what follows, and then undertake it.” by Epictetus.

  6. Combine this detailed way of building, the possibility of uploading other buildings and customization and put in a strong political generator that exceeds SimCity 4 (putting proposals through a city council, elections even…) and you will have a game with very high potential.

  7. Good Day, just found your game/site. I have to say in reading the available posts, pretty excited. I do have a question though and forgive me if I just missed it in another post. How do you plan on handling scale? Something that has always bugged me a bit with city builders is scale and to be fair I understand you have to consider system and game limitations but for example… residential single family homes produce maybe 2-5 citizens and a couple of cars. They also tend to take up a bunch of space. But then jump to say higher density residential buildings. A building that takes up the same land mass as maybe 10-15 single family homes might house hundreds of people sometimes more, producing hundreds of cars. Games in my experience dont provide adequate parking lot space required and dont generate the amount of cars and citizens a building such as this might (except maybe in an arbitrary population counter). A handful of these high density buildings in real life can generate a traffic nightmare by themselves (school, work, shopping) but seldom do. Again to be fair seeing as many city builders struggle with creating meaningful traffic behaviors (something I’m excited to see you tackling) I understand why they dont bother to scale these things. Just curious as to if you’ve got a unique approach to this. Again all this asked in a positive light, very excited to see what you have planned. Thanks

  8. metropolisimer1000

    Hi! How many tiers will each zone have? I’m wondering because I want to know how big they’ll get. Also, how tall are the skyscrapers going to be, and how many different building models will there be? I’m extremely exited to buy the game in November (or whenever you happen to release it)! Thanks so much for going alone in the world of simulation for the benefit of us players!

  9. Joaquin Josue Santana Batista

    will you include roundabouts and restricted traffic areas (like can only pass residents or for example a certain vehicle category) they are called ZTL in taly?

  10. Parking would be great to simulate, including garages and street parking.

    • Hey there. That is on the roadmap. The initial release isn’t going to have it (not enough time) but I have plans for a very robust parking system where every citizen car owner will need to have a place to park their car if they own one. Parking garages, street parking, underground parking, with citizens being willing to walk certain distances to park their car but not unlimited distance. Then different ordinances, events, and decisions the player can make regarding how to move the needle on the amount of cars in their city encouraging use of mass transit instead if traffic and parking capacity become an issue. Really excited about this, just need time to get to it.

  11. Wow. I’m impressed with your ambition level for this game and I really hope you manage to take it all the way. Question: Does the simulation mean that traffic will avoid traffic jams as well? In your example above the highway will be the best option as long as there’s no traffic jam on it, if there is a severe traffic jam the “cost” will/should go up and some traffic will instead choose the street to get around the congested point.

  12. It is so cool to see how much detail you are putting and are going to put in traffic/traffic management. I, personally get city building games not just for building the cities but I love to watch traffic flow and move around, like watching intersections and seeing how I can change and develop them. I do really hope to see some form of road editor where you can actually add turn lanes or made roads larger with parking spots, etc. Traffic islands with maybe a way to customize traffic light fixtures in intersections or just a more complex traffic/ road management system would also be a great feature. However, I as a non-game maker doesn’t know how difficult it is to design something like that so if your game did not have that in the future, I would still be extremely happy with what you are already planning and no matter what I am going to buy this game ASAP as soon as it releases. Good luck with making this whats going to be an incredible game for the city-building genre.

Leave a Comment

Your email address will not be published. Required fields are marked *