public readonly record struct StimulusEventSomething that happened, which some senses are the only way of noticing.
Remarks
⚠ Hearing and damage are events, and sight and touch are states, and that difference is why both machines exist. An entity is continuously visible, so sight is sampled: it can be asked at any moment and the answer is a property of the world right now. A gunshot is not continuously audible — an entity is not "audible", an event is — so a hearing sense that sampled would have to sample the exact frame the shot happened, which at 4 Hz means hearing one shot in six.
So events are kept for EventMemory seconds and each listener consumes the ones newer than its own last pass. A listener at 4 Hz hears every shot; it just hears them up to a quarter of a second late, which is the reaction time it was configured for.
Fields and properties (7)
public AiSense SenseWhich sense it reaches.
public Entity SourceWho caused it.
public Entity TargetWho it happened to, or Null for anyone in range.
public Vector3 PositionWhere it happened.
public float StrengthHow loud, or how much damage.
public float StampThe clock reading when it was reported.
public long SequenceWhere it came in the order of reports. ⚠ What a listener consumes against, and the clock is not. The clock only advances inside a step, so an event reported after a pass in the same frame carries exactly the clock that pass recorded — and a listener comparing clocks would decide it had already heard a gunshot that had not happened yet.
Methods (1)
Used by (1)
- PerceptionSystemVixen.Ai.Perception