Go to file
Serhii Snitsaruk 0e6c83d07c GHA: Update default Godot version to 4.2.1-stable 2023-12-13 00:07:02 +01:00
.github GHA: Update default Godot version to 4.2.1-stable 2023-12-13 00:07:02 +01:00
blackboard Add support for variant param editing and fix bug with ModeSwitchButton 2023-12-10 14:35:28 +01:00
bt Add "inline" optimizations 2023-11-22 13:41:28 +01:00
demo Add property editor for blackboard parameters 2023-12-08 21:56:14 +01:00
doc GH: Update docs 2023-12-02 14:44:10 +01:00
doc_classes Fix drag & drop position in the same branch 2023-11-22 13:05:55 +01:00
editor Debugger: Add the resource header control with a path to the BehaviorTree for the currently debugged instance. 2023-12-12 23:37:28 +01:00
hsm Add tests for HSM 2023-09-11 15:33:13 +02:00
icons Add property editor for blackboard parameters 2023-12-08 21:56:14 +01:00
tests Fix drag & drop position in the same branch 2023-11-22 13:05:55 +01:00
util Fix errors in LimboUtility 2023-11-19 16:26:00 +01:00
.clang-format Initial commit 2022-08-28 12:54:16 +02:00
.gitignore Initial commit 2022-08-28 12:54:16 +02:00
LICENSE.md README: Add LimboAI logo 2023-11-05 15:19:13 +01:00
LOGO_LICENSE.md README: Add LimboAI logo 2023-11-05 15:19:13 +01:00
README.md GH: Update docs 2023-12-02 14:44:10 +01:00
SCsub Reorganize task categories 2023-08-28 13:22:23 +02:00
config.py Add BTProbabilitySelector class 2023-09-24 14:06:09 +02:00
register_types.cpp Add BTProbabilitySelector class 2023-09-24 14:06:09 +02:00
register_types.h Add MIT license - LimboAI is now Open Source! 2023-07-22 19:41:01 +02:00

README.md

LimboAI - Behavior Trees and State Machines for Godot 4

LimboAI logo

LimboAI is a C++ module for Godot Engine 4 that provides an implementation of Behavior Trees and State Machines, which can be used together to create complex AI behaviors.

🛈 Supported Godot Engine: 4.2

🛈 Previously supported: godot-4.1

🛈 License: Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.

A Behavior Tree (BT) is a powerful hierarchical structure used to model and control the behavior of agents in a game. It comprises tasks that represent specific actions or decision-making rules. When executed, the Behavior Tree starts from the root task and traverses down to the leaf tasks, which correspond to the actual actions or behaviors that the agent should perform. For detailed information on how various BT tasks function, please refer to the class documentation. The BehaviorTree class serves as a good starting point.

🛈 See also: Introduction to Behavior Trees.

Textured screenshot

Features

  • Behavior Trees (BT):

    • Easily create, edit, and save BehaviorTree resources in the editor.
    • Execute BehaviorTree resources using the BTPlayer node.
    • Create complex behaviors by combining and nesting tasks in a hierarchy.
    • Control execution flow using composite, decorator, and condition tasks.
    • Create custom tasks by extending core classes: BTAction, BTCondition, BTDecorator, and BTComposite.
    • Built-in class documentation. Check out the BehaviorTree class documentation to get started.
    • Share data seamlessly between tasks using the Blackboard.
    • Blackboard scopes isolate variable namespaces and enable advanced techniques like sharing data between agents in a group.
    • Use the BTSubtree task to execute a tree from a different resource file, promoting organization and reusability.
    • Visual Debugger: Inspect the execution of any BT in a running scene to identify and troubleshoot issues.
    • Monitor tree performance with custom performance monitors.
  • Hierarchical State Machines (HSM):

    • Extend the LimboState class to implement state logic.
    • The LimboHSM node serves as a state machine that manages LimboState instances and transitions.
    • LimboHSM is a state itself and can be nested within other LimboHSM instances.
    • Event-based: Transitions are associated with events and are triggered by the state machine when the relevant event is dispatched, allowing for better decoupling of transitions from state logic.
    • Combine state machines with behavior trees using BTState for advanced reactive AI.
    • Delegation Option: Using the vanilla LimboState, delegate the implementation to your callback functions, making it perfect for rapid prototyping and game jams.
    • 🛈 Note: State machine setup and initialization require code; there is no GUI editor.
  • Tested: Behavior tree tasks and HSM are covered by unit tests.

Getting LimboAI

Precompiled builds

  • For the most recent builds, navigate to ActionsAll Builds, select a build from the list, and scroll down until you find the Artifacts section.
  • For release builds, check Releases.

Compiling from source

  • Download the Godot Engine source code and put this module source into the modules/limboai directory.
  • Consult the Godot Engine documentation for instructions on how to build from source code.
  • If you plan to export a game utilizing the LimboAI module, you'll also need to build export templates.
  • To execute unit tests, compile the engine with tests=yes and run it with --test --tc="*[LimboAI]*".

Using the module

Contributing

All contributions are welcome! Feel free to open issues with bug reports and feature requests, and submit PRs.

Roadmap

Features and improvements that may be implemented in the future:

  • Providing precompiled builds for download. 🗸
  • Tests and CI. 🗸
  • Expanding the library of commonly useful tasks.
  • Creating a non-trivial demo project to showcase the capabilities of LimboAI.
  • Exploring the execution history of behavior trees in the visual debugger.
  • Per-project ignore list for tasks that users may want to hide in the task palette.
  • GUI editor for state machines.
  • Supporting GDExtension in the future, once it matures.