Skip to main content

ForestConnectivityIncreaser

A class in Root.Township, Alta.Forests.

Forest node map step that opens some blocked edges into normal paths, to add loops between nodes of similar height.

Constructors​

MemberWhat it is
ForestConnectivityIncreaser()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

5 private and internal fields
MemberWhat it is
private BiomeAttribute cutChanceBiome attribute for the chance an edge is opened, summed from both nodes.
private AnimationCurve heightChanceMultiplierScales the chance by height difference over maxHeightDifference.
private int iterationsNumber of passes over the edges.
private int maxCutDistanceNodes must already be within this many path steps of each other.
private float maxHeightDifferenceEdges with a bigger height difference are never opened.

Methods​

MemberWhat it is
override void Modify(ForestGeneration forest)Over several passes, turns blocked edges between non-entrance nodes into normal edges by chance, if the nodes are close in height and already near on the path graph.