Evolving Plants
The interactive parts of this page require javascript to be enabled.
(There are no ADs or tracking scripts installed on this website!).

The simulation is a download of around 13 MB, and works best with a mouse or trackpad. On a touch screen a tap or drag selects plants (or whatever the left button is set to do), and you can zoom and move around with the buttons, but not yet pinch or pan.
This is one of my earliest interactive projects, or at least, the original version was. It was first written in Java, updated in 2022 to C++ in Qt, and in 2026 moved to Godot so it can run in the browser.
This project is open source and can be found on GitHub
Controls
Mouse and keyboard
The tool buttons at the view's top right choose what the left mouse button does. The right button always selects. Press Help (or H) in the game for the full list.
| Tools: Select, Move, Add seed, Remove | S M A R |
| Select, without a right button | Ctrl/Cmd + click, or hold X |
| Use the tool under the cursor | Hold Z |
| Pan | Middle drag, Alt/Option + drag, two-finger drag, or the arrow keys |
| Zoom | Mouse wheel, pinch, + and -, or the buttons at the view's bottom right |
| Fit the world to the view | F |
| Pause or resume | Space |
| Speed | 1 2 3 for 10, 250 and 1,000 ticks a second, 4 for as fast as possible |
| Step 1, 10 or 100 ticks, while paused | 1 2 3 |
| New simulation | N |
| Hide the side panels | The handles halfway down the view's sides |
Tools
The left panel follows the tool. Add seed picks a genome, and Plant all seeds the whole world evenly. Remove kills a plant, or every plant in a box you drag, and Clear all empties the world. Settings on the right holds the simulation's constants, with Default, Low wind and High wind presets.
Looking closer
Select a plant to see its details and genes in the left panel, and save its genome to plant again later.
Genome builder
Edit…, beside Add seed's genome or under a selected plant, opens a builder. Type a shape and set the genes, and the preview draws the plant it grows, a stage at a time. Plant it, or Save as a new genome.
Graphs
The bar under the view unfolds into graphs of the run so far: the number of plants, their mean height and leaves, their leaf colour (red, green and blue told apart by solid, dashed and dotted lines, each labelled), and the time each tick takes. Turn Record off for the most speed.
Download it
It also runs on its own, without a browser. Unzip the file for your system, keeping the two files in it together, then run "EvolvingPlants.exe" on Windows or "EvolvingPlants.x86_64" on Linux.
How it works
The Gist
"Plants" are modelled as lines (stems) and ovals (leaves), the leaves absorb light energy and cast shadows. Over time plants evolve to compete for this light energy by being taller than competitors, or a different colour,
or by having more leaves. The trade-off is that being taller and more complex requires more energy to exist, and a high dense canopy that blocks out all light prevents baby plants from surviving long enough to grow to full
size.
Light
The image shows a new simulation, 60 ticks in, with the light drawn in. The small plants are all different colours, and the coloured columns beneath each leaf are its shadow. The colour of the light represents the energy available at that point. R,G,& B channels each contain their own energy and a leaf may evolve in colour to extract energy from one or more of these
channels. A leaf "blocks" all of the energy it absorbs.
A leaf's colour is the light it reflects; it absorbs the rest. A leaf with the colour 200, 200, 200 in full sunlight (255 in each channel) absorbs 55 from each, 165 in total. A leaf can use up to 150 energy from the light it absorbs.
Beyond that, the excess counts against it, as too much light inhibits photosynthesis in nature, so that leaf gains 150 − 15 = 135. So pale leaves suit plants in full sun, and plants in the shade can afford darker leaves that absorb more.
Early on
Here we can see two groups of plants. This is the same simulation as in the previous image, some 4000 ticks later, and judging by their colour these plants appear to all be descended from just two of the original plants.
Competition
Now that these plants are growing in the same range, they have begun to compete for light, both with members of their own species, but now also with the other species too. Initially we see a simple increase in height, with a few plants breaking above the canopy.
Colour Niches
As there is a cap on how much energy a leaf can extract from the light when photosynthesising, we see different species evolving to take advantage of the light not absorbed by the upper canopy. Here, 150,000 ticks in, a magenta and orange canopy grows over a yellow-green and cyan
layer, with small plants beneath, with the shadows becoming progressively darker as each species extracts a different subset of the available light. From this point on the upper canopy colour may drift over time via genetic drift and
smaller species will adapt their colours via natural selection to stay different from the taller plants.
To show the idea clearly, here are three designed plants, with evolution turned off, after 20,000 ticks: a cyan layer on top, magenta in the middle and yellow at the bottom. Each absorbs one colour channel that the layers above let through. Left: the plants. Right: the light reaching each point, from white sky to near-dark at the ground.
Branching
Plants aren't limited to a single stem with a leaf at the top. Each plant's shape is written in a short text genome:
| grows a stem, / and \ turn, and […] starts a branch.
This is a designed genome, Acacia, growing in the simulation 60,000 ticks in. It's one of the genomes you can plant with Add seed. Stems thicken to carry their load, and thin ones pay a cost in the wind, so tall spindly poles no longer win every run.