News for hackers. Stuff that matters.
Re:SimCity’s Sims Don’t Seem That Smart After All by JumpCrisscross on Wednesday March 13, 2013 @12:33PM (#5369464)
I am the guy who builds agent-based models for fun. A lesson you learn quickly is that heterogeneity is your guardian angel - varying the path-finding model a little bit from agent to agent hedges against the resonance structures on display here. Additionally, you periodically check the accumulated micros against a macro model and correct gross deviations. Neither step is computationally strenuous.
Re:SimCity’s Sims Don’t Seem That Smart After All by tempaccount9473 on Wednesday March 13, 2013 @12:57PM (#5369596)
If you're the guy that builds agent-based models for fun, why not build an open-source citiy simulation engine? Grafting your simulator with an open-source tile-based graphics engine such as the one used in OpenTTD would make a lot of nerds very happy.
Re:SimCity’s Sims Don’t Seem That Smart After All by egor83 on Wednesday March 13, 2013 @01:13PM (#5369698)
That's something I would be really interested to follow and maybe contribute to, so if anyone shares any pointers or links to existing OSS projects, I'd be very grateful.

Now necessarily city-simulation engine - just routing/pathfinding in graphs would be great.

Re:SimCity’s Sims Don’t Seem That Smart After All by tempaccount9473 on Wednesday March 13, 2013 @01:24PM (#5369770)
The best example of a working and fun open-source routing/pathfinding engine is http://www.openttd.org

It's optimized for gameplay rather than perfect efficiency, but parts of it are quite hackable, including the ability to add custom AIs

Re:SimCity’s Sims Don’t Seem That Smart After All by EvanKelly on Wednesday March 13, 2013 @02:49PM (#5370303)
I just started playing openttd, and am having a great time, though I still struggle with complex rail networks.

Do you have recommendations for AI? I've been using NoCAB, but I'm kind of frustrated with how that AI works, so I almost always play solo games now.

Re:SimCity’s Sims Don’t Seem That Smart After All by duck on Wednesday March 13, 2013 @01:42PM (#5369881)
Thanks for sharing that, I had no idea that existed and I loved TTD!
Re:SimCity’s Sims Don’t Seem That Smart After All by anigbrowl on Wednesday March 13, 2013 @04:22PM (#5370881)
Netlogo is an open tool written in Java for agent-based simulations (and much more), and quite mature, well worth checking out if you are into this sort thing. I always had a down on Logo because when I was a kid it seemed only to be mentioned in the context of turtle graphics, but the implementation here is powerful and reasonably terse.
Re:SimCity’s Sims Don’t Seem That Smart After All by aidos on Wednesday March 13, 2013 @12:54PM (#5369578)
Could you explain a little bit more about how that works - you used words I don't understand :) It seems as though something as simple as a random selection when presented with intersections is better than the behaviour here. I guess there should just be a weight on the streets though, right?
Re:SimCity’s Sims Don’t Seem That Smart After All by carlob on Wednesday March 13, 2013 @01:05PM (#5369640)
Let me translate this to physics talk for you: when you use a greedy algorithm with no interaction between agents and no randomness, it's effectively like bosons at zero temperature, they will all fall in the lowest energy state and form a Bose-Einstein condensate.

This can be avoided in one of two ways, make them aware of each other, so that they can't all be in the same state (like fermions) or raise the temperature, i.e. add randomness. Probably you'll need to do both and find an energy function that's less retarded than choose the first branch you see…

Re:SimCity’s Sims Don’t Seem That Smart After All by skore on Wednesday March 13, 2013 @08:06PM (#5372090)
Apologies for going meta, but - Only on Hacker News will you see a "simpler" explanation involve the mention of Bose-Einstein condensate.
Re:SimCity’s Sims Don’t Seem That Smart After All by zevyoura on Wednesday March 13, 2013 @01:20PM (#5369740)
I'm not the person you're responding to, but I think this is how what the poster said applies to a SimCity-like model:

>heterogeneity is your guardian angel - varying the path-finding model a little bit from agent to agent hedges against the resonance structures on display here.

Adding a small amount of randomness (occasional 'wrong' turns) reduces congestion on the major paths that would be the dominant route for agents.

>Additionally, you periodically check the accumulated micros against a macro model and correct gross deviations. Neither step is computationally strenuous.

Every once in a while, check and make sure those wrong turns didn't add up to some agents being way far away from their destinations; if so, turn them in the right direction.

Re:SimCity’s Sims Don’t Seem That Smart After All by chc on Wednesday March 13, 2013 @03:07PM (#5370424)
AFAIK it doesn't even have to be wrong turns. You can just have some agents prefer to turn more often and others to drive straight for longer stretches, or have some prefer to approach things from the left and others from the right. They won't be randomly turning the wrong direction, but they'll prefer different paths.
Re:SimCity’s Sims Don’t Seem That Smart After All by Total_Meltdown on Wednesday March 13, 2013 @11:29PM (#5372925)
Or to put it in a more socioeconomic context, consider a low-wealth actor that might prefer to avoid toll roads, versus a high-wealth actor that would rather pay a little bit to save some time. Those are the kinds of motivations I was hoping to see in this game.
Re:SimCity’s Sims Don’t Seem That Smart After All by aqme28 on Wednesday March 13, 2013 @02:10PM (#5370061)
In a nutshell:

In some situations, a greedy algorithm works well but a totally random one works terribly, in other situations a random algorithm works well but a greedy one works terribly. Combine the two, and everything works out well enough to be plausible under all circumstances.

Re:SimCity’s Sims Don’t Seem That Smart After All by sirclueless on Wednesday March 13, 2013 @03:29PM (#5370557)
Case in point: The Heroku load-balancing issue is a nasty one. The random algorithm (the one they went with) leads to really nasty queues in some places, it's super inefficient. On the other hand, a greedy algorithm doesn't scale well. You get one Heroku dyno (or SimCity road) swamped by all the agents making the same decision.

A popular load-balancing strategy that finds a middle ground is "best-of-two" routing where you choose two servers at random and route to the one with lower load. There are probably similarly simple ways to introduce variety and randomness into the SimCity agents.

Re:SimCity’s Sims Don’t Seem That Smart After All by fgdsfgds on Wednesday March 13, 2013 @01:05PM (#5369642)
In a nutshell: Make very agent a bit different in the sense that they all won't make the exact same choices. i.e. Rather than have a human always choose the first source, vary this and have some humans that go for the fifth and others for the sixth, etc. etc. Your random selection would also work I guess. Although how well? I don't know.

Then, have a global pattern of how everything should be working, more or less. When a major deviation is found from the global pattern, adjust. How exactly? Those are implementation details.