Go to file
Serhii Snitsaruk 13f5eb1f71 Reorganize BT tasks 2023-08-15 17:49:13 +02:00
.github GH: Fix windows .NET build failing to generate solutions 2023-08-03 13:43:52 +02:00
blackboard Update variables demo and small fixes 2023-08-08 15:07:02 +02:00
bt Reorganize BT tasks 2023-08-15 17:49:13 +02:00
demo Update waypoints demo 2023-08-14 13:29:16 +02:00
doc/images Poetry for the README 2023-07-23 18:02:26 +02:00
doc_classes Add class doc for BTCallMethod 2023-08-15 13:29:12 +02:00
editor Reorganize BT tasks 2023-08-15 17:49:13 +02:00
hsm Fix LimboHSM compile errors with mono glue 2023-07-25 18:39:41 +02:00
icons Add icon for BTCallMethod 2023-08-15 13:16:07 +02:00
util Reorganize BT tasks 2023-08-15 17:49:13 +02: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 Add MIT license - LimboAI is now Open Source! 2023-07-22 19:41:01 +02:00
README.md Update README 2023-08-04 11:28:28 +02:00
SCsub Reorganize BT tasks 2023-08-15 17:49:13 +02:00
config.py Add CallMethod action task 2023-08-15 13:09:18 +02:00
register_types.cpp Reorganize BT tasks 2023-08-15 17:49:13 +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 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.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 BTTask class serves as a good starting point.

Textured screenshot

Textured screenshot

Features

  • Behavior Trees (BT):
    • Use the BTPlayer node to execute BehaviorTree resources.
    • Easily create, edit, and save BehaviorTree resources within the editor.
    • Combine and nest tasks in a hierarchy to create complex behaviors.
    • Control the flow of execution using composite, decorator, and condition tasks.
    • Write your own tasks by extending core classes: BTAction, BTCondition, BTDecorator, and BTComposite.
    • Built-in class documentation. Check out the BehaviorTree and BTTask class documentation to get started.
    • Utilize the Blackboard for seamless data sharing between tasks.
    • Use the BTSubtree task to execute a tree from a different resource file, promoting organization and reusability.
    • Blackboard scopes separate namespaces of variables from subtrees, and enable advanced techniques like sharing data among agents in a group.
    • Visual Debugger: Inspect the execution of any BT in a running scene to identify and troubleshoot issues.
    • Evaluate the performance of your trees with custom performance monitors.
  • Hierarchical State Machine (HSM)
    • Extend LimboState class to implement state logic.
    • 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: Instead of extending LimboState, utilize vanilla LimboState and delegate implementation to provided callback functions. Perfect for game jams and quick prototyping.
    • 🛈 Note: Currently, state machine transition setup and initialization must be done through code as there is no GUI editor for state machines.

How to Get Started

You have two options to start using this module:

  1. Download precompiled builds: Navigate to "Actions → All Builds" and scroll down until you find the "Artifacts" section.
  2. Compile the module on your own (refer to the next section).

Compiling

🛈 Precompiled builds are available in "Actions → All Builds".

To incorporate this module, you'll need to build Godot Engine from source with LimboAI module included.

Building 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 need to build export templates as well.

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. 🗸
  • Creating a non-trivial demo project to showcase the capabilities of LimboAI.
  • Exploring the execution history of Behavior Trees in the Visual Debugger.
  • Tests and CI.
  • Expanding the library of tasks that can be optionally included in the build.
  • Implementing an ignore list for tasks that users may want to hide in the task panel.
  • GUI editor for state machines.
  • Supporting GDExtension in the future, once it matures.