APSDocs
Memory

Search & evidence#

Things you leave behind that an AI can find, a search that sends it where you could plausibly be, and places it will never look.

APS Evidence, APS Observer and APS Search componentsThe APS Knowledge module (part of APS)Demo: rooms Q5 and M4
The 30-second version
Room Q5. A forced lock is APS Evidence: the guard who finds it believes someone was here, and searches the points around it (the circles), the most likely first.
  • Add APS Evidence to anything an AI should be able to find: a body, a forced lock, blood.
  • An AI with APS Observer discovers it and fires On Evidence Discovered.
  • APS Search hands out the best place to look next, and Is Search Exhausted says when it has looked everywhere.

Evidence#

APS Evidence turns any actor into something an AI can discover and draw a conclusion from. Add the component: that is the setup.

SettingDefaultWhat it does
Evidence TagEvidenceWhat kind of thing it is: Body, ForcedLock, Blood, Footprints
Conspicuousness0.6How obvious it is, 0 to 1: 1 a body in a corridor, 0.2 a scuff mark. An AI has to be closer to notice the subtle ones.
Belief Strength0.8How strongly finding it convinces the AI: the confidence of the belief it forms
Lifetime Seconds0Fades away on its own after this long; 0 stays until removed
Instigator(none)Who did it, if your game knows: carried into the finder's memory
Implied Direction(0, 0, 0)Which way they went: drag marks, a blood trail, a door left swinging
Auto Register as PerceivableOnRegister itself so AI can perceive it, with nothing else to do

Get Age says how long it has existed ("still warm"); Remove Evidence takes it away: a body dragged off, a stain mopped up.

Implied Direction is the useful one. Most evidence says something happened here; evidence with a direction says and they went that way, which turns a sweep into a pursuit.

Discovering it#

An AI with an APS Observer component and Discover Evidence on finds evidence near it and fires On Evidence Discovered (Evidence Actor, Evidence Tag, Location), once per piece. By then the AI already holds a belief about that place. The rest is your logic: raise the alarm, start a search, change the patrol, file a memory. Get Discovered Evidence Count says how many it has found.

APS Search answers one question again and again: they were last seen here, and I've already looked there: where next?

On AI Lost (Target, Last Known)
  → Begin Search (Last Known)

Behavior Tree:
  → Get Best Search Point → Point
  → Move To (Point's Location)
  → Branch: Is Search Exhausted → give up, back to patrol
NodeWhat it does
Begin Search (Last Known Location)Start searching around a point (replaces any search running)
End SearchStop
Is SearchingIs one running?
Get Best Search PointThe single best place to look next; false when nothing is left
Get Ranked Search Points (Count)The best few, most promising first: one each for a squad
Mark Cleared (Location, Radius)"I've looked here": for a look through a window, or a squadmate's search
Is Search ExhaustedIt has looked everywhere it can reach
Get Search ProgressHow much of the reachable area is checked, 0 to 1
Get Search DurationSeconds since Begin Search

It clears as it walks: while searching, everywhere the AI goes counts as checked (every quarter second, within Clear Radius). Call Mark Cleared yourself only for places it checked without walking there.

SettingDefaultWhat it does
Cell Size300Grid resolution in cm: smaller is more precise and costs more
Grid Radius20Half-width of the grid in cells: 20 at 300 cm covers a 120 m square
Target Speed450How fast the target could move, in cm/s: what turns elapsed time into an area. Set it near your player's sprint.
Clear Radius450How close the AI must get before a place counts as checked
Require NavigableOnOnly hand out places on the navmesh that the AI can walk to
Go deeperHow it ranks, and the navmesh

Probability follows reachability, not distance: the most likely place isn't next to where it lost you, because you've had time to move. The peak sits at the edge of how far you could plausibly have got, and it widens as time passes.

Points respect the navmesh, so the AI never searches inside a wall:

  • each point is the cell's spot on the navmesh, never a cell centre inside a wall or over a gap;
  • the first time a point comes up, APS checks the AI has a full path to it; a place it can't walk to (a closed room, a roof, the far side of a wall) is skipped for the rest of the search;
  • reaching a point clears its cell, even when the point sits off the cell's centre.

So every point is one an AI MoveTo can walk to, and Is Search Exhausted doesn't wait on places nobody can reach. One query path-tests at most 32 points; past that, points are handed out untested and checked on a later call, so a query never stalls a frame. With no navigation in the level (or Require Navigable off), every cell is accepted: a plain widening area.

Places it never searches#

Room M4. A designer-marked safe room (the green zone): the guard chases you to it, then searches everywhere but inside.

Give the player a guaranteed safe space: Register Never Search Zone (Center, Radius) on the APS subsystem marks a sphere; Unregister Never Search Zone and Clear Never Search Zones remove them.

APS doesn't enforce it by itself: your search and chase logic asks Is Location in Never Search Zone (on APS Core, which respects the profile's Respect Never Search Zones) before sending the AI somewhere, as the demo's M4 guard does.

The demo's safe zone Blueprint
BP_SafeZone › Set Zone On: unregister the zone, then register it again (Register Never Search Zone) when it is switched on.

Putting it together#

All of it your logic, with the parts APS gives you:

  1. The player breaks a lock and leaves. The lock has APS Evidence: tag ForcedLock, Implied Direction down the corridor.
  2. A guard with an APS Observer walks past: On Evidence Discovered fires.
  3. Your Blueprint calls Begin Search at the lock, and Remember on a place subject so the guard finds that corridor suspicious for the rest of the session (Memory).
  4. The Behavior Tree runs Get Best Search Point → move, until Is Search Exhausted.
  5. The guard gives up; the memory of that corridor stays.
The demo guard's search from evidence
How the demo does it (BP_DemoGuard › Behaviour): start a search where the evidence is, walk to the best point, then the next, and give up when the search is exhausted.
APS Advanced Perception System, by AuraGame. Unreal Engine 5.2 and later. These docs are for APS 3.0.
Questions and bug reports