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.