FractalNet
Home Software Music Other
Overview   Overview
Guitar Chord Explorer   GCE
Marble Challenge   Marble Challenge
ASCIIroids   ASCIIroids
Particle System Designer   PSD (Second Life)
Gravity Bubbles   Gravity Bubbles
FractalNet   FractalNet
EcoSim   EcoSim
Cosmic Dust   Cosmic Dust
LandMesh   LandMesh
Imagencrypter   Imagencrypter
Foxy Detector   Foxy Detector
MacDiff   MacDiff
Asteroid Belt   Asteroid Belt
Matrix Attack   Matrix Attack
Solar Swarm   Solar Swarm
Mac OS X Terminal guide   OS X Terminal
Tools   Tools
Names :-)   Names :-)
EcoSim

EcoSim

EcoSim is an ecosystem simulator, featuring flowers, grasses, butterflies, seeds, wind, clouds and rain.  It consists of about 3,300 lines of Java, and uses OpenGL to provide hardware-accelerated graphics (via Java OpenGL).  Apart from adapting some sample OpenGL code provided by Felix Gers, I coded the whole application from scratch.

I must say many thanks to Laukosargas Svarog for creating Svarga, an amazing island in Second Life with its own ecosystem, which inspired me to have a go at creating my own ecosystem simulator.


Details

EcoSim is a very simplified model of a real ecosystem.  The following diagram illustrates how the various elements interact with each other:

EcoSim diagram

Drawn using OmniGraffle, a very cool program for drawing diagrams :-)

Each butterfly wanders around at random until it passes close to a flower, at which point it “homes in” and lands on the flower (unless another butterfly has got there first!)  If the butterfly is not carrying any pollen, it will collect some from the flower, and change colour to indicate what colour pollen it’s now carrying.

When it lands on another flower, it deposits its pollen, and changes back to grey (indicating that it’s no longer carrying pollen).  The colours of the flower and pollen are combined according their hues, and seeds of this combined colour are released.

There are 14 species of grass, which release white seeds (as opposed to the coloured seeds released by flowers).  All seeds drift in the wind for a while, and then land on the ground.  Rain causes seeds to germinate – a coloured seed produces a flower of that colour, and a white seed produces a grass of the same species as the grass which released that seed.

A butterfly picks up yellow pollen and deposits it on a cyan flower, which then releases green seeds

A butterfly picks up yellow pollen from a yellow flower, and deposits it on a cyan flower, which then releases green seeds.

EcoSim automatically generates a graph indicating the variation in the number of flowers, grasses and seeds in the ecosystem over time:

EcoSim graph

Click on the graph for a larger annotated version.

During periods of rainfall (indicated by blue bands on the graph), the number of seeds decreases rapidly, as the seeds germinate and produce new flowers and grasses.  In-between periods of rainfall, grasses and flowers gradually release new seeds and then die.


Video

Watch this video on Vimeo  →

Note: EcoSim actually runs at 60fps, but this video is only 30fps, so the animation is not as smooth as it should be.


Things to do
  • Add birds to the ecosystem.  These would eat seeds, and so keep the number of seeds in check.
     
  • Butterflies could lay eggs on tree branches, which would hatch into caterpillars. After some time, these would change into chrysalises, and then into butterflies.  Old butterflies would eventually die, to keep the population in balance.
     
  • A sun could be added, to provide sunlight during the day.  Flowers and grasses would only grow when the sun is in the sky, and the sunlight is not blocked by clouds.
     
  • ... plus many other possibilities!

Automatic country lookup for comments powered by hostip.info
Comments

No comments yet.  Be the first to add a comment!


Add a comment

Contact me  –  Page last updated on 9th August 2008  –  Website hosted by 5quidhost (highly recommended!)
Michael Hogg