Skip to main content
Version: Next (dev)

Testing and Debugging AI

Test AI in layers so that a missing path is not mistaken for a behavior-selection problem.

  1. Geometry: create a simple floor with collision and verify navmesh visualization.
  2. Route: use Navmesh Path Test with two nearby endpoints, then introduce an obstacle.
  3. Movement: request one destination on AI Navigation. Check its movement mode and controller settings.
  4. Selection: add an AI Agent with a simple idle behavior. Add target-dependent behaviors after sensor detections work.
  5. Queries: test EQS or tactical destinations separately, then connect them to a navigation state.
  6. Coordination: add claims, squads, and distance-based update budgets after the single-agent case works.

Editor previews versus runtime tests

ToolWhat it verifies
Behavior Score PreviewConsideration curves, utility, weight scaling, and commit/cooldown effects for simulated inputs.
Archetype Perception & PeekAuthored behavior grouping, consideration summaries, and perception tuning.
EQS Query PreviewQuery scoring in a synthetic layout with approximate navigation tests.
Navmesh Path TestRoutes on generated scene navigation data while simulating.
AI EQS Query Test / AI Tactical Query TestQuery results and optional cover claims in the actual simulating scene.

The EQS editor's use scene simulation checkbox is currently disabled. Use a scene test component for collision, line-of-sight, and navmesh validation.

Useful CVars

Open Panels > CVars to edit these values. Most visualizations need a simulating scene. See CVars for console and command-line alternatives.

CVarUse
AI.Navmesh.VisualizeNavmesh index: 0 = first, -1 = off.
AI.Navmesh.ShowBuildStatsInspect sector build progress and load.
AI.Navmesh.VisualizeBlockersShow blockers and obstacle carve volumes.
AI.Navmesh.VisualizeLinksShow off-mesh links.
AI.Agents.ShowScoresBehavior scores and consideration breakdowns.
AI.Agents.ShowHistoryBehavior switch history.
AI.Agents.ShowPerceptionPerceived target records.
AI.Agents.DebugFilterOnly display agents whose object names contain this text.
AI.EQS.VisualizeQueriesSet to 1 to inspect query candidates/results.
AI.EQS.VisualizeScoresShow the winning candidate's per-test scores.
AI.EQS.StatsQuery statistics.
AI.Tactical.VisualizeCoverGenerated/authored cover and claims.
AI.Tactical.VisualizeQueriesTactical query results.
AI.Tactical.ShowStatsTactical statistics.
AI.SmartObjects.ShowDebugInteraction slots and claims.
AI.Squad.ShowDebugSquad membership, tokens, targets, and intent.
AI.VoxelGrid.VisualizeVoxel navigation grid.

Common problems

SymptomCheck
Empty navmesh overlayA navmesh configuration must exist and something must request sectors. Check floor collision, layer, ground type, sector bounds, and simulation state.
Narrow doorway missingAgent radius rounds up to whole cells. Check clearance, height, slope, and step height.
Path test works but character stays stillCheck destination calls, navigation state, ApplySteering in DirectTransform mode, and controller/animation setup in the other modes.
Agent never chooses combatCheck sensor categories/markers, team filtering, target confidence, zero-valued considerations, cooldown, and behavior locks.
Behavior switches repeatedlyInspect history; tune commit bonus, curve floors, cooldown, and completion signals.
EQS reports area not readyAllow generation to finish or prebuild the region. Retry rather than treating it as an unreachable destination.
EQS reports no resultInspect context names, candidate radius, filters, cover generation, and claims.
Agent walks to the originCheck query success and the exact vector-entry name before starting navigation.
Cover is missing on low propsA prop below step height may not form a navmesh boundary. Add an authored cover point or strip.
Smart object is found but cannot be usedCheck claim ownership, slot position, use range, and the navigation result.
Slow response at distanceCheck the LOD center and decision-rate budgets before assuming logic failed.

Changes to geometry, settings, or asset dependencies can require a new simulation run. Keep an explicit failure or retry branch in state machines so a query or path failure does not leave the agent waiting indefinitely.

See also