SimCity - GlassBox at work





Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on Mar 12, 2013

Glassbox at work in the new SimCity. Note how all the cars as they leave work attempt to go to the one house at the end of the dead end street because it is the closest home with an open resident spot. Forget the fact that tens of cars try to fill that one spot. Once the spot is filled, newly created cars will head directly toward the larger residential area, but cars already created will head the entire way along the road before they turn around and reroute.

Reddit discussion: http://redd.it/1a6rj0

UPDATE: After looking at the glassbox slides from the GDC (http://www.andrewwillmott.com/talks/i...) it appears that the agents are slightly more intelligent than I had originally given them credit for, although it also means that a solution to the problem may be even more difficult.

Based on my reading of the slides regarding pathing, when an agent is created it is not assigned a particular destination, but rather just looks at all the nearest "vertexes" (in this case, intersections), and heads to the one that it calculates as lowest cost. It appears that cost is a function of sink size (i.e. capacity of the home/homes that are in that direction) and distance to that sink or other vertex (other intersection).

Let's say for instance that there is a 0/200 home. That gets a score of 1 (remember, lower is better). There is also a 5/6 home, that gets a score of 50. There is an intersection that is near the 0/200 home, let's say it gets a score of 5 because of the distance from the 0/200 home. There is another intersection near the 5/6 home, that gets a score of 55. Now there is an intersection that is close to the "55" intersection and far away (but still connected) to the "5" intersection. The path toward the "5" intersection is given a score of 100, while the path toward the "55" intersection is given a score of "60".

Therefore, every agent reaching the intersection will head toward the 5/6 home, because its score of 60 is less than the score of 100 for the other area. At some point the first agent finally hits the 5/6 home and fills it up. Now the "55" intersection toward the smaller home no longer has a score (or is given a very large score) because it has no capacity in that direction. The intersection we were previously looking at now sees only one viable path, and cars now start heading toward the 0/200 home.

The issue is still that a large number of cars may already be heading toward the now full home because they already passed the intersection. The other issue is that the time to propagate the new higher/infinite score through the transportation network (i.e. roads) is not instantaneous, so even after the home has been filled you still see cars heading toward the full house.

The other issue is that a system of calling "dibs" on a sink is not possible, because the agents don't actually know their destination, they just are going toward the lowest number at each intersection. While that enables much easier processing (you only have to calculate the weights for a given agent type once per "tick" rather than per agent per tick), it means that I can't think of an easy solution to the problem.

It does probably mean that the fact that the route to the single house in my example is several times shorter than the route to the large residential block is significant. I would imagine that if the route to the residential block is 5-10% longer than the route to the single house (instead of 2-3 times as long) that the cars would choose the longer route to the area with more capacity first.


When autoplay is enabled, a suggested video will automatically play next.

Up next

to add this to Watch Later

Add to

Loading playlists...