Why "RVO Avoidance" does not work when pawn is cotrolled by AAIController?

When i use RVO Avoidance in a pawn controlled by an APlayerController it does work well… is impossible touch other pawn…

But when i use RVO Avoidance in a pawn controlled by an AAIController it seem does not work… My NPCs can touch each other without problems.

What i need is exactly the opposite behaviour.

This is the only setting i modified (UCharacterMovement):

	if (Controller->IsA<AAIController>())
	{
		bUseRVOAvoidance = true;
		AvoidanceConsiderationRadius = 1000.f;
		AvoidanceWeight = 0.5f;
		SetAvoidanceEnabled(true);		
	}

Why this happen?
I need to do something else?

Thank you so much!!


Edited:


And this happen if i try to inherit from ADetourCrowdAIController (UE5.4)

0>Module.Catharsis.8.cpp.obj: Error  : LNK2019: símbolo externo "private: static class UClass * __cdecl ADetourCrowdAIController::GetPrivateStaticClass(void)" (?GetPrivateStaticClass@ADetourCrowdAIController@@CAPEAVUClass@@XZ) sin resolver al que se hace referencia en la función "public: static class UClass * __cdecl ADetourCrowdAIController::StaticClass(void)" (?StaticClass@ADetourCrowdAIController@@SAPEAVUClass@@XZ)
0>Module.Catharsis.8.cpp.obj: Error  : LNK2019: símbolo externo "public: __cdecl ADetourCrowdAIController::ADetourCrowdAIController(class FVTableHelper &)" (??0ADetourCrowdAIController@@QEAA@AEAVFVTableHelper@@@Z) sin resolver al que se hace referencia en la función "class UObject * __cdecl InternalVTableHelperCtorCaller<class ATheAIControllerBase>(class FVTableHelper &)" (??$InternalVTableHelperCtorCaller@VATheAIControllerBase@@@@YAPEAVUObject@@AEAVFVTableHelper@@@Z)
0>Module.Catharsis.8.cpp.obj: Error  : LNK2019: símbolo externo "public: virtual __cdecl ADetourCrowdAIController::~ADetourCrowdAIController(void)" (??1ADetourCrowdAIController@@UEAA@XZ) sin resolver al que se hace referencia en la función "public: virtual __cdecl ATheAIControllerBase::~ATheAIControllerBase(void)" (??1ATheAIControllerBase@@UEAA@XZ)
0>TheAIControllerBase.cpp.obj: Error  : LNK2019: símbolo externo "public: __cdecl ADetourCrowdAIController::ADetourCrowdAIController(class FObjectInitializer const &)" (??0ADetourCrowdAIController@@QEAA@AEBVFObjectInitializer@@@Z) sin resolver al que se hace referencia en la función "public: __cdecl ATheAIControllerBase::ATheAIControllerBase(class FObjectInitializer const &)" (??0ATheAIControllerBase@@QEAA@AEBVFObjectInitializer@@@Z)

I’m sure i have the AIModule:

Anyway i think i don’t need it… i think RVO Avoidance can be enough.

Bump the post:

I wrote my own avoidance algorithm and more or less works in my specific case.
But I would like to use Epic’s RVOAvoidance because it sure is better.

So this post is not dead… As long as RVO doesn’t work for me.

Thank you so much!!

Hi, I haven’t setup RVO avoidance from c++, but in the character movement settings in blueprint (see e.g. step 4 here Using Avoidance With the Navigation System in Unreal Engine), did you try it with those settings?

And for crowd avoidance, you would need to set it to use the UCrowdFollowingComponent instead of the default path following component in your AIController (don’t know why its like that instead of inheriting), post #3 here Missing DetourCrowdAIController in C++ - #3 by chrudimer

1 Like

Hi @chrudimer

Yes, I did it as in the guide… but I didn’t see any difference. Pawns can touch each other.

I also did it as you explain in your comment.

ABaseAIControllerCPP::ABaseAIControllerCPP(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer.SetDefaultSubobjectClass<UCrowdFollowingComponent>(TEXT("PathFollowingComponent"))) {}

And I disabled RVOAvoidance too (I know that only one of the two can be used at the same time). But the same thing happens. The pawns can touch each other.

So I think. if it works for everyone else, and it doesn’t work for me. So there must be something in my code that prevents it from working.

Maybe it’s because I have a custom CharacterMovemrntComponent. But it’s strange because I use the same CharacterMovemrntComponent for the player and for the NPCs and RVOAvoidance works for the players but it doesn’t work for NPCs…

I’ll have to look into it. I suspect there is something I haven’t configured correctly to work.

Thank you very much for your help @chrudimer