Some great simulations are a feedback loop with exits.
Looking at plants in the game, I think the way to go will be:
- Sunlight makes energy
- Energy fuels plant growth
- Plants limit the available sunlight for nearby shorter plants
- Plants have different rates of sunlight conversion, growth, growth efficiency and maximum sizes
- The faster you grow, the more energy you require
This will cause competition for sunlight to be an influence on plant distribution. Large trees should block the sunlight around them, causing plants with high energy needs to not grow nearby. A small flower with low energy requirements should be able to live happily in the shade of a giant oak, but you shouldn’t get two oaks growing right next to each other.
I have now done a quick simulation of sunlight affecting growth: the small highlighted ‘tree’ below will actually never grow any further until the taller trees die out. I added a debug cylinder as a ‘canopy’ indicator for now.
I’m estimating the available sunlight by checking for nearby taller plants and multiplying the available light by the density of the canopy of overlapping trees by the ratio of their overlap. It’s sort of a 2D approximation of available sunlight, but it actually models out pretty well.
Next I need look at setting up the relationship between stored energy, sunlight and growth, as well as making plants die out or not germinate if they lack sunlight.