Hi, I’m working on Behavior Trees for unit movement in my game. I used the ‘Compare Blackboard Entries’ with ‘Is Equal To’ operator for deciding whether a task should be run or not. Initially I tried with bool values. One of the bool variables is set as true from the beginning, and the other one at a later stage. However, the compare decorator refuses to acknowledge that. It runs the task, when I set it to ‘Not Equal to’. So the one other condition that I’m using a bit higher in the BT is running fine. I printed out both these bool values, just before running the task, and both print out ‘true’. So next time I tried it out with integer values. One integer set to ‘1’ by default and the other set to ‘1’ at a particular point for running the task. Again printing it out gives ‘1’ in both cases. However the decorator refuses to run the task in my BT. Is there a known bug for ‘Compare Blackboard entries’? If not, I’ll try a bit more and see if there is any issue with my logic.
There’s no known bug in said mechanics. If you double-check your logic and it proves to be correct please share more details. A stripped-down version of your project would be awesome.
Cheers,
–mieszko
Thanks. I will keep trying again, after some time. So far, I haven’t got past the issue. I’ll try to post a stripped down version by tomorrow, currently the project size is kind of big compared to my upload speed here. For now, I can post the screenshots of what I’m doing:
In the Behavior Tree, it is not entering the ‘CalculateCurrentState’ task. I’ve highlighted the ‘Compare BB’ decorator so that you can see the details. As soon as I remove that condition, the behavior tree runs again.
Hi Mieszko, sorry for the delay in reply. My project was kind of unstructured and big back then. Stripping it down seemed like a lot of work. And I was occupied with some other design changes and UMG stuff. I just got back into Behavior Trees today and after converting my project to 4.7 P8, this issue still seems to be there. I just checked for other similar cases online, and I came across this link:
compare blackboard entries between vectors
It seems two other people went through the same issue while working on BT. So I’m guessing that this is a bug. I will try it out on a new project some time this week.
Hi, I’ve checked it out in a new Top Down template. It still produces the error related to ‘Compare BB Entries’. I’ve created a zip file of the project and pasted the link below. All the logical stuff are inside the blueprints folder. I’ve also written a detailed comment in the AIController blueprint to describe the situation.
Cool, thanks! I’ll have a look today.
Um… I had a look at the project you’ve supplied and everything works as expected. The compared BB entries are different so BB comparing decorator fails. Call me dumb, but I wasn’t able to find where you set the AITurnOn?
value (though I wasn’t looking too hard :P)
You can find an event Call AITask inside the TopDownAIController where I set the AITurnOn? blackboard value to true. It is being called from the TopDownPlayerController when the user presses Right Mouse Button. By default, you might see that the game is printing out false, which happens to be the default value of AITurnOn?. If you click the Right mouse button, it starts printing out true, but does not go through the Compare BB entries decorator. If it goes passes the decorator comparison check, it will print out Passed through BT
Roger.
It’s a bug Got it fixed and hopefully it will make it to 4.7.1 (I’m pushing for it really hard). Thanks!!!
Cool! Glad to see that’s taken care of.
Hi Mieszko, do you know if this bug has been fixed in the 4.7.3 release? I still seem to be getting the same bug.
I’ve checked it for the opposite condition as well. It always lets the BT flow through it no matter what the condition. If you guys don’t have this issue at your side, I can provide a code sample.