Interactive visualizer and live monitor for BehaviorTree.CPP v4 XML files. Tree rendering, node search, blackboard inspector, node palette, drag layout, and real-time ZMQ status overlay.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Loads the live tree with correct UIDs for accurate status mapping
Multi-tree Support
Dropdown selector for XML files containing multiple <BehaviorTree> definitions
Usage
Open any BehaviorTree.CPP v4 XML file in VSCode
Open the viewer using any of:
Editor title bar: click the tree icon (top-right, appears on XML files)
Right-click menu: "Open Behavior Tree Viewer" (editor or explorer)
Keyboard: Ctrl+Shift+T (Cmd+Shift+T on Mac) when an XML file is active
Command palette: BehaviorTree: Open Behavior Tree Viewer
Keyboard shortcuts (in the viewer)
Key
Action
F
Fit tree to view
R
Reset layout
+ / -
Zoom in / out
0
Reset zoom to 100%
Ctrl+F
Focus search box
Esc
Clear search
Scroll wheel
Zoom toward cursor
Click + drag (background)
Pan
Click + drag (node)
Move node/subtree
Double-click (node)
Collapse/expand children
Configuration
Set in VSCode Settings (Ctrl+,) under "BehaviorTree Viewer", or in .vscode/settings.json:
{
// Host for live BT.CPP ZMQ monitor connection
"behaviortreeViewer.monitorHost": "localhost",
// Port for BT.CPP ZMQ monitor (REP socket; SUB socket is port+1)
"behaviortreeViewer.monitorPort": 1666
}
For monitoring a remote BT process, set monitorHost to the target machine's IP address.
Supported XML format
The extension supports BehaviorTree.CPP v4 XML with:
<root BTCPP_format="4"> wrapper
<BehaviorTree ID="..."> definitions (one or more per file)
zeromq for live monitoring (optional; monitor button is non-functional without it)
Acknowledgements
BehaviorTree.CPP by Davide Faconti and contributors (MIT License) -- the behavior tree library this extension visualizes. Live monitoring uses the Groot2 ZMQ protocol.
ZeroMQ (MPL-2.0) -- messaging library for live monitoring