Coder Social home page Coder Social logo

bitbrain / beehave Goto Github PK

View Code? Open in Web Editor NEW
1.6K 21.0 103.0 5.08 MB

🐝 behavior tree AI for Godot Engine

Home Page: https://bitbra.in/beehave

License: MIT License

GDScript 97.89% C# 0.09% CSS 0.74% HTML 1.03% Batchfile 0.16% Shell 0.10%
ai behavior-tree gamedev gdscript godot godot3 godot4 game-development godotengine

beehave's Introduction

logo

beehave-ci


Beehave is a powerful addon for Godot Engine that enables you to create robust AI systems using behavior trees. With Beehave, you can easily design complex NPC behaviors, build challenging boss battles, and create other advanced setups with ease.

Using behavior trees, Beehave makes it simple to create highly adaptive AI that responds to changes in the game world and overcomes unexpected obstacles. Whether you are a beginner or an experienced developer, Beehave is the perfect tool to take your game AI to the next level.

✨ Development of Beehave 3.0 has started. Read #285 for more details.

🐝 Features

πŸ€– Node based - build behavior trees within your scene tree

Compose behavior trees in your scene and attach them to any node of your chosing.

πŸ› Debug view - a dedicated debug view to analyze your behavior at runtime

A dedicated debug view inside the Godot editor allows you to better understand what the behavior is doing under the hood.

πŸš— Performance - built-in monitors to track performance of your behavior trees

Maintaining high framerate is important in games. Investigate performance issues by using the custom monitor available inside the Godot editor.

πŸ§ͺ Tested - any functionality of this addon is covered by test automation

In order to avoid bugs creeping into the codebase, every feature is covered by unit tests.

πŸ“¦ Installation

  1. Download Latest Release
  2. Unpack the addons/beehave folder into your /addons folder within the Godot project
  3. Enable this addon within the Godot settings: Project > Project Settings > Plugins
  4. Move script_templates into your project folder.

To better understand what branch to choose from for which Godot version, please refer to this table:

Godot Version Beehave Branch Beehave Version
3.x 3.x 1.x
4.x 4.x 2.x

Refer to this guide for more details behind this structure.

πŸ“š Getting started

Behavior trees are a modular way to build AI logic for your game. For simple AI, behavior trees are definitely overkill, however, for more complex AI interactions, behavior trees can help you to better manage changes and re-use logic across all NPCs.

example

Learn how to beehave on the official wiki!

Tutorial (Godot 3.5+)

bitbrain recorded this tutorial to show in more depth how to use this addon:

tutorial-thumbnail

Liam Flannery wrote up a getting started tutorial that's up to date with Godot 4.2

πŸ₯° Credits

beehave's People

Contributors

bitbrain avatar bits-by-brandon avatar creadicted avatar darkangelzt avatar darkmessiah avatar donorhan avatar fonkins avatar foxomat avatar garethsomers avatar geroveni avatar goudcode avatar ksmithdev avatar leodog896 avatar liamflannery avatar lostptr avatar lpbayliss avatar lucasrafael98 avatar lunartides avatar mechpensketch avatar nathanhoad avatar ohan17 avatar razcore-rad avatar redstoneparadox avatar stronkkey avatar structed avatar tavurth avatar thiagola92 avatar werninator avatar wichamir avatar zeroregard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beehave's Issues

Add ParallelNode composite

I was trying out beehave and I've been enjoying it for creating AI. But it got me thinking about if it'd be possible to reuse AI actions and conditions for a player character controller too. This is where I ran into issues as dealing with player inputs in a behaviour tree gets messy pretty fast (very deep nested node trees).

While looking around I noticed a description here of a parallel composite node (which can run in selector or sequence mode). This would make it possible to make a behviour tree more flat which would work better when you're dealing with lots of different player inputs.

I think I know how to implement this in a simple way, but it wouldn't be truly parallel. It would run each child tree collecting their statuses and after all children have been processed it the Parallel node could return success or failure based on the collected results.

Todo

  • introduce SequenceParallelComposite
  • introduce SelectorParallelComposite
  • write tests for SequenceParallelComposite
  • write tests for SelectorParallelComposite
  • update documentation
  • πŸ’₯ BREAKING: replace get_running_action() with get_running_actions() array, as with parallel nodes multiple nodes can be running at the same time.

Overhaul icons

