Go to file
Serhii Snitsaruk 58ff47d688 GHA: Add web build to GDExtension workflow 2024-02-14 20:33:52 +01:00
.github GHA: Add web build to GDExtension workflow 2024-02-14 20:33:52 +01:00
blackboard Blackboard: Complain when variable is missing 2024-02-13 17:15:19 +01:00
bt BTRunLimit: Add `count_policy` property 2024-02-10 20:13:39 +01:00
demo Editor: Fix issues with property editors & remove old docs 2024-01-29 10:16:24 +01:00
doc Doc: Add C# instructions 2024-02-14 19:58:50 +01:00
doc_classes Blackboard: Complain when variable is missing 2024-02-13 17:15:19 +01:00
editor Better error handling when resolving _generate_name 2024-02-10 15:05:50 +01:00
gdextension Add icon for BehaviorTreeView 2024-02-03 17:55:05 +01:00
hsm Disallow LimboHSM transitions to self when ANYSTATE is used 2024-02-07 13:39:45 +01:00
icons Add icon for BehaviorTreeView 2024-02-03 17:55:05 +01:00
tests Fix tests printing errors 2024-02-13 17:27:32 +01:00
util Util: Function to decorate output variable 2024-02-10 12:34:29 +01:00
.clang-format Initial commit 2022-08-28 12:54:16 +02:00
.gitignore GHA: Update setup script and make build workflow for GDExtension 2024-01-12 10:57:26 +01: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 Doc: Update README.md 2024-02-14 20:32:32 +01:00
SCsub Fix module compilation 2024-01-10 22:45:42 +01:00
config.py Fix issues and update docs for BehaviorTreeData/View 2024-02-03 17:53:12 +01:00
register_types.cpp Fix GDExtension template compilation error 2024-02-03 17:59:21 +01:00
register_types.h Refactor and clean up the code 2024-01-13 17:10:42 +01:00

README.md

LimboAI - Behavior Trees and State Machines for Godot 4

LimboAI logo

🔗 All builds 🔎 Unit Tests Documentation Status GitHub License Discord 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, and more! While it is implemented in C++, it fully supports GDScript for creating your own tasks and states.

🛈 Supported Godot Engine: 4.2

🛈 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.

Behavior Trees are powerful hierarchical structures used to model and control the behavior of agents in a game (e.g., characters, enemies, entities). They are designed to make it easier to create complex and highly modular behaviors for your games. To learn more about behavior trees, check out 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.

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

  • Demo project: Check out our extensive demo project with a tutorial!

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

  • 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

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

Got an idea for a behavior tree task that you think would be useful on a variety of projects? I invite you to open an issue and describe your concept.

Social

We have a fresh new Discord server: https://discord.gg/N5MGC95GpP

I also write about LimboAI development on the 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. 🗸
  • Non-trivial 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.