Vixen
c7401864
csharp
public struct AiPerception

An entity that notices things.

Read the guide page for this →

As a component

Size
16 bytes — 585 rows in a 16 KB chunk, alone on the archetype

Remarks

The same shape as AiAgent and for its reasons: an index into a library, a slot the system owns, and a few numbers. The perceived list is a managed object with a list in it, so it lives beside the slot in PerceptionSystem rather than in a chunk column.

[Component] without [DataContract], deliberately. ListenerIndex is the system's own bookkeeping and a saved copy of it would name a slot that does not exist in the process that loads it. AiStimuliSource is the placeable half, because being perceivable really is a property of a level's contents.

⚠ A listener does not have to be an AiAgent. A security camera, a trap and a trigger volume all want to notice things without deciding anything, and a perception pass that required a planner would make each of those carry one. The binding to a blackboard is what needs an agent, and it is skipped when there is not one.

Fields and properties (5)

  • public ushort Config

    Which configuration it senses with. An index into the system's library.

  • public int ListenerIndex

    Its slot with the system. Owned by PerceptionSystem.

  • public byte Team

    Which side it is on. What IPerceptionFilter reads.

  • public bool Enabled

    Whether it senses at all. A dead or blinded agent sets it false.

  • public float Countdown

    Seconds until its next pass. Owned by the system.

Methods (1)

  • public static AiPerception Sensing(int config, byte team = 0)

    A listener that has not joined a system yet.

Used by (14)

  • AiGameplayDebuggerVixen.Ai.Diagnostics
  • BindingTestsVixen.Ai.Perception.Tests
  • FleetVixen.Ai.Perception.Tests
  • OverlayFixtureVixen.Ai.Diagnostics.Tests
  • PatrolChaseGiveUpTestsVixen.Ai.Nodes.Tests
  • PerceptionNodeTestsVixen.Ai.Perception.Tests
  • PerceptionSnapshotsVixen.Ai.Perception
  • PerceptionSystemVixen.Ai.Perception
  • ScheduleTestsVixen.Ai.Perception.Tests
  • SeamTestsVixen.Ai.Nodes.Tests
  • SightTestsVixen.Ai.Perception.Tests
  • TypeRegistrationVixen.Ai.Perception
  • VillageVixen.Ai.Nodes.Tests
  • VillageSampleTestsVixen.Ai.Nodes.Tests