SimCity Traffic, Under the Hood - Explained | General | Forum

 
You must be logged in to post Login Register


Register? | Lost Your Password?

Search Forums:


 






Minimum search word length is 3 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

SimCity Traffic, Under the Hood – Explained
Read original blog post

No Tags
UserPost

3:13 pm
March 25, 2013


quill18

Ontario, Canada

Admin

posts 559

The offcial SimCity blog just made a post explaining the internals of the traffic routing system:

http://www.simcity.com/en_US/b…..ys-traffic

It's pretty simplified, but I suspect that it might still be hard for people to understand so I figured that I would try to distill it even further. I've done  work with pathfinding systems in the past, and for the last couple of weeks I've been studying D*Lite, which is the pathfinding algorithm used in SimCity, and also playing with road networks and such in Unity (hence the latest tutorial on quill18creates).

There are two ways in which the pathfinding system in SimCity differs from how most people "think" of pathfinding in real life.

  1. The pathfinding system works backwards. It starts from the "goal" and works its way to the "start" location.
  2. The pathfinding system is about intersections, not roads. (NOTE: This doesn't necessarily mean ACTUAL multi-way intersections — sometimes road segments can get split depending on how they were laid out. You can see this in game when you are upgrading roads or CTRL-bulldozing them. Sometimes only a certain amount will get selected. This will look like a single road, but is actually several road segments.)

Basically, here's how it works:

When a vehicle is at an intersection, it looks at all other connected intersections and asks: How close are you to (this thing I want).  Each intersection then replies and the car picks the one with the lowest number.

Note that at NO POINT does the vehicle have any idea what the cost of travelling to that next intersection is.

 

 

For example:

 

 

A car leaves the green residential area in the morning, trying to get to work at the yellow industry.

It will turn NORTH onto segment 5, because the north intersection has a lower number than the south intersection.

It will then go NORTH onto segment 6, because the next intersection on that route has a lower number (60) than the one on segment 4 (110). It doesn't matter how much traffic is on segment 6, because the next intersection Is truly and correctly 60 away from the industry.

 

Now let's look at the next example, in which segment 6 is split into two by the addition of a little dirt road intersection:

 

 

 

The previous intersection still has a weight of 60 (which is correct). However now, because of the traffic, the mini-intersection in between 6 and 7 has a very high weight, which means that our car will now take segment 4 (I am 110 away from industry) instead of segment 7 (I am 560 away from industry).

Using this information, we can DRAMATICALLY improve our traffic. Again, as mentioned above, this doesn't mean that we literally need to add intersections (which slow down traffic in their own way) as long as we can force road segments to split.

Expect a video soon!

 


Read original blog post

I'm just a dude with Fraps and too much spare time.

8:59 pm
March 26, 2013


happybob123

New Member

posts 1

quill im glad that you took the time to write this.  happy because it really helped me understand how the traffic worked and when i showed this post to my computer teacher who happens to enjoy a good explanation of stuff like this. he also enjoyed it and made a project that was based on this post.  Laugh

 

thanks again for this,

happybob123

5:11 am
August 24, 2013


firefly2442

New Member

posts 1

Post edited 5:15 am – August 24, 2013 by firefly2442


This paper has a really neat and simple machine learning dynamic routing system that can be easily applied to networks like the one you described.

 "Packet Routing in Dynamically Changing Networks: A Reinforcement Learning Approach"

http://www.cs.rutgers.edu/~mli…..g-nips.pdf

 

Had to register just for this, thought you might enjoy it. ;)

No Tags

About the Tower Dive! Forum

Forum Timezone: UTC 0

Most Users Ever Online: 155

Currently Online:
4 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 3
Forums: 4
Topics: 388
Posts: 3517

Membership:

There are 27348 Members

There is 1 Admin
There are 3 Moderators

Top Posters:

Niicks – 198
Mordius – 168
Briarstone – 125
raynesummers – 103
Smartzach – 98
wbmc1 – 72

Recent New Members: Mattson, themarbleguru, acentriatech, vipin12345, Daisy221, Silden

Administrators: quill18 (559 Posts)

Moderators: AnimeHero (263 Posts), Jay Is Awesome (155 Posts), Demonac (59 Posts)



 
Go to Top