Introduction

Open Edit → Behaviour Trees to launch the OpenCAGE Behaviour Tree Editor. Unlike most Edit tools, this runs as a separate process (a Brainiac Designer fork with OpenCAGE's LegendPlugin node set) and works on global AI data — you don't need a level loaded.

Authoritative trees live in:

  • DATA/BINARY_BEHAVIOR/_DIRECTORY_CONTENTS.BML — packed catalogue the game loads

On startup the editor extracts trees to DATA/BEHAVIOR/*.xml for editing (it clears existing XMLs first). That folder is scratch space — don't treat leftover XMLs as a permanent source of truth.

Closing the script editor, or choosing Behaviour Trees again, kills any open Behaviour Tree Editor instance. Save first if you have unsaved graphs.

Editing Trees

The main layout:

  • Explorer — list of behaviour trees (top) and the node palette (bottom): Actions, Conditions, Decorators, Selectors, Sequences
  • Document tabs — graph canvas for the open tree
  • Properties — property grid for the selected node

Double-click a tree in Explorer to open it. Drag nodes from the palette onto the canvas and wire the graph; select a node to edit its properties. The in-tool help (?) opens the Behaviour Tree Nodes reference.

You can also export a graph snapshot via Save Image Of Behavior (*.emf / *.png). This editor does not edit per-level WORLD/BEHAVIOR_TREE.DB files.

Keyboard Shortcuts

Shortcuts depend on focus — graph canvas vs Explorer. There is no Ctrl+S save shortcut; use the toolbar Save Behavior button.

Graph Canvas

When the behaviour graph has focus:

  • Ctrl (hold) — arrow cursor; drag with Ctrl to duplicate the selection
  • Shift (hold) — operate on the whole branch (copy / cut / delete / paste / drag)
  • Ctrl+C — copy the selected node
  • Ctrl+Shift+C — copy the selected node and its branch
  • Ctrl+V — enter paste mode (ghost preview); left-click to place under a target (release V to cancel)
  • Ctrl+V + Shift — paste as a full branch instead of a single node
  • Ctrl+X — cut the selected node (children are reparented to its parent)
  • Ctrl+Shift+X — cut the selected node and its entire subtree
  • Delete — remove the selected node by extracting it (children kept / reparented)
  • Shift+Delete — delete the selected node and its entire subtree
  • Right-drag — move the selection (hold Shift for the whole branch)

Copy / cut / delete apply to non-root nodes only. There is no undo/redo on the canvas.

Explorer

When the Explorer tree list has focus:

  • F2 — rename the selected behaviour or folder
  • Delete — delete the selected behaviour or group (same as toolbar Delete Behavior/Group)

Explorer does not use Ctrl+C / Ctrl+V / Ctrl+X. Delete here removes trees from the catalogue, not nodes from an open graph.

Saving

Use Save (Save Behavior) in the Behaviour Tree Editor — not OpenCAGE's File → Save Level. Save writes XML for the tree(s), then repackages all DATA/BEHAVIOR/*.xml files back into _DIRECTORY_CONTENTS.BML.

If you close with unsaved graphs, the Unsaved Behaviors dialog offers Save Selected Behaviors, Discard All Unsaved Changes, or Cancel.

Assigning Trees

Editing a tree changes the global definition. To point a character at a tree name from that catalogue, use Edit → Configurations → Characters → Attributes and the Behaviour Tree field (names come from _DIRECTORY_CONTENTS.BML).

Resetting

To restore stock trees, open the Backup ManagerRevert ConfigsReset Behaviour Trees. That closes the game and Behaviour Tree Editor if open, restores the vanilla BML, and refreshes the DATA/BEHAVIOR extract.