Vixen
02b45cc4
csharp
public readonly record struct FoliageEcology

How a type behaves in a growth simulation.

Read the guide page for this →

Remarks

[docs/plan/31 § T9]'s four sliders, and they are Unreal's procedural foliage parameters. A type sows itself at some density, ages towards maturity, spreads seeds a distance, casts shade over a radius, tolerates some amount of it, and wins or loses when two of them land on the same ground.

⚠ Separate from the placement rules, and the separation is the point. FoliageType's slope, altitude and layer filters say where a plant may stand; these say what happens between plants. A hand-painted stroke obeys the first set and knows nothing about the second, which is what lets one type be painted and simulated without two assets.

⚠ A zeroed ecology never sows, and that is the right way round. A type an author has not given a seed density to is one they paint by hand; a zero that meant "the default density" would make every palette entry appear in a simulation somebody ran to grow one species.

Fields and properties (11)

  • public float SeedDensity

    How many seeds a square metre starts with.

  • public float SpreadDistance

    How far a seed lands from the plant that dropped it, in metres.

  • public int SeedsPerStep

    How many seeds a mature plant drops each step.

  • public float ShadeRadius

    How far a mature plant's canopy shades, in metres.

  • public float ShadeTolerance

    How much shade this survives, 0…1.

  • public int Priority

    Who wins when two plants want the same ground. Higher takes it.

  • public float MaxAge

    How many steps a seed takes to reach full size.

  • public static FoliageEcology None

    A type that takes no part in a simulation.

  • public static FoliageEcology Tree

    The settings a species that behaves like a tree starts from.

  • public bool Sows

    Whether this type takes part in a simulation at all.

  • public bool Spreads

    Whether a mature plant of this type drops seeds.

Methods (3)

  • public float Maturity(float age)

    How far through its life a plant of this age is, 0…1.

  • public float ShadeAt(float age)

    How far a plant of this age shades, in metres.

  • public string? Validate()

    Why this ecology cannot be simulated, or if it can.

Used by (7)

  • FoliageBlockerTestsVixen.Rendering.Terrain.Tests
  • FoliageGrowthVixen.Foliage
  • FoliageGrowthTestsVixen.Foliage.Tests
  • FoliageTypeVixen.Foliage
  • TypeRegistrationVixen.Foliage
  • Vixen_Foliage_FoliageEcologySerializerVixen.Foliage
  • Vixen_Foliage_FoliageTypeSerializerVixen.Foliage