> For the complete documentation index, see [llms.txt](https://sniveler-code.gitbook.io/dots/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sniveler-code.gitbook.io/dots/project-ai-behavior-architect/section-3/runtime-visual-debugging.md).

# 🐞 Runtime Visual Debugging

Debugging DOTS applications can be notoriously difficult since the logic happens inside multithreaded Burst jobs. AI Behavior Architect completely solves this by providing real-time, visual debugging directly on the graph.

#### 🔍 How to Monitor an Agent

1. Enter **Play Mode** in the Unity Editor.
2. Open the **Entity Hierarchy** window (provided by Unity's Entities package).
3. Select any Entity that possesses a `BtAgent` component.
4. If your `Behavior Editor` window is open, it will immediately snap to the `Graph Asset` currently running on that Entity.

#### 🚦 Visual Feedback

As the C# Job evaluates the behavior tree, the Editor listens to the state buffer and updates the nodes on your canvas in real-time. Look at the colored borders of the nodes:

* 🟡 **Yellow Border:** The node is currently **Running**.
* 🟢 **Green Border:** The node returned **Success** this frame.
* 🔴 **Red Border:** The node returned **Failure** this frame.

> 🔒 **Read-Only Mode**\
> When you enter Play Mode, the entire graph canvas and toolbar become locked (Read-Only). This prevents you from accidentally making structural changes to the graph while the backend DOTS systems are actively iterating over the unmanaged Blob Assets.

#### ⚡ Zero Overhead in Production

You might be wondering: "Does visual debugging slow down my DOTS jobs?"\
The answer is **No**.\
The debug state buffers (`BtDebugState`) are wrapped in strict `#if UNITY_EDITOR` preprocessor directives. When you build your game, the debugging memory footprint and logging logic are completely stripped from the compilation. Your production builds run with absolute maximum performance.

***

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sniveler-code.gitbook.io/dots/project-ai-behavior-architect/section-3/runtime-visual-debugging.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
