Go to file
Serhii Snitsaruk 654d0cd685
Merge 792502db84 into 5f5ecc2db1
2024-05-28 19:16:38 +00:00
.github GHA: Use godotengine buildroot mirror 2024-05-26 09:32:49 +02:00
blackboard Fix compile-time errors with updated godot-cpp 2024-05-28 19:50:57 +02:00
bt Fix compile-time errors with updated godot-cpp 2024-05-28 19:50:57 +02:00
demo Update demo AI assets 2024-03-25 01:08:58 +01:00
doc Doc: Add first steps 2024-05-26 12:34:18 +02:00
doc_classes Fix `parent_scope` argument in `create_blackboard` should have a default value 2024-05-17 10:36:25 +02:00
editor Editor: Add tab context menu option "Open owner scene" 2024-05-28 21:16:26 +02:00
gdextension Editor: Tab button to inspect blackboard plan 2024-05-28 11:16:37 +02:00
hsm BlackboardPlan: Utilize mapping in LimboHSM 2024-05-15 11:38:53 +02:00
icons Editor: Tab button to inspect blackboard plan 2024-05-28 11:16:37 +02:00
tests Add `agent` parameter to `BTPlayer` to propagate upon `BehaviorTree` initialization, and add `scene_root` property to `BTTask` 2024-05-01 23:20:17 +02:00
util BlackboardPlan: Update inspector upon mapping editing finished 2024-05-15 12:52:50 +02:00
.clang-format Initial commit 2022-08-28 12:54:16 +02:00
.gitignore gitignore: Ignore script templates in demo 2024-02-14 21:09:16 +01:00
.pre-commit-config.yaml Add pre-commit configuration 2024-05-03 00:21:51 +02:00
LICENSE.md Demo: Add LICENSE_ASSETS.md 2024-02-14 21:09:16 +01:00
LOGO_LICENSE.md README: Add LimboAI logo 2023-11-05 15:19:13 +01:00
README.md Update README.md 2024-05-26 12:39:04 +02:00
SCsub Add pre-commit configuration 2024-05-03 00:21:51 +02:00
config.py Add BTEvaluateExpression 2024-02-18 12:20:48 -05:00
register_types.cpp Editor: Add tab context menu option "Open owner scene" 2024-05-28 21:16:26 +02:00
register_types.h Update file headers and fix whitespace 2024-03-21 21:38:57 +01:00

README.md

LimboAI logo

LimboAI - Behavior Trees & State Machines for Godot 4

🔗 All builds 🔎 Unit Tests Documentation Status GitHub License

Discord Support this project Mastodon Follow

LimboAI is an open-source C++ plugin for Godot Engine 4 providing a combination of Behavior Trees and State Machines, which can be used together to create complex AI behaviors. It comes with a behavior tree editor, built-in documentation, visual debugger, extensive demo project with a tutorial, and more! While it is implemented in C++, it fully supports GDScript for creating your own tasks and states.

🛈 Supported Godot Engine: 4.2

Textured screenshot

Behavior Trees are powerful hierarchical structures used to model and control the behavior of agents in a game (e.g., characters, enemies). They are designed to make it easier to create rich and highly modular behaviors for your games. To learn more about behavior trees, check out Introduction to Behavior Trees and our demo project, which includes a tutorial.

Demonstration

Charger from Demo

Videos

Demonstration

🛈 Demo project lives in the demo folder and is available separately in Releases. Run demo/scenes/showcase.tscn to get started. It also contains a tutorial that introduces behavior trees using examples.

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.
    • Blackboard system: Share data seamlessly between tasks using the Blackboard.
      • Blackboard plans: Define variables in the BehaviorTree resource and override their values in the BTPlayer node.
      • Plan editor: Manage variables, their data types and property hints.
      • Blackboard scopes: Prevent name conflicts and enable advanced techniques like sharing data between several agents.
      • Blackboard parameters: Export a BB parameter, for which user can provide a value or bind it to a blackboard variable (can be used in custom tasks).
      • Inspector support for specifying blackboard variables (custom editor for exported StringName properties ending with "_var").
    • 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.
    • Visualize BT in-game using BehaviorTreeView node (for custom in-game tools).
    • Monitor tree performance with custom performance monitors.
  • Hierarchical State Machines (HSM):

    • Extend the 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 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.

  • GDExtension: LimboAI can be used as extension. Custom engine builds are not necessary.

  • Demo + Tutorial: Check out our extensive demo project, which includes an introduction to behavior trees using examples.

First steps

Follow the First steps guide to learn how to get started with LimboAI and the demo project.

Getting LimboAI

LimboAI can be used as either a C++ module or as a GDExtension shared library. GDExtension version is more convenient to use but somewhat limited in features. Whichever you choose to use, your project will stay compatible with both and you can switch from one to the other any time. See Using GDExtension.

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

🛈 For GDExtension: Refer to comments in setup_gdextension.sh file.

  • 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 plugin

Contributing

Contributions are welcome! Please open issues for bug reports, feature requests, or code changes. Keep the minor versions backward-compatible when submitting pull requests.

If you have an idea for a behavior tree task or a feature that could be useful in a variety of projects, open an issue to discuss it.

Social

Need help? We have a Discord server: https://discord.gg/N5MGC95GpP

I write about LimboAI development on Mastodon: https://mastodon.gamedev.place/@limbo.

Roadmap

Features and improvements that may be implemented in the future:

  • Providing precompiled builds for download. 🗸
  • Tests and CI. 🗸
  • GDExtension support. 🗸
  • Extensive demo project. 🗸
  • Expanding the library of commonly useful tasks.
  • 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.

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.