C++ Custom Behaviour Tree Service not getting called

I have added the c++ service to my Behaviour tree and it never gets called.

I have C++ BT Tasks that get called just fine.
I have blueprint custom BT services that get called just fine.
But c++ BT services never get called, as you can see i have log message in it and also added break points that never get hit.

Any help much appreciated

I am using UE5

Everything i am doing with Behaviour Tree in BP and C++ works just fine except C++ BT Services
As mentioned BP Services work too.

UCLASS()
class UBTS_SetupNpcChase : public UBTService_BlackboardBase
{
	GENERATED_BODY()

public:
	//UBTS_SetupNpcChase(const FObjectInitializer& ObjectInitializer);
	UBTS_SetupNpcChase();

	//UFUNCTION(BlueprintCallable)
	void OnBecomeRelevant(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) override;
	

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "NPC Data", meta = (AllowPrivateAccess = "true"))
		FBlackboardKeySelector mvo_PlayerCharKey;
};

UBTS_SetupNpcChase::UBTS_SetupNpcChase()
{
	//verify(false);
	bNotifyBecomeRelevant = true;
	bNotifyTick = true;
	bNotifyCeaseRelevant = true;
	bNotifyOnSearch = true;

}
void UBTS_SetupNpcChase::OnBecomeRelevant(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
	

	Super::OnBecomeRelevant(OwnerComp, NodeMemory);

	M_LOG(g_AppLog, Display, true, "UBTS_SetupNpcChase::OnBecomeRelevant");
	
	AAIController* pAiCtrl = Cast<AAIController>(OwnerComp.GetAIOwner());
	ANpcCharacterBase* pNpcChar = Cast<ANpcCharacterBase>(pAiCtrl->GetCharacter());
	UBlackboardComponent* pBlackBoardComp = OwnerComp.GetBlackboardComponent();


	


	ACharacter* pPlayerChar = Cast<ACharacter>(pBlackBoardComp->GetValueAsObject(mvo_PlayerCharKey.SelectedKeyName));
	verifyf(pPlayerChar != nullptr, TEXT("Invalid Player pointer"));


	FRotator lc_lookRotation = UKismetMathLibrary::FindLookAtRotation(
		pNpcChar->GetActorLocation(),
		pPlayerChar->GetActorLocation()
	);

	pNpcChar->SetActorRotation(lc_lookRotation.Quaternion());

}

Just added the Behaviour tree that uses the service.
Again my problem is that the service never runs
cheers

Think i found the problem

I had BTS BPs BTTs , some with similar names And even C++ custom tasks and Services ,

Basically i was selecting the wrong Service, cause the names are similar and Unreal Seems to mess with what you name files a lot , for example it adds its own characters and often removes underscore .

The point is in message to unreal

  1. Please allow developers to choose their own naming convention without adding A’s and U’s and etc to what we name stuff.

  2. Please if i add underscore to a name, please show that underscore wherever the name is being displayed, cause with the BP’s BTTS. BTS’s along without the CPP’s we going to need underscore to name files, so would be best to add the underscore in menus without changing the name in anyway.

Having to get used to the naming issues with unreal is part of the learning curve, its simple soltion to just name stuff excatly what people put in th dialogue box at creation, like with Visual Studio etc

Imagine how confusing it would be if Visual Studio has a convention of removing underscore from names and often adding extra characters to names of files. That would get very confusing quite quickly.

Simple solution i create file called ==== MyName_Is_DontChange

i would expect not to see a file called ==== AMyName_IsDontChnage

Now i need to go find a naming convention that cant lead to confusion given the name you type is not what you endup with in Unreal. Its Unreal, just think if other tools did this too.

All files you create are given the names you created them with. The editor, unless you’ve installed some sort of plugin that does this, will not change the names of things for you. So, much more likely, that you mistyped the names of things. There are recommended naming conventions for assets, but there is zero enforcement of that.

When you create C++ classes, you must follow the naming conventions. It doesn’t care what your files are called, or how you structure that, but your classes that derive from UObject must start with a U, your classes that derive from an Actor must start with A, your Enums must start with E, and so on and so forth.

Thats my point, this forces programmers who already have thier own naming convention to use Unreal naming convention , and this adds to the learning curve.

People who have been writing code for decades suddenly have to get used to unreal coding style in detail. And thats not a selling point is all am saying.

Windows API is more vast than unreal, but windows does not force you to use thier naming conventions, by adding extra characters to names off types when you create them.

Also C++ files dont appear as the same name in all windows of the editor, some letters are dropped , i have C_ which i add to c++ types so i can tell them apart from BP’s . In some menus you see the C_ in other menus it does not appear.

This enforced naming convention and adding characters to types you create, just means unnecessary confusion. Its simple enough to just always show the name user call their stuff, without messing with it in anyway.

I don’t personally know of any other API or tool that forces users to use a certain coding convention. This is not normal, and adds to the learning curve and confusion.

i just had to restart a project renaming everything very defensively to avoid confusion as project files multiply cause the names shown for types in menus is not exactly what the source file is called.
This is a recipe for mistakes.

There are organisation who have their own strict coding conventions that will have a problem using Unreal engine.

Basically all the c++ types have different name in editor , that’s recipe for disaster on big project.

Solution simple when someone type in name to create stuff, dont change it., and let people use naming convention they are used to.

Also in the editor menus its often the case that underscore in names is often replaced by space , to add to the confusion.

This debacle with naming , and inconsistency of type names in editor menus is on the same level as the Ue4 deplorable documention , whichi is a joke in its on right.

Its a great product dont get me wrong , but you get the impression unreal delivery lacks professionalism, sometimes it feels like a product developed in someone garage. A genius no doubt , but no professional delivery .

How many API or tools do you know that enforce naming convention, by messing with names you choose when you create types. Its a recipe for disaster.

People who have been writing code for decades suddenly have to get used to unreal coding style in detail.

And whenever you use someone else’s code, you have to get used to that coding style.

In some menus you see the C_ in other menus it does not appear.

Seems unlikely. Where?

This enforced naming convention and adding characters to types you create, just means unnecessary confusion.

If you know the naming conventions, then it serves to eliminate confusion. Also, I don’t know how the conventions are enforced, but I suspect removing them would be a rather difficult task with zero benefit at all.

I don’t personally know of any other API or tool that forces users to use a certain coding convention

… all of them?

There are organisation who have their own strict coding conventions that will have a problem using Unreal engine.

They would likely recognize any conflicts in style, and resolve that before choosing to move forward with Unreal, I would suspect.

In general, it is probably best to adopt The Unreal Way rather than try to force Unreal to work in ways that it might not. The build system is exceptionally complex, and it wouldn’t surprise me if you could break it in many ways by deviating. But, mostly, The Unreal Way is to explicitly name things in such a way that they are easily identifiable.

Epic Coding Standards: Coding Standard | Unreal Engine 4.27 Documentation

… it looks like the Asset Naming Convention document disappeared with the old Wiki, but here’s a copy:

Also in the editor menus its often the case that underscore in names is often replaced by space , to add to the confusion.

Where?

This debacle with naming , and inconsistency of type names

As far as I’m aware, it’s only inconsistent when you start doing inconsistent things. I can’t think of anywhere I’ve ever seen the names altered by anything, other than stripping the A,F,U,E, etc prefix off.

Ue4 deplorable documention , whichi is a joke in its on right

Yeah some of the documentation is pretty atrocious. Advanced Navigation Topics, for example, are basically non-existent, which seems kind of weird, because most everything needs navigation.