优点:
   0.行为逻辑和状态数据分离,任何节点都可以反复利用。
   1.高度模块化状态,去掉状态中的跳转逻辑,使得状态变成一个“行为”。
   2."行为"和"行为"之间的跳转是通过父节点(Composite)的类型来决定的(例如sequence或者selector) 。比如并行处理两个行为,在状态机里面无法同时处理两个状态。
   3.通过增加控制节点的类型,可以达到复用行为的目的。

Behavior trees are a combination of many different AI techniques: hierarchical state machines, scheduling, planning, and action execution. 
行为树结合了多种ai计数:分层状态机,调度,规划和执行

There are four different types of tasks: action, conditional, composite, and decorator
四种节点: 行为, 条件, 复合, 装饰

基于行为树的AI 与 Behavior Designer插件
简单的行为树例子,条件和动作在同一层的前面,而不是像状态机一样的在前面
Behavior Designer will execute the tasks in a depth first order
深度优先,子节点从左到右执行

常用的控制节点有以下三种
选择(Selector):    选择其子节点的某一个执行(顺序,无序,权重)
序列(Sequence):将其所有子节点依次执行,也就是说当前一个返回“完成”状态后,再运行先一个子节点
并行(Parallel):     将其所有子节点都运行一遍
可以扩展出很多其他的控制节点,比如循环(Loop)等

装饰节点是一个父节点,并且只能有一个子节点

节点状态: running, success, or failure 

BehaviorManager 管理行为树的运行
update interval: every frame; Special seconds, manual 手动调用  BehaviorManager.instance.Tick(); 或 BehaviorManager.instance.Tick(BehaviorTree);
Task Execution Type:  Task Execution Type allows you to specify if the behavior tree should continue executing tasks until it hits an already executed task during that tick or if it should continue to execute the tasks until a maximum number of tasks have been executed during that tick.  No Duplicates 每个task一帧只会执行一次
   
 Behavior Designer 基本概念

     

    Priority Selector 优选选择节点    此节点下属所有节点依次执行直到返回success

    http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=54
 




相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-01
  • 2022-12-23
  • 2021-10-19
  • 2021-12-06
  • 2022-12-23
  • 2022-01-06
相关资源
相似解决方案