• 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.

Paranoyd

Corporal
Apr 6, 2015
37
24
Why are these residents so dense? I have built "downtown" zones with 3 highways connecting them, 2 large roads and plenty of surface streets that lead to, in around and out of the areas. In other words, there are over half a dozen options commuters have, in order to get to work. Common sense would dictate that people see traffic and they change course to a less busy route, like most normal people do. Not these guys though!!

I like making realistic cities and districts, modeled largely after New York City, where I was born and raised. Highways are not efficient cookie cutters in that city and traffic is a way of life. But... people don't grow old and die over the course of a single commute like they do in this game. Traffic gets spread over every surface street, highway and secondary way in to the city during rush hour. Cities Skylines fails at recognizing this though. I have had tens of thousands of cars back up a single highway and gridlock and entire city because these little idiots only take one single route in the same lane of traffic to their destinations.

Is there a way to make them figure this out before they leave their houses and not all hive-mind their way down the exact same route to the same general downtown district?
 

prismaticmarcus

Field Marshal
Moderator
70 Badges
Sep 28, 2014
7.305
11.434
  • Victoria 3 Sign Up
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Empire of Sin
  • Europa Universalis 4: Emperor
  • Crusader Kings III: Royal Edition
  • Stellaris: Federations
  • Europa Universalis IV
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Mass Transit
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Cities: Skylines - Green Cities
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Golden Century
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Stellaris: Megacorp
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Third Rome
  • Cities in Motion 2
  • Crusader Kings II
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines Industries
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Res Publica
in vanilla you have to work with the way the pathfinding works. the citizen/vehicle decides the fastest way to the destination when they leave, but that's based purely on distance and speed limits. they can't 'see' traffic.

and new york city has an extensive subway system, doesn't it? ;)
 

MarkJohnson

Field Marshal
16 Badges
Feb 19, 2015
3.464
716
  • Cities in Motion 2
  • Europa Universalis IV
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Prison Architect
  • Cities: Skylines - Campus
The game uses a GPS type AI system to travel, like you have in your car, except It does not recalculate its route. They could add it, but then it would raise requirements even higher.

This is a game and not real life, so you'll need to make adjustments for the cims to move around.

Cims will walk to work if jobs are within 12 block (~1km) and this will free up vehicle traffic. It helps to balance the jobs:workers ratios to keep cims from driving to another district to work. This game is more about balancing zones than fixing roads.

Freight is the same. If commerce is next to generic industry, and on the highway. Freight can move around very smoothly.

Ironically, cims do plan their routes before leaving the house, it's just it calculates the quickest route. So this route will be common for a lot of neighbors.

You would need a pretty hefty computer for it to calculate a route at every intersection. Which is what you'd need for the traffic to work semi-realistically.

This game can calculate 80k worth of cim routes simultaneously, which can require an eight core CPU to manage effectively. So you can see adding any more AI to the game is going to raise the system requirements a lot.
 
  • 1Like
Reactions:

icedancer

Sergeant
8 Badges
Aug 28, 2014
52
19
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
...

You would need a pretty hefty computer for it to calculate a route at every intersection. Which is what you'd need for the traffic to work semi-realistically.

This game can calculate 80k worth of cim routes simultaneously, which can require an eight core CPU to manage effectively. So you can see adding any more AI to the game is going to raise the system requirements a lot.

There is an algorithm to calculate all routes simultaneously with three extra threads but it takes 3 NxN matrices where N is the number of intersections.
 

MarkJohnson

Field Marshal
16 Badges
Feb 19, 2015
3.464
716
  • Cities in Motion 2
  • Europa Universalis IV
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Prison Architect
  • Cities: Skylines - Campus
There is an algorithm to calculate all routes simultaneously with three extra threads but it takes 3 NxN matrices where N is the number of intersections.

That's great, but what exactly what does that relate to in performance? Especially compared to a more direct GPS system locked path.
 

MarkJohnson

Field Marshal
16 Badges
Feb 19, 2015
3.464
716
  • Cities in Motion 2
  • Europa Universalis IV
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Prison Architect
  • Cities: Skylines - Campus
Each vehicle gets to easily choose the best path at each intersection.

How? You forgot to mention how easy it would be to accomplished with ease. It will be a bigger nightmare. You're asking the game to recalculate thousands of paths continuously at every intersection. The game already will use a full 8 core CPU making just single paths only.

Multiply that by 1,000 minimum and up to 80,0000. Holy cow! You'd need many super computers to accomplish this.
 
  • 1Like
  • 1
Reactions:

icedancer

Sergeant
8 Badges
Aug 28, 2014
52
19
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
How? You forgot to mention how easy it would be to accomplished with ease. It will be a bigger nightmare. You're asking the game to recalculate thousands of paths continuously at every intersection. The game already will use a full 8 core CPU making just single paths only.

