Unity中的行为树插件:Behavior Designer

外国技术人员的插件:http://www.opsive.com/assets/BehaviorDesigner

目前公司内部比较推崇的行为树插件就是这个,虽然有其他几个同类的竞品。

说一句题外话,优秀的插件总是外国人开发的,并且可以将插件开发做成一个小工作室或者个人的主要收入来源,但没看到国人有类似的作品出现。

行为树的概念出现已经很多年了,总的来说,就是使用各种经典的控制节点+行为节点进行组合,从而实现复杂的AI。目前在游戏中一般复杂的AI都可以看到行为树的身影,简单的AI可以使用状态机来实现。

       Behavior Designer插件里,主要有四种概念节点,都称之为Task。包括:

       (1) Composites  组合节点,包括经典的:Sequence,Selector,Parallel

       (2) Decorator 装饰节点,顾名思义,就是为仅有的一个子节点额外添加一些功能,比如让子task一直运行直到其返回某个运行状态值,或者将task的返回值取反等等

       (3) Actions     行为节点,行为节点是真正做事的节点,其为叶节点。Behavior Designer插件中自带了不少Action节点,如果不够用,也可以编写自己的Action。一般来说都要编写自己的Action,除非用户是一个不懂脚本的美术或者策划,只想简单地控制一些物件的属性。

       (4) Conditinals 条件节点 ,用于判断某条件是否成立。目前看来,是Behavior Designer为了贯彻职责单一的原则,将判断专门作为一个节点独立处理,比如判断某目标是否在视野内,其实在攻击的Action里面也可以写,但是这样Action就不单一了,不利于视野判断处理的复用。一般条件节点出现在Sequence控制节点中,其后紧跟条件成立后的Action节点。

       Behavior Designer对于变量的共享做了如下处理:

      在同一个Behavior Tree(一般一个GameObject有一个Behavior Tree)的Task间共享的局部变量可以直接在编辑器的Variables添加;另外也支持在不同Behavior Tree之间共享的全局变量;还支持Task与非Task(游戏系统中的其他脚本)之间进行变量传递,通过下面代码进行:

	behaviorTree.GetVariableName("MyVariableName");
	behaviorTree.SetVariableName("MyVariableName", value);
    看了下Behavior Tree官网的视频,感觉还是挺清晰的,就是Sample代码需要一个码才能下载,木有码只能不了了之了,毕竟目前只是用非正式渠道的插件。


This extension requires one license per seat Requires Unity 4.6.0 or higher. Behavior trees are used by AAA studios to create a lifelike AI. With Behavior Designer, you can bring the power of behaviour trees to Unity! Behavior Designer is a behaviour tree implementation designed for everyone - programmers, artists, designers. Behavior Designer offers an intuitive visual editor with a powerful API allowing you to easily create new tasks. It also includes hundreds of tasks, PlayMaker integration, and extensive third party integ ration making it possible to create complex AIs without having to write a single line of code! Behavior Designer was designed from the ground up to be as efficient as possible with zero allocations after initialization. As a result, it runs great on all platforms including mobile. Behavior Designer is dedicated to behavior trees, which means that each update will be a better behavior tree implementation. Features: - An intuitive visual editor - A powerful API - Visual runtime debugger - Variables to communicate between tasks - Conditional Aborts - Built in event system - Unity 5 multiplayer support - Use existing code with reflection tasks - Hundreds of tasks - Evaluate tasks using Utility Theory - Realtime error detection - Binary or JSON serialization - Data-oriented design - Zero runtime allocations after startup - Object drawers (property drawers) - Includes runtime source code - Extensive documentation and videos - Sample projects available online - And more Addon Packs: - Formations Pack - Movement Pack - Tactical Pack Complete Projects: - Deathmatch AI Kit Third Party Integrations: - 2D Toolkit - A* Pathfinding Project (Movement Pack) - Adventure Creator - Anti-Cheat Toolkit - Apex Path (Movement Pack) - Blox - Camera Path Animator - Chronos - Cinema Director - Control Freak - Core GameKit - Curvy - Dialogue System - DOTween - Final IK - Glow Effect - ICode - Inventory Pro - LeanTween - Love/Hate -
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值