Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations
BTGraphLayoutEngine.h File Reference

Graph layout engine for behavior tree visualization. More...

#include "../vector.h"
#include "../AI/BehaviorTree.h"
#include <vector>
#include <map>
+ Include dependency graph for BTGraphLayoutEngine.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Olympe::BTNodeLayout
 Layout information for a single behavior tree node. More...
 
class  Olympe::BTGraphLayoutEngine
 Computes clean hierarchical layouts for behavior trees. More...
 

Namespaces

namespace  Olympe
 

Enumerations

enum class  Olympe::BTLayoutDirection { Olympe::TopToBottom , Olympe::LeftToRight }
 Layout direction for behavior tree visualization. More...
 

Detailed Description

Graph layout engine for behavior tree visualization.

Author
Olympe Engine - Behavior Tree Debugger
Date
2025

Implements a 5-phase hierarchical graph layout algorithm:

  1. Layering: Assign nodes to layers via BFS
  2. Initial Ordering: Order nodes within layers
  3. Crossing Reduction: Minimize edge crossings using barycenter heuristic
  4. Buchheim-Walker Layout: Optimal parent centering in abstract unit space
  5. Force-Directed Collision Resolution: Iterative overlap elimination

The algorithm works in abstract unit space (each node = 1.0 unit) and converts to world coordinates at the end with adaptive spacing based on tree complexity.

Definition in file BTGraphLayoutEngine.h.