LerpworksAcademy
On this page

World and levels › Vegetation and placement

Placing things along roads and shores

Know first: Plant a forest by rules in PCG, Roads and trails

A PCG graph can place things along lines: reeds in a strip along a lake shoreline, rocks on the road shoulders, fence posts along a path. Each one follows its own spline, a line you define with control points and reshape by dragging them. Move the shore, the road or the path, and the reeds, rocks and posts follow. This flow continues “Plant a forest by rules in PCG” and does not repeat the graph basics, tags, debugging or density rule from there.

Goal

Before: a lake, a road and a path on a landscape, with the forest already planted. After: a PCG_Lines graph that places a different kind of object along each line. The reeds lie in a strip that reaches up to 2 m out on each side of the water’s edge. The rocks lie in a strip from 4 to 6 m from the road axis. The fence posts stand every 2.5 m. The numbers are only an example.

lake reeds: 0–2 m from the edge rocks: 4–6 m from the road axis posts every 2.5 m
Top view. The dashed line is the road axis, and the gray strips are the shoulders where the rocks lie. The green ring around the lake is the reed strip, on both sides of the water’s edge. The small squares are fence posts along the path.

Further in the article

  1. What you need to start
  2. Steps
  3. If it doesn’t come out right
  4. Checklist
  5. Theory
  6. Sources and further reading
  7. Test yourself