Real-time evolutionary ecosystem simulation where autonomous creatures with 90 unique genes compete, reproduce, and evolve across 22 climate-driven biomes.
90
Genes
22
Biomes
8
Chromosomes
4
Dominance Patterns
10
Archetypes
CGVC
Published
01
The World
Procedural generation with real climate science, not just Perlin noise.
Each simulation constructs a complete planetary surface from scratch. Seven stages in sequence, each building on the last:
Heightmap synthesis: layered Perlin noise produces continental masses with realistic coastlines and mountain ranges
Latitude banding: horizontal position sets base temperature, colder at poles, warmer at the equator
Elevation lapse rate: temperature drops with altitude at ~6.5°C per 1,000m, the real atmospheric lapse rate
Rain shadow modelling: prevailing winds deposit moisture on windward slopes, leaving leeward regions arid
Precipitation distribution: combined moisture from wind patterns and elevation creates varied rainfall zones
Whittaker classification: temperature + precipitation maps every tile to one of 22 biomes using real climate boundaries
Flora seeding: plants spawn with biome-appropriate traits, establishing the initial food web
Whittaker Biome Classification Matrix
Arid
Dry
Moderate
Wet
Saturated
Hot 30°C+
Hot Desert
Savanna
Savanna
Tropical Forest
Tropical Rainforest
Warm 20-30°
Hot Desert
Savanna
Grassland
Tropical Forest
Tropical Rainforest
Temperate 10-20°
Steppe
Grassland
Temperate Forest
Temperate Forest
Temperate Rainforest
Cool 0-10°
Steppe
Shrubland
Temperate Forest
Temperate Rainforest
Temperate Rainforest
Cold -10-0°
Cold Desert
Taiga
Boreal Forest
Boreal Forest
Alpine Meadow
Frozen <-10°
Ice Sheet
Tundra
Tundra
Glacier
Glacier
The same algorithms that classify Earth's ecosystems classify this one. Temperature from latitude + elevation lapse rate. Precipitation from wind patterns + rain shadow. Biome from the Whittaker matrix above.
02
The Genetics Engine
The crown jewel. Not hardcoded species, but emergent traits from continuous gene values.
Every organism carries a full genome of 90 genes organised across 8 chromosomes, each gene a continuous floating-point value between 0 and 1. There are no species definitions. No creature type enums. What an organism is emerges entirely from what its genes produce.
Diet type illustrates this perfectly. Rather than storing "herbivore" or "carnivore" as a flag, the simulation calculates diet from digestion gene values. A creature with high plant digestion and low meat digestion becomes functionally herbivorous, not because it was labelled that way, but because its genes make plant-eating efficient and meat-eating wasteful.
Four dominance patterns govern inheritance: complete dominance, incomplete dominance, codominance, and epistasis. When two organisms reproduce, their chromosomes undergo crossover and mutation, producing offspring that are genuinely novel combinations, not clones, not random.
Universal energy budget: every gene has a maintenance cost. An organism can't be good at everything. Large bodies cost more energy. Thick armour slows movement. Sharp claws require calories. Evolution is forced to make tradeoffs.
03
Creature Intelligence
State-machine AI driven by needs, with gene-controlled pathfinding.
Each creature runs a hierarchical state machine that selects behaviour based on current needs: hunger, energy, reproductive urge. The priorities shift dynamically as internal states change.
RestRecover energy when stamina drops below threshold
HuntTrack and pursue prey using sensory range genes
FeedConsume food sources based on diet capabilities
MateSeek compatible partners when reproductive urge peaks
ZoochoryDisperse seeds while moving through the environment
MovementNavigate terrain with gene-driven route preferences
Pathfinding uses A* search, but with a twist: the environmental_sensitivity gene controls how much terrain cost matters in route calculation. Creatures with high sensitivity stick to familiar, low-cost terrain. Creatures with low sensitivity take direct paths regardless of obstacles. This means pathfinding strategy itself evolves. Cautious navigators and bold chargers emerge from the same algorithm with different gene values.
The AI system was originally a 2,420-line monolithic class. Extracting it into a modular Strategy pattern, one class per behaviour dispatched by the state machine, was one of the project's most significant refactors. Each behaviour became independently testable and tuneable.
04
Combat & Predation
Rock-paper-scissors damage mechanics where shape determines type and size determines magnitude.
Shape genes determine damage type. Size genes determine damage amount. A small creature with piercing attacks and a large creature with blunt attacks occupy completely different combat niches, even at similar overall power levels.
Three damage types interact against three defence types in a rock-paper-scissors triangle:
Attack ↓ / Defence →
Shell
Scales
Fur
Blunt
1.5×
1.0×
0.5×
Piercing
0.5×
1.5×
1.0×
Slashing
1.0×
0.5×
1.5×
This creates evolutionary arms races. When shell-armoured herbivores dominate, blunt-attacking predators gain an advantage. As blunt predators spread, fur-defended prey outcompete shelled ones. The cycle continues indefinitely, preventing any single body plan from permanently winning.
05
The Plant Kingdom
Often overlooked in ecosystem sims. Not here.
Plants are fully simulated organisms with their own genomes, not just static food sources. They compete for light and space, reproduce, and evolve dispersal strategies. Six emergent methods arise from gene combinations:
WindLightweight seeds carried by prevailing wind patterns
Animal-FruitNutritious fruit entices creatures to eat and carry seeds
Animal-BurrHooks and barbs attach to fur for passive transport
ExplosiveSeed pods build tension then burst, launching seeds outward
GravityHeavy seeds fall and cluster near the parent plant
VegetativeRunners and rhizomes spread clonally through the soil
Zoochory is the most interesting. Fruit-dispersed seeds are consumed along with the fruit, pass through the creature's digestive tract, and are deposited elsewhere; genuinely simulated endozoochory. Burr-dispersed seeds attach to creatures with fur and detach as they move, favouring long-distance transport by active animals.
Plants also evolve chemical defences (toxins, thorns) and creatures evolve corresponding resistances. This produces coevolutionary arms races independent of the predator-prey dynamics, a second axis of evolutionary pressure running in parallel.
06
Emergent Behaviour
All systems combine. Predator-prey oscillations. Speciation. Extinction events.
When all the systems run simultaneously, complex ecological dynamics emerge without being programmed. Predator and prey populations oscillate in classic Lotka-Volterra cycles. Populations isolated by mountain ranges diverge genetically, producing allopatric speciation. Sudden climate shifts trigger mass extinction events followed by adaptive radiation as survivors fill empty niches.
The simulation generates scientific names for emergent species based on their phenotype: diet, size, defence, and distinguishing features:
Carnopredax titan dentatus
Large apex predator with prominent teeth
Herboscutum grandis cornuatus
Armored herbivore with horn-like structures
Omniflexus minor vulgaris
Small, common generalist omnivore
How Scientific Names Are Constructed
Carnopredax titan dentatus borealis
Carnopredax
Genus
Carno = meat_dig > 0.7 predax = aggression > 0.7
titan
Species (Size)
Body size ≥ 2.5 units Scale: minimus → titan
dentatus
Epithet (Trait)
tooth_sharpness > 0.5 Most distinctive feature
borealis
Climate
Tundra/Taiga adapted fur > 0.7, fat > 0.6
Ten creature archetypes recurrently evolve across different simulation runs, convergent evolution emerging from selection pressure alone:
An early version of EcoSim was published at the Computer Graphics and Visual Computing (CGVC) conference as part of my BSc dissertation at Bangor University. The paper covers the foundational genetics engine, world generation, and emergent dynamics.
The current version is vastly more complex than what was published. The genetics system has grown from a handful of traits to 90 genes across 13 categories, the combat system, plant coevolution, scent communication, and classification systems were all added since. The paper represents where it started; everything above shows where it went.