Course contentsShow
← Unreal Engine Game Development
Lesson 436 of 8806. AI, Navigation, and Decision MakingFree lesson

Managing Query Results with Blackboard Keys

Learners will store and retrieve high-scoring EQS locations within the Blackboard to influence subsequent AI movement or combat decisions.

In this lesson, you will learn how to bridge the Environmental Query System (EQS) and the Blackboard to allow your AI to dynamically store and react to high-scoring spatial data.

Bridging EQS and the Blackboard

When an EQS query executes, it generates a list of potential locations—such as "best cover spots" or "optimal flanking positions"—ranked by their score. While an EQS query inside a Behavior Tree (BT) can automatically update a Blackboard key, managing that result effectively requires understanding how the query "writes" to the Blackboard.

In your Behavior Tree, you typically use the Run EQS Query node. Within its details panel, you’ll find the Blackboard Key property. When the query completes, the single highest-scoring location is automatically pushed into this key.

Why this matters for AI logic

The power of this workflow lies in the AI’s ability to treat the Blackboard key as a "decision anchor." Once the location is stored, downstream nodes don't need to perform new queries; they simply read the data already sitting in the Blackboard:

  • MoveTo Task: By setting the MoveTo node to target the same Blackboard Key used by the EQS, the AI will immediately pathfind to the winning location.
  • Decorator Validation: You can use a Blackboard Decorator to check if the key is "Set." If the EQS fails to find a valid spot (e.g., all cover is flanked), the Blackboard key remains empty, allowing your Behavior Tree to branch into a fallback sequence, such as "Retreat" or "Take Cover."

Implementation Tip

When configuring the Run EQS Query node, ensure your query is set to Single Result. If you need multiple points, you would need to store an array of objects or vectors in the Blackboard, which requires custom service logic. For most combat scenarios, updating a single Vector or Object key is the most efficient way to keep your AI’s movement target in sync with the environment's tactical reality.

Key Takeaway: Storing EQS results in a Blackboard Key creates a persistent memory of the "best" tactical position, allowing your AI to make movement decisions based on data-driven environmental analysis rather than hard-coded coordinates.