I don’t underestand one Very important question.
My Project
I have Third Person Template with custom Animation Blueprint, that has NativeUpdateAnimation
event overriden with simple logic:
void UAnimInstanceBase::NativeUpdateAnimation(float DeltaSeconds)
{
Super::NativeThreadSafeUpdateAnimation(DeltaSeconds);
if (Character == nullptr || MovementComponent == nullptr) return;
// all calculations go here
GroundSpeed = Velocity.Size2D(); //UKismetMathLibrary::VSizeXY(Velocity);
CurrentAcceleration = MovementComponent->GetCurrentAcceleration();
//UE_LOG(LogTemp, Warning, TEXT("Speed: %f"), GroundSpeed)
ShouldMove = (GroundSpeed > 3.f && !UKismetMathLibrary::Vector_IsNearlyZero(CurrentAcceleration));
//UE_LOG(LogTemp, Warning, TEXT("Speed: %i"), (int)ShouldMove)
}
It’s the c++
realization of third person template’s default BlueprintUpdateAnimation
event.
I made scene with 40 NPC’s without any logic or AI inside of them. Just simple NPC’s.
Each NPC on the scene has just Empty mannequin and c++ based anim bp.
No extra components, no tick logic, nothing.
AnimBP
is very simple, it’s the one you get by “default” on ThirdPersonTemplate
.Now let’s have a look at my framerate on the scene.
It’s 20 frames per secong and Game Thread has 12ms of World Tick Time
.
Only 20! Why do i got so BAD results with nearly empty scene?
“you can optimize tick rate blah blah”… No. With only 40 npc’s i even don’t have to.
Let’s look at this:
For free we have GitHub - dyanikoglu/ALS-Community: Replicated and optimized community version of Advanced Locomotion System V4 for Unreal Engine 5.1 with additional features & bug fixes
It’s c++ plugin of Advanced Locomotion. It’s totally free and can be used. I downloaded it.
ALS Community plugins scene has 42
NPC Characters with simple AI logic on Each! of them.
Logic of each character is very complex, including curves and other things…
Animations are complex, AnimBP
very complex, just look at it.
AnimBp
itself is parented to the c++ base, which has very complex NativeUpdateAnimation
logics.Yet, on ALC test scene, with 42 characters + AI i have 32 frames per second!
Conclusion
Why, on my very simple project i get 20 frames for 40 npcs, and on very complex ALS
project i have 32 frames per second. It is Impossible!
Simple project should had bigger framerate results. I can’t belive results that i got. It is impossible. How on earth is this works. What is the secret of ALS that i don’t know?
“Update Rate Optimistaions” on each character? No, they are disabled. So Why? Why? I can’t get it.