AI Tree - Behaviour Tree for Unity


what are u doing?

This function is executed once only on Editor launch for caching the necessary information, while it is running, it does not affect performance.

Not once dude. This function is running at every reload domain timing

Yes, we checked it, and you are right, there is one condition missing, which is why it is called every time the script is recompiled. Thanks for you report, we have already fix this function. The update will be available soon.

Update | Version 1.4.0p1 | Date 17.06.23

Changelog:

  • Updated internal packages ExLib and Apex to newest versions.

Update | Version 1.5.0 | Date 27.07.23

Added

  • SensorToolkit2 integration.
  • Ultimate Horror FPS KIT integration.
  • Decorator icons.
  • Decorator and Service nodes creation window.
  • Send message task.

Updated

  • Parallel nodes.
  • AI perception sight config.
  • Node enum properties hiding.
  • Run behaviour task.
  • Playground bot behaviour tree.
  • Decorator view hightlighting.

Fixed

  • Auxiliary nodes.
  • Runtime node visualization.
  • AI Perception replaceable property.
  • Setup parent reference.
  • Editor node initializing.
  • Running empty behaviour tree without root node.

Hello- new user to Ai Tree, looks great!

Quick question, is it possible to set Blackboard variables from external scripts at runtime? If so, what is the way you recommend doing this?

I want to use AiTree to create a simple crowd system that is configurable by the games player- so to enable/disable different branches of the ai tree I want to set bools on the blackboard externally to enable/disable branches of a “master” tree all the agents will use.

I don’t think it is possible to “build” an ai tree BT at runtime so I’ve chosen this path. To create a master tree with all branches then let the player enable/disable them etc.

Thank you.

Hello, sure you can use AI Tree API.

public class Example : MonoBehaviour
{
   [SerializedField]
   private BehaviourRunner runner;

   private void Start()
   {
       Blackboard blackboard = runner.GetBlackboard();

       // Set key by name.
       if(blackboard.TryFindKey<BoolKey>("YouKeyName", out BoolKey boolKey))
       {
           boolKey.SetValue(true);
       }

       // Find all keys of blackboard.
       foreach(Key key in blackboard.Keys)
       {
           // Try cast to bool key.
           if(key is BoolKey boolKey)
           {
               boolKey.SetValue(true);
           }
       }
   }
}

We have released WebGL demo!

Try the Demo!

1 Like

Llam Academy released new video in which shows the work of the behavior tree based on AI Tree!

The new version 1.8.0 is ready and sent for release! The new version will be available for download within a few hours. This update will bring a lot of new tasks, the number of which increases to 175! Improved stability, performance and much more!
Changelog v1.8.0

Added
• Creation of nodes C# script templates.
• Max node view width.
• All selector manipulator in tree graph.
• Editor window icons.
• Component and gizmos icons.
• KeyQuery field drawer.
• Delete context menu for nodes.
• Audio tasks:
• AudioMuteTask
• AudioPauseTask
• AudioPlayTask
• AudioStopTask
• PlayRandomSoundTask
• PlaySoundTask
• SetAudioClipTask
• SetAudioLoopTask
• SetAudioPitchTask
• SetAudioVolumeTask
• Debug tasks:
• DebugLogTask
• DebugDrawLineTask
• DebugDrawRayTask
• GameObject tasks (GO prefix):
• GOActivateTask
• GOAddCompTask
• GOCreateObjectTask
• GODestroyCompTask
• GODestroyObjectTask
• GODestroySelfTask
• GODetachChildrenTask
• GOFindChildTask
• GOFindClosestTask
• GOFindTask
• GOGetChildCountTask
• GOGetChildTask
• GOGetDistanceTask
• GOGetNameTask
• GOGetParentTask
• GOGetRootTask
• GOGetTagTask
• GOSetParentTask
• GOSetTagTask
• Math tasks:
• BoolFlipTask
• FloatAbsTask
• IntAbsTask
• IntClampTask
• RandomBoolTask
• RandomFloatTask
• RandomIntTask
• SampleCurveTask
• GetACosTask
• GetASinTask
• GetAtan2FromV2Task
• GetAtan2FromV3Task
• GetAtan2Task
• GetAtanTask
• GetCosTask
• GetSinTask
• GetTanTask
• PlayerPrefs tasks (PP prefix):
• PPDeleteAllTask
• PPDeleteKeyTask
• PPGetFloatTask
• PPGetIntTask
• PPGetStringTask
• PPSetFloatTask
• PPSetIntTask
• PPSetStringTask
• Quaternion tasks (QRot prefix):
• QRotGetEulerAnglesTask
• QRotEulerTask
• QRotAngleAxisTask
• QRotFromToRotation
• QRotInverseTask
• QRotMultiplyByVectorTask
• QRotMultiplyTask
• Transform tasks (Trfm prefix):
• TrfmGetAngleToTargetTask
• TrfmGetPositionTask
• TrfmGetRotationTask
• TrfmInverseDirectionTask
• TrfmInversePointTask
• TrfmSetScaleTask
• TrfmDirectionTask
• TrfmPointTask
• Vector2 tasks (V2 prefix):
• V2GetLengthTask
• V2GetXYTask
• V2SelectRandomTask
• V2SetValueTask
• V2SetXYTask
• V2AddTask
• V2AddXYTask
• V2ClampMagTask
• V2InvertTask
• Vector3 tasks (V3 prefix):
• V3GetXYZTask
• V3GetLengthTask
• V3SelectRandomTask
• V3SetValueTask
• V3SetXYZTask
• V3AddTask
• V3AddXYZTask
• V3ClampMagTask
• V3InvertTask

