Why prefer Decorator to Leaf,when making an conditional node? #14
Replies: 1 comment 1 reply
-
Both ways are good. It used to be done with leaves before, now it's also possible to do it with decorators, in the Unreal fashion. These are just useful scripts you can use to follow a common design pattern in videogame AI, but nothing stops you from going your own way, since this is completely code based for now. You could even use a plain BTNode lol. I prefer the condition to be a decorator cause it is more separate and intuitive to me. I feel like an action should just be a very small script, with just a single function call and a return value, and that the condition should be checked on a higher level of the tree (so with a decorator). This makes the tree more clear in terms of what it does and how it flows but, again, you can have your conditions inside leaves as well. Something you can do to separate things is to put your condition leaves inside a sequence, but this can result in several nested sequences. |
Beta Was this translation helpful? Give feedback.
-
In my view, when making an conditional node, using Leaf seems to be more understandable than Decorator.
I am quite curious about the key differences between them In this situation? LOL
Beta Was this translation helpful? Give feedback.
All reactions