Multiply that by 1,000 minimum and up to 80,0000. Holy cow! You'd need many super computers to accomplish this.
Are there really that many intersections. I think not. I would guess 1000 would be pushing it. But space is the problem. Computer time is only one matrix multiply.
 

MarkJohnson

Field Marshal
16 Badges
Feb 19, 2015
3.464
716
  • Cities in Motion 2
  • Europa Universalis IV
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Prison Architect
  • Cities: Skylines - Campus
Not intersections, the game controls up to 80k paths (cim agents) simultaneously on larger cities. Then multiply that per intersection to recalculate each of the 80k cims over and over and over, etc. Instead of once and done.

It would be nice to at least mark hot spot intersections and try to route around them from the start. But that will still take a bit of time and still not be that great. Or even a timer interval to recalculate. Of course, it would likely mean they are already in a traffic jam anyway and be unable to go anywhere.

But this is just a game, so we're left to figuring out the AI behaviors and adjust from there. Most solutions are more to real life than I thought. though and make perfect sense for their perfectly normal behavior.
 
  • 1Like
  • 1
Reactions:

icedancer

Sergeant
8 Badges
Aug 28, 2014
52
19
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
Not intersections, the game controls up to 80k paths (cim agents) simultaneously on larger cities. Then multiply that per intersection to recalculate each of the 80k cims over and over and over, etc. Instead of once and done.

It would be nice to at least mark hot spot intersections and try to route around them from the start. But that will still take a bit of time and still not be that great. Or even a timer interval to recalculate. Of course, it would likely mean they are already in a traffic jam anyway and be unable to go anywhere.

But this is just a game, so we're left to figuring out the AI behaviors and adjust from there. Most solutions are more to real life than I thought. though and make perfect sense for their perfectly normal behavior.
The route calculation take about 6.3GB for 1024 intersections and one 1024x1024 matrix multiply in a separate thread.
Each vehicle does a simple lookup at each intersection.
Doubling the number of intersections takes 4 time the memory and 8 times the MM time.
 

MarkJohnson

Field Marshal
16 Badges
Feb 19, 2015
3.464
716
  • Cities in Motion 2
  • Europa Universalis IV
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Prison Architect
  • Cities: Skylines - Campus
The route calculation take about 6.3GB for 1024 intersections and one 1024x1024 matrix multiply in a separate thread.
Each vehicle does a simple lookup at each intersection.
Doubling the number of intersections takes 4 time the memory and 8 times the MM time.

What CPU time does it take. One thread, does that mean a full core and with HT, Doubling the intersections, will it need 8 more cpu cores.

With the game already using over 6gb of RAM (25 gb memory) This would raise requirements significant for memory alone.

But it's easy to calculate memory, but not sure how you measure CPU usage.

Could this just be added to TMPE? It seems some sort of overhead would have to be added as well?
 

prismaticmarcus

Field Marshal
Moderator
70 Badges
Sep 28, 2014
7.305
11.434
  • Victoria 3 Sign Up
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Empire of Sin
  • Europa Universalis 4: Emperor
  • Crusader Kings III: Royal Edition
  • Stellaris: Federations
  • Europa Universalis IV
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Mass Transit
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Cities: Skylines - Green Cities
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Golden Century
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Stellaris: Megacorp
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Third Rome
  • Cities in Motion 2
  • Crusader Kings II
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines Industries
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Res Publica
The route calculation take about 6.3GB for 1024 intersections and one 1024x1024 matrix multiply in a separate thread.
Each vehicle does a simple lookup at each intersection.
Doubling the number of intersections takes 4 time the memory and 8 times the MM time.
it's not just about intersections, but about nodes as well. roads have nodes in them which are the points at which vehicles change lanes. so that makes the issue a whoooole lot bigger
 
  • 1
Reactions:

icedancer

Sergeant
8 Badges
Aug 28, 2014
52
19
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
it's not just about intersections, but about nodes as well. roads have nodes in them which are the points at which vehicles change lanes. so that makes the issue a whoooole lot bigger
Each lane is not considerd a separate route. That was the big mistake.
Each road segment is simulated separately. The lane picked is chosen according to exit left, right or straight through.
 

MarkJohnson

Field Marshal
16 Badges
Feb 19, 2015
3.464
716
  • Cities in Motion 2
  • Europa Universalis IV
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Prison Architect
  • Cities: Skylines - Campus
Each lane is not considerd a separate route. That was the big mistake.
Each road segment is simulated separately. The lane picked is chosen according to exit left, right or straight through.

Each node is calculated where the cims go. So the AI would be calculating it as well to make the AI more realistic by better using all lanes. i.e. a node is technically counted as an intersection.

Why would counting each lane a separate route be better. it would need to calculate, up to, 6 times the the number of routes to use, and compounded exponentially the longer the route.
 
  • 2
Reactions: