An experimental, browser-based plant ecosystem simulator built with vanilla HTML, CSS, and JavaScript.
It models a small โdigital twinโ greenhouse where plants grow, react to changing environmental conditions, pass genetic traits into future generations, and generate live ecosystem telemetry.
The project is designed as an interactive learning lab for plant growth, genetics, environmental stress, resource management, and simulation design.
Frontier Plant Ecosystem Simulation turns a simple plant-growing game into a living systems sandbox.
You can plant seeds, adjust greenhouse conditions, scan phenotypes, tune plant behaviour, mutate the seed bank, and harvest mature plants. The simulation focuses on the relationship between:
- G โ Genetics
- E โ Environment
- M โ Management
This makes it useful as a creative prototype for ecosystem simulations, digital agriculture interfaces, artificial-life experiments, and educational science tools.
- Grow plants from seed to maturity.
- Watch height, health, and visual state change over time.
- Harvest mature fruiting plants to build the yield bank.
Each plant can carry different trait values that influence behaviour such as:
- Growth potential
- Stress tolerance
- Nutrient efficiency
- Environmental resilience
- Yield performance
Strong plants can pass lightly mutated genes into the seed bank, creating a simple evolutionary loop.
The simulation includes changing weather and greenhouse conditions that affect plant performance.
Current greenhouse/environment controls include:
- Nutrients
- Water
- Light
- Temperature
- Soil pH
- Weather state
- Forecast/event feedback
Use the phenotype scan feature to inspect plant performance and identify useful traits.
The telemetry panel tracks:
- Plant count
- Average height
- Average health
- Current generation
- Selected plant
- Best gene
- Yield bank
- Eco score
The AI tuning feature is a simulation-facing control designed to support smarter balancing of plant traits, environment, and management decisions.
It can be expanded into future adaptive systems such as:
- Auto-balancing greenhouse controls
- Trait recommendation
- Growth prediction
- Stress warnings
- Yield optimization
Mutate the available seed bank to explore genetic variation and encourage different plant outcomes across generations.
Run the ecosystem at different speeds:
1x2x10x
Useful for slow observation, fast testing, and rapid generation experiments.
The project runs directly in the browser with no build step required.
You can run the project by opening index.html directly in a modern browser.
For the most reliable local testing, you can also serve it with a simple local server:
git clone https://github.com/kai9987kai/plant-ecosystem-sim.git
cd plant-ecosystem-sim
python -m http.server 8000Then open:
http://localhost:8000
plant-ecosystem-sim/
โโโ index.html # Main simulation app
โโโ README.md # Project documentation
โโโ LICENSE # MIT license
โโโ CODE_OF_CONDUCT.md # Contributor Covenant code of conduct
โโโ SECURITY.md # Security policy
-
Open the simulation in your browser.
-
Click a soil bay or use the Plant button to add a seed.
-
Adjust the greenhouse sliders:
- Nutrients
- Water
- Light
- Temperature
- Soil pH
-
Watch plant height, health, and ecosystem score change.
-
Use Phenotype Scan to inspect traits and plant state.
-
Use AI Tune to experiment with adaptive balancing.
-
Use Mutate Seeds to introduce variation into future plants.
-
Harvest mature plants to collect yield and continue the growth loop.
-
Change the speed to observe the simulation slowly or accelerate testing.
Plants can carry trait values that affect how they respond to the greenhouse environment. These traits influence growth, health, and survival.
Weather, light, water, nutrients, pH, and temperature all shape plant outcomes. A strong plant in one environment may struggle in another.
The player acts as the greenhouse manager, changing resources and conditions to improve growth, yield, and resilience.
Harvesting and mutation create a basic generational feedback system. Over time, the seed bank can shift toward stronger or more interesting traits.
The simulator includes a live dashboard for understanding the ecosystem state.
| Metric | Meaning |
|---|---|
| Plants | Current number of active plants |
| Average Height | Mean plant height across the ecosystem |
| Average Health | Overall ecosystem health |
| Generation | Current genetic generation |
| Selected | Currently inspected plant |
| Best Gene | Strongest observed genetic trait |
| Yield Bank | Harvested output |
| Eco Score | Overall ecosystem performance |
This project is inspired by modern ideas in:
- Plant digital twins
- Functional plant modelling
- High-throughput phenotyping
- Genotype ร environment ร management analysis
- Controlled-environment agriculture
- AI-assisted plant monitoring
- Artificial life and evolutionary simulation
The goal is not to be a scientifically exact crop model yet, but to act as an approachable creative prototype for exploring those ideas interactively.
Future versions could add:
- Different species
- Species-specific genetics
- Unique growth curves
- Flowering and fruiting stages
- Pest outbreaks
- Disease spread
- Resistance genes
- Treatment choices
- Light changes over time
- Circadian-style growth effects
- Night recovery periods
- Dominant/recessive traits
- Heritable stress tolerance
- Seed lineage tracking
- Trait history charts
- Growth graphs
- Health history
- Yield trends
- Weather impact charts
- Gene performance comparison
- Rule-based greenhouse assistant
- Predictive yield hints
- Auto-adjusted water/light/nutrients
- Explainable recommendations
- Save ecosystem state
- Export seed banks
- Import experiments
- Share simulation presets
- Drought stress test
- Low nutrient challenge
- High temperature trial
- Mutation lab mode
- Maximum yield mode
- HTML
- CSS
- Vanilla JavaScript
- Browser-based simulation logic
- No required build step
Contributions are welcome.
Ideas for useful contributions:
- Improve simulation realism
- Add better plant visuals
- Add charts and analytics
- Expand genetics
- Improve mobile layout
- Add accessibility improvements
- Refine the UI/UX
- Add save/load support
- Improve documentation
Suggested workflow:
git clone https://github.com/kai9987kai/plant-ecosystem-sim.git
cd plant-ecosystem-sim
git checkout -b feature/my-improvementAfter making changes:
git add .
git commit -m "Add my improvement"
git push origin feature/my-improvementThen open a pull request.
If you find a vulnerability or unsafe behaviour, please report it through the repositoryโs security process rather than opening a public issue.
This project is licensed under the MIT License.
See LICENSE for details.
Inspired by ecosystem simulations, farming games, digital twin research, artificial-life systems, and controlled-environment agriculture tools.
Active experimental prototype.
The current version focuses on interactive plant growth, greenhouse controls, simple genetics, mutation, harvesting, telemetry, and research-inspired simulation design.
::contentReference[oaicite:1]{index=1}