Behavior3 client library for Delphi (Behavior Trees for Delphi)

Friday, July 1st, 2016 | Dennis D. Spreen | AI, Delphi 10.1 Berlin, Delphi Programming

behavior3delphi is a Behavior3 client library for Delphi (Behavior Trees for Delphi) based on behavior3js.

Download current version at GitHub


Core Classes

This library includes the following core structures

  • BehaviorTree: the structure that represents a Behavior Tree
  • Blackboard: represents a “memory” in an agent and is required to to run a BehaviorTree
  • Composite: base class for all composite nodes
  • Decorator: base class for all decorator nodes
  • Action: base class for all action nodes
  • Condition: base class for all condition nodes
  • Tick: used as container and tracking object through the tree during the tick signal
  • BaseNode: the base class that provide all common node features


Composite Nodes:

  • Sequence
  • Priority
  • MemSequence
  • MemPriority


  • Inverter
  • Limiter
  • MaxTime
  • Repeater
  • RepeaterUntilFailure
  • RepeaterUntilSuccess


  • Succeeder
  • Failer
  • Error
  • Runner
  • Wait


Either include all units (incl. those found in the Actions/Composites/Core/Decorators directories) or install and compile the Behavior3Delphi.dpk package (in the \Package folder) and set Link with runtime packages to true in the project options (Packages -> Runtime Packages) of your project.

Copyright and license

Copyright 2016 by Dennis D. Spreen Code released under the MIT license.



6 Comments to Behavior3 client library for Delphi (Behavior Trees for Delphi)

Robert Crandall
July 8, 2016

Thank you, this looks very cool. I’m new to behaviour trees but hope to make up for lost time thanks to this new framework. Cheers, Rob

July 9, 2016

@Robert: Behavior3 is a “first generation” behavior tree implementation, thus I’m currently working on a “second generation” event-driven (see link above) implementation – which maximizes performance. And in conjunction with (the new “ai superstar”) utility based AI this is IMHO a great AI concept.

September 15, 2016

New to the concept of Behavior3.
Can you give a example of how and why use Behavior3 in application development(not Games).

September 16, 2016

@JLouro: Why do you ask? If don’t need behaviours of any kind (robotics, automation, etc) you don’t need behavior3 – it’s that simple ­čśë

September 22, 2016

Well. I would like to automate parts of my applications, based on user usage or other, hence the question.
So !? can you give a simple example.

Dennis D. Spreen
September 22, 2016

just take a look at the bottom box link “An Introduction to Behavior Trees” which is written by the Behavior3 author. It gives a quite nice overview of behavior models vs finite state machines (which may better fit your needs)

Leave a comment

About Dennis D. Spreen

I'm an avid programmer working on a variety of platforms in a variety of languages with a wide technical interest.


QR Code