Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e0c1a61
add new nodes
bitbrain Jan 6, 2024
dcb7397
remove old Godot versions
bitbrain Jan 6, 2024
3cdcef7
fix compile error
bitbrain Jan 11, 2024
a5fa3f6
fix gdextension
bitbrain Jan 11, 2024
2f7da0b
rename BeehaveNode -> BeehaveTreeNode
bitbrain Jan 11, 2024
48aa21e
add beehave context + license info
bitbrain Jan 11, 2024
4ad288e
implement BeehaveContext (#300)
bitbrain Jan 13, 2024
482fab8
expose BeehaveTree on context
bitbrain Jan 13, 2024
5b441ca
remove tick method from tree
bitbrain Jan 13, 2024
2167005
use double rather than float for delta
bitbrain Jan 13, 2024
f08c868
avoid cyclic dependencies through forward declaration
bitbrain Jan 14, 2024
1168f86
implement child ticking
bitbrain Jan 14, 2024
769f8aa
.clang formatting
bitbrain Jan 15, 2024
406e75b
Beehave tree and blackboard improvements (#313)
bitbrain Feb 17, 2024
395269d
Pass beehave tree tests (#314)
bitbrain Feb 17, 2024
cc07dc2
implement failer (#315)
bitbrain Feb 17, 2024
daccbe8
implement inverter (#316)
bitbrain Feb 17, 2024
ae0b4dc
fix icons
bitbrain Feb 17, 2024
afffd40
⚒️ Remaining decorators (#317)
bitbrain Mar 1, 2024
1c5b2b9
V3 nodes composites (#360)
bitbrain Nov 3, 2024
058096c
Add BeehaveSequence C++ implementation (#414)
LenNerd42 Sep 20, 2025
33d3e8a
Implement missing composites in C++ (#415)
LenNerd42 Sep 24, 2025
d25e4e9
Add hooks (before_run, after_run) and interrupts back in (#416)
LenNerd42 Oct 3, 2025
2c587c6
Add leaves in C++ (#417)
LenNerd42 Oct 19, 2025
a71c87c
fixed lib path on linux and added linux specific gitignores (#433)
Clicky-coded Apr 5, 2026
5a81730
Fixed Broken References (#434)
Clicky-coded Apr 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 185 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
# Commented out parameters are those with the same value as base LLVM style.
# We can uncomment them if we want to change their value, or enforce the
# chosen value in case the base style changes (last sync: Clang 14.0).
---
### General config, applies to all languages ###
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
# AlignArrayOfStructures: None
# AlignConsecutiveMacros: None
# AlignConsecutiveAssignments: None
# AlignConsecutiveBitFields: None
# AlignConsecutiveDeclarations: None
# AlignEscapedNewlines: Right
AlignOperands: DontAlign
AlignTrailingComments: false
# AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
# AllowShortEnumsOnASingleLine: true
# AllowShortBlocksOnASingleLine: Never
# AllowShortCaseLabelsOnASingleLine: false
# AllowShortFunctionsOnASingleLine: All
# AllowShortLambdasOnASingleLine: All
# AllowShortIfStatementsOnASingleLine: Never
# AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: false
# AlwaysBreakTemplateDeclarations: MultiLine
# AttributeMacros:
# - __capability
# BinPackArguments: true
# BinPackParameters: true
# BraceWrapping:
# AfterCaseLabel: false
# AfterClass: false
# AfterControlStatement: Never
# AfterEnum: false
# AfterFunction: false
# AfterNamespace: false
# AfterObjCDeclaration: false
# AfterStruct: false
# AfterUnion: false
# AfterExternBlock: false
# BeforeCatch: false
# BeforeElse: false
# BeforeLambdaBody: false
# BeforeWhile: false
# IndentBraces: false
# SplitEmptyFunction: true
# SplitEmptyRecord: true
# SplitEmptyNamespace: true
# BreakBeforeBinaryOperators: None
# BreakBeforeConceptDeclarations: true
# BreakBeforeBraces: Attach
# BreakBeforeInheritanceComma: false
# BreakInheritanceList: BeforeColon
# BreakBeforeTernaryOperators: true
# BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
# BreakStringLiterals: true
ColumnLimit: 0
# CommentPragmas: '^ IWYU pragma:'
# QualifierAlignment: Leave
# CompactNamespaces: false
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
# DeriveLineEnding: true
# DerivePointerAlignment: false
# DisableFormat: false
# EmptyLineAfterAccessModifier: Never
# EmptyLineBeforeAccessModifier: LogicalBlock
# ExperimentalAutoDetectBinPacking: false
# PackConstructorInitializers: BinPack
ConstructorInitializerAllOnOneLineOrOnePerLine: true
# AllowAllConstructorInitializersOnNextLine: true
# FixNamespaceComments: true
# ForEachMacros:
# - foreach
# - Q_FOREACH
# - BOOST_FOREACH
# IfMacros:
# - KJ_IF_MAYBE
# IncludeBlocks: Preserve
IncludeCategories:
- Regex: '".*"'
Priority: 1
- Regex: '^<.*\.h>'
Priority: 2
- Regex: "^<.*"
Priority: 3
# IncludeIsMainRegex: '(Test)?$'
# IncludeIsMainSourceRegex: ''
# IndentAccessModifiers: false
IndentCaseLabels: true
# IndentCaseBlocks: false
# IndentGotoLabels: true
# IndentPPDirectives: None
# IndentExternBlock: AfterExternBlock
# IndentRequires: false
IndentWidth: 4
# IndentWrappedFunctionNames: false
# InsertTrailingCommas: None
# JavaScriptQuotes: Leave
# JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
# LambdaBodyIndentation: Signature
# MacroBlockBegin: ''
# MacroBlockEnd: ''
# MaxEmptyLinesToKeep: 1
# NamespaceIndentation: None
# PenaltyBreakAssignment: 2
# PenaltyBreakBeforeFirstCallParameter: 19
# PenaltyBreakComment: 300
# PenaltyBreakFirstLessLess: 120
# PenaltyBreakOpenParenthesis: 0
# PenaltyBreakString: 1000
# PenaltyBreakTemplateDeclaration: 10
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 60
# PenaltyIndentedWhitespace: 0
# PointerAlignment: Right
# PPIndentWidth: -1
# ReferenceAlignment: Pointer
# ReflowComments: true
# RemoveBracesLLVM: false
# SeparateDefinitionBlocks: Leave
# ShortNamespaceLines: 1
# SortIncludes: CaseSensitive
# SortJavaStaticImport: Before
# SortUsingDeclarations: true
# SpaceAfterCStyleCast: false
# SpaceAfterLogicalNot: false
# SpaceAfterTemplateKeyword: true
# SpaceBeforeAssignmentOperators: true
# SpaceBeforeCaseColon: false
# SpaceBeforeCpp11BracedList: false
# SpaceBeforeCtorInitializerColon: true
# SpaceBeforeInheritanceColon: true
# SpaceBeforeParens: ControlStatements
# SpaceBeforeParensOptions:
# AfterControlStatements: true
# AfterForeachMacros: true
# AfterFunctionDefinitionName: false
# AfterFunctionDeclarationName: false
# AfterIfMacros: true
# AfterOverloadedOperator: false
# BeforeNonEmptyParentheses: false
# SpaceAroundPointerQualifiers: Default
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceInEmptyBlock: false
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpacesInAngles: Never
# SpacesInConditionalStatement: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
## Godot TODO: We'll want to use a min of 1, but we need to see how to fix
## our comment capitalization at the same time.
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# SpaceBeforeSquareBrackets: false
# BitFieldColonSpacing: Both
# StatementAttributeLikeMacros:
# - Q_EMIT
# StatementMacros:
# - Q_UNUSED
# - QT_REQUIRE_VERSION
TabWidth: 4
# UseCRLF: false
UseTab: Always
# WhitespaceSensitiveMacros:
# - STRINGIZE
# - PP_STRINGIZE
# - BOOST_PP_STRINGIZE
# - NS_SWIFT_NAME
# - CF_SWIFT_NAME
---
### C++ specific config ###
Language: Cpp
Standard: c++17
22 changes: 11 additions & 11 deletions .github/workflows/beehave-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ on:
branches:
- "godot-4.x"
paths-ignore:
- '**.jpg'
- '**.png'
- '**.svg'
- '**.md'
- '**plugin.cfg'
- "**.jpg"
- "**.png"
- "**.svg"
- "**.md"
- "**plugin.cfg"
pull_request:
paths-ignore:
- '**.jpg'
- '**.png'
- '**.svg'
- '**.md'
- '**plugin.cfg'
- "**.jpg"
- "**.png"
- "**.svg"
- "**.md"
- "**plugin.cfg"
workflow_dispatch:

concurrency:
Expand All @@ -31,7 +31,7 @@ jobs:
fail-fast: false
max-parallel: 10
matrix:
godot-version: ['4.0.4', '4.1.3', '4.2.1']
godot-version: ["4.2.1"]

name: "🤖 CI on Godot ${{ matrix.godot-version }}"
uses: ./.github/workflows/unit-tests.yml
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
**/*.import
export.cfg
export_presets.cfg
*.uid

# Mono-specific ignores
.mono/
Expand All @@ -16,4 +17,10 @@ reports/
*.dblite
*.exp
*.lib
*.obj
*.obj
*.os

.vs

compile_commands.json

7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ To better understand what branch to choose from for which Godot version, please
|---|---|--|
|`3.x`|`3.x`|`1.x`|
|`4.x`|`4.x`|`2.x`|
|`4.x`|`4.x`|`3.x`|

Refer to [this guide](https://bitbra.in/2023/09/03/godot-addon-compatibility.html) for more details behind this structure.

Expand All @@ -58,12 +59,6 @@ Behavior trees are a modular way to build AI logic for your game. For simple AI,

[Learn how to beehave on the official wiki!](https://bitbra.in/beehave/#/manual/)

## Tutorial (Godot 3.5+)

[bitbrain](https://youtube.com/@bitbraindev) recorded this tutorial to show in more depth how to use this addon:

[![tutorial-thumbnail](https://img.youtube.com/vi/n0gVEA1dyPQ/0.jpg)](https://www.youtube.com/watch?v=n0gVEA1dyPQ)

# 🥰 Credits

- logo designs by [@NathanHoad](https://twitter.com/nathanhoad) & [@StuartDeVille](https://twitter.com/StuartDeVille)
Expand Down
18 changes: 17 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,23 @@
import os
import sys

def recursive_glob(rootdir, pattern):
matches = []
for root, dirnames, filenames in os.walk(rootdir):
for filename in filenames:
if filename.endswith(pattern):
matches.append(os.path.join(root, filename))
return matches

env = SConscript("godot-cpp/SConstruct")

# Add those directory manually, so we can skip the godot_cpp directory when including headers in C++ files
source_path = [
os.path.join("godot-cpp", "include","godot_cpp"),
os.path.join("godot-cpp", "gen", "include","godot_cpp")
]
env.Append(CPPPATH=[env.Dir(d) for d in source_path])

# For the reference:
# - CCFLAGS are compilation flags shared between C and C++
# - CFLAGS are for C-specific compilation flags
Expand All @@ -14,7 +29,8 @@ env = SConscript("godot-cpp/SConstruct")

# tweak this if you want to use different folders, or more folders, to store your source code in.
env.Append(CPPPATH=["extension/src/"])
sources = Glob("extension/src/*.cpp")

sources = recursive_glob('extension/src', '.cpp')

if env["platform"] == "macos":
library = env.SharedLibrary(
Expand Down
39 changes: 34 additions & 5 deletions addons/beehave/beehave.gdextension
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[configuration]
entry_symbol = "initialize_beehave_types"
entry_symbol = "beehave_library_init"
compatibility_minimum = 4.2

[libraries]
Expand All @@ -9,9 +9,9 @@ windows.release.x86_64 = "res://addons/beehave/libs/windows/beehave.windows.temp
macos.editor = "res://addons/beehave/libs/macos/beehave.macos.editor.framework"
macos.debug = "res://addons/beehave/libs/macos/beehave.macos.template_debug.framework"
macos.release = "res://addons/beehave/libs/macos/beehave.macos.template_release.framework"
linux.editor.x86_64 = "res://addons/beehave/libs/linux/beehave.linux.editor.x86_64.so"
linux.debug.x86_64 = "res://addons/beehave/libs/linux/beehave.linux.template_debug.x86_64.so"
linux.release.x86_64 = "res://addons/beehave/libs/linux/beehave.linux.template_release.x86_64.so"
linux.editor.x86_64 = "res://addons/beehave/libs/linux/libbeehave.linux.editor.x86_64.so"
linux.debug.x86_64 = "res://addons/beehave/libs/linux/libbeehave.linux.template_debug.x86_64.so"
linux.release.x86_64 = "res://addons/beehave/libs/linux/libbeehave.linux.template_release.x86_64.so"
android.debug.x86_64 = "res://addons/beehave/libs/android/x86_64/beehave.android.template_debug.x86_64.so"
android.release.x86_64 = "res://addons/beehave/libs/android/x86_64/beehave.android.template_release.x86_64.so"
android.debug.arm64 = "res://addons/beehave/libs/android/arm64/beehave.android.template_debug.arm64.so"
Expand All @@ -20,4 +20,33 @@ ios.debug = "res://addons/beehave/libs/ios/beehave.ios.template_debug.universal
ios.release = "res://addons/beehave/libs/ios/beehave.ios.template_release.universal.dylib"

[icons]
BeehaveTree = "res://addons/beehave/icons/tree.svg"
BeehaveTree = "res://addons/beehave/icons/tree.svg"
BeehaveTreeNode = "res://addons/beehave/icons/category_bt.svg"
BeehaveBlackboard = "res://addons/beehave/icons/blackboard.svg"
BeehaveComposite = "res://addons/beehave/icons/category_composite.svg"
BeehaveCompositeRandom = "res://addons/beehave/icons/category_composite.svg"
BeehaveSelector = "res://addons/beehave/icons/selector.svg"
BeehaveSelectorRandom = "res://addons/beehave/icons/selector_random.svg"
BeehaveSelectorReactive = "res://addons/beehave/icons/selector_reactive.svg"
BeehaveSequence = "res://addons/beehave/icons/sequence.svg"
BeehaveSequenceRandom = "res://addons/beehave/icons/sequence_random.svg"
BeehaveSequenceReactive = "res://addons/beehave/icons/sequence_reactive.svg"
BeehaveSequenceStar = "res://addons/beehave/icons/sequence_reactive.svg"
BeehaveSimpleParallel = "res://addons/beehave/icons/simple_parallel.svg"
BeehaveDecorator = "res://addons/beehave/icons/category_decorator.svg"
BeehaveCooldown = "res://addons/beehave/icons/cooldown.svg"
BeehaveDelayer = "res://addons/beehave/icons/delayer.svg"
BeehaveFailer = "res://addons/beehave/icons/failer.svg"
BeehaveSucceeder = "res://addons/beehave/icons/succeeder.svg"
BeehaveInverter = "res://addons/beehave/icons/inverter.svg"
BeehaveLimiter = "res://addons/beehave/icons/limiter.svg"
BeehaveRepeater = "res://addons/beehave/icons/repeater.svg"
BeehaveTimeLimiter = "res://addons/beehave/icons/limiter.svg"
BeehaveUntilFail = "res://addons/beehave/icons/until_fail.svg"
BeehaveLeaf = "res://addons/beehave/icons/category_leaf.svg"
BeehaveAction = "res://addons/beehave/icons/action.svg"
BeehaveCondition = "res://addons/beehave/icons/condition.svg"
BeehaveBlackboardCompare = "res://addons/beehave/icons/condition.svg"
BeehaveBlackboardErase = "res://addons/beehave/icons/action.svg"
BeehaveBlackboardHas = "res://addons/beehave/icons/condition.svg"
BeehaveBlackboardSet = "res://addons/beehave/icons/action.svg"
13 changes: 13 additions & 0 deletions addons/beehave/icons/simple_parallel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading