FAIStimulus
FAIStimulusBus — everything the AI can sense, filed by where it is.
- Module
- AINavigation
- Header
#include "AINavigation/AIStimulusBus.h"- Namespace
Mowo
Gameplay emits stimuli (a sound, a flare seen, a scan pulse, a hit) with a position, a strength and a type; perceivers ask the bus for what lies around them instead of walking every actor and every event in the world. Both halves are indexed by the same 8 m sector key the point-cloud renderer chunks by (FPointCloudSector) — one spatial hash for the scan the players see and the stimuli the creatures sense, so a later change to the chunk size moves both together or neither.
Events live in a fixed ring with a timestamp and a lifetime, and every event has a rising id. A perceiver remembers the last id it consumed, so one that only ticks every fourth frame (significance stagger) still hears the gunshot that happened between its ticks, and none hears the same one twice. When the ring is full the oldest event is overwritten and counted.
Presence — where the perceivable targets are this frame — is rebuilt by the perception system each tick and queried the same way for sight and touch.
Properties
| Type | Name | Description |
|---|---|---|
uint32_t | id | Default 0. |
EAIStimulusType | type | Default EAIStimulusType::Sound. |
Vec3 | position | Default Vec3(0.0f, 0.0f, 0.0f). |
float | strength | Default 1.0f. |
float | radius | Default 0.0f. |
EntityID | instigator | Default INVALID_ENTITY. |
EntityID | victim | Default INVALID_ENTITY. |
int32_t | roomIndex | The acoustic room it happened in, -1 outside every room or unknown. Default -1. |
float | time | Default 0.0f. |
float | lifetime | Default 0.0f. |
bool | flash | A Sight stimulus that is a scanner's flash, so a creature that turns toward it knows it saw a scan rather than a flare. Default false. |
Public functions
| Returns | Name | Description |
|---|---|---|
float | ReachFor | How far this stimulus reaches a perceiver whose own sense radius is senseRadius. |
Function details
ReachFor
float ReachFor(float senseRadius) constHow far this stimulus reaches a perceiver whose own sense radius is senseRadius.