12

I want to create a city filled with virtual creatures.

Say like Sim City, where each creature walks around, doing it's own tasks.

I'd prefer the city to not 'explode' or do weird things -- like the population dies off, or the population leaves, or any other unexpected crap.

Is there a set of basic rules I can encode each agent with so that the city will be 'stable'? (Much like how for physics simulations, we have some basic rules that govern everything; is there a set of rules that governs how a simulation of a virtual city will be stable?)

I'm new to this area and have no idea what algorithms/books to look into. Insights deeply appreciated.

Thanks!

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
anon
  • 41,035
  • 53
  • 197
  • 293

4 Answers4

8

Here is the original SimCity source code:

http://www.donhopkins.com/home/micropolis/micropolis-activity-source.tgz

jedierikb
  • 12,752
  • 22
  • 95
  • 166
7

I would start with the game of Life.

Stephen Wrighton
  • 36,783
  • 6
  • 67
  • 86
2

It may be hard to find any general resources on the subject, because it is quite specific area.

I have implemented some population dynamics and I know that it is not easy to get all the behavior correct to ensure that the population does not die off or overgrows. It is relatively easy if you implement a simple scenario like in predator-prey model, but tends to get tricky as the number of factors increases.

Some advice:

  • Try to make behavior of agents parametrized

  • Optimize the behavior parameters using some soft method, a neural network, a genetic algorithm or a simple hillclimbing algorithm, optimizing a single parameter of the simulation (like the time before the whole population dies off combined with average growth factor)

Marek
  • 10,307
  • 8
  • 70
  • 106
0

Here is a pointer to some research on the topic, but be advised -- the population in this research study all died off.

http://www.nsf.gov/news/news_summ.jsp?cntn_id=104261

jedierikb
  • 12,752
  • 22
  • 95
  • 166