Behavior tree system2 min read

Behavior tree system feature image

Behavior Tree Module for Galaxy108

After extensive research and design, I have finally developed a Behavior Tree module and data visualization editor tailored specifically for Galaxy108.

Node Types

The module consists of the following node types:

  • Action
  • Composite
  • Condition
  • Decorator
  • IO
  • Symbol

Structure

  • Root Behavior Tree: The main tree that drives NPC behavior.
  • Module Sub-Trees: Secondary behavior trees linked to the root tree via Symbol Nodes, enabling data relationships between the root and modules, as well as between modules themselves.

Processing Flow

  • IO Nodes: Process data from right to left.
  • Other Nodes: Process data from left to right, moving unidirectionally from the root node to child nodes.

Current Features

We have implemented common NPC behavior nodes, such as:

  • Pathfinding
  • Fleeing
  • Attacking
  • Free Movement

Future Plans

We will continue to expand the behavior node library based on NPC feedback states and gameplay requirements, adding more sophisticated logic to enhance NPC interactions and decision-making.




Galaxy108 行为树模块

经过深入的研究和设计,我终于为 Galaxy108 量身定制了一套 行为树模块数据可视化编辑器

节点类型

该模块由以下几类节点组成:

  • Action(动作节点)
  • Composite(组合节点)
  • Condition(条件节点)
  • Decorator(装饰节点)
  • IO(输入输出节点)
  • Symbol(符号节点)

结构

  • Root Behavior Tree(根行为树):驱动 NPC 行为的主行为树。
  • Module Sub-Trees(模块子行为树):通过 Symbol Nodes(符号节点) 与根行为树链接,实现根行为树与模块之间以及模块与模块之间的数据关系。

处理流程

  • IO 节点:数据从 右到左 处理。
  • 其他节点:数据从 左到右 单向处理,从根节点向子节点传递。

当前功能

我们已经实现了一些常见的 NPC 行为节点,例如:

  • 寻路
  • 逃跑
  • 攻击
  • 自由移动

未来计划

我将根据 NPC 的反馈状态和游戏需求,继续扩展行为节点库,添加更强大的逻辑,以增强 NPC 的交互和决策能力。