I'm interested in creating a world in which the behaviors of some of the elements are generated randomly or evolved. Is there a field of study or some well known work that deals with what it takes to create a stable ecosystem?

For instance, let's say I randomly generate three creatures that each eat each other. It's easy to imagine that one of the creatures might be dramatically better than the other two, kill all of its prey and defend itself against all of its predators. This will result in everything in the world dying, which isn't very interesting.

I'm looking for techniques which help to find or guarantee ecosystems that don't implode or explode, but instead oscillate within some interesting (hopefully fun!) bounds.

  • \$\begingroup\$ Starbound is a modern game entirely procedural like you describe. There was a game back in the 80's called "omega la planete invisible" that also was procedural. There is a project of a procedural universe (entirely roamable, load free) called "infinity quest for earth" by flavien brebion. And I personally made a 2d game that has procedural terrains: sourceforge.net/projects/extremecarnage or gamedev.net/topic/… \$\endgroup\$
    – v.oddou
    Commented Sep 3, 2014 at 8:22
  • \$\begingroup\$ But your question is different in the sense of post procedural creation activity and stability. This is veyr interesting and I am not aware of any creation that features that ! topic star-ed :) \$\endgroup\$
    – v.oddou
    Commented Sep 3, 2014 at 8:24
  • \$\begingroup\$ Guaranteeing that a given ecosystem is stable becomes increasingly harder the more variables you add to it and as far as I am aware you cannot tell beforehand if it will be stable/interesting (at least once you have a sufficient amount of variables, as few variables will probably be uninteresting for different reasons). The first thing that comes to my mind would be to use evolutionary or genetic algorithms to try to find various stable ecosystems which would then be "hard-coded" into your world (e.g.: chosen randomly at the start of the game) \$\endgroup\$ Commented Sep 3, 2014 at 13:03
  • \$\begingroup\$ "Cybernetics", "Systems Theory", and "Control Theory" are probably the fields of study you're looking for. All fascinating! You might also find this interesting reading (and part 1 and part 3. \$\endgroup\$
    – amitp
    Commented Sep 3, 2014 at 15:51
  • \$\begingroup\$ I am not sure if a stable system is something you want so much as a "probably long running stable system". Generally, complex and procedurally generated worlds are better thought of as chaotic systems, so their state after some sufficient time period can not be predicted. The Earth, for example, is a chaotic system, yet has a long-running (10 years or so) stable system, but is not stable over millions of years. Your game is likely to exhibit the same behavior. \$\endgroup\$
    – kurtzbot
    Commented Sep 4, 2014 at 20:29

1 Answer 1


Population dynamics is a research field for over 200 years and describes changes in size and age of populations over time. Some famous models include Lotka-Volterra equations as a model for predator and prey.

Some assumptions in the Lotka-Volterra model are:

  • The prey population finds ample food at all times.
  • The food supply of the predator population depends entirely on the size of the prey population.
  • The rate of change of population is proportional to its size.
  • During the process, the environment does not change in favour of one species and the genetic adaptation is sufficiently slow.
  • Predators have limitless appetite

They naturally lead to oscillations (with a fixed delay between them) of both involved species if the parameters are chosen right. taken from wikipedia (Lotka-Volterra)

Otherwise you can also get one or both of them to extinction.

You can probably model this in a cellular automaton fashion (e.g. as agents) so that it directly fits into your game.

Some advice to get the system more stable:

  • Have prey and predator species (so species that just reproduce and species that need to kill others in order to live and reproduce)
  • Have a limited but renewable supply of food for the prey.
  • Rate of change of population is proportional to its size, prey reproduces itself faster than predators (otherwise prey will die out)
  • Keep that predators have limitless or virtually limitless apetite (otherwise overpopulation of prey may follow)
  • Have some "refuge areas" for the prey where predators seldom go
  • If prey dies out by chance (can happen in real life see Dodos) just put them back or cheat (make them reproduce faster if the population is very low)
  • Have large enough numbers of prey to be statistically on the save side

To make it more interesting/diverse:

  • Change the environment periodically and make the system (reproduction rate, agility, hunting success rate, ...) dependent on the environment

In general:

  • The more stable you are the less the system will react on random influences/distortions
  • Therefore keep the oscillations inbuilt in the system and the random fluctuations small enough, so you will always go back to equilibrium
  • To have an additional security mechanism to ensure stability cheat (make species reproduce faster and more difficult to hunt if they are far below their equilibrium, make them reproduce slower, ... if they are far above)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .