Hi everyone! Happy Sunday! Make sure to hit the 👍 and the 🔔 if you don't want to miss next week's video that will continue this topic into Blackboard Architecture! Hope you like it! Also, check out the little bash script I included in the repo. If you are like me, and you use CTRL-ALT-A to stage your files in your IDE, it doesn't include the meta files, which you might want to include. The `stageMeta` script will find all the missing meta files and stage them for you.
Dude.. I don't know how you don't have more subscribers. I used to do basic gamedev back in the late '90's/00's and have tried to get back into it in the last couple years (off and on) without writing my own openGL based engine again. It's refreshing to find tutorials that not aimed at absolute beginners. I've been programming professionally for 20 years -- I just want help with structure/systems/engine specifics. This is great.
I found a good way to organize the tree: Use Unity's Hierarchy tree. Basically, make node a gameObject and add it as children of the tree. Then you can process nodes in sequence of child index. The good thing is that you can drag around any node without changing scripts. you can read the status of each node by changing the name of respected gameObject
This channel is the only one I found that has the correct implementation of the sequence compositor. Every other tutorial implements a parallel or parallel sequence and calls it a sequence which is really misleading. Thanks a lot mate!
Great stuff, as always! For those interested, there are ways to migrate the logic into a UI grid with nodes and links through UI Toolkit. You can even throw a mini-map in the lot. It's quite nice. The final product is far more scalable and readable than code only. It also allows compartmentalization of blocs of logic to reuse them in other trees and more! Level up your complex systems with visuals that boosts productivity 😀.
there is a dedicated tutorial for that using UI Builder and Graph View.. ruclips.net/video/nKpM98I7PeM/видео.html Mixing those with your tutorial will be the ultimate behaviour tree to be use.
I am very glad someone mentionned this RUclips channel, somewhere, I don't remember where. Nice topics you've got there, thanks for sharing. I can't wait to watch more of your videos.
This is just another banger to be frank. You broke it down so simply I was able to grasp the concepts quickly and create my own behaviour tree with different functionality! Legend.
Your Unity-C# tutorials are among the best on RUclips and you deserve much higher viewership. It's so hard to find scripting tutorials any more advanced than a basic introduction to design patterns, or aren't overly niche... And yet you write truly practical, useful, and properly structured code with a high production value, and you pump these things out like a beast! We must protect this man at all costs! Quick question although this may have been answered in a previous video: where did you get that editor script for drag-ang-drop arrays? Did you make it yourself or is it an asset?
Little tip! If your waypoints are too close to each other then agent.pathPending will never be true and your hero will not go to the next waypoint. I think because the calculation will be that quick that the path is ready before we could check it.
I haven't watched the full video yet, but I have spent the last week looking for the best implementation for a simple AI for my card game. It is almost like a sign from the Universe. You always have the perfect video. Can't wait to learn and implement this
Excellent video! I am using the Fluid Behavior Tree in my current main project. A well.implemented BT makes it so easy to keep track of and debug agent AIs.
Nice video! it just popped on my home page exactly when i was going to code my AI and now i will implement it with this pattern! im pretty sure your channel will grow even more than brackeys.
I've watched all of your videos but this is my first time commenting! I really love your style and approach. This channel has become my favorite channel in the game dev space on RUclips. I've used Unity for around 5 years and my current live service game is a Unity game. However, the past year or so I have transitioned to Godot for a variety of reasons. Using your approaches and methodologies to help me with better architecting systems in a new engine such as Godot has been a blast! All of the knowledge you expel is so easily transferable. I really appreciate all you do and I hope you continue making videos like these for the foreseeable future.
Thanks for the great message! I'm glad you are finding it easy to transfer topics from the channel to Godot! Nice when that works out! Lots more to come!
An interesting extension for performance could be integrating the BT and/or some nodes with an event-system to handle interruptions & environment changes rather than relying entirely on the entity's class Update method. Alternatively, you could go down the coroutine/task path and use a fixed time-interval to reduce the number of environment/condition evaluations (e.g. every 1/10th of a second rather than at every frame). If you have 100s of NPCs/AIs, or are targeting mobile, this could make a difference.
Yes, there is definitely room for some performance enhancements. Rate limiting is probably chief among them. We'll talk a bit more about handling environment changes and additional data in next week's video! Thanks for the comment!
6 месяцев назад
You are doing the best tutorials in known Internet....Keep doing!
Wow, excellent video! I just finished udemy course about Behaviour Trees and it's seems that your approach is waaay more flexible and understandable. I'm really looking forward to see the next video about blackboard (:
There are a few NodeCanvas assets on the store. I only have one of them, the one made by Paradox Notion, and I think it is excellent. My advice is definitely to either use a visual tool like this or make your own, once you have a good understanding of Behaviour Trees. That way you can either adapt your solution to that tool, or go the other way and extend that tool to suit your needs. On a larger BT I would definitely advise some kind of visual aid.
I have noticed that you do the execution of the behaviour tree on the "Update" function. The thing is , if you do a complex strategy , lets say for an fps game where you have to move/check for enemies/check for whatever/do the action. and lets say that you have 50 npcs with that strategy , then your complexity is super huge for the proccessor . What do you recommend in that case ?
In this case I would suggest implementing an execution policy. If you take a look at the repository, I've actually included a few policies in the root node. There you could have a timer so you only run once every few milliseconds instead of every single frame - this way you can throttle the processing - in most cases this is overkill. You could also throttle outside of the BT, but that's up to you!
Great guide as always! Where do you seperate logic which is not common? For example, Your character is moving to patrol points with "animation" even if you didnt call it inside Patrol, so do you just call it in another place where you check magnitude etc. I want to make the strategies modular as possible, but there are some typical conditions like animation running, or tweening while moving etc. Should i seperate the logic there, or create another interface to handle that. As far as i see, you seperated the animation logic from the strategies. Or instead of passing, agent, target, speed etc. should i directly pass "Zombie" or smth to the strategy constructors for better usage? I generally find myself setting the logic inside Zombie (live move methods etc.), and in strategies, I am just calling them. I dont know its a good way though. I cant seem to understand how to seperate them, for example there should be a Die Strategy where we implement die methods to call ragdoll etc, or should i simply call zombie.Die(); inside the strategy and actions/events would do the rest like ragdolls etc. So to summarize, writing the logic inside Strategy, or calling it from given class
Well, this is a question that could have multiple answers, and there is no cookie-cutter solution. Here are a few guidelines (by no means rules). Strategies should primarily encapsulate decision-making logic. Keep strategies focused on decision-making, delegating execution through interfaces or events - so if a strategy needs to execute an animation, either pass in an Action that will trigger the animation change, or fire and event. Another option is to completely separate animations from the behaviour tree and whatever node is currently being evaluated. In my example, the behaviour tree does not handle animation at all - the Hero updates the Speed float of the AnimationController based on the velocity of the NavMeshAgent. Regardless, I think you are going to see an interesting solution on Sunday when we look at Blackboard architecture.
@@git-amend Cant wait to see blackboard and data sharing! I was using State machine for my zombies and showed your BT and implemented. Had hard times sharing data between nodes like checking targret and attacking them. Just waiting your approach to make it better. Thanks for your gold answer and time.
I notice that, in selector node, process will start from current child, but in priority selector, process starts from the first child. So we must use priority selector to do some interrupt?
Thank you. Actually there is a great video on this topic that was made by Nik Lever on the Unity channel about this. He talks about 3 ways to use URP render features, and I believe it's the 3rd technique. ruclips.net/video/3CpEn_mmr3o/видео.html
Great question! A BT is very similar to a Hierarchical State Machine. There are pros and cons to both. A state machine offers clear delineation of states and transitions, simplifying the logic flow. However, they can become cumbersome when handling numerous states or complex transitions, potentially leading to bloated code and reduced maintainability compared to more dynamic approaches like BTs. And yes, the can be combined - that is going to be the subject of a video in a few weeks!
Hello, I'm learning a lot from your videos, your explanations are great and the code sometimes seems complex but it's great. Could you make videos based on different project architectures?
@@git-amend Your knowledge is very good for people who are developing advanced skills, to be honest, I need to gradually digest them, DI is something I want to apply first for small projects that scale and maintain into large projects
Can i let All the nodes action or condition inherit from Leaf directly instead of using IStrategy (of course i will remove this interface, only use Leaf class)?. And how to integrate blackboard to behavior tree?. That's all my wondering, im so gratefull if you have time to answer me. Thank you!!!
It appears that the current child keeps getting called until it returns Success or Failure. What if we want to run a higher priority node to be checked while the current node is still Running? For example, while the AI is running around. It's HP gets too low and now it needs to run away
The processing logic differs because `PrioritySelector` evaluates each child in priority order from the start on each tick, whereas `Selector` iterates through children sequentially, resuming where it left off. In `PrioritySelector`, resetting ensures high-priority children are always checked first, which is useful for dynamic priorities. `Selector`, by contrast, advances incrementally through its list of children, maintaining its position unless it needs to reset, which is simpler and efficient for sequential decision-making.
For me, that would seem counter intuitive because I'm considering the total outcome. But if that makes more sense to you, then by all means you can use it that way, I can understand how it could be interpreted at succeeding at failure.
Haha yeah, it gets asked a lot. I should put it in the description of all the videos maybe. Anyway, I use Excalidraw for Obsidian for all my diagrams these days. You can see more about that here: ruclips.net/video/o0exK-xFP3k/видео.html
Thank you very much for the tutorial! I have a little problem. After the final code, the execution logic doesn't continue after the sequence is executed. For example, if the hero got the treasure, then nothing further happens. If he became in a safe position, then after that, he doesn't react to any changes, etc. The code has already checked 10 times, everything is identical to yours (I guess).
Check the repository link in the description. I added the concept of Policies for how long to execute to the main Behaviour Tree node (after recording)
I know I'm a few months late, but the issue seems to be that in the Behavior Tree class, the Process() method should have "currentChild = (currentChild + 1) % children.Count;" before "return Status.Success" (second to last line of the method). If it doesn't do this, then the currentChild will never be set back to 0 and thus the whole tree will only ever run once. He actually briefly references this at 7:48. This only works if you always want your behavior trees running forever and you don't plan on making subtrees. I'm guessing he did it this way so that you can have functioning subtrees?
Great video as usual, I have a question about the BT and the Goab, how could we integrate the Goab system to pick and create nodes and sequences to archive a goal, so the nodes would be an actions but the action wont be a one class but a combination of nodes, is that has any logic or it's just two deferent soultions for two different problems on the same Ai agent.
Interesting question for sure. In most cases you would not need to mix and match the two. But if you did want to, it could involve using GOAP's planning capabilities to dynamically generate sequences of behavior tree nodes to achieve goals. This would potentially offer a flexible and adaptive approach to decision-making. This integration allows for leveraging the strengths of both systems: GOAP's goal-oriented planning and behavior trees' hierarchical structure for action execution. I think it would be fairly complex to implement and debug, but definitely an interesting idea!
Using the strategy pattern provides flexibility by allowing dynamic node behaviors at runtime, enhancing adaptability to changing requirements. This approach allows for easier maintenance and extensibility compared to a standard state machine. You could just as easily use the strategy pattern in a state machine as well.
Hey , In my hero class I don't have input and animation so I had not used enable and disable.. the rest of the code is same. But when I toggle is in danger it goes to the resting spot, but then when I toggle it back, it stays there. Also after picking up both the treasures, it keeps standing at the last treasure place and does not go into patrolling.. Am I missing something? Could you please help?. the rest of the code is same as even tested by downloading the git code.. Thank you in advance!
It's tough to solve problems like that without more information. I suggest you join the Discord and ask in the video-forum-discussions, and someone will likely be able to give you some advice.
Loving your videos. If it's not too much to ask, would you keep your code structured in a way that the same code can be easily replicated in other tools or engines too? As a seasoned dev I can port your code to my monogame or even godot, but for those who are just learning using other engines, it could be harder.
Yes very similar. One subtle difference if you take a look in the repository you’ll see I added Policies to the BT Node, but it didn’t make it into the video.
Hi everyone! Happy Sunday! Make sure to hit the 👍 and the 🔔 if you don't want to miss next week's video that will continue this topic into Blackboard Architecture! Hope you like it!
Also, check out the little bash script I included in the repo. If you are like me, and you use CTRL-ALT-A to stage your files in your IDE, it doesn't include the meta files, which you might want to include. The `stageMeta` script will find all the missing meta files and stage them for you.
Dude.. I don't know how you don't have more subscribers.
I used to do basic gamedev back in the late '90's/00's and have tried to get back into it in the last couple years (off and on) without writing my own openGL based engine again.
It's refreshing to find tutorials that not aimed at absolute beginners. I've been programming professionally for 20 years -- I just want help with structure/systems/engine specifics. This is great.
Thanks for the kind words, I appreciate the comment!
This channel is a pure gem. I am really impressed that you manage to put out these quality videos on a weekly basis.
Wow, thank you! Thanks for the kind words!
I found a good way to organize the tree: Use Unity's Hierarchy tree.
Basically, make node a gameObject and add it as children of the tree. Then you can process nodes in sequence of child index.
The good thing is that you can drag around any node without changing scripts. you can read the status of each node by changing the name of respected gameObject
That's a very interesting approach. I'll have to try that one out!
This channel is the only one I found that has the correct implementation of the sequence compositor. Every other tutorial implements a parallel or parallel sequence and calls it a sequence which is really misleading. Thanks a lot mate!
Great to hear!
Great stuff, as always!
For those interested, there are ways to migrate the logic into a UI grid with nodes and links through UI Toolkit. You can even throw a mini-map in the lot. It's quite nice.
The final product is far more scalable and readable than code only. It also allows compartmentalization of blocs of logic to reuse them in other trees and more! Level up your complex systems with visuals that boosts productivity 😀.
Thanks for sharing that tip, it's a great idea!
Would love to see that
there is a dedicated tutorial for that using UI Builder and Graph View.. ruclips.net/video/nKpM98I7PeM/видео.html
Mixing those with your tutorial will be the ultimate behaviour tree to be use.
@@TheKr0ckeR gonna check that out, thanks
I am very glad someone mentionned this RUclips channel, somewhere, I don't remember where. Nice topics you've got there, thanks for sharing. I can't wait to watch more of your videos.
Welcome aboard!
This is just another banger to be frank. You broke it down so simply I was able to grasp the concepts quickly and create my own behaviour tree with different functionality! Legend.
Glad to hear that! Thank you!
Your Unity-C# tutorials are among the best on RUclips and you deserve much higher viewership. It's so hard to find scripting tutorials any more advanced than a basic introduction to design patterns, or aren't overly niche... And yet you write truly practical, useful, and properly structured code with a high production value, and you pump these things out like a beast! We must protect this man at all costs!
Quick question although this may have been answered in a previous video: where did you get that editor script for drag-ang-drop arrays? Did you make it yourself or is it an asset?
Thanks for the comment. I think the functionality you are referring to is just built in with Odin Inspector, but I'd have to double check.
Little tip! If your waypoints are too close to each other then agent.pathPending will never be true and your hero will not go to the next waypoint. I think because the calculation will be that quick that the path is ready before we could check it.
Great tip! Thanks for pointing that out!
I haven't watched the full video yet, but I have spent the last week looking for the best implementation for a simple AI for my card game. It is almost like a sign from the Universe. You always have the perfect video. Can't wait to learn and implement this
Great to hear! Hope it helps!
Excellent video! I am using the Fluid Behavior Tree in my current main project. A well.implemented BT makes it so easy to keep track of and debug agent AIs.
Awesome! I agree, makes life easier!
Nice video! it just popped on my home page exactly when i was going to code my AI and now i will implement it with this pattern!
im pretty sure your channel will grow even more than brackeys.
Glad it was helpful! Thanks for the comment!
I've watched all of your videos but this is my first time commenting! I really love your style and approach. This channel has become my favorite channel in the game dev space on RUclips. I've used Unity for around 5 years and my current live service game is a Unity game. However, the past year or so I have transitioned to Godot for a variety of reasons. Using your approaches and methodologies to help me with better architecting systems in a new engine such as Godot has been a blast! All of the knowledge you expel is so easily transferable. I really appreciate all you do and I hope you continue making videos like these for the foreseeable future.
Thanks for the great message! I'm glad you are finding it easy to transfer topics from the channel to Godot! Nice when that works out! Lots more to come!
You consistently have the best tutorials out there right now. You'll be at 100k subscribes in no time! keep up the great work.
Hope so! Thanks for the encouraging feedback!
Awesome implementation! Looking forward to the blackboard.
Coming soon!
Yeah me too.
An interesting extension for performance could be integrating the BT and/or some nodes with an event-system to handle interruptions & environment changes rather than relying entirely on the entity's class Update method. Alternatively, you could go down the coroutine/task path and use a fixed time-interval to reduce the number of environment/condition evaluations (e.g. every 1/10th of a second rather than at every frame). If you have 100s of NPCs/AIs, or are targeting mobile, this could make a difference.
Yes, there is definitely room for some performance enhancements. Rate limiting is probably chief among them. We'll talk a bit more about handling environment changes and additional data in next week's video! Thanks for the comment!
You are doing the best tutorials in known Internet....Keep doing!
Glad you like them!
Wow, excellent video! I just finished udemy course about Behaviour Trees and it's seems that your approach is waaay more flexible and understandable. I'm really looking forward to see the next video about blackboard (:
Awesome! See you next Sunday then!
Another awesome AI video after GOAP, already looking forward to coding along and learning something new!
Great! Hope you like it!
Thanks! This is exactly what I was looking for.
Glad to hear it!
Woww.
And here I am spending a month on if statements and switch cases to make my AI
Nice, big improvement then.
I love It. it was what I needed the most.
Thank you very much.
Great! I'm glad to hear that! I'm sure you will like next week's video too.
@@git-amend There's never been a time when I didn't like your video.
However, this video is "LOVE".!!
Thanks! Awesome as usual!
Thanks again!
Great video as always
There are a few NodeCanvas assets on the store. I only have one of them, the one made by Paradox Notion, and I think it is excellent. My advice is definitely to either use a visual tool like this or make your own, once you have a good understanding of Behaviour Trees. That way you can either adapt your solution to that tool, or go the other way and extend that tool to suit your needs. On a larger BT I would definitely advise some kind of visual aid.
I have noticed that you do the execution of the behaviour tree on the "Update" function.
The thing is , if you do a complex strategy , lets say for an fps game where you have to move/check for enemies/check for whatever/do the action.
and lets say that you have 50 npcs with that strategy , then your complexity is super huge for the proccessor .
What do you recommend in that case ?
In this case I would suggest implementing an execution policy. If you take a look at the repository, I've actually included a few policies in the root node. There you could have a timer so you only run once every few milliseconds instead of every single frame - this way you can throttle the processing - in most cases this is overkill. You could also throttle outside of the BT, but that's up to you!
Great guide as always! Where do you seperate logic which is not common? For example, Your character is moving to patrol points with "animation" even if you didnt call it inside Patrol, so do you just call it in another place where you check magnitude etc. I want to make the strategies modular as possible, but there are some typical conditions like animation running, or tweening while moving etc. Should i seperate the logic there, or create another interface to handle that. As far as i see, you seperated the animation logic from the strategies. Or instead of passing, agent, target, speed etc. should i directly pass "Zombie" or smth to the strategy constructors for better usage? I generally find myself setting the logic inside Zombie (live move methods etc.), and in strategies, I am just calling them. I dont know its a good way though. I cant seem to understand how to seperate them, for example there should be a Die Strategy where we implement die methods to call ragdoll etc, or should i simply call zombie.Die(); inside the strategy and actions/events would do the rest like ragdolls etc. So to summarize, writing the logic inside Strategy, or calling it from given class
Well, this is a question that could have multiple answers, and there is no cookie-cutter solution. Here are a few guidelines (by no means rules). Strategies should primarily encapsulate decision-making logic. Keep strategies focused on decision-making, delegating execution through interfaces or events - so if a strategy needs to execute an animation, either pass in an Action that will trigger the animation change, or fire and event. Another option is to completely separate animations from the behaviour tree and whatever node is currently being evaluated. In my example, the behaviour tree does not handle animation at all - the Hero updates the Speed float of the AnimationController based on the velocity of the NavMeshAgent.
Regardless, I think you are going to see an interesting solution on Sunday when we look at Blackboard architecture.
@@git-amend Cant wait to see blackboard and data sharing! I was using State machine for my zombies and showed your BT and implemented. Had hard times sharing data between nodes like checking targret and attacking them. Just waiting your approach to make it better. Thanks for your gold answer and time.
I notice that, in selector node, process will start from current child, but in priority selector, process starts from the first child. So we must use priority selector to do some interrupt?
god-like tutorial
Thanks!
This vid is so useful. Btw, do u know how to make the shader effect for your character when it's concealed by the wall or something else. Thank you!
Thank you. Actually there is a great video on this topic that was made by Nik Lever on the Unity channel about this. He talks about 3 ways to use URP render features, and I believe it's the 3rd technique. ruclips.net/video/3CpEn_mmr3o/видео.html
amazing video yet again!
Thank you!
Amazing video! One question - how does Behaviour tree compare to StateMachines? Could them be combined, or it's just too excessive?
Great question! A BT is very similar to a Hierarchical State Machine. There are pros and cons to both.
A state machine offers clear delineation of states and transitions, simplifying the logic flow. However, they can become cumbersome when handling numerous states or complex transitions, potentially leading to bloated code and reduced maintainability compared to more dynamic approaches like BTs.
And yes, the can be combined - that is going to be the subject of a video in a few weeks!
Hello, I'm learning a lot from your videos, your explanations are great and the code sometimes seems complex but it's great. Could you make videos based on different project architectures?
also advantages and disadvantages of each project architecture, and what things should be taken into account when choosing a certain architecture
Slowly but surely we'll cover all sorts of game architecture topics like this!
So great, keep it up!!!
Thank you! Will do!
@@git-amend Your knowledge is very good for people who are developing advanced skills, to be honest, I need to gradually digest them, DI is something I want to apply first for small projects that scale and maintain into large projects
Thanks for this 🙏
My pleasure 😊
Nice
Thanks
Thanks for the video sir.
Can you do some video about "Custom Package Publishing" ?
You are welcome. Yes, I have a video about creating packages coming soon!
When adding nodes, can you just chain them together, like you do for a Builder?
So like node.AddChild(child1).AddChild(child2).AddChild(child3);
Yes, you can apply a Fluent Builder pattern to this very easily.
Can i let All the nodes action or condition inherit from Leaf directly instead of using IStrategy (of course i will remove this interface, only use Leaf class)?. And how to integrate blackboard to behavior tree?. That's all my wondering, im so gratefull if you have time to answer me. Thank you!!!
It appears that the current child keeps getting called until it returns Success or Failure. What if we want to run a higher priority node to be checked while the current node is still Running? For example, while the AI is running around. It's HP gets too low and now it needs to run away
Why is the processing logic different for the Selector and PrioritySelector? It seems they should be the same except for using a sorted list.
The processing logic differs because `PrioritySelector` evaluates each child in priority order from the start on each tick, whereas `Selector` iterates through children sequentially, resuming where it left off. In `PrioritySelector`, resetting ensures high-priority children are always checked first, which is useful for dynamic priorities. `Selector`, by contrast, advances incrementally through its list of children, maintaining its position unless it needs to reset, which is simpler and efficient for sequential decision-making.
Hey. I was wondering if UntilFail Node should return Success when the child returns Failure?
For me, that would seem counter intuitive because I'm considering the total outcome. But if that makes more sense to you, then by all means you can use it that way, I can understand how it could be interpreted at succeeding at failure.
What is the whiteboard app been used here in the intro?
That's Excalidraw for Obsidian, though you can use it standalone too.
Awesome video... ❤
Glad you liked it
Do you have a video on menu systems yet?
Last year I made one for UGUI that might interest you: ruclips.net/video/Wir7jMp5v_k/видео.html
Probably has been asked a 1000 times before but anyway, which tool do you use to draw your diagrams?
Haha yeah, it gets asked a lot. I should put it in the description of all the videos maybe. Anyway, I use Excalidraw for Obsidian for all my diagrams these days. You can see more about that here: ruclips.net/video/o0exK-xFP3k/видео.html
Thank you very much for the tutorial! I have a little problem. After the final code, the execution logic doesn't continue after the sequence is executed. For example, if the hero got the treasure, then nothing further happens. If he became in a safe position, then after that, he doesn't react to any changes, etc. The code has already checked 10 times, everything is identical to yours (I guess).
Check the repository link in the description. I added the concept of Policies for how long to execute to the main Behaviour Tree node (after recording)
@@git-amend ok, thanks, I'll check it:)
I know I'm a few months late, but the issue seems to be that in the Behavior Tree class, the Process() method should have "currentChild = (currentChild + 1) % children.Count;" before "return Status.Success" (second to last line of the method). If it doesn't do this, then the currentChild will never be set back to 0 and thus the whole tree will only ever run once. He actually briefly references this at 7:48. This only works if you always want your behavior trees running forever and you don't plan on making subtrees.
I'm guessing he did it this way so that you can have functioning subtrees?
Great video as usual, I have a question about the BT and the Goab, how could we integrate the Goab system to pick and create nodes and sequences to archive a goal, so the nodes would be an actions but the action wont be a one class but a combination of nodes, is that has any logic or it's just two deferent soultions for two different problems on the same Ai agent.
Interesting question for sure. In most cases you would not need to mix and match the two. But if you did want to, it could involve using GOAP's planning capabilities to dynamically generate sequences of behavior tree nodes to achieve goals. This would potentially offer a flexible and adaptive approach to decision-making. This integration allows for leveraging the strengths of both systems: GOAP's goal-oriented planning and behavior trees' hierarchical structure for action execution.
I think it would be fairly complex to implement and debug, but definitely an interesting idea!
Whats the benefits of implementing such a state management with strategy pattern instead of using standart abstraction of state machine
Using the strategy pattern provides flexibility by allowing dynamic node behaviors at runtime, enhancing adaptability to changing requirements. This approach allows for easier maintenance and extensibility compared to a standard state machine. You could just as easily use the strategy pattern in a state machine as well.
Noice 👍
Thank you!
Hey , In my hero class I don't have input and animation so I had not used enable and disable.. the rest of the code is same. But when I toggle is in danger it goes to the resting spot, but then when I toggle it back, it stays there. Also after picking up both the treasures, it keeps standing at the last treasure place and does not go into patrolling.. Am I missing something? Could you please help?. the rest of the code is same as even tested by downloading the git code.. Thank you in advance!
It's tough to solve problems like that without more information. I suggest you join the Discord and ask in the video-forum-discussions, and someone will likely be able to give you some advice.
@@git-amend okay, thank you so much!
Loving your videos. If it's not too much to ask, would you keep your code structured in a way that the same code can be easily replicated in other tools or engines too? As a seasoned dev I can port your code to my monogame or even godot, but for those who are just learning using other engines, it could be harder.
Amazing stuff!
Quick question.... What do you use to make graphs like at 1:20? It seems very useful.
Thanks! I use Excalidraw for Obsidian - can see that here: ruclips.net/video/o0exK-xFP3k/видео.html
But what if I just put this in a big if statement?
At first glance BahviorTree node and Sequence node look both the same...
Yes very similar. One subtle difference if you take a look in the repository you’ll see I added Policies to the BT Node, but it didn’t make it into the video.