LerpworksAcademy
On this page

World and levels › Vegetation and placement

Scattering by rules

Know first: Biomes: how a forest is built, Randomness: seeds, distributions and fairness, LOD, instancing and Nanite: drawing a million blades of grass

A computer can plant hectares of forest in seconds. It throws points onto the ground and sifts them through rules: height, slope, masks, roads and water. Then it thins the points out so that trunks don’t grow into each other, and turns each point into a copy of a tree. The lesson also shows why the same seed gives the same forest and why editing one rule must not reshuffle the whole world. It ends with how a forest grows around the player and where the rules need an artist’s hand.

Why this matters

Do the math. Say a forest has one tree per 25 m². A hectare is 100 by 100 meters, 10,000 m², so it holds 10,000 / 25 = 400 trees. A square kilometer holds 40,000. Grass is far denser: on the same hectare, at four tufts per square meter, there are 40,000 tufts, a hundred times more than trees (the lesson on foliage).

You can’t place that by hand. And even if you did, the first edit of the terrain would ruin it: a hill moves, and half the trees hang in the air. So an artist doesn’t place trees but writes rules for where they may grow. The rules are the laws of nature from the lesson Biomes: how a forest is built, and the computer carries them out. In Horizon Zero Dawn, three people made the natural assets for the whole game, and rules scattered them across a huge world.

Further in the article

  1. The seeder and the sieves
  2. Points on a surface
  3. Density map: denser here, sparser there
  4. Sieves by height and slope
  5. Subtracting roads and water
  6. No closer than a set distance
  7. Passes: from large to small
  8. Every copy is different
  9. Seed: the same forest every time
  10. Sowing around the player
  11. Where an artist’s hand is needed
  12. Where it breaks
  13. Connections: the same idea in other fields
  14. Sources and further reading
  15. Key points
  16. Test yourself