Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
BTNode Struct Reference

Represents a single node in a behavior tree. More...

#include <BehaviorTree.h>

Public Member Functions

std::string GetParameterString (const std::string &key, const std::string &defaultValue="") const
 
int GetParameterInt (const std::string &key, int defaultValue=0) const
 
float GetParameterFloat (const std::string &key, float defaultValue=0.0f) const
 

Public Attributes

BTNodeType type = BTNodeType::Action
 Node type.
 
uint32_t id = 0
 Unique node ID within tree.
 
std::vector< uint32_tchildIds
 IDs of child nodes.
 
BTConditionType conditionType = BTConditionType::TargetVisible
 Condition type (enum)
 
std::string conditionTypeString
 Condition type as string (for flexible conditions like CheckBlackboardValue)
 
float conditionParam = 0.0f
 Generic parameter for conditions.
 
BTActionType actionType = BTActionType::Idle
 Action type.
 
float actionParam1 = 0.0f
 Generic parameter 1 for actions.
 
float actionParam2 = 0.0f
 Generic parameter 2 for actions.
 
uint32_t decoratorChildId = 0
 
int repeatCount = 1
 
std::string name
 
float editorPosX = 0.0f
 Horizontal position in editor canvas (pixels)
 
float editorPosY = 0.0f
 Vertical position in editor canvas (pixels) - used for execution order sorting.
 
std::map< std::string, std::string > stringParams
 String parameters.
 
std::map< std::string, intintParams
 Integer parameters.
 
std::map< std::string, floatfloatParams
 Float parameters.
 
std::string eventType
 Event type listener (e.g., "Olympe_EventType_AI_Explosion")
 
std::string eventMessage
 Optional event message filter (for future event filtering)
 
uint32_t onEventRootIndex = 0
 Index into BehaviorTreeAsset::m_eventRootIds for backreference.
 
std::string subgraphPath
 Path to external .bt.json or .ats file.
 
std::map< std::string, std::string > subgraphInputs
 Input bindings: "childVar" → "parentVar".
 
std::map< std::string, std::string > subgraphOutputs
 Output bindings: "childVar" → "parentVar".
 

Detailed Description

Represents a single node in a behavior tree.

Can be a composite, decorator, condition, or action node. Stores node type, parameters, and child references.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 139 of file BehaviorTree.h.

Member Function Documentation

◆ GetParameterFloat()

float BTNode::GetParameterFloat ( const std::string &  key,
float  defaultValue = 0.0f 
) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 196 of file BehaviorTree.h.

References floatParams, and GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetParameterInt()

int BTNode::GetParameterInt ( const std::string &  key,
int  defaultValue = 0 
) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 190 of file BehaviorTree.h.

References GetComponentTypeID_Static(), and intParams.

+ Here is the call graph for this function:

◆ GetParameterString()

std::string BTNode::GetParameterString ( const std::string &  key,
const std::string &  defaultValue = "" 
) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 184 of file BehaviorTree.h.

References GetComponentTypeID_Static(), and stringParams.

+ Here is the call graph for this function:

Member Data Documentation

◆ actionParam1

float BTNode::actionParam1 = 0.0f

Generic parameter 1 for actions.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 154 of file BehaviorTree.h.

◆ actionParam2

float BTNode::actionParam2 = 0.0f

Generic parameter 2 for actions.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 155 of file BehaviorTree.h.

◆ actionType

BTActionType BTNode::actionType = BTActionType::Idle

◆ childIds

std::vector<uint32_t> BTNode::childIds

◆ conditionParam

float BTNode::conditionParam = 0.0f

Generic parameter for conditions.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 150 of file BehaviorTree.h.

◆ conditionType

Condition type (enum)

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 148 of file BehaviorTree.h.

◆ conditionTypeString

std::string BTNode::conditionTypeString

Condition type as string (for flexible conditions like CheckBlackboardValue)

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 149 of file BehaviorTree.h.

◆ decoratorChildId

uint32_t BTNode::decoratorChildId = 0

◆ editorPosX

float BTNode::editorPosX = 0.0f

Horizontal position in editor canvas (pixels)

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 165 of file BehaviorTree.h.

◆ editorPosY

float BTNode::editorPosY = 0.0f

Vertical position in editor canvas (pixels) - used for execution order sorting.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 166 of file BehaviorTree.h.

◆ eventMessage

std::string BTNode::eventMessage

Optional event message filter (for future event filtering)

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 175 of file BehaviorTree.h.

◆ eventType

std::string BTNode::eventType

Event type listener (e.g., "Olympe_EventType_AI_Explosion")

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 174 of file BehaviorTree.h.

◆ floatParams

std::map<std::string, float> BTNode::floatParams

Float parameters.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 171 of file BehaviorTree.h.

Referenced by GetParameterFloat().

◆ id

uint32_t BTNode::id = 0

◆ intParams

std::map<std::string, int> BTNode::intParams

Integer parameters.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 170 of file BehaviorTree.h.

Referenced by GetParameterInt().

◆ name

std::string BTNode::name

◆ onEventRootIndex

uint32_t BTNode::onEventRootIndex = 0

◆ repeatCount

int BTNode::repeatCount = 1

◆ stringParams

std::map<std::string, std::string> BTNode::stringParams

◆ subgraphInputs

std::map<std::string, std::string> BTNode::subgraphInputs

Input bindings: "childVar" → "parentVar".

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 180 of file BehaviorTree.h.

◆ subgraphOutputs

std::map<std::string, std::string> BTNode::subgraphOutputs

Output bindings: "childVar" → "parentVar".

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 181 of file BehaviorTree.h.

◆ subgraphPath

std::string BTNode::subgraphPath

Path to external .bt.json or .ats file.

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 179 of file BehaviorTree.h.

Referenced by BehaviorTreeManager::DetectCircularDependencies().

◆ type


The documentation for this struct was generated from the following file: