行为树的两种运行方式
来源:互联网 发布:聚合数据是什么意思 编辑:程序博客网 时间:2024/06/04 04:11
行为树的两种运行方式
(金庆的专栏 2017.8)
行为树每个Tick运行有两种实现方式:
- 从根节点重新开始运行
- 继续上次运行的节点
http://blog.renatopp.com/2014/08/15/an-introduction-to-behavior-trees-part-3/
One common question when implementing a Behavior Tree is that: what to do in the next tick after a node returned a running state? There are two answer to it: starting the graph traversal from the running node or starting it over from the first node.
Behavior3 是每次都从根节点运行的。这种实现简单,正在运行中的行为可以自然地中止切换到其他行为。
缺点是每次运行都是遍历整个树,对于庞大的行为树,性能较差。
http://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php
In the basic implementation of behaviour trees, the system will traverse down from the root of the tree every single frame, testing each node down the tree to see which is active, rechecking any nodes along the way, until it reaches the currently active node to tick it again.
This isn’t a very efficient way to do things, especially when the behaviour tree gets deeper as its developed and expanded during development. I’d say its a must that any behaviour tree you implement should store any currently processing nodes so they can be ticked directly within the behaviour tree engine rather than per tick traversal of the entire tree.
Behaviac 实现为继续当前节点运行。
http://www.behaviac.com/concepts/
当节点持续返回“运行”的时候,BT树的内部“知道”该节点是在持续“运行”的,从而在后续的执行过程中“直接”继续执行该节点,而不需要从头开始执行,直到该运行状态的节点返回“成功”或“失败”,从而继续后续的节点。
但是为了处理事件打断当前运行,需要复杂的实现。
如果发生了其他“重要”的事情需要处理怎么办?
在behaviac里至少有多种办法。
具体为:
- 前置节点
- 并行节点
- 监测节点
- 事件子树
- 行为树的两种运行方式
- 运行shell脚本的两种方式
- 进程协调运行的两种方式
- solr的下载、两种运行方式
- Python的两种运行方式
- 运行js代码的两种方式
- 两种驱动系统运行的方式--分时的方式
- 两种不同的运行wlst脚本的方式
- 两种定制行为的方式:使用参数和使…
- rh中ftp的两种运行方式
- Maven运行TestNG的testcase 两种方式
- python脚本在linux上运行的两种方式
- php-fpm多用户运行的两种方式
- #TensorFlow学习笔记#02 Session的两种运行方式
- 【Python】Python的两种运行方式01
- Oracle数据库两种运行方式
- Loadrunner Vuser 两种运行方式
- 网络编程之Json解析方式与Gson方式解析两兄弟的行为和特点
- NumPy(3)full,eye,empty,random
- 双向链表
- 如何阻止handler的消息处理
- 线程的几种状态转换
- 面试OR笔试10——小数转字符串
- 行为树的两种运行方式
- JMX 入门(三)
- 安卓守护进程,使你的进程不被杀死
- JQuery中的Ajax
- 禅道的安装使用和升级
- Maven打包扔到linux服务器后配置文件乱码的问题
- [js高手之路]搞清楚面向对象,必须要理解对象在创建过程中的内存表示
- python打开网页获取网页内容方法总结
- JDBC常用的类和接口