Updated
• Improved decorator highlighting.
• Improved multiple grouping.
• Improved Node Inspector window title drawing.
• Improved key drawer.
• Improved Way Point task.
• Improved runtime visualization.
• Improved Blackboard window.
• Improved KeyDetails window.
• Improved Blackboard Viewer window.
• Improved Behaviour Runner API.
• Improved Behaviour Tree API.

Fixed
• BlackboardSetup (Experimental feature)
• Inspector missing script delete button function.
• Blackboard window then nothing is selected.

1 Like

The new version 1.8.1 is available for download!
Changelog v1.8.1

Updated

  • Improved performance and stablility.
  • Improved graph visualization algorithm.
  • Menu item paths Tools/Renowned Games/ → Tools/.

Fixed

  • Groups undo deleting.
1 Like

The new version 1.8.4 is available for download!
Changelog v1.8.4

Added

  • Default icon for task nodes.
  • New Blackboard Details window.

Updated

  • Node type cache ignoring of abstract node implementations and null script assets.

  • Behaviour tree window:

  • Support of dropdown assets with multiple behaviour tree with same name.

  • Nicify title of behaviour tree name.

  • Improved selection logic.

  • Support of multiple windows.

  • Support lock state.

  • Blackboard window:

  • Align the top of the foldout container.

  • Remove search icon.

  • Support selection from BehaviourRunner.

  • Support of adding keys at playmode.

  • Added label of selected blackboard reference.

  • Support of multiple windows.

  • Support lock state.

  • Blackboard asset inspector editor.

  • Improved auto loading built-in window styles.

  • Replaced icon of BlackboardViewer window with classic blackboard icon.

  • Key details window is obsolete, but still support and supported until next major update.

Fixed

  • Auto opening Node Inspector window from Behaviour Tree window when Node Inspector windows has not focus.
  • Hiding key query drawer in new created projects.

Changelog v1.8.3

Updated

  • Improved performance and memory management.
  • Improved stability of blackboard window.

Fixed

  • Empty dropdown of key if call it via node inspector.

Changelog v1.8.2

Updated

  • Improved performance and stablility.

Fixed

  • Selecting associated keys in play mode through graph nodes.

Wow, an Unreal Engine tree/icon design with video covers resembling Unity’s own :slight_smile: It feels kind of weird to have ue style icons/assets in the Unity project.
That being said, It seems interesting. I like how UE handles these things, especially when it comes to the EQS. It might be worth checking.

1 Like

During development, we researched different game engines and draw inspiration from different sources in order to implement the most convenient tool. We implemented all the most interesting features like EQS, Perception System and etc.

Hi, how do I fix this error ? I don’t know what I gotta do here.

Hello can you describe the steps you have taken, after which such an error appears?

I just used this tree here. I also have another script on an object that changes a key if the player enters a certain zone.
Th error appears only when I press play.
9442643--1324835--Screenshot 2023-10-31 at 16.34.25.png

so far the most updated Behavior system with full source and applied some new techs ^^ Can you support another pack like 2D Formations, 3D Formations, Vehicle AI, …

1 Like

Could you please add the demo scenes on WebGL into package? It was the reason that I bought this asset and I found it hard to start without full demo scenes XD.

1 Like