T-011: Environment fields
Goal
The world outside the organisms: terrain and the fields stored on a coarse 3D grid. See
docs/DESIGN.md section 3.
Scope
- Terrain: a seeded height field with rocky and sandy areas and a few vents.
- Light: fades with depth and is blocked by opaque cells above (coarse column shading). Day and night, and seasons, from a world clock.
- Dissolved nutrients: diffuse, drift with the current, are taken up and released. Total matter must be conserved exactly by the field code.
- Vent chemicals: released at vents, diffuse, decay.
- Temperature: warmer near the surface and near vents.
- Current: a slowly changing flow field.
- Background colour: water colour by depth, terrain colour by place.
- Sampling functions for other modules: value and gradient at a point.
- Fields update on a slower cadence than physics. Everything in
Params.
Done when
- ☐ Tests: nutrient total is constant under diffusion and drift. Light under an opaque slab is dimmer than beside it. Fields are identical for the same seed.
- ☐ Field update cost measured and logged.
- ☐ A debug dump (image slices of each field) saved under
docs/media/T-011/.