9#include "../../system/system_utils.h"
10#include "../../BlueprintEditor/ColorScheme.h"
21 return (
a << 24) | (
b << 16) | (
g << 8) |
r;
41 "Executes children until one succeeds (OR logic)",
54 "Executes children until one fails (AND logic)",
67 "Executes all children simultaneously",
84 "Inverts child result (SUCCESS <-> FAILURE)",
97 "Repeats child N times",
110 "Repeats child until it succeeds",
123 "Repeats child until it fails",
136 "Limits execution frequency",
151 "BT_CheckBlackboardValue",
152 "Check Blackboard Value",
153 "Compares blackboard value against expected value",
160 {
"key",
"operator",
"value"}
166 "Checks if entity has a target",
177 "BT_IsTargetInRange",
178 "Is Target In Range",
179 "Checks if target is within specified distance",
192 "Checks line of sight to target",
209 "Waits for N seconds",
222 "Waits for random duration",
229 {
"minDuration",
"maxDuration"}
233 "BT_SetBlackboardValue",
234 "Set Blackboard Value",
235 "Modifies blackboard value",
248 "Moves entity towards target",
261 "Moves entity to specific position",
274 "Attacks current target",
287 "Plays specified animation",
300 "Plays sound effect",
317 "Entry point for behavior tree execution (auto-created, undeletable)",
334 "Entry point triggered by EventQueue message (parameterized by event type)",
341 {
"eventType",
"eventMessage"}
351 "Selects a random child to execute (non-deterministic)",
362 "BT_ParallelThreshold",
363 "Parallel Threshold",
364 "Executes children in parallel with success/failure thresholds",
371 {
"successThreshold",
"failureThreshold"}
381 "Continuously re-evaluates condition during child execution",
398 "Emit event to EventQueue for other systems to receive",
405 {
"eventType",
"domain",
"param1",
"param2",
"state"}
415 "Encapsulates and executes another behavior tree (enables reusability and modularity)",
422 {
"subgraphPath",
"inputParamCount",
"outputParamCount",
"inputBindingCount",
"outputBindingCount"}
425 SYSTEM_LOG <<
"[BTNodeRegistry] Initialized " <<
m_nodeTypes.size() <<
" built-in node types" << std::endl;
438 std::vector<std::string> result;
442 result.push_back(
it->first);
449 std::vector<std::string> result;
452 if (
it->second.category == category) {
453 result.push_back(
it->first);
466 if (
info ==
nullptr) {
470 return info->maxChildren != 0;
475 if (
info ==
nullptr) {
479 return info->minChildren;
484 if (
info ==
nullptr) {
488 return info->maxChildren;
Registry of all Behavior Tree node types for AIGraphPlugin_BT.
ComponentTypeID GetComponentTypeID_Static()
Singleton registry for all BT node types.
bool CanHaveChildren(const std::string &typeName) const
Check if a node type can have children.
std::map< std::string, BTNodeTypeInfo > m_nodeTypes
void RegisterNodeType(const BTNodeTypeInfo &info)
Register a new node type.
int GetMaxChildren(const std::string &typeName) const
Get maximum number of children for a node type.
std::vector< std::string > GetNodeTypesByCategory(BTNodeCategory category) const
Get node types in a specific category.
const BTNodeTypeInfo * GetNodeTypeInfo(const std::string &typeName) const
Get metadata for a node type.
bool IsValidNodeType(const std::string &typeName) const
Check if a node type exists.
std::vector< std::string > GetAllNodeTypes() const
Get all registered node type names.
void InitializeBuiltInTypes()
Initialize all built-in BT node types.
static BTNodeRegistry & Get()
Get singleton instance.
int GetMinChildren(const std::string &typeName) const
Get minimum number of children for a node type.
constexpr ImU32 Composite_Primary
constexpr ImU32 EntryPoint_Primary
constexpr ImU32 SubGraph_Primary
constexpr ImU32 Inverter_Primary
constexpr ImU32 FlowControl_Primary
constexpr ImU32 Repeater_Primary
constexpr ImU32 Action_Primary
BTNodeCategory
Categories of behavior tree nodes.
@ Action
Leaf execution nodes (Wait, Move, Attack, etc.)
@ Composite
Flow control nodes (Selector, Sequence, Parallel)
@ Decorator
Modifiers (Inverter, Repeater, Cooldown, etc.)
@ Condition
Boolean checks (HasTarget, InRange, etc.)
uint32_t ConvertColorFormat(ImU32 imguiColor)
< Provides AssetID and INVALID_ASSET_ID
Metadata for a behavior tree node type.