We are still using the default icons coming from the original demo project however, it is time to introduce a consistent icon theme that makes it clear that these are indeed beehave nodes.

@nathanhoad already introduced a new logo:

logo

Having icons in a similar colour theme (and with cute-round corners) is way more fitting than the current ones we have.

Blackboards count as orphans if created dynamically

Godot version: 4.0-rc1

As hinted from #122: It seems like, if a blackboard will be initialized at runtime (when there is no Blackboard assigned), it will count as an orphaned node, as it isn't added to the SceneTree.

I added following to beehave_tree.gd:_ready():

if not blackboard:
    blackboard = Blackboard.new()
    blackboard.name = "Blackboard that has been created at runtime"

print_orphan_nodes()

Output:

Output: 52714014507 - Stray Node: Blackboard that has been created at runtime (Type: Node)

GDUnit4 didn't show me this being an orphan and in general this might not be an issue per se, but it did make me search for why there suddenly was an orphaned node appearing per Instance using a BeehaveTree.

Current workaround is to add a Blackboard and assign it, otherwise you'll have to ignore it. A solution could be to add new Blackboards to the tree.

To Reproduce
Steps to reproduce the behavior:

  1. Add BeehaveTree to the Scene without an assigned Blackboard in it

Expected behavior
No orphaned node

Screenshots
N/A

Desktop (please complete the following information):

  • OS: win11

Missing topics in the wiki

Is your feature request related to a problem? Please describe.
There are no explanations to the new overridable methods interrupt(), begin_run() and end_run() in the wiki.

Describe the solution you'd like
There's a short explanation about tick() in the Manual section. We could add there or make a new section with overridable methods and make it easier for people to find all methods.

Unit tests with gdUnit (Godot 4.0 only)

Currently, there is no way of telling if a change will break this addon or not. Introduce unit tests to ensure that any new PR will not break existing logic.

This should only apply to the godot-4.x branch since maintaining two separate versions of GUT is difficult to maintain and once Godot 4 launches, the godot-3.x branch goes into maintenance mode.

GUT is one option but after much consideration, gdUnit4 has a better and cleaner integration:

https://github.com/MikeSchulze/gdUnit4

Tests to write

  • simple composites
  • advanced composites (star nodes)
  • advanced composites (random nodes)
  • decorators
  • complex behavior tree setup (end-2-end)
  • simple blackboard
  • advanced blackboard (shared between multiple trees)
  • interrupt logic for running nodes
  • beehave tree methods (currently running action + get last condition)

Debug view in editor

Is your feature request related to a problem? Please describe.
When running games with behavior trees it is difficult to follow what is currently happening within it. Setting breakpoints within individual nodes is not ideal and when there is a bug it is quite difficult to figure out which nodes of the tree are currently running and what status they are currently in.

Describe the solution you'd like
Introduce a visual view inside the editor when clicking on a behavior tree that renders the behavior tree visually and highlights the status of every node in the tree and the "flow" animated as well.

Example from Tomate_Salat

Harvest02.mp4

Performance benchmarks of this addon

Some people might have concerns that using behavior trees, especially a lot of nodes impacts performance unnecessarily. Setup multiple behavior trees (simple, medium, complex) and measure the performance against different systems (e.g. Macbook, Default browser, Gamer PC, older PC system) and compose a performance matrix.

Mention the benchmark results on the README.md but in a shortened/brief version and link up to the wiki page where we can describe in detail how the performance was measured. Potentially automate the benchmarks too.

References

Invalid icon paths in Godot 4

Godot version: v4.0.beta3.official

Describe the bug
In Godot 4 icons of BeehaveRoot and BeehaveNode are not visible.

image

Their icon paths go one directory higher than they should.

image

Automatic release generation when changing plugin version

When updating the version of the plugin file (only on godot-3.x and godot 4.x branches), automatically generate a tag and push a release with generated release notes + generated discussion.

πŸ‘‰ we perhaps need to introduce a new Github action first that is able to extract the version from a plugin file and does a tag exists check before generation, similar to https://github.com/bitbrain/jekyll-dash/blob/main/.github/workflows/build-tag.yml#L20

Blackboard class is kind of broken in Godot 4

Godot version: v4.0.beta3.official

Describe the bug

Set and get don't work
Blackboard overrides built-in set and get functions. This makes Blackboard's set and get functions unusable. I can't call them, because built-in functions are called instead. For example:
image
image
It expects 2 arguments, although it can take 3. If I pass 2 parameters, then I can run the game, but the built-in set function gets called instead of Blackboard's, so nothing happens, because there's no such property as "example".

Memory leak
Blackboard inherits Object, but it isn't freed, when BeehaveRoot gets deleted, so it causes a memory leak.
image
I think Blackboard should inherit RefCounted instead.

Godot 4 support

Create a new branch called 2.x which will be compatible with Godot 4.0

Any change might need to be ported onto that branch through 1. cherry-pick + 2. code adjustment for new gdscript syntax.

failer.gd wrong indent

The indent of the return FAILURE in failer.gd is wrong, it shouldn't be in the for-loop.

Discussed in #25

Originally posted by Foxomat August 22, 2022
In the failer.gd script, the last return FAILURE line is inside of the for loop, is that correct? If it has no children, it would return nothing.

failer.gd

extends Decorator

class_name AlwaysFailDecorator, "../../icons/fail.svg"


func tick(action, blackboard):
	for c in get_children():
		var response = c.tick(action, blackboard)
		if response == RUNNING:
			return RUNNING
		return FAILURE

Blackboard as scene node

Currently, blackboards are created dynamically and are local to each behaviour tree. However, it may be useful to share data between different behaviours. Especially, when swapping between different behaviours but you want to track an 'overall state' for a particular node, these blackboards can become quite handy.

Solution

  • introduce an (optional) Blackboard node that can be added to any scene tree
  • make Blackboard an export variable of BeehaveRoot but by default, initialise a node internally if nothing was set.

Add nodes for Blackboard operations

Discussed in #125

Add 4 predefined nodes for Blackboard operations:

  • BlackboardSetAction - sets a key to a specified value
  • BlackboardEraseAction - erases the key from the blackboard
  • BlackboardHasCondition - returns SUCCESS if the key exists in the blackboard, otherwise FAILURE
  • BlackboardCompareCondition - compares two values from the blackboard by using the specified comparison operator

We can use the built-in Expression class to make it possible to define values, which are not a String.

It's good and time for make the tutorial demo builtin

Is your feature request related to a problem? Please describe.
Since #31 we only export addon, we can contain demo project folder , example project folder in the root folder.
It's good for test and learn behave.

Describe the solution you'd like
We can builtin this tutorial demo inside.
tutorial-thumbnail

It won't export and install to user's project.
It provide a good demo for they to test and use this plugin.
And we can maintain both in the same project and for test.

Example:
I make myself a demo in local for test and learn.
image
GIF
When I modify behave source code, I just run this demo as smoke test.

Add a `.gitattributes` file

Is your feature request related to a problem? Please describe.

After downloading this addon from AssetLib, all files from the repository are provided by default. This includes unnecessary directories like .github and files like icon.png.

Describe the solution you'd like

As recommended in the documentation, a .gitattributes file can be added to only include the addons folder when downloading from the Asset Library.

Describe alternatives you've considered

Deselect everything and select addons/ manually.

Additional context
ksnip_20220820-095353

Nodes with `enter()` and `exit()` methods

Overview

We could have enter() and exit() methods for when its necessary to do some setup or cleanup before or after the first and last ticks.
The enter() and exit() methods would be called before the first tick() and after the last, respectively.
For more information, checkout #117

Possible implementation

We create an execute() method inside BeehaveNode to be called by parent nodes only. This method will call enter(), tick() and exit() when needed as well as return the result of tick().

func execute(actor: Node, blackboard: Blackboard) -> int:
	if not _has_entered:
		enter(actor, blackboard)
		_has_entered = true
	
	var result = tick(actor, blackboard)

	if result != RUNNING:
		exit(actor, blackboard)
		_has_entered = false

	return result

This way, we only need to change composite nodes to call execute() instead of tick(). Composites and leaf nodes should never override the execute() method, only tick().

Could not resolve "BeehaveEditorDebugger" because of a parser error

Godot version: 4.0 rc2

Describe the bug
The BeehaveEditorDebugger is causing errors in the build, preventing behaviour nodes from working.

To Reproduce
Steps to reproduce the behavior:

  1. Export the project with default settings
  2. Run projectname.console.exe

Expected behavior
Behaviors running in the build.

Screenshots
Screenshot_20230219_090251

Desktop (please complete the following information):

  • Windows 11 Desktop

Minimal Reproduction Project:
BeehaveBugTest.zip

Add class_name Blackboard to blackboard.gd

The blackboard exposes the methods set, get, has and erase.
It would be nice to use the code completion when working with the blackboard in a node. Is there a reason the blackboard is not a class?

Describe the solution you'd like

extends Object
class_name Blackboard
var blackboard = {}

The export var enabled is useless isn't it?

Godot version: x.x.x

Describe the bug
image

wether you set enabled true or false,the code doesn't use enabled to enable/disable behavior tree root. Tree still running.

Expected behavior
export var enable can disable behavior tree process on ready or dynamic disable process in runtime.

Condition and Action examples

Currently, it is difficult to grasp what kind of nodes one can set up. In order to establish some code references, write up a set of new nodes that can be loaded as part of the demo project in the root folder:

examples/conditions/<condition nodes go here>
examples/actions/<condition nodes go here>

Interruptions

Is your feature request related to a problem? Please describe.
There doesn't seem to be a way to notify an action that it needs to perform some cleanup due to interruption (say, stop moving if the player becomes visible.)

This is open to discussion since I'm not sure what would be the best way to achieve this.

Describe the solution you'd like
I'd suggest to add some sort of Interruptor node (or interrupt(priority) method to the tree itself), so that when an interruption happens (say, an Interruptor node returns a SUCCESS, etc), nodes with lower priority that are in RUNNING state would have interrupt method called.
I'm still relatively new to behavior trees, so please let me know if there are better ways to achieve this.

Describe alternatives you've considered
Let's say we have a "move" action that builds a path and starts the motion process (which is handled outside of the tree - e. g. monster.walk_to_position(xy) method which starts a Tween).
Now, in case the player becomes visible, I'd like to stop the movement, which means I'll need to explicitly call monster.stop_movement() before attacking. This "leaks" part of starting/stopping the walking process from "move" action to "attack" action.

Methods to ensure tree is only modified between ticks

Is your feature request related to a problem? Please describe.
I'm prototyping a game that I plan to modify the behavior tree during runtime. I think it would be helpful to have an add_behavior(node/scene, parent_node) that adds the node/scene after the tree has processed for the tick.

The same could happen for removing with a remove_behavior(node/scene, parent_node).

Thoughts?

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Enforce US spelling on all documentation

I live in the UK for 7+ years, so I am spelling most of things the British way (e.g. realise instead of realize or behaviour instead of behavior)

Update the docs, code and READMEs so everything follows the US spelling for consistency.

Be able to set Tickrate of a BeehaveTree

My game will have hundreds of active BeehaveTrees running at once. Some trees don't need to run multiple times per second (maybe an Animal AI that just walks around its perimiter). Or a villager that is offscreen and doesn't need to do the most efficient work.

Describe the solution you'd like
Be able to set the Tickrate of a BeehaveTree - maybe even dynamically.

Additional context
This could also help with slowing down the tree to debug things like stated in #141 point 3.

Generate wiki docs

Having a single README.md can quickly grow out of hand to explain all the functionality of this addon.

Introduce a docs folder and based of its content generate a wiki page to a new orphan 'gh-pages' branch. Also update the README.md to be less heavy-weight and it should focus rather on key points like high level features, how to contribute, how to install.

https://github.com/myles/awesome-static-generators#documentation

Example created with 'docsify'

example

Bundle only addons/beehave folder in releases

Is your feature request related to a problem? Please describe.
We currently bundle the entire .zip folder for the release but users of this addon do not care about all the extra files.

Describe the solution you'd like
Provide a better way of bundling releases to minimise the size.

Track performance metrics inside Godot

Godot recently introduced performance monitoring: https://docs.godotengine.org/en/latest/tutorials/scripting/debug/custom_performance_monitors.html

The idea is that we can track various metrics in Godot and it will be displayed inside the performance tab. Possible metrics we can track:

Metric Name Description Implemented
beehave/tree_id/process_time The total process time per frame tick for the whole behaviour tree #103
beehave/node_count The number of total beehave nodes in the scene not yet
beehave/active_count Number of active behaviour trees in the scene not yet

Preset some action/condition scene

Is your feature request related to a problem? Please describe.

Some common nodes are suitable for making as scenes and built-in , and users can quickly use them by instantiating scenes.

For example, wait action, check blackboard key condition, set blackboard key action, and clear blackboard key action, log action.

image

Describe the solution you'd like
Preset some scene in plugin. Users use them by instantiating scenes.

ERROR: Custom monitor with id '' doesn't exist

Godot version: 4.0-rc1

Following error appears while switching scenes inside the editor:
image

Probably stems from beehave_tree.gd _exit_tree(), whereas _process_time_metric_name might be an empty string and BeehaveGlobalMetrics not having been initialized / added to Autoload yet.

To Reproduce

Open up a scene that contains a BeehaveTree and one that does not. Switching Scene Tabs should cause this error

Expected behavior

No error should appear

Screenshots

See above

Desktop (please complete the following information):

  • OS: Windows 11

Tree using InverterDecorator crashes Godot Editor when trying to view in Debug view

Godot version: 4.0-rc2

Trying to view a tree containing the InverterDecorator has capped me from viewing any tree in the debug view, even after deleting the Decorator from the tree.

To Reproduce
Steps to reproduce the behavior:

  1. Create or modify existing BeehaveTree with InverterDecorator
  2. Try to view BeehaveTree in Debug view -> Crash on Click
  3. Delete InverterDecorator from BeehaveTree -> still crashes on click

Expected behavior
No crash, see BeehaveTree with Decorators in it

Screenshots
N/A

Desktop (please complete the following information):

  • OS: win11

Additional context

Happened on da0ba03

Random composite task

Is your feature request related to a problem? Please describe.
It would be nice to have a node that runs a random child to simulate some non deterministic behaviour (ie. an NPC in an RPG choosing randomly between walking around or talking to another NPC)

An example implementation can be found here:
https://github.com/libgdx/gdx-ai/wiki/Behavior-Trees#random-selector
https://github.com/libgdx/gdx-ai/wiki/Behavior-Trees#random-sequence

Describe the solution you'd like
Two new nodes added:

  • Random selector: selects one of the children randomly, runs it and the composite returns the same state
  • Random sequence: shuffles children randomly, and executes them in order the same way that sequence would do

Design issues to resolve:
Star nodes variants: Is there a need to support the star variants? Should the default behaviour just be the star version as re-entry into a currently running state is expected? I also have some other thoughts on the whole star behaviour that I will post in a separate discussion.
Probabilities: To support non uniform probabilities for children their weights would need to be added somewhere in the new nodes and correspond to existing children. But this is a problem that can be solved in a new release after the uniform model is implemented.

Describe alternatives you've considered
You could have a separate script that randomly shuffles the children and you would get the same behaviour as what I am describing. The problem with this is that it's not really plug and play and that it's not so easy to determine when a composite execution has already ended and you need to do a reshuffle for the next execution. And you have to create a child node with a randomness script attached, and I'm not sure if that child would mess up the execution in some way.
An example:

  • SelectorNode
    |- ShuffleScript: doesn't extend beehave node, but changes order of the children
    |- WalkAroundAction
    |- TalkAction

Maybe having it as a decorator node for selector and sequence is a better approach? Would only have a single new node, but it would need to change the composite behaviour, and I'm not sure that's possible.

Additional context
I can work on implementing this during the holidays if there is an agreement on the design and an interest in merging this feature

Include with plugin a script template for BeehaveNode

Is your feature request related to a problem? Please describe.
Designing behavior trees requires making a ton of separate scripts, where every one of them has to have an overridden tick method. Defining it for every new script quickly becomes tedious.

Describe the solution you'd like
Just include a script template for BeehaveNode (and derived classes) with a predefined overridden tick method.
Create a template script inside res://script_templates/BeehaveNode/ (that's where Godot searches for project-scope script templates by default) and make a .gdignore file inside res://script_templates/ so the scripts are ignored when parsed.
Here's docs about it.

Restructure composite nodes to be less confusing

Is your feature request related to a problem? Please describe.
I have a sequence. Something like:

  • Get the closest object
  • Walk to the closest object
  • Interact with object

During the walk, the closest object can change. So how do I let the previous sequence nodes run if the 'Walk to the closest object' is RUNNING . From other behavior tree implementations, I learned about the ReactiveSequence.

Type of ControlNode Child returns FAILURE Child returns RUNNING
Sequence Restart Tick again
ReactiveSequence Restart Restart
SequenceStar Tick again Tick again
  • "Restart" means that the entire sequence is restarted from the first child of the list.
  • "Tick again" means that the next time the sequence is ticked, the same child is ticked again. Previous sibling, which returned SUCCESS already, are not ticked again.
    (Source: https://www.behaviortree.dev/sequencenode/)

Describe the solution you'd like
A new node that follows the specification of the reactive sequence.
If a leaf returns "Running" the previous children are ticked as well.

Too many trees spam error logs

My game will have hundreds of BeehaveTrees running at the same time. A little stress test resulted in this:
image
(lol typo in error)

Describe the solution you'd like
Title explains it - option to exclude certain trees from the performance metrics / debugging.

Describe alternatives you've considered
Alternatively we could have a lightweight BeehaveTree that strictly does AI stuff - allowing you to swap the .gd-Files / Nodes depending on what you need.

Maybe a global option to deactivate all perf/debug for Production Builds would be great, might be another issue though.

Don't include gdUnit4 in releases

Problem
We have a separate test directory for the unit tests and they are not included in releases, but the addons/gdUnit4 is, although it is not necessary for the end user (or am I missing something?).

Solution
Remove addons/gdUnit4 from .gitattributes file.

Use node icons in docs

The current docs do not display any node icons. Although, I pushed the icons into this path: https://github.com/bitbrain/beehave/tree/godot-4.x/docs/assets/icons we now effectively have duplicated the icons on the repository. In case someone wants to update an icon or add a new one, we'd have to do it in two places.

Re-introduce node icons by potentially considering a way to only have them in the addons folder + delete the icons from the docs/assets/icons folder. In case this is not possible, re-introduce them in the docs as usual.

Auto-update addon inside the editor

Similar to how https://github.com/nathanhoad/godot_dialogue_manager works, it is possible to download the latest addon version inside the editor.

Potentially, there could be a new button somewhere (in case there is an update available) prompting the user to download the new version.

Another idea (preferable) could be a notification message that has a clickable action in it.

See https://github.com/nathanhoad/godot_dialogue_manager/blob/08ee0579a6828386cdd6000edfb2871a96a7fd62/addons/dialogue_manager/components/download_update_panel.gd for an example implementation.

Add documentation comments

Is your feature request related to a problem? Please describe.
It would be nice to have documentation for the most important classes like BeehaveRoot, ActionLeaf etc. Especially for people, who are yet learning behavior trees.

Describe the solution you'd like
Godot 4 adds documentation comments, so adding docs would be very easy.

For example:
image

Results in:
image
image

Switch to static typing

Is your feature request related to a problem? Please describe.
Some parts of the this plugin's code use static typing, others don't. Just for the sake of consistency and readability it would be nice to use it everywhere. Static typing reduces bugs and enables completion hints. In Godot 4.x it also boosts performance.

Describe the solution you'd like
Add type hints everywhere (or at least wherever it's possible). Of course the programmers using Beehave will still be able to use dynamic typing in their projects, if they wish so. It's just that the codebase of the plugin itself will be entirely statically typed.

add node name in beehave error message

Is your feature request related to a problem? Please describe.
The error Beehave error: Root should have one child (beehave_root.gd:16) comes without a hit or something similar to what node is missing the child, making it harder to identify the origin of the error

Describe the solution you'd like
Beehave error: Root should have one child in node " + str(name)

Describe alternatives you've considered
Some way to link to the node instead of just printing the name, but I don't know how one would do that or if that is even possible.

Simulation mode for behaviour trees

Is your feature request related to a problem? Please describe.

It is currently quite difficult to do changes to a behaviour tree unless you start the game and tweak things while the game is running. This wastes a lot of time and can be frustrating since the exact conditions to replicate the exact state of the tree need to be redone every single time.

Describe the solution you'd like
Have the ability to simulate the behaviour tree inside the Godot editor. There could be an option to render a "visual tree" inside the Node2D window (only visible inside the editor itself). The nodes come with a "play" button and you can click any node in the tree to invoke a "tick". There could also be the option to define a "tick interval" and let the tree execute in a loop but at "slow speed" to better see what is going on. There could also be some sort of "step function" to step through the tree bit by bit (similar to how the debugger works). The goal here is to be able to quickly test the behaviour of the tree without the need to start the game itself. Another useful thing could be a "force jump" action where I can force the tree to jump somewhere in the tree and execute an action.

this may be partially blocked on #1 perhaps it could even replace it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.