![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Main debug window for behavior tree runtime visualization. More...
#include <BehaviorTreeDebugWindow.h>
Collaboration diagram for Olympe::BehaviorTreeDebugWindow:Public Member Functions | |
| BehaviorTreeDebugWindow () | |
| ~BehaviorTreeDebugWindow () | |
| void | Initialize () |
| Initialize the debug window. | |
| void | Shutdown () |
| Shutdown and cleanup. | |
| void | Render () |
| Render the debug window (in separate SDL3 window) | |
| void | ToggleVisibility () |
| Toggle window visibility (creates/destroys separate window) | |
| bool | IsVisible () const |
| Check if window is visible. | |
| void | ProcessEvent (SDL_Event *event) |
| Process SDL events for separate window. | |
| void | AddExecutionEntry (EntityID entity, uint32_t nodeId, const std::string &nodeName, BTStatus status) |
| Add an execution log entry. | |
Private Types | |
| enum class | SortMode { Name , TreeName , LastUpdate , AIMode } |
Private Member Functions | |
| void | RenderEntityListPanel () |
| void | RenderInspectorPanel () |
| void | CreateSeparateWindow () |
| void | DestroySeparateWindow () |
| void | RenderInSeparateWindow () |
| void | RefreshEntityList () |
| void | UpdateEntityFiltering () |
| void | UpdateEntitySorting () |
| void | RenderEntityEntry (const EntityDebugInfo &info) |
| void | RenderRuntimeInfo () |
| void | RenderBlackboardSection () |
| void | RenderExecutionLog () |
| void | InitNodeGraphDebugMode () |
| void | ShutdownNodeGraphDebugMode () |
| void | RenderNodeGraphDebugPanel () |
Private Attributes | |
| std::vector< EntityDebugInfo > | m_entities |
| std::vector< EntityDebugInfo > | m_filteredEntities |
| EntityID | m_selectedEntity = 0 |
| std::deque< ExecutionLogEntry > | m_executionLog |
| const size_t | MAX_LOG_ENTRIES = 100 |
| bool | m_isVisible = false |
| bool | m_isInitialized = false |
| float | m_autoRefreshInterval = 0.5f |
| char | m_filterText [256] = "" |
| bool | m_filterActiveOnly = false |
| bool | m_filterHasTarget = false |
| SortMode | m_sortMode = SortMode::Name |
| bool | m_sortAscending = true |
| float | m_entityListWidth = 250.0f |
| float | m_inspectorWidth = 350.0f |
| bool | m_imnodesInitialized = false |
| SDL_Window * | m_separateWindow |
| SDL_Renderer * | m_separateRenderer |
| bool | m_windowCreated |
| ImGuiContext * | m_separateImGuiContext |
| EditorAutosaveManager | m_autosave |
| NodeGraphPanel | m_nodeGraphPanel |
| int | m_debugGraphId = -1 |
| uint32_t | m_lastDebugTreeId = 0 |
Main debug window for behavior tree runtime visualization.
Provides comprehensive debugging capabilities for AI behavior trees, including entity selection, graph visualization, and blackboard inspection.
Renders in a separate SDL3 native window (not embedded in main engine window).
Definition at line 79 of file BehaviorTreeDebugWindow.h.
|
strongprivate |
| Enumerator | |
|---|---|
| Name | |
| TreeName | |
| LastUpdate | |
| AIMode | |
Definition at line 166 of file BehaviorTreeDebugWindow.h.
| Olympe::BehaviorTreeDebugWindow::BehaviorTreeDebugWindow | ( | ) |
Definition at line 26 of file BehaviorTreeDebugWindow.cpp.
| Olympe::BehaviorTreeDebugWindow::~BehaviorTreeDebugWindow | ( | ) |
Definition at line 34 of file BehaviorTreeDebugWindow.cpp.
References Shutdown().
Here is the call graph for this function:| void Olympe::BehaviorTreeDebugWindow::AddExecutionEntry | ( | EntityID | entity, |
| uint32_t | nodeId, | ||
| const std::string & | nodeName, | ||
| BTStatus | status | ||
| ) |
Add an execution log entry.
| entity | Entity that executed |
| nodeId | Node that was executed |
| nodeName | Node name |
| status | Execution result |
Definition at line 811 of file BehaviorTreeDebugWindow.cpp.
References GetComponentTypeID_Static(), and Olympe::ExecutionLogEntry::timeAgo.
Referenced by BehaviorTreeSystem::Process().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 113 of file BehaviorTreeDebugWindow.cpp.
References GetComponentTypeID_Static(), m_separateImGuiContext, m_separateRenderer, m_separateWindow, and m_windowCreated.
Referenced by ToggleVisibility().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 157 of file BehaviorTreeDebugWindow.cpp.
References GetComponentTypeID_Static(), m_separateImGuiContext, m_separateRenderer, m_separateWindow, and m_windowCreated.
Referenced by Shutdown(), and ToggleVisibility().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::BehaviorTreeDebugWindow::Initialize | ( | ) |
Initialize the debug window.
Definition at line 39 of file BehaviorTreeDebugWindow.cpp.
References GetComponentTypeID_Static(), Olympe::EditorAutosaveManager::Init(), InitNodeGraphDebugMode(), m_autosave, m_imnodesInitialized, and m_isInitialized.
Referenced by SDL_AppInit(), and ToggleVisibility().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 36 of file BehaviorTreeDebugWindow_NodeGraph.cpp.
References Olympe::EditorContext::Get(), Olympe::NodeGraphPanel::Initialize(), Olympe::EditorContext::InitializeRuntime(), m_debugGraphId, m_lastDebugTreeId, m_nodeGraphPanel, and SYSTEM_LOG.
Referenced by Initialize().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Check if window is visible.
Definition at line 108 of file BehaviorTreeDebugWindow.h.
References m_isVisible.
Referenced by BehaviorTreeSystem::Process(), and SDL_AppEvent().
Here is the caller graph for this function:Process SDL events for separate window.
| event | SDL event to process |
Definition at line 199 of file BehaviorTreeDebugWindow.cpp.
References GetComponentTypeID_Static(), m_isVisible, m_separateImGuiContext, m_separateWindow, m_windowCreated, and ToggleVisibility().
Referenced by SDL_AppEvent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 339 of file BehaviorTreeDebugWindow.cpp.
References BehaviorTreeRuntime_data::AITreeAssetId, Combat, Dead, BehaviorTreeManager::DebugPrintLoadedTrees(), Olympe::EntityDebugInfo::entityId, Flee, BehaviorTreeManager::Get(), World::Get(), GetComponentTypeID_Static(), BehaviorTreeManager::GetTreeByAnyId(), BehaviorTreeManager::GetTreePathFromId(), AIBlackboard_data::hasTarget, Idle, Investigate, m_entities, BehaviorTreeAsset::name, Identity_data::name, Patrol, UpdateEntityFiltering(), and UpdateEntitySorting().
Referenced by RenderInSeparateWindow().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::BehaviorTreeDebugWindow::Render | ( | ) |
Render the debug window (in separate SDL3 window)
Definition at line 221 of file BehaviorTreeDebugWindow.cpp.
References GetComponentTypeID_Static(), m_isVisible, m_separateImGuiContext, m_separateRenderer, m_windowCreated, and RenderInSeparateWindow().
Referenced by SDL_AppIterate().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 694 of file BehaviorTreeDebugWindow.cpp.
References World::Get(), and GetComponentTypeID_Static().
Here is the call graph for this function:
|
private |
Definition at line 536 of file BehaviorTreeDebugWindow.cpp.
References Failure, GetComponentTypeID_Static(), and Success.
Here is the call graph for this function:
|
private |
Definition at line 483 of file BehaviorTreeDebugWindow.cpp.
References GetComponentTypeID_Static().
Referenced by RenderInSeparateWindow().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 773 of file BehaviorTreeDebugWindow.cpp.
References Failure, GetComponentTypeID_Static(), and Success.
Here is the call graph for this function:
|
private |
Definition at line 245 of file BehaviorTreeDebugWindow.cpp.
References GameEngine::fDt, GetComponentTypeID_Static(), m_autoRefreshInterval, m_entityListWidth, m_executionLog, m_inspectorWidth, RefreshEntityList(), RenderEntityListPanel(), RenderInspectorPanel(), and RenderNodeGraphDebugPanel().
Referenced by Render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 585 of file BehaviorTreeDebugWindow.cpp.
References GetComponentTypeID_Static().
Referenced by RenderInSeparateWindow().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 71 of file BehaviorTreeDebugWindow_NodeGraph.cpp.
References Olympe::NodeGraphManager::CloseGraph(), Olympe::NodeGraphManager::CreateGraph(), Olympe::NodeGraphShared::BTGraphDocumentConverter::FromBehaviorTree(), BehaviorTreeManager::Get(), Olympe::NodeGraphManager::Get(), World::Get(), GetComponentTypeID_Static(), Olympe::NodeGraphManager::GetGraph(), BehaviorTreeManager::GetTreeByAnyId(), m_debugGraphId, m_lastDebugTreeId, m_nodeGraphPanel, m_selectedEntity, Olympe::NodeGraphPanel::RenderGraph(), Olympe::NodeGraphPanel::SetActiveDebugNode(), Olympe::NodeGraphManager::SetActiveGraph(), Olympe::NodeGraphShared::BTGraphDocumentConverter::SyncActiveNode(), and SYSTEM_LOG.
Referenced by RenderInSeparateWindow().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 612 of file BehaviorTreeDebugWindow.cpp.
References Combat, Dead, BehaviorTreeManager::DebugPrintLoadedTrees(), Failure, Flee, BehaviorTreeManager::Get(), World::Get(), GetComponentTypeID_Static(), BehaviorTreeManager::GetTreeByAnyId(), BehaviorTreeManager::GetTreePathFromId(), Idle, Investigate, Patrol, and Success.
Here is the call graph for this function:| void Olympe::BehaviorTreeDebugWindow::Shutdown | ( | ) |
Shutdown and cleanup.
Definition at line 66 of file BehaviorTreeDebugWindow.cpp.
References DestroySeparateWindow(), Olympe::EditorAutosaveManager::Flush(), m_autosave, m_imnodesInitialized, m_isInitialized, and ShutdownNodeGraphDebugMode().
Referenced by ~BehaviorTreeDebugWindow().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 54 of file BehaviorTreeDebugWindow_NodeGraph.cpp.
References Olympe::NodeGraphManager::CloseGraph(), Olympe::NodeGraphManager::Get(), m_debugGraphId, m_nodeGraphPanel, Olympe::NodeGraphPanel::Shutdown(), and SYSTEM_LOG.
Referenced by Shutdown().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::BehaviorTreeDebugWindow::ToggleVisibility | ( | ) |
Toggle window visibility (creates/destroys separate window)
Definition at line 87 of file BehaviorTreeDebugWindow.cpp.
References CreateSeparateWindow(), DestroySeparateWindow(), Initialize(), m_isInitialized, m_isVisible, and m_windowCreated.
Referenced by ProcessEvent(), and SDL_AppEvent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 432 of file BehaviorTreeDebugWindow.cpp.
References GetComponentTypeID_Static(), m_entities, m_filterActiveOnly, m_filteredEntities, m_filterHasTarget, and m_filterText.
Referenced by RefreshEntityList().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 459 of file BehaviorTreeDebugWindow.cpp.
References GetComponentTypeID_Static(), m_filteredEntities, and m_sortAscending.
Referenced by RefreshEntityList().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 158 of file BehaviorTreeDebugWindow.h.
Referenced by RenderInSeparateWindow().
|
private |
Definition at line 192 of file BehaviorTreeDebugWindow.h.
Referenced by Initialize(), and Shutdown().
|
private |
Definition at line 200 of file BehaviorTreeDebugWindow.h.
Referenced by InitNodeGraphDebugMode(), RenderNodeGraphDebugPanel(), and ShutdownNodeGraphDebugMode().
|
private |
Definition at line 147 of file BehaviorTreeDebugWindow.h.
Referenced by RefreshEntityList(), and UpdateEntityFiltering().
|
private |
Definition at line 177 of file BehaviorTreeDebugWindow.h.
Referenced by RenderInSeparateWindow().
|
private |
Definition at line 152 of file BehaviorTreeDebugWindow.h.
Referenced by RenderInSeparateWindow().
Definition at line 162 of file BehaviorTreeDebugWindow.h.
Referenced by UpdateEntityFiltering().
|
private |
Definition at line 148 of file BehaviorTreeDebugWindow.h.
Referenced by UpdateEntityFiltering(), and UpdateEntitySorting().
Definition at line 163 of file BehaviorTreeDebugWindow.h.
Referenced by UpdateEntityFiltering().
|
private |
Definition at line 161 of file BehaviorTreeDebugWindow.h.
Referenced by UpdateEntityFiltering().
Definition at line 181 of file BehaviorTreeDebugWindow.h.
Referenced by Initialize(), and Shutdown().
|
private |
Definition at line 178 of file BehaviorTreeDebugWindow.h.
Referenced by RenderInSeparateWindow().
Definition at line 157 of file BehaviorTreeDebugWindow.h.
Referenced by Initialize(), Shutdown(), and ToggleVisibility().
Definition at line 156 of file BehaviorTreeDebugWindow.h.
Referenced by IsVisible(), ProcessEvent(), Render(), and ToggleVisibility().
|
private |
Definition at line 201 of file BehaviorTreeDebugWindow.h.
Referenced by InitNodeGraphDebugMode(), and RenderNodeGraphDebugPanel().
|
private |
Definition at line 199 of file BehaviorTreeDebugWindow.h.
Referenced by InitNodeGraphDebugMode(), RenderNodeGraphDebugPanel(), and ShutdownNodeGraphDebugMode().
|
private |
Definition at line 149 of file BehaviorTreeDebugWindow.h.
Referenced by RenderNodeGraphDebugPanel().
|
private |
Definition at line 189 of file BehaviorTreeDebugWindow.h.
Referenced by CreateSeparateWindow(), DestroySeparateWindow(), ProcessEvent(), and Render().
|
private |
Definition at line 185 of file BehaviorTreeDebugWindow.h.
Referenced by CreateSeparateWindow(), DestroySeparateWindow(), and Render().
|
private |
Definition at line 184 of file BehaviorTreeDebugWindow.h.
Referenced by CreateSeparateWindow(), DestroySeparateWindow(), and ProcessEvent().
Definition at line 174 of file BehaviorTreeDebugWindow.h.
Referenced by UpdateEntitySorting().
|
private |
Definition at line 173 of file BehaviorTreeDebugWindow.h.
|
private |
Definition at line 186 of file BehaviorTreeDebugWindow.h.
Referenced by CreateSeparateWindow(), DestroySeparateWindow(), ProcessEvent(), Render(), and ToggleVisibility().
Definition at line 153 of file BehaviorTreeDebugWindow.h.