My greatest good thing i ever done on 2024 is subscribing this channel. every video in this channel is shining gem compare to other Unity related channels
This is one of the few channels who dont just show how to do things in a beginner way, but how to up your game, its a very valuable channel and really should be way more popular. I like that nearly every video is self contained enough that you can go there, view a thing, decide yes, i want that, and then go off and implement the thing in a project without too much of the oh, you need to have 15 other videos worth of stuff in the project before it even dreams of working
Love seeing this video! Protip: you can use the A key to align the delected nodes' children, and Shift A to align everything under the select nodes so you don't need to right click to find the align options :)
I've been waiting for built-in behavior for a long time. And the wait was worth it. And thanks for the introduction! I overlooked the example packages, didn't know about those. Now I have to figure out how to change the type of SELF or if doing so would be a bad idea.
woke up late so wasn't able to watch right away, but glad to see this hit 500+ views in the first hour. Will have to watch a few times to understand the system. Seems easy enough to get the package installed.
I've been using BehaviorDesigner Asset for a while now and it's been working quite well for my project. But I am super excited about this, Unity's been really missing node-based interfaces that the competition has had for quite a while now. Thank you so much for the video and for shining a light on this new graph editor, as it flew under my radar completely but it looks so good!
This is amazing. Once I figure my life out again I will have to make a game with this package - we have been waiting for a proper behavior/node tooling in unity for years now!
I am a Behavior Designer user from years ago as Unity lacked a node-based system (Unreal has) so it is good news for all who do not want to spend money on the asset, or just prefer this workflow...Wich after watching the video, it is pretty similar and I would say that I prefer that GUI Now, I only miss an Octree system (Unreal also has a built-in) as I tried to implement my own one (following paid courses that did not help) and finally, I created a functional one but I am not totally satisfied. If a great programmer like you could show us how to implement a good Octree system I would thank it forever :P Thanks for the video!
Man, the content of your videos is fantastic and really good quality as well. This is a nightmare comment for any TH-camr but, have you ever thought about making a course with many of the content and knowledge you have given on your other videos? Having your teaching and content quality in a nicely packed course could be a really nice experience! Thank you for your videos, as always!
A video on how to make various AI sensors would be cool. Like FOV, Hearing etc. And more general ones like proximity sensors and more simpler sensors that help with gameplay. I already made some of these but i always feel like i make them wrong and unoptimized so it would be cool to see you make these to get an idea on how to make them better.
Amazing video as usual! One thing I was wondering about though, what would be the best approach to combine this with the other considerations/action pattern and GOAP? Do you have any thoughts on this, would trying to incorporate those into the behavior graph be a good idea?
Oh man this looks amazing, we've been using Behaviour Designer by Opsive for our more complex enemy AI, it's good and obviously has the same functionality but it is a pain to work with, just little things like having to be in prefab mode to edit trees as well as annoying things with the interface, also having to write some really simple actions that really should come pre packaged in it. This would have been a much better option, though we are still using 2022 LTS so a moot point really. PS keep up the good work!!! your content is amazing
Great video! Many thanks for sharing. My main concern is that the time it takes to learn and to customize the package to my needs outweighs the burden of building my own. But in this case, it does look like it's worth learning - having this visual nodes just looks too good. :)
Do you know if it can integrate with state machines? I think unity mentioned something about a built in HFSM a few months ago, tho im not sure I've been playing around with a hfsm+behaviour tree architecture with node canvas for the last month and it's been great, very powerful approach. Good video as always!
You can definitely make an FSM using this, even an HFSM potentially using sub graphs. As for Unity's plans for a build-in HFSM, I haven't heard that specifically... but there is nothing stopping you from doing that with this tool, and I can see it being very useful for that. (Or the Node Canvas approach, also a good choice)
I remember using muse behavior months ago on beta and thinking "Unity should make this apart of the Muse AI Program", this behavior tool is so complete and powerfull that it kinda feels like, why wasn't this a thing before?
I sincerely can't understand why it took them so long to understand that and to actually release it. It's just a shame that such an advanced engine had literally zero tools for building AI.
I was seeing this video again and wondering if you can even work with this without monobehaviours. I'm trying to use the humble object pattern and it's hard tracking the references because in the behavior package you can only use monobehaviours or scriptable objects as shared references
Would you recommend this for a visual state machine implementation? I've been using the animator with StateMachineBehaviours to handle transitions in my state machine but it feels hacky.
Yes, I think this could be used to create a State Machine no problem. My only caution with that is if you have a lot of transitions to handle, it might be a lot of logical paths to try to visualize. Try making a small one and see if it's going to work for you.
@@git-amend Thanks for the reply! Yeah I'll play around with it. I've been using your state machine implementation and it's been awesome. When the state machine gets super complicated I guess it's just a question of would you rather look at a giant block of code defining transitions or stare at a spiderweb. Awesome video and I'm super stoked about this feature in Unity 6!
looks awesome. One question I have: How good is the performance of this? What if I want to create 2D scenes with about 500 agents, controlled by behaviour graphs?
I haven’t done any massive tests like that, but you will get an answer quickly if you ask in Unity Discussions under the release thread discussions.unity.com/t/behavior-package-1-0-1-is-released-update-1-0-2-is-out/1521797
@@git-amend Got an answer: "The performance should be good in general, we are following best practices & we should be not creating to much garbage or overhead at runtime. 500 agents will be fine." So, let's hope for the best.
Thanks for this tutorial! Is there anyway to add [TextArea] to a string in the blackboardvariable, wanting to be able to add lines in the inspector panel
I'm not 100% sure about that, but you can go over to the Unity discussion and add your suggestion there. I'm sure they will consider adding it. discussions.unity.com/t/behavior-package-1-0-1-is-released-update-1-0-2-is-out/1521797
Just spent the last three weeks working on a lightweight NodeGraph editor for a quest system cause I assumed Unity would never actually get around to updating their GraphView API 😅 super interested to see what they've done.
@@git-amend Personally, I'm curious if you could possibly cover the skill system later on? The reason I'm curious about this is because I think it would intuitively show various methods of handling data
Yes! I've started using this in my project today... I will watch video (too excited had to post at start!) but I think I have a question about Event Channels on a separate Blackboard so I can pass messages between different trees. It doesn't seem to pick them up. Anyway, I'll watch and see if you covered it.
I did not cover that exact scenario, but you may have to keep a reference to a Blackboard that is outside your different trees so that both trees can reference the same channel. It will also depend on making sure you are listening for the exact message (which could include references). But I'm not 100% sure on that one, I'll have to try it out myself.
@@git-amend I've created another separate Blackboard and added it to different trees and have been able to reference variables between different trees but it doesn't seem like you can 'subscribe' to an event on a shared/separate blackboard which is a shame. I am not sure if I have missed something very obvious. Anyway, thanks for reply. Let me know if you find a way of doing it!
Is there any other usage of Behavior Tree besides creating an RPG-like character? I always wanted to utilize this design pattern and the tools that come with it, but it seems like I cannot find a good use case for it. I'm not making an RPG, so it seems like there's no much reason to make a behavior tree for a simple enemy AI that only has one state of being.
Sure, you can use this beyond RPG-like characters, even for simpler AI or non-character behaviors. A behavior tree is great for structuring decision-making and can be used in areas like controlling complex environmental systems, managing procedural generation, handling multiple NPCs with different conditional actions, or even controlling UI flows.
Thank you for amazing tutorials! After this one I realised I need BT for my game. It is 2d physics based game where agents is regularly change behaviors after collisions. So BT should be able to do OnFixedUpdate. And so far it is looks like com.unity.behavior can't do it yet (please correct me if I am wrong). I discovered there is another solutions like NodeCanvas, BehaviorDesigner, AItree... please can you advice me which one of these should I use for 2d Physics based games (~30 agents on screen with different behaviors and runtime change when conditions met.) Thank you very much!
You're correct that the graph is not setup to execute any methods during the Player Loop's fixed update method. There are several ways around that if you are ambitious... for example. the BehaviourGraph class is not a sealed class and can be extended or used with the decorator programming pattern. That being said, the other options you mentioned are also good (I have both). NodeCanvas, in particular, is popular for its flexibility in custom setups, while Behavior Designer has efficient runtime performance, which could be ideal for managing ~30 agents with unique behaviors.
No, I wouldn't say that. You might be able to do some similar things, but the Behavior package has more specialized tools for building trees, state machines and decision-making processes.
Does any of this play nice with ECS? Or do you think this package somehow anticipates the coming features that unite game object and entity workflows more?
Thanks for the video! I wasn't aware of this and it's quite nifty! Looks like a fun middle ground between coding your own solutions but also having a visual feedback system. As a question: Is it possible to add default values for the variables? ie: "Agent seeks Target" and Agent being self by default? Thank you!
For value types, it's easy. For reference types, generally no because a graph can be shared by many agents and therefor it's impossible to know which one will be 'Self'. But, I bet you could write some easy Initialization scripts that could do that for you in the OnStart method of a node.
Oh hello! So if you have a variable, for example "Self" or "Agent" and you add a node that has a field called "Self" or "Agent", it generally tries to auto assign variables to fields in the node if the name match, or if you recently connected such nodes :) If this feature didn't break last minute :D
@@ShaneeNishry Just to update you! It works perfectly! If I have a Blackboard named variable "Agent" and I create one for the Behavior, it automatically does feel it in! Great stuff, thank you!
GraphView is a graph UI tool. Behavior is specifically a Behavior tree or high level event graph tool. The replacement for GraphView is the graph framework showed at the Unite keynote :)
Dude, that’s amazing!! I was hoping you would do a vid on Behavior Graph. You said at the end that this plugin is made with UI Toolkit. Do you know whether it is supposed to replace Unity’s experimental GraphView?? Thanks.
I'm not sure that it is a replacement for the GraphView, but like most things Unity I suspect that they might eventually try to combine a lot of these tools that have similar functionality. It's is on my list of things to dive into as well, so I'll find out what the deal is.
@@git-amend Sounds awesome! I spent a few months working with GraphView. It is a great tool, but has many limitations. I read somewhere on the Unity Forum that they were working on GraphTools Foundation as a long-term replacement for GraphView. But there aren’t a lot of information on the topic…
It works based on a nav mesh, and falls back to moving by transform is there is no nav mesh. For 2D, you may want to extend that Node with some custom logic.
Yes, I do recommend it. I was skeptical at first, but it's become an invaluable tool for me, especially when I'm making videos I tend to iterate a lot.
Just keep in mind that, for multiplayer games, hot reload can cause issues where only one instance of your editor is updated instead of all instances of your editor. Otherwise, its a pretty solid tool.
I'm sure that can be done, yes. You could build any kind of state machine with this. Keep blackboard references to the things you need (your controller, nav mesh agent, maybe camera for example) and then build a few nodes that represent states.
Well, to be honest I have both of those assets and I like them both. If you need some of the more advanced features that you can get out of Behaviour Designer, like tactics, then I would stick with that. But, I'm impressed that Unity has taken the initiative to provide a tool like this and it has great potential. The team working on it seems very dedicated, and I think it will continue to improve.
The package also supports runtime serialization using Unity 6 new serialization package. By default all built-in nodes are not using reflection at runtime (code generation that extend the nodes partial class). The documentation provides information about how to make your custom nodes used this code generation using simple attributes (`[CreateProperty]`) and they are also 2 virtual serialization method (`OnSeriaize/OnDeserialize`) in case you need to bake complex data.
Huh, an actually usable out-of-the-box behavior tree from Unity? Impossible! On a side node, seems like they're using their own GraphView class instead of Experimental one. I wonder if it will be the new, official GraphView class?
god dang it I've been meaning to release my own behavior tree solution on the asset store for years now but life just keeps getting in the way now it's basically futile. And this is way better than anything I could do
When I saw the title of the video I hoped that Unity had finally released Graph Tools Foundation, but no. We still have to mess around with Graph View.
Not quite there yet... one day. At least here a lot of the custom functionality is already in place and you don't have to build everything from scratch.
@@git-amend The main use I see for graphs is complex pipelines. My personal example is branching sequences of actions in an asynchronous turn-based game, or for example the environment generator that Game Dev Guide recently demonstrated. The behavior graph is a pretty different thing, which would be too difficult to customize for these needs.
you cant drag n drop reference to the inspector, if the reference is from other gameobject. Only if it was the same Gameobject from 1 parent, then you can do it.
I think, I encountered a bug.When I click inspect script on built-in action nodes like "talk" or "patrol", it just open a blank visual studio code page, there is not any single line of code, so I can't edit script. Are there anybody had the same problem?
Will it be new not supported feature of unity that lacks ton of stuff and after all is programmer heavy anyways? Find out in the next episode of Unity Roadmap!
Hey @STARasGAMES, I'm sorry to hear you are having freezes. Can you use the Unity Discussion pages and post with the tag Behavior so we can help you? We're working on performance but it really shouldn't freeze for several seconds or lag when having only 4 nodes!
@@ShaneeNishry hey, that's a bit of misunderstanding here. I didn't try new Behavior package, but I spotted in this video noticeable micro-lag when user deletes node. The same is true for good old Shader Graph, which works acceptable with 10 nodes, but past that it freezes for most of operations, especially undo and duplication. So I assume that if new Behavior package has noticeable freez on 4 nodes it's safe to say it won't handle well 30-50 nodes. Wish you best, and hope I'm wrong about that
Hey @@STARasGAMES Maybe @git-amend can comment if he's encountering freezes or if it could be a recording artifact. Personally I haven't had an issue with such few nodes, but that said we're definitely working on improving performance for larger graphs.
I have not experienced any lag or freezing while using this package. Any perceived issues in that regard are likely just from editing in a pause while speaking. The only time there was any delay was while creating Assets.
@@git-amend That's good to hear! I'm not saying we have no performance issues, we do, but they shouldn't be THAT BAD and we're working on them :) The main issue is we need to contribute some fixes to AppUI to get panning performance up with more nodes.
Happy Sunday! Even though this package flew a little under the radar, I think it might be a hidden gem. 👍
My greatest good thing i ever done on 2024 is subscribing this channel. every video in this channel is shining gem compare to other Unity related channels
Thank you for the kind words!
This is one of the few channels who dont just show how to do things in a beginner way, but how to up your game, its a very valuable channel and really should be way more popular. I like that nearly every video is self contained enough that you can go there, view a thing, decide yes, i want that, and then go off and implement the thing in a project without too much of the oh, you need to have 15 other videos worth of stuff in the project before it even dreams of working
Thanks for the kind words!
Love seeing this video!
Protip: you can use the A key to align the delected nodes' children, and Shift A to align everything under the select nodes so you don't need to right click to find the align options :)
Great tip!
Thanks for the excellent learning resource!! Extremely thorough and focused. Absolutely love this channel!
Awesome! Thanks for the super!
Thanks for making this! You are a great teacher making super current tutorials. I'm locked in!
You're very welcome!
I've been waiting for built-in behavior for a long time. And the wait was worth it. And thanks for the introduction! I overlooked the example packages, didn't know about those. Now I have to figure out how to change the type of SELF or if doing so would be a bad idea.
You're so welcome!
I was thinking to myself that I wish git-amend would make a video on this package earlier today, and well...here we are. Thank you!
You are so welcome!
woke up late so wasn't able to watch right away, but glad to see this hit 500+ views in the first hour.
Will have to watch a few times to understand the system. Seems easy enough to get the package installed.
Yup, this seems to be a popular topic. I think you'll like this system, it's easy and extensible.
AI behaviors never been easier ! Can't wait for the LTS version of Unity 6 🔥
Yes, I'm with you 💯on that!
unity 6 is already LTS by itself. LTS is no longer a thing.
So, is Behaviours only available on Unity 6? I can't find version requirements in the docs and haven't had time to test it on 2022.3
@@Miguel-oq9mu Requires Unity version of 6000.0.16 or above.
I saw the reddit post about this package being released, I'm glad someone already made a video about it! :)
Hope you enjoy it!
Thanks a lot Adam, you definitely get my vote for Unity awards when i get chance to check them out, you are there I hope...
Thank you! I appreciate that!
This is a great introduction to behavior graphs. Thank you
You're very welcome!
I've been using BehaviorDesigner Asset for a while now and it's been working quite well for my project. But I am super excited about this, Unity's been really missing node-based interfaces that the competition has had for quite a while now. Thank you so much for the video and for shining a light on this new graph editor, as it flew under my radar completely but it looks so good!
Sounds great! Thanks for watching! I have Behavior Designer too, and I think highly of it as well.
This is amazing. Once I figure my life out again I will have to make a game with this package - we have been waiting for a proper behavior/node tooling in unity for years now!
Great, glad to hear it!
Incredible how fast you made this, well done.
Thank you! Cheers!
I am a Behavior Designer user from years ago as Unity lacked a node-based system (Unreal has) so it is good news for all who do not want to spend money on the asset, or just prefer this workflow...Wich after watching the video, it is pretty similar and I would say that I prefer that GUI
Now, I only miss an Octree system (Unreal also has a built-in) as I tried to implement my own one (following paid courses that did not help) and finally, I created a functional one but I am not totally satisfied. If a great programmer like you could show us how to implement a good Octree system I would thank it forever :P
Thanks for the video!
Not a bad idea, I'll jot that one down!
Wake up babe, new git-amend video
Nice!
Seems like a very powerful package. Thanks for the tutorial.
You're welcome!
Oh my god, this changes everything! all the things I didn't know already existed!
Nice, glad to hear that!
Man, the content of your videos is fantastic and really good quality as well.
This is a nightmare comment for any TH-camr but, have you ever thought about making a course with many of the content and knowledge you have given on your other videos?
Having your teaching and content quality in a nicely packed course could be a really nice experience!
Thank you for your videos, as always!
One day I will start working on something like that, probably after I'm past 20k subscribers. I'll keep ya posted.
A video on how to make various AI sensors would be cool. Like FOV, Hearing etc. And more general ones like proximity sensors and more simpler sensors that help with gameplay. I already made some of these but i always feel like i make them wrong and unoptimized so it would be cool to see you make these to get an idea on how to make them better.
Not a bad idea, I'll jot that down!
Man, I like your tutorials so much.
Happy to hear that!
Very good and in-depth video, thanks!
Very welcome!
I'm comparing this to Behavior Trees by Opsive, and there are so many nice features on this one. Really looking forward to experimenting with this!
I’ve heard that a few times now. I think that barring the addons, it will be a good alternative .
Oh my goodness,i was planning to read docs and u end up giving a good intro to behaviour graph.
The docs are still worth a read, I couldn't cover everything! 😀
This is pretty sick. I wrote one a decade ago but it would take some porting now so this drops at a nice time :)
Nice!
Amazing video as usual! One thing I was wondering about though, what would be the best approach to combine this with the other considerations/action pattern and GOAP? Do you have any thoughts on this, would trying to incorporate those into the behavior graph be a good idea?
Man, I love this channel so much
Thank you!
Oh man this looks amazing, we've been using Behaviour Designer by Opsive for our more complex enemy AI, it's good and obviously has the same functionality but it is a pain to work with, just little things like having to be in prefab mode to edit trees as well as annoying things with the interface, also having to write some really simple actions that really should come pre packaged in it.
This would have been a much better option, though we are still using 2022 LTS so a moot point really.
PS keep up the good work!!! your content is amazing
Thank you!
Thank you for this video, it's helpful!
I would like to see a tutorial about an implementation of the GOAP system with this new tool please 😊
Thanks, I'll keep that idea in mind!
Great video! Many thanks for sharing.
My main concern is that the time it takes to learn and to customize the package to my needs outweighs the burden of building my own. But in this case, it does look like it's worth learning - having this visual nodes just looks too good. :)
Yes, I agree!
Do you know if it can integrate with state machines? I think unity mentioned something about a built in HFSM a few months ago, tho im not sure
I've been playing around with a hfsm+behaviour tree architecture with node canvas for the last month and it's been great, very powerful approach.
Good video as always!
You can definitely make an FSM using this, even an HFSM potentially using sub graphs. As for Unity's plans for a build-in HFSM, I haven't heard that specifically... but there is nothing stopping you from doing that with this tool, and I can see it being very useful for that. (Or the Node Canvas approach, also a good choice)
I was thinking about HFSM with this myself
Thank you for the video. I'm enjoying your content so much!
What you think about Zenject and ECS frameworks?
Personally, I've been more interested in Reflex these days than Zenject, however I think both Zenject and ECS are great choices for some projects.
I remember using muse behavior months ago on beta and thinking "Unity should make this apart of the Muse AI Program", this behavior tool is so complete and powerfull that it kinda feels like, why wasn't this a thing before?
Haha yeah, feels that way.
I sincerely can't understand why it took them so long to understand that and to actually release it. It's just a shame that such an advanced engine had literally zero tools for building AI.
I was seeing this video again and wondering if you can even work with this without monobehaviours. I'm trying to use the humble object pattern and it's hard tracking the references because in the behavior package you can only use monobehaviours or scriptable objects as shared references
Me : spend two years using the half-baked and undocumented Experimental.Graphview API
Unity : *releases a node based Editor tool*
Haha, yes I know the feeling, and I'm glad now that I never made a 3 hour video on how to DIY a system like this.
Same
Would you recommend this for a visual state machine implementation? I've been using the animator with StateMachineBehaviours to handle transitions in my state machine but it feels hacky.
Yes, I think this could be used to create a State Machine no problem. My only caution with that is if you have a lot of transitions to handle, it might be a lot of logical paths to try to visualize. Try making a small one and see if it's going to work for you.
@@git-amend Thanks for the reply! Yeah I'll play around with it. I've been using your state machine implementation and it's been awesome. When the state machine gets super complicated I guess it's just a question of would you rather look at a giant block of code defining transitions or stare at a spiderweb. Awesome video and I'm super stoked about this feature in Unity 6!
Voted for you, good luck you deserve it!
Thank you!
Amazing, thank you.
Glad you liked it!
I made my own behaviour tree few months back. It's working fine but editing it isn't that fine. Now I feel like I wasted my time.
Great video!
Rarely a waste though... thanks for watching!
looks awesome. One question I have: How good is the performance of this? What if I want to create 2D scenes with about 500 agents, controlled by behaviour graphs?
I haven’t done any massive tests like that, but you will get an answer quickly if you ask in Unity Discussions under the release thread
discussions.unity.com/t/behavior-package-1-0-1-is-released-update-1-0-2-is-out/1521797
@@git-amend Got an answer:
"The performance should be good in general, we are following best practices & we should be not creating to much garbage or overhead at runtime.
500 agents will be fine."
So, let's hope for the best.
Wow you're fast! It just got released few days ago.
Haha, yeah it's all I've been playing with for the last few days.
Thanks for this tutorial! Is there anyway to add [TextArea] to a string in the blackboardvariable, wanting to be able to add lines in the inspector panel
I'm not 100% sure about that, but you can go over to the Unity discussion and add your suggestion there. I'm sure they will consider adding it.
discussions.unity.com/t/behavior-package-1-0-1-is-released-update-1-0-2-is-out/1521797
this is awasome, can you make a tutorial for a basic dialogue system use this behaviour graph sir?
Yeah, maybe at some point. I'll keep that idea in mind!
@@git-amend okay sir 👍👍
exactly what i was looking for!
Awesome!
Just spent the last three weeks working on a lightweight NodeGraph editor for a quest system cause I assumed Unity would never actually get around to updating their GraphView API 😅 super interested to see what they've done.
But my stuff won't be obsolete until GTF releases in 20yrs and we actually move to Unity 6 at least, whew
Haha 😊
Holy crap!! Is this a package released this year?? All the leg work and boiler plate done for me???
Nice isn't it.
Great video. Thanks
You are welcome!
Interesting, could this replace Unity Visual Scripting (if you built your own nodes) and would it be more performant I wonder?
I'm sure it can handle a lot of that. Another subscriber asked on the Unity Discussions about handling 500 agents, and they said no problem.
Good! this is very helpful!
I'm glad!
@@git-amend Personally, I'm curious if you could possibly cover the skill system later on? The reason I'm curious about this is because I think it would intuitively show various methods of handling data
Oooh nice. 😁 I wonder if this can be used for app flow state machines as well.
Might be a good usecase there.
Yes! I've started using this in my project today... I will watch video (too excited had to post at start!) but I think I have a question about Event Channels on a separate Blackboard so I can pass messages between different trees. It doesn't seem to pick them up. Anyway, I'll watch and see if you covered it.
I did not cover that exact scenario, but you may have to keep a reference to a Blackboard that is outside your different trees so that both trees can reference the same channel. It will also depend on making sure you are listening for the exact message (which could include references). But I'm not 100% sure on that one, I'll have to try it out myself.
Ah, you just seemed to mention separate blackboards at the end then the video ended! I'll see if I can figure it out.
@@git-amend I've created another separate Blackboard and added it to different trees and have been able to reference variables between different trees but it doesn't seem like you can 'subscribe' to an event on a shared/separate blackboard which is a shame. I am not sure if I have missed something very obvious. Anyway, thanks for reply. Let me know if you find a way of doing it!
Do you think that this can replace the normal statemachine workflow? If so would you say that it's scalable?
You can certainly make state machines with it. I think it's also scalable, but I have not tested anything extreme.
@@git-amend Thank you, I hope I can give it a try soon and see what I can do xD
Is there any other usage of Behavior Tree besides creating an RPG-like character?
I always wanted to utilize this design pattern and the tools that come with it, but it seems like I cannot find a good use case for it.
I'm not making an RPG, so it seems like there's no much reason to make a behavior tree for a simple enemy AI that only has one state of being.
Sure, you can use this beyond RPG-like characters, even for simpler AI or non-character behaviors. A behavior tree is great for structuring decision-making and can be used in areas like controlling complex environmental systems, managing procedural generation, handling multiple NPCs with different conditional actions, or even controlling UI flows.
I've been using it for an RTS and city builder :)
Thank you for amazing tutorials! After this one I realised I need BT for my game. It is 2d physics based game where agents is regularly change behaviors after collisions. So BT should be able to do OnFixedUpdate. And so far it is looks like com.unity.behavior can't do it yet (please correct me if I am wrong). I discovered there is another solutions like NodeCanvas, BehaviorDesigner, AItree... please can you advice me which one of these should I use for 2d Physics based games (~30 agents on screen with different behaviors and runtime change when conditions met.) Thank you very much!
You're correct that the graph is not setup to execute any methods during the Player Loop's fixed update method. There are several ways around that if you are ambitious... for example. the BehaviourGraph class is not a sealed class and can be extended or used with the decorator programming pattern. That being said, the other options you mentioned are also good (I have both). NodeCanvas, in particular, is popular for its flexibility in custom setups, while Behavior Designer has efficient runtime performance, which could be ideal for managing ~30 agents with unique behaviors.
@@git-amend Thank you!
Would you say that this replaces visual scripting (previously "bolt")? Or is it its own thing?
No, I wouldn't say that. You might be able to do some similar things, but the Behavior package has more specialized tools for building trees, state machines and decision-making processes.
Does any of this play nice with ECS?
Or do you think this package somehow anticipates the coming features that unite game object and entity workflows more?
Not yet. It's in the plans
Nice, looking forward to that.
Thanks for the video! I wasn't aware of this and it's quite nifty! Looks like a fun middle ground between coding your own solutions but also having a visual feedback system.
As a question: Is it possible to add default values for the variables? ie: "Agent seeks Target" and Agent being self by default?
Thank you!
For value types, it's easy. For reference types, generally no because a graph can be shared by many agents and therefor it's impossible to know which one will be 'Self'. But, I bet you could write some easy Initialization scripts that could do that for you in the OnStart method of a node.
Oh hello! So if you have a variable, for example "Self" or "Agent" and you add a node that has a field called "Self" or "Agent", it generally tries to auto assign variables to fields in the node if the name match, or if you recently connected such nodes :)
If this feature didn't break last minute :D
I also need to check if it supports the new casting feature we added correctly, but technically I'm on vacation 😂
@@ShaneeNishry That sounds amazing! And a great time-saver as well!
@@ShaneeNishry Just to update you! It works perfectly! If I have a Blackboard named variable "Agent" and I create one for the Behavior, it automatically does feel it in!
Great stuff, thank you!
its been 6 years....since i have been asking for something like this in Unity....
Yes, long time coming that's for sure.
this is cool. Do you feel like it will replace the experimental GraphView stuff?
That's a good question, but I don't have an answer for that yet. But a few people have asked, so I'll try to find out.
GraphView is a graph UI tool. Behavior is specifically a Behavior tree or high level event graph tool.
The replacement for GraphView is the graph framework showed at the Unite keynote :)
Dude, that’s amazing!! I was hoping you would do a vid on Behavior Graph. You said at the end that this plugin is made with UI Toolkit. Do you know whether it is supposed to replace Unity’s experimental GraphView?? Thanks.
I'm not sure that it is a replacement for the GraphView, but like most things Unity I suspect that they might eventually try to combine a lot of these tools that have similar functionality. It's is on my list of things to dive into as well, so I'll find out what the deal is.
@@git-amend Sounds awesome! I spent a few months working with GraphView. It is a great tool, but has many limitations. I read somewhere on the Unity Forum that they were working on GraphTools Foundation as a long-term replacement for GraphView. But there aren’t a lot of information on the topic…
Amazing!
Thank you! Cheers!
this only works for unity 6 or is it available for earlier versions of unity (etc 2022 lts)?
This requires Unity version of 6000.0.16 or greater.
Wait what is this? Had no idea…Is it better than Playmaker? I’m used to using that. Seems like this is a Blueprint competitor… 🤔
I'm not very familiar with Playmaker, so I can't speak to that. But this will allow you to build complex Node based systems fairly easily.
Nice!
Thank you! Cheers!
Hey, based on what does this patrolling work? Will it avoid obstacles? Speaking for 2D world if anybody has some experiences :)
It works based on a nav mesh, and falls back to moving by transform is there is no nav mesh. For 2D, you may want to extend that Node with some custom logic.
It wont avoid obstacles if they arent baked into the navmesh. You need a custom node to switch from navmesh to your own collision avoidance.
Very good video! A little bit off topic but I saw you are using hot reload, do you recommend that asset?
Yes, I do recommend it. I was skeptical at first, but it's become an invaluable tool for me, especially when I'm making videos I tend to iterate a lot.
@@git-amend Thank you! I'm skeptical too and I also saw that it doesn't work when creating classes, but I will give it a try
Just keep in mind that, for multiplayer games, hot reload can cause issues where only one instance of your editor is updated instead of all instances of your editor. Otherwise, its a pretty solid tool.
Can you use this for dialogue trees?
Yes, you certainly could.
A state machine character controller with this would work right?
I'm sure that can be done, yes. You could build any kind of state machine with this. Keep blackboard references to the things you need (your controller, nav mesh agent, maybe camera for example) and then build a few nodes that represent states.
What do you think of this new package vs established assets like Behavior Designer and Node Canvas?
Well, to be honest I have both of those assets and I like them both. If you need some of the more advanced features that you can get out of Behaviour Designer, like tactics, then I would stick with that. But, I'm impressed that Unity has taken the initiative to provide a tool like this and it has great potential. The team working on it seems very dedicated, and I think it will continue to improve.
Does this use reflection like their built in visual scripting does?
There is some reflection under the hood, yes.
The package also supports runtime serialization using Unity 6 new serialization package. By default all built-in nodes are not using reflection at runtime (code generation that extend the nodes partial class). The documentation provides information about how to make your custom nodes used this code generation using simple attributes (`[CreateProperty]`) and they are also 2 virtual serialization method (`OnSeriaize/OnDeserialize`) in case you need to bake complex data.
LET'S GOOOO
Cheers!
This channel is a diamond in this theme video. So I encourage everyone to vote for this channel in the Unity Awards! (I already did this)
Thank you!
finally better late then never i guess :) btw i voted for you good luck
Awesome, thank you!
Huh, an actually usable out-of-the-box behavior tree from Unity? Impossible!
On a side node, seems like they're using their own GraphView class instead of Experimental one. I wonder if it will be the new, official GraphView class?
Yes, that's a good question. Maybe they are testing the waters...
Let's hope this will not be the next never-production-ready package!
Yes, I agree. I think this one will be a keeper though...
god dang it I've been meaning to release my own behavior tree solution on the asset store for years now but life just keeps getting in the way now it's basically futile. And this is way better than anything I could do
When I saw the title of the video I hoped that Unity had finally released Graph Tools Foundation, but no. We still have to mess around with Graph View.
Not quite there yet... one day. At least here a lot of the custom functionality is already in place and you don't have to build everything from scratch.
@@git-amend The main use I see for graphs is complex pipelines. My personal example is branching sequences of actions in an asynchronous turn-based game, or for example the environment generator that Game Dev Guide recently demonstrated. The behavior graph is a pretty different thing, which would be too difficult to customize for these needs.
Oh this is still using Graph view? I thought maybe this was built on top of GTF. 😔
I cant find talk action
Install the samples, it's an extra custom Node (and there are a few more too)
How it run in multiplayer? Is ready for multiplayer or needs to change everything to be able to run with mulitiplayer?
Considering the stunt unity pulled, im surprised you're giving the program the time of day.
you cant drag n drop reference to the inspector, if the reference is from other gameobject. Only if it was the same Gameobject from 1 parent, then you can do it.
I think, I encountered a bug.When I click inspect script on built-in action nodes like "talk" or "patrol", it just open a blank visual studio code page, there is not any single line of code, so I can't edit script. Are there anybody had the same problem?
How to use it for other kind of node logic?
Will it be new not supported feature of unity that lacks ton of stuff and after all is programmer heavy anyways? Find out in the next episode of Unity Roadmap!
But why does it lag even with 4 nodes in the graph?😃
Looks like another ShaderGraph that freezes for several seconds when changed anything
Hey @STARasGAMES, I'm sorry to hear you are having freezes. Can you use the Unity Discussion pages and post with the tag Behavior so we can help you? We're working on performance but it really shouldn't freeze for several seconds or lag when having only 4 nodes!
@@ShaneeNishry hey, that's a bit of misunderstanding here. I didn't try new Behavior package, but I spotted in this video noticeable micro-lag when user deletes node. The same is true for good old Shader Graph, which works acceptable with 10 nodes, but past that it freezes for most of operations, especially undo and duplication.
So I assume that if new Behavior package has noticeable freez on 4 nodes it's safe to say it won't handle well 30-50 nodes.
Wish you best, and hope I'm wrong about that
Hey @@STARasGAMES Maybe @git-amend can comment if he's encountering freezes or if it could be a recording artifact. Personally I haven't had an issue with such few nodes, but that said we're definitely working on improving performance for larger graphs.
I have not experienced any lag or freezing while using this package. Any perceived issues in that regard are likely just from editing in a pause while speaking. The only time there was any delay was while creating Assets.
@@git-amend That's good to hear! I'm not saying we have no performance issues, we do, but they shouldn't be THAT BAD and we're working on them :)
The main issue is we need to contribute some fixes to AppUI to get panning performance up with more nodes.
FIRST
Nice!