Module ai

Expand description

Shared AI plus authoritative current-pose rigid-world occlusion.

Structs§

Candidate
CoverReservation
A value snapshot of an active cover lease, in simulation time.
DecisionChange
DecisionEdge
First matching edge wins. all/none refer to host-authored sensor bits. None as source matches any state. Matching the current destination holds that state and blocks lower-priority edges without resetting its timer.
DecisionEdgeExplanation
All guard checks for an edge, even when an earlier edge wins or its source does not match. No sensor callbacks run: guards inspect supplied bits only. See DecisionExplanation::edges and DecisionState::explain.
DecisionExplanation
A read-only snapshot of one proposed update, borrowing only the graph. Stores constant-size metadata and lazily explains at most MAX_DECISION_EDGES edges, without allocating. Later updates of the source state do not change this snapshot. See DecisionState::explain for usage.
DecisionGraph
An immutable, bounded graph in authored priority order. Multi-state cycles are allowed: each update follows at most one edge.
DecisionState
EnemyConfig
EnemyController
Constant-space controller. Identity supplies a deterministic strafe phase; no random global state, heap allocation, renderer, transport or damage access.
EnemyInput
EnemyIntent
EnemyStatus
Constant-size snapshot of the controller’s latest successfully applied input. Reading this snapshot never advances time or consumes a transition.
Hearing
Memory
Fixed-capacity memory. Current-tick sight always takes precedence over hearing. Older hearing can update a remembered position; it never grants current sight.
MemorySettings
Noise
NoiseBuffer
Retains newest sounds on saturation. Age once per simulation tick, then publish accepted gameplay sounds. Consumers should exclude their own source ID.
Observer
RadioContact
RigidVisibility
RoundRobin
Round-robin slots over the host’s stable dense agent array. Deletion/reordering is allowed between calls. Every remaining index is visited within ceil(n/k) calls while population and allowance stay fixed. No per-call allocation.
Sight
Slots
SquadBoard
TargetSelection
TargetSelectionReport
Constant-size explanation of one selection. Scores describe this call only. T is Candidate for sight selection and Track for memory selection.
TargetSelector
Opt-in, allocation-free target retention using a finite, nonnegative score margin. Keep one selector per observer/selection stream and call it after sensing on actual simulation ticks. Reset it when restarting that stream.
Track
Unoccluded
WorkBudget
WorkCounts
Shared per-tick allowances. Counts include rejected work attempts; actual navigation work is charged only after the incremental search consumes it.

Enums§

AiError
DecisionEdgeOutcome
An edge’s disposition for one proposed update. See DecisionState::explain.
DecisionGraphError
The first invalid graph setting or edge, returned without allocating. Edge indices refer to the original slice in priority order. See DecisionGraph::validate for check ordering and an example.
Detection
EnemyAttackPhase
Phase of the existing reaction/cooldown timers, not a separate action queue. Recovery takes precedence when both timers are running.
EnemyState
Sense
SquadRole
TargetSelectionReason
Why an opt-in TargetSelector selected or released its target.

Constants§

MAX_DECISION_EDGES
MAX_DECISION_STATES
MAX_MEMORIES
MAX_NOISES

Traits§

VisibilityQuery
True means the host’s authoritative static/dynamic world permits sight. Implementations should ignore the observer/target bodies and enforce layers.

Functions§

select_target
Budgeted deterministic priority selection. Non-finite scores are ignored; equal scores prefer the lower ID. Stops as soon as work is deferred, so an unbounded iterator cannot exhaust the frame. All returned targets passed sight.
turn_towards
Angular speed limit, including a deterministic antiparallel fallback.