Very interesting plugin. Will most certainly be incorporating this into a future project.
Not sure if anyone else has reported this but there are some slight issues with Team Create and using the plugin where deleting a node will replicate immediately to other team create members but creating a new node won’t replicate until the other clients either disable and reenable the plugin or they leave and reopen the place.
Is there any possibility of implementing a force refresh button/have the BTree refresh the node data each time the root is opened? I really don’t care about having true live syncing but being able to work on a BTree and then letting another team create member work on it after I’m done without having them close/reopen studio and/or disable/reenable the plugin would be life changing.
This plugin has been a huge quality of life when creating AI. Though I do have one question, Is there any way to recover a tree if you accidently delete it? Some times I muscle memory press the key delete when trying to delete a node and end up deleting the whole tree. From what I can tell hitting undo or even trying to make duplicates of a tree all seem unsuccessful when trying to access them. If there is a way, it would be a huge life savor for me haha.
However, perhaps I’m missing something.
I have my trees working great with one NPC. However, I run into an issue where I cannot have more than one tree :Running() at once. The tree will not run until all other trees are not running. I’ve even tried putting the :run function in a coroutine (different threads anyways).
In awesome Upgrade for Btrees4 (if there is a btrees4 ever) would be a system similar to unity bolt where btrees becomes an all in one tool for VBS and AI behaviors. It could be insanely helpful for quick and dirty testing when your too lazy to script, though I can see it being used to create Story games (not like roblox ones, more like DBH or telltale games)
This is a really neat plugin, thank you for sharing.
Is it possible to set weights through code or some kind of input? For example, I have characters with different personalities so the weights may vary.
Hiya, I’ve noticed a bug with the plugin.
Whenever you open a tree and then close it, you will always get lag spikes when selecting any object in studio. I’ve had to restart my studio many times after editing a tree
Hi
I’m sure this is a basic question, but how can I get the BehaviorTreeCreator module? Is it supposed to appear under ReplicatedStorage? It doesn’t show for me…
Are you talking about updating the current visual editor? or something completely different? I’m currently in the process of ironing some bugs in this module because I kept having lag-related issues with it, so if you’ve any issues feel free to lmk, I’ll try and address those too.
I’ve edited a bit of the BTrees visual editor plugin, and it should no longer lag when you select any object in your game (not just behavior trees). The issue was that no matter what you selected, behavior-tree or not, the plugin always called a ChangeHistoryService::SetEnabled method. This method is called to stop folder changes to be undone on ctrl z, so be aware that this modified version of the plugin breaks undo behavior! https://www.roblox.com/library/6988737146/BehaviorTreesPlugin-V4-Optimized-version
On a sidenote, @Defaultio - whenever I return RUNNING, it still re-evaluates the whole tree the next time I call the :Run() method. Is this expected behavior? If so, is there any way to only call the currently running task if the state is RUNNING, instead of re-evaluating the whole tree?
But decided that removing the ChangeHistoryService line caused more usability problems than it was worth. By removing this, you risk irrecoverably losing work. I’d advise building trees in a separate blank place, where the spike won’t happen, and copying the trees over to the master place.
On the running issue, I took a quick look and it seems like the intended behavior is only run the current task, and the rest of the nodes will not be evaluated. Are you sure it is reexecuting the whole tree? Are you sure you are calling the same tree? That is, that the obj parameter passed to run is consistent. I don’t have time to debug this at the moment, let me know if you find a fix.
Ah! found the culprit. I watched sleitnick’s video where his code looked like so:
It seems like he was only returning RUNNING in some very specific scenarios, which caused his code to work fine but not mine.
The issue is that whenever my tree would return RUNNING, I would never re-evaluate it again - I was basically waiting for my TreeRunning variable to change, even though it never would’ve since I’d never run the tree in the first place. Sorry for the trouble
EDIT:
In regards to the issue you mentioned, I was actually aware of that post - in fact, that’s why I was able to figure out why that line was there in the first place, so I could put up a warning to those that would install it
Is there a way to duplicate an entire tree folder?
I want to retain a bunch of behavior for a seperate npc but I also want to use a bunch of the same logic.
The editor doesn’t work on a new clone of a folder if I just try to copy it.
Now with Roblox’s new Task Library it would be a good idea to change the “task” table to treeTask or something different to prevent compatibility issues in new work.
Would be amazing if we could specify the quality of the bezier curve (i.e how many frames it uses) as on my larger behaviour trees it gets really painful to use. I also can’t split them out into more as then we loose features such as linked tasks.
UPDATE: You can modify the variable ‘segments’ in DrawCurve.lua as low as 6 (down from 24). There are lots of other improvements which could be made. Right now there’s way too much instancing and destroying going on but I haven’t found the time to dig my teeth into it.
UPDATE UPDATE: It is now 2:30am, Got sucked in haha. Found a fair few inefficiencies, for instance rather than pooling existing frames for the bezier curves we were creating new ones each time and destroying the old. Changelog:
Use existing pool, only create new instances when required
Switch from RenderStepped to Heartbeat
Only call update every 4 frames for avg cost and 6th for expensive
Reduce framecount per bezier curve from 24 to 6
BehaviorTreesPlugin_V4.rbxmx (1.1 MB)
All my changes were made on the fly with no consideration for futureproofing or conflicts passed the immediate term. Only use if you need it (i.e you have large trees).