• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

SimCity Traffic and AI is broken, Sims are fake

Alright, I have a moral dilemma, GAF. My UPS package finally showed up - 9 days late. They've already refunded me for the missing package, but now I have it in my hands. Do I appease the karma gods by letting Amazon know and send it back, or do I fall into temptation and sleep with the EA devil for free?

Free herpes is still herpes.


Go for it. If you can live with yourself :p
 

mavs

Member
Alright, I have a moral dilemma, GAF. My UPS package finally showed up - 9 days late. They've already refunded me for the missing package, but now I have it in my hands. Do I appease the karma gods by letting Amazon know and send it back, or do I fall into temptation and sleep with the EA devil for free?

Would you want it to fall into someone else's hands? This must be your burden to bear.
 
Are people really asking for a game to run an agent for every citizen when there are 200k+ citizens in a city? I'm sure that'll have low system resources. No game I've ever played keeps track of the routines of 200k NPCs at the same time.

didn't simcity 4 rush hour do this? you could click the route query on any building and see all the workers that left or arrived there. it was in the background and the actual visual representation of the sims was fake but i think they modeled consistent homes and workplaces for sims. thought it was pretty cool.
 

Rubius

Member
Would you want it to fall into someone else's hands? This must be your burden to bear.

No one must have this kind of power.
RaidersoftheLostArk.jpg
 

Thraktor

Member
Yeah, if thats true then they should have probably just stuck with whatever actually works, instead of making a computational experiment for people paying $60 for a game which expect it to WORK, and not just be an admirable effort.

Besides, there are many smaller things they COULD have done, but didnt. (Like having workers go to random free houses, not just the nearest one) to alleviate these kind of traffic problems. Its all pretty apparent that they didnt release the game in a decent state.

I guess I'm just a bit tired of developers and publishers "sticking with whatever works". I'd much prefer a flawed attempt at something genuinely new than a remake of SC4 with nicer graphics.

I've been thinking about this too, and I think you're overstating the required complexity a bit though. The difference between academic models and a game model is that academic models aren't going to be able to approximate behaviors in ways that save computational power like you can in a game, since they require accuracy.

For example, pathing. If sims were given a home and a place of employment they would only need to calculate pathing once initially, and subsequently when any changes to the road/transport network occur. There's no need to calculate it every time if the Sim has a starting point and ending point that are constant. The difference being that in an academic model, when a sim ran into regular traffic they would alter their pathing to try to save time, which would require much more frequent path calculations. In Sim City there's no need for that.

So you effectively cut down the time pathing is calculated for sims from constantly running to only running when the portion of the network they utilize changes. That leaves you time to simulate all of the other issues, such as property demand, happiness, etc etc. There's no need to run an extremely complex simulation on a game, when approximating behavior would have been more efficient for the context.

The problem is that they didn't implement either approach appropriately.

Non-Euclidean graph? What's that?

Also, no, it's not hard to do. You have a table of entries that you update every time you place a new road, or when a new building appears. Then the game finds all the optimal ways traveling from that place to all other places. And build it so that when you know how to get to your neighbour with the fastest route, you can use his fastest routes entries to get everywhere (which will use his neighbours' neighbours' route). Use weighted numbers for road-capacity, solve loop problematics, do special cases for intersections, et voila.

If you want to simplify it further, have a "prefered" cluster of industry and shops that that sim will want to go to, as not to map all work and shops in existence.

The sim needs to know where he's going when he leaves the house, and he can look it up in his transit table. You don't need to calculate things when people are moving, you just need some memory to store it for everyone.

A Euclidean graph is a graph of points on a plane which satisfies the Euclidean axioms. Most pertinently for path-finding algorithms and heuristics, all Euclidean graphs satisfy the triangle inequality, which roughly states that the direct path between two points is shorter than any indirect path. Assuming the triangle inequality is satisfied allows you to make quick, effective pathfinding routines, as you can easily disregard a huge number of nodes and edges.

The issue in this case is that when you take traffic into account, the triangle inequality doesn't hold, because direct paths may be clogged up, and hence become slower than indirect paths (which is precisely what this video posted in the OP about "abysmal pathfinding" is all about). Not only does this make writing effective pathfinding routines a lot more difficult, but because traffic is necessarily dynamic it also means you can't just pre-compute a big table of paths, and you have to do them all in real-time.

When doing pathfinding over non-Euclidean graphs, you can either be quick or be accurate, and the accurate choice (the A* algorithm) isn't an option when you're calculating this many paths over this many nodes in real-time. As such, it's inevitable that there are going to be some inefficient paths chosen now and again. I'm sure Maxis will tweak the pathfinding routine to eliminate some of the most obviously illogical paths, but people are expecting the impossible if they want sims to take a perfect path every time.

That's great, but in the end, it is still a sequel to a franchise that has delivered quite admirably with statistics-based methods and the cure is worse than the disease. Esp since if I understand you correctly, the scale of a genuinely 'realistic' agent-based model of a city would overwhelm home PCs for decades to come.

I won't restate my reply to Toma, but I will say that an agent-based city simulation can actually achieve that phrase that's long been an unfulfilled buzz-word of the industry; emergent gameplay. The old style of top-down statistically based simulation only reacts to the strategies that Maxis have programmed it to react to, and it only reacts in the exact manner in which Maxis intended. As much as I love the old Sim City games, there's rarely a sense of surprise in what you can do and how the game reacts to it, and bottom up agent based simulation changes that completely, allowing the game to respond in an almost infinite number of ways.

Ironically, a lot of what people are calling "broken" are actually examples of emergent gameplay, being strategies and techniques that the developers didn't explicitly program the game to respond to. They're just emergent strategies that people don't particularly like, or they feel unnatural in the context of a city simulation. Post-launch updates should eliminate some of the more bizarre strategies (such as the long snaking road), but I'm happy that the game, even as it is, is capable of surprising and challenging players in a new way for the series.
 
Ironically, a lot of what people are calling "broken" are actually examples of emergent gameplay, being strategies and techniques that the developers didn't explicitly program the game to respond to. They're just emergent strategies that people don't particularly like, or they feel unnatural in the context of a city simulation. Post-launch updates should eliminate some of the more bizarre strategies (such as the long snaking road), but I'm happy that the game, even as it is, is capable of surprising and challenging players in a new way for the series.

http://www.youtube.com/watch?v=VVPk1aK7BUA

revolutionary new emergent gameplay
 

Septimius

Junior Member
A Euclidean graph is a graph of points on a plane which satisfies the Euclidean axioms. Most pertinently for path-finding algorithms and heuristics, all Euclidean graphs satisfy the triangle inequality, which roughly states that the direct path between two points is shorter than any indirect path. Assuming the triangle inequality is satisfied allows you to make quick, effective pathfinding routines, as you can easily disregard a huge number of nodes and edges.

The issue in this case is that when you take traffic into account, the triangle inequality doesn't hold, because direct paths may be clogged up, and hence become slower than indirect paths (which is precisely what this video posted in the OP about "abysmal pathfinding" is all about). Not only does this make writing effective pathfinding routines a lot more difficult, but because traffic is necessarily dynamic it also means you can't just pre-compute a big table of paths, and you have to do them all in real-time.

When doing pathfinding over non-Euclidean graphs, you can either be quick or be accurate, and the accurate choice (the A* algorithm) isn't an option when you're calculating this many paths over this many nodes in real-time. As such, it's inevitable that there are going to be some inefficient paths chosen now and again. I'm sure Maxis will tweak the pathfinding routine to eliminate some of the most obviously illogical paths, but people are expecting the impossible if they want sims to take a perfect path every time.

I agree. I also feel that congestion-avoidance is the least of our problems, as the absolute atrocity of this algorithm is that it doesn't weight distance of a road based on road type, but I think that's because the glass engine is over-simplified, in that a car is the same as sewage, and electricity is the same as a car. Cars need to follow weighted roads. Electricity doesn't. Well, it does, by the path of least resistance, but that's much simpler math, if you'd implemented electricity as electricity. And sure, I don't really need them to. But cars need to act like that, and the two biggest flaws in the way all agents work right now is that they don't claim a sink they set out for when they set out for it, and cars don't choose paths based on weighted distance.

With those two, even with no congestion avoidance, I could lay out my city in a way that would make sense, and not one that plays to the poor implementations they have done.

Ironically, a lot of what people are calling "broken" are actually examples of emergent gameplay, being strategies and techniques that the developers didn't explicitly program the game to respond to. They're just emergent strategies that people don't particularly like, or they feel unnatural in the context of a city simulation. Post-launch updates should eliminate some of the more bizarre strategies (such as the long snaking road), but I'm happy that the game, even as it is, is capable of surprising and challenging players in a new way for the series.

Emergent would be when you build computers in Minecraft. SimCity is not emergent as much as it requires you to fall into line of poor systems when making your system. Emergent game-play to have 500 cop cars blocking an avenue? Color me depressed.
 

Septimius

Junior Member
Are people really asking for a game to run an agent for every citizen when there are 200k+ citizens in a city? I'm sure that'll have low system resources. No game I've ever played keeps track of the routines of 200k NPCs at the same time.

I've checked the config files. They do set a lot of settings statically based on hardware. Why not just set the amount of simulated sims and the fudged number function according to how many sims your system can actually handle? If you have an i7? Here, have 200k sims. If you have an old CPU? Here, have 20k sims and a lot of fudged sims.
 

Dead Man

Member
I've checked the config files. They do set a lot of settings statically based on hardware. Why not just set the amount of simulated sims and the fudged number function according to how many sims your system can actually handle? If you have an i7? Here, have 200k sims. If you have an old CPU? Here, have 20k sims and a lot of fudged sims.

I don't want any sims. I want it to be a simulation of a city, not a simulation of 20,000 sort of simlike agents that are not realistic in the slightest. If a fire breaks out, decide whether the engine gets there quick enough using algorithms, then render it. I don't want micro level events jamming up the works in a city simulator.
 

beat

Member
Yeah, what Dead Man and Septimius said.

This game as it is now is exhibiting emergent behavior. Specifically, the kind we don't want. By modelling citizens as agents no more clever than water flows in pipes, you get a city model that does not behave like real cities. To make Sim agents behave more like real people would likely require a lot more rules, and even then you're constantly fighting unintended and unrealistic behaviors.

The old style of top-down statistically based simulation only reacts to the strategies that Maxis have programmed it to react to, and it only reacts in the exact manner in which Maxis intended.
But the way (that I gather) high density zoning only works when next to high density roads is a top-down rule (discussed more heavily in the "It's a shame SimCity is stuck in the 1950s" thread). They still have top-down rules that enforce a rather constrained certain vision of how cities are run, and then the bottom-up rules that drive SimCitizen behavior are uncompelling. A Sim finds the nearest non-filled job every morning afresh? Then finds the nearest non-full home after work? "Shopping" can be fulfilled just by going to the park... and while it costs no money to do so, a Sim can't go in without at least having a dollar?
 
Top Bottom