Vixen
c7401864
csharp
public sealed class DistanceLodGovernor

Agents far from the focus sense less often.

Read the guide page for this →

Remarks

Three bands rather than a curve, because a continuous falloff makes every agent's interval a different number and the jitter that keeps them off each other's frames then has nothing to be jittered around. Three bands and a deviation give a schedule somebody can reason about: near agents are exact, far ones are approximately quarter-rate, and no agent's reaction time is a mystery.

With the shipped defaults and a 0.1 s interval, the far band lands on 4 Hz — doc 37 § D15's number for what an agent behind the player is worth.

⚠ The focus is where the player is, not where the camera is. A cutscene camera that swung across a level would otherwise wake every agent it passed, and a spectator camera in a multiplayer game would give whoever it followed a different AI from everybody else's.

Fields and properties (4)

  • public float NearRadius

    Inside this, in metres, the configured rate.

  • public float FarRadius

    Beyond this, in metres, the slowest rate.

  • public float MidScale

    What to multiply the interval by between the two radii.

  • public float FarScale

    What to multiply it by beyond FarRadius.

Methods (1)

  • public float IntervalFor(PerceptionConfig config, float distance)

    Seconds until this listener's next pass.

Used by (1)

  • ScheduleTestsVixen.Ai.Perception.Tests