BTService: Event Receive Tick signature differs compile error

I’m on epic/master and my test project worked last week. I synced to epic/master tonight and now I’m getting this error when trying to compile my BTService blueprint:

Error Cannot override ‘BTService_BlueprintBase::ReceiveTick’ at Event Receive Tick which was declared in a parent with a different signature

The last change to the parent class BTService_Blueprint_Base was back in March and my project was working fine until today…

I also tried re-creating my BTService without much effect - still errors compiling the blueprint.

The change done in March boils down to unvirtualizing couple of BlueprintImplementableEvent-s in blueprintable BT node classes. Those functions should have never been done virtual and be overridden in C++ in the first place.

Obviously, since ReceiveTick is no longer virtual you can’t override it. But why do you even derive from BTService_BlueprintBase? This class is meant to be derived by BP classes? And if you really, really need to derive from that class simply override BTService_BlueprintBase::TickNode instead of ReceiveTick.

Cheers,

–mieszko

Hi Mieszko,

Thanks for your reply.

Am I not using BTService properly then?

You can see in my attachment above what is being done, and it’s just some old AI example - before AI Perception was implemented.

How should I do this, if at all?

Oh, that’s all in blueprints? Sorry, my bad!

So it seems the reason BT node thinks you want o observe BT keys is because you have key selectors in your blueprint, but if fails to find them at some point. It looks like a bug and I’ve filed it as UE-15812.

In the mean time - it’s not a good idea to have a decorator checking if your AI is alive. It’s better to stop the BT when AI dies (StopLogic or StopTree on AIController’s BrainComponent). Also, the setup you have would result in BT trying to find a task for dead AI every frame, since it will never be able to find a valid task. As a rule of thumb it’s always good to add some fallback behavior (like a Wait task) that would have your from that.

Sorry, but I still don’t understand how I should be using the BTService then and what class to use for it?

Here’s a screenshot of my BT.

I use the service to determine the distance to a Guard Target and then decide what to do about it. As I said, it’s an old example without using EQS…

Also, why is AIPerception giving me this warning on OnPerceptionUpdated event:

Info No value will be returned by reference. Parameter ‘UpdatedActors’. Node: OnPerceptionUpdated (AIPerception)

Thanks!!

@Mieszko

FYI, it also seems that Event Receive Activation, Deactivation and Search Start are not firing at all. I made a test service with a print to screen node and there is no output happening at all. :frowning:

And just so that I look crazy, the Event Receive Activation/Deactivation/SearchStart is now working all of a sudden.

Sigh.

I am not sure what BTService is dependent upon, but it does not trigger in all conditions it seems. When my BT executes Idle (lowest priority node) BTS does not trigger.
Yet if I manually set some BB keys and let the AI run with usual then I see BTS activates upon completion of the highest priority node.

The way you are deriving and using the service is fine. The reason Mieszko suggested you may be doing something wrong was just that he thought you were deriving it in C++. Since you’re not, the issue really is that you are syncing to the master branch. Stuff is being committed there all the time and it’s to be expected that things will get broken regularly.

If you want to develop without these problems, just sync to a more stable branch such as 4.8.0-preview-2 (tag) or release.