Photosynthesis, tree growth and water transport

For the new engine. I have been designing a genome model for the biosphere. This is the set of genes that describe any plant that can grow in Earthsim’s biosphere. Each gene has a specific function in the plant.

To do this well I needed to have a good idea of the model that the trees and plants would be growing inside.

Once you have a good understanding of the model. You can know what genes to put in a plant description so it can optimise itself for growing in the environment.

Below is the model for how water can move around on the land.

The land simulator manages this water for us, so we will know exactly how much water we have in any of these components.

This water availability is used by the Biosphere simulation to know where and how trees can grow.

Here is the summary design of the plant/tree model that works with the above.

A few interesting points to note about this model. (When I mention a tree it also applies to any plant)

  1. Trees can self shadow, so sections of a tree can be less efficient and can die away. So a tree can grow and change shape over time.
  2. Trees and plants have a few interesting dilemmas they need to solve with their different genetic makeups.
    1. When they want to photosynthesize, they have to open their pores. But when they open their pores, if the air is hot, the can loose much more water to the air than they would want. Trees that can manage when they open or close their pores can survive better in arid climates.
    2. Tree’s that have leaves that can be damaged by the cold have to decide when to drop and when to grow their leaves.
    3. Tree’s that have seed/fruit that can be damaged by the cold. or that can require much more water and energy to grow also have to manage their timings.
    4. Tree canopies heat up from sunlight, but you can still photo synthesize from indirect illumination. Hence different canopy and leaf configurations offer different competitive factors for optimization.

The critical thing about all this is that it lets us know how much new water vapor and C02 is added to the atmosphere by a forest. And we can model what happens to the atmosphere as we change the forest.

Here is the diagram of the top level model that these pieces fit into.

New Beginnings

Dave and I have started working together on Earthsim.

We have started with a clean slate and are writing pretty much everything from scratch. But times have changed, there is so much open source out there that we can base many components on existing technologies. This leaves us clear to focus on just the pieces we want to specialize on.

We have already set out some of our goals for the game and what the engine needs to do:

  • Simulate an 80km square tile of landscape at 16k x 16k resolution.
  • Simulate over a million plants & trees for the 80km square down to centimeter accuracy.

Above is our first screenshot from getting the first rendering prototype drawing a test landscape. Dave is building out the DirectX parts of the engine while I work on the model for how all our plants and trees grow.

Storing such large data sets at high performance needs real-time data compression. This done using hierarchical grids running at multiple resolutions that divide a world up into successively smaller cells that each have their own sub coordinate systems.

These sub-coordinate systems let us store plant and creature positions relative to their closest grid cell.

This storage model allows those positions to be stored with far fewer bits of data than would be required in the floating point or large integer numbers that would normally be used to store a position over a big section of landscape.

Here is the design I just finished for our simulation grids. This shows all the different grid resolutions we are using to model and simulate our ecosystem.

Earthsim Grids

These grids also enable the algorithms to be more easily multi threaded for many core parallel performance, as well as enabling us to precisely tune the code so that all data fits by design into first and second level CPU caches over a complete data processing loop. This removes the requirement of the CPU to fetch new data from main memory until a given cell’s work is complete and sent back out of the cache to main memory.

We want all performance critical code to be running in this fashion so performance is gated on first of second level cache speed rather than main memory speed.