Behaviour Tree gets stuck when alt-tabbing

This is from latest 4.7 release.
I have a Behaviour Tree setup that makes the enemy face the player and shoot at him. It works fine, until the engine loses focus or the framerate drops. When I press the Windows key, the behaviour tree appears to get stuck, looping only the last task of a sequence.
This loop continues even if I pause the application. It appears to restore it’s behaviour every now and then, sometimes even while the application is still paused.

I’ve made a video to demonstrate.

Hi Blue669,

I am investigating this in 4.7.1 with a few of my own AI, but I am getting different results. I was able to use the windows key to jump out and everything continued to run as expected. I would like to know more about the service and the task that are getting stuck. Can you send me some screenshots of their event graphs and any other information about exactly how they function? That will let me set up my tests to be more like yours.

Thanks!

This is the task that is getting stuck when frames drop or alt-tabbing:

Sorry for the delay in response. I have been looking into this blueprint and I think the issue may be occurring around the Nearly Equal (float) node. I would suggest placing a “Print String” node before the branch to print the Bool’s value. That will let you see if the Angle is getting within that tolerated area. What do you have the Angle Tolerance set to? If it is 0, it may not be able to reach that perfectly. Let me know if that helps.

The tolerance was between 0 and 0.5 and it worked properly 99% of the time. I’ve set the value higher and it seems to reduce the propability of causing the issue, but it seemed very strange to me that I could cause this 100% of the time when alt-tabbing or when the game has frame drops (starting Fraps for example).

Hey Blue669,

Event Receive Tick is frame dependent, so it would make sense that an FPS change may be affecting this. My theory is that it is ticking less frequently due to low FPS, causing it to “miss” the point where it would meet that rotation angle, so it just keeps rotating (Which is what the set actor rotation seems to be saying to do). When the angle is larger, it has more of a to run the tick execution when the rotation meets those requirements.

My suggestion is to either lock the FPS down or perhaps try using a Timer, so that it is time dependent and not frame.

I hope that helps you!