Hi, I’ve had several years of experience both implementing and using BT systems in custom engines in the past, and I’ve been having a bit of a hard time wrapping my head around the way that UE4 BTs are implemented.
For instance, I was trying to have an agent perform an action for a minimum amount of time, and then start checking a condition. In a “standard” BT I would do this by having a parallel that aborts on its first failure, with one branch being a selector with the Time Limit condition and the secondary condition as children, and the other branch being the action in question.
I thought I could achieve the same behavior by using a Composite decorator, with the Time Limit OR’ed with the other condition. To my surprise, the time limit node always returns true within a composite (at least on the version I’m currently on, 4.18.1). This could well be a bug, but from inspecting why this happens it seems to illustrate something I find is a design issue. In “standard” BTs conditions are regular leaf nodes that always evaluate the same regardless of where you put them on the tree. In UE4 BTs decorators have a different evaluation route inside a Composite than when simply decorating a node. I think this works against how conditions are atomic and can be easily combined in “standard” BTs. With the current behavior, any number of user-implemented conditions could fall into the same trap.
Another issue I have is with understanding “Observers”. I think both in nomenclature and documentation, the behavior of the different Observer settings are unclear. Am I correct in assuming that Aborts Self will abort the current branch if the decorator fails, while Aborts Lower Priority will abort lower priority branches if the decorator succeeds? If this is the case, it should be made much clearer, in my opinion. In both cases you’re simply stating that the Observer will abort, but it’s not made clear under what conditions.
Another thing that’s unclear about Observers is what happens when multiple decorators on a node have an Abort setting. Is it possible to have a branch abort only when multiple decorators fail, or succeed simultaneously? This would be trivial in “standard” BTs but I’m not sure how to achieve it in UE4 BTs. If it’s achievable with Composite decorators, it’s pretty unclear how.
Thanks for taking the time to read this, and hopefully you can address my concerns. I want to avoid having to implement yet another BT system, if at all possible, but as it is I’m having difficulty seeing how I could use UE4 BTs to build more complex behaviors for future projects.