From 0b1256aa7df7707f6f207b01ae37226f907dfdcd Mon Sep 17 00:00:00 2001 From: Charles Alexander Date: Tue, 18 May 2021 23:56:13 -0400 Subject: [PATCH 1/3] Revert footstep trace to kismet version There were compile issues in the change to reduce allocations in footstep traces. Revert back to the kismet version, but use MeshOwner as the world context object so that bIgnoreSelf can ignore it. That way MeshOwner->Children can be used directly as the rest of the ignore list, avoiding the allocations. --- .../Notify/ALSAnimNotifyFootstep.cpp | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/Source/ALSV4_CPP/Private/Character/Animation/Notify/ALSAnimNotifyFootstep.cpp b/Source/ALSV4_CPP/Private/Character/Animation/Notify/ALSAnimNotifyFootstep.cpp index 83559633..37843cf9 100644 --- a/Source/ALSV4_CPP/Private/Character/Animation/Notify/ALSAnimNotifyFootstep.cpp +++ b/Source/ALSV4_CPP/Private/Character/Animation/Notify/ALSAnimNotifyFootstep.cpp @@ -10,6 +10,7 @@ #include "Components/AudioComponent.h" #include "Engine/DataTable.h" +#include "Kismet/KismetSystemLibrary.h" #include "Library/ALSCharacterStructLibrary.h" #include "PhysicalMaterials/PhysicalMaterial.h" #include "NiagaraSystem.h" @@ -46,25 +47,8 @@ void UALSAnimNotifyFootstep::Notify(USkeletalMeshComponent* MeshComp, UAnimSeque FHitResult Hit; - ECollisionChannel CollisionChannel = UEngineTypes::ConvertToCollisionChannel(TraceChannel); - - FCollisionQueryParams Params(SCENE_QUERY_STAT(ALSFootstep), true /*bTraceComplex*/, MeshOwner); - Params.bReturnPhysicalMaterial = true; - for (auto& Child : MeshOwner->Children) - { - Params.AddIgnoredActor(Child); - } - - bool const bHit = MeshComp->GetWorld() ? World->LineTraceSingleByChannel(Hit, FootLocation, TraceEnd, CollisionChannel, Params) : false; - -#if ENABLE_DRAW_DEBUG - if (MeshComp->GetWorld()) - { - DrawDebugLineTraceSingle(MeshComp->GetWorld(), FootLocation, TraceEnd, DrawDebugType, bHit, Hit, TraceColor, TraceHitColor, DrawTime); - } -#endif - - if (bHit) + if (UKismetSystemLibrary::LineTraceSingle(MeshOwner /*used by bIgnoreSelf*/, FootLocation, TraceEnd, TraceChannel, true /*bTraceComplex*/, MeshOwner->Children, + DrawDebugType, Hit, true /*bIgnoreSelf*/)) { if (!Hit.PhysMaterial.Get()) { From 89f3363b41c1f78aebb0848eb6971db6ae5fbf97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fa=20Can=20Yan=C4=B1ko=C4=9Flu?= Date: Wed, 19 May 2021 20:32:12 +0300 Subject: [PATCH 2/3] Fix #218. Prevent spamming SetMovementSettings on movement component by turning the call into event based. --- Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp | 9 ++++++--- .../Private/Character/ALSCharacterMovementComponent.cpp | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp b/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp index 5973235b..e3adb1b3 100644 --- a/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp +++ b/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp @@ -154,6 +154,8 @@ void AALSBaseCharacter::BeginPlay() MainAnimInstance->SetRootMotionMode(ERootMotionMode::IgnoreRootMotion); } + MyCharacterMovementComponent->SetMovementSettings(GetTargetMovementSettings()); + DebugComponent = FindComponentByClass(); } @@ -877,6 +879,8 @@ void AALSBaseCharacter::OnStanceChanged(const EALSStance PreviousStance) { CameraBehavior->Stance = Stance; } + + MyCharacterMovementComponent->SetMovementSettings(GetTargetMovementSettings()); } void AALSBaseCharacter::OnRotationModeChanged(EALSRotationMode PreviousRotationMode) @@ -893,6 +897,8 @@ void AALSBaseCharacter::OnRotationModeChanged(EALSRotationMode PreviousRotationM { CameraBehavior->SetRotationMode(RotationMode); } + + MyCharacterMovementComponent->SetMovementSettings(GetTargetMovementSettings()); } void AALSBaseCharacter::OnGaitChanged(const EALSGait PreviousGait) @@ -1074,9 +1080,6 @@ void AALSBaseCharacter::UpdateCharacterMovement() SetGait(ActualGait); } - // Get the Current Movement Settings and pass it through to the movement component. - MyCharacterMovementComponent->SetMovementSettings(GetTargetMovementSettings()); - // Update the Character Max Walk Speed to the configured speeds based on the currently Allowed Gait. MyCharacterMovementComponent->SetAllowedGait(AllowedGait); } diff --git a/Source/ALSV4_CPP/Private/Character/ALSCharacterMovementComponent.cpp b/Source/ALSV4_CPP/Private/Character/ALSCharacterMovementComponent.cpp index 4822a499..66fbec87 100644 --- a/Source/ALSV4_CPP/Private/Character/ALSCharacterMovementComponent.cpp +++ b/Source/ALSV4_CPP/Private/Character/ALSCharacterMovementComponent.cpp @@ -183,6 +183,7 @@ void UALSCharacterMovementComponent::SetMovementSettings(FALSMovementSettings Ne { // Set the current movement settings from the owner CurrentMovementSettings = NewMovementSettings; + bRequestMovementSettingsChange = true; } void UALSCharacterMovementComponent::SetAllowedGait(EALSGait NewAllowedGait) From b467da34e432497276e47180b330a8865914eb37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fa=20Can=20Yan=C4=B1ko=C4=9Flu?= Date: Wed, 19 May 2021 20:34:49 +0300 Subject: [PATCH 3/3] Update version to 4.20.1 --- ALSV4_CPP.uplugin | 2 +- .../Blueprints/UI/ALS_HUD.uasset | Bin 713683 -> 713687 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/ALSV4_CPP.uplugin b/ALSV4_CPP.uplugin index a7485aee..1ccb4fba 100644 --- a/ALSV4_CPP.uplugin +++ b/ALSV4_CPP.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "4.20", + "VersionName": "4.20.1", "FriendlyName": "Advanced Locomotion System Community", "Description": "Performance optimized community version of LongmireLocomotion's Advanced Locomotion System V4", "Category": "Animation", diff --git a/Content/AdvancedLocomotionV4/Blueprints/UI/ALS_HUD.uasset b/Content/AdvancedLocomotionV4/Blueprints/UI/ALS_HUD.uasset index e6646d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