Vixen
c7401864
csharp
public record class SightSettings

What being able to see means for one kind of agent.

Read the guide page for this →

Remarks

⚠ LoseSightRadius is a separate, larger radius, and leaving it out makes targets flicker. With one radius, a target walking the boundary is perceived, lost, perceived, lost — several times a second — and every decorator observing the target key aborts a branch each time. It is the first thing every hand-rolled implementation gets wrong, it looks like a bug in the behaviour tree rather than in the sense, and it costs one field. doc 37 § D15.

The three tests run in a fixed order and the order is the cost model: radius first, cone second, occlusion last — the trace is a physics raycast and it only ever runs for what survived two comparisons.

Fields and properties (6)

  • public float Radius

    How far it can notice something, in metres.

  • public float LoseSightRadius

    How far something already seen can get before it is lost. Clamped up to Radius, because a smaller one is the flicker with extra steps.

  • public float ConeDegrees

    The full angle of the cone, in degrees. 360 is all round.

  • public bool Occlusion

    Whether something solid in the way stops it.

  • public float EyeHeight

    Where the eye is above the entity's own position, in metres.

  • public float ConeCosine

    The cosine of the half-angle, which is what a dot product is compared against.

Methods (1)

  • public float RadiusFor(bool perceived)

    The effective radius for something that is already perceived.

Used by (8)

  • AiGameplayDebuggerVixen.Ai.Diagnostics
  • FleetVixen.Ai.Perception.Tests
  • PatrolChaseGiveUpTestsVixen.Ai.Nodes.Tests
  • PerceptionConfigVixen.Ai.Perception
  • PerceptionSystemVixen.Ai.Perception
  • SightOcclusionTestsVixen.Ai.Perception.Tests
  • SightTestsVixen.Ai.Perception.Tests
  • VillageVixen.Ai.Nodes.Tests