Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ reports/
*.dblite
*.exp
*.lib
*.obj
*.obj

.vs
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
33 changes: 31 additions & 2 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 @@ -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.
45 changes: 45 additions & 0 deletions addons/beehave/icons/until_fail.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified addons/beehave/libs/windows/beehave.windows.editor.x86_64.dll
Binary file not shown.
Binary file not shown.
Loading
Loading