The Architectural Philosophy: Ditching Heavyweight Frameworks
At Outlore Interactives, our philosophy for hardcore action combat—whether architecting systems for Project Ronin or building bespoke C++ engines—centers on extreme mechanical responsiveness and mechanical clarity. Many modern UE5 tutorials default to massive, heavyweight architectures like 300,000-line Gameplay Ability System (GAS) stacks or messy Blueprint graphs for simple combat arbitration. For an uncompromising, high-precision combat feel, we favor lean, explicit C++ components and strict state machines: zero unnecessary tick overhead, deterministic hit-arbitration protocols, and animation-driven notify states that give frame-accurate hyper armor windows without architectural bloat. Read technical details on outlore game studio project ronin.
When building a Souls-like poise and hyper armor system, you must decouple data from execution. Stacking variables directly onto your character class guarantees spaghetti code and maintenance nightmares. Instead, encapsulate all poise tracking, threshold checks, and armor multipliers inside a dedicated UActorComponent instantiated natively in your character's C++ constructor. Read technical details on project ronin action combat souls-like. Reference: UE5 Swept Melee Collision: SweepMultiByChannel C++.
Decoupling Poise Logic into a Dedicated UActorComponent
Isolating combat metrics into a modular component ensures that your AI controllers and player characters share an identical arbitration interface. We utilize cache-friendly hit context structures passed by const reference to avoid dynamic memory allocation during high-frequency combat hitsparks and trace events. Read technical details on parry mechanics hit-stop input buffering combat design.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "PoiseComponent.generated.h"
USTRUCT(BlueprintType)
struct FPoiseHitContext
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float PoiseDamage = 0.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
AActor* DamageCauser = nullptr;
};
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class OUTLORE_API UPoiseComponent : public UActorComponent
{
GENERATED_BODY()
public:
UPoiseComponent();
UFUNCTION(BlueprintCallable, Category = "Combat|Poise")
void ReceivePoiseDamage(const FPoiseHitContext& HitContext);
UFUNCTION(BlueprintCallable, Category = "Combat|Poise")
void SetHyperArmorActive(bool bActive, float DamageMultiplier = 1.0f);
protected:
virtual void BeginPlay() override;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Poise")
float MaxPoise = 100.0f;
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Poise")
float CurrentPoise = 100.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Poise")
float PoiseRegenDelay = 3.0f;
bool bIsHyperArmorActive = false;
float HyperArmorAttenuation = 1.0f;
FTimerHandle RegenTimerHandle;
void ResetPoise();
};Implementing Frame-Accurate Hyper Armor via UAnimNotifyState
Hyper armor should never be a blanket character state managed by arbitrary boolean flags toggled in animations. We use native C++ UAnimNotifyState subclasses. These classes cleanly inject armor state modifications directly into the animation montage timeline, guaranteeing frame-accurate activation and termination windows. Read technical details on Structuring Character State Machines in C++ for Action Combat.
#pragma once
#include "CoreMinimal.h"
#include "Animation/AnimNotifies/AnimNotifyState.h"
#include "PoiseComponent.h"
#include "AnimNotifyState_HyperArmor.generated.h"
UCLASS()
class OUTLORE_API UAnimNotifyState_HyperArmor : public UAnimNotifyState
{
GENERATED_BODY()
public:
virtual void NotifyBegin(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, float TotalDuration, const FAnimNotifyEventReference& EventReference) override;
virtual void NotifyEnd(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference) override;
protected:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hyper Armor")
float ArmorDamageAttenuation = 0.5f;
};#include "AnimNotifyState_HyperArmor.h"
void UAnimNotifyState_HyperArmor::NotifyBegin(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, float TotalDuration, const FAnimNotifyEventReference& EventReference)
{
Super::NotifyBegin(MeshComp, Animation, TotalDuration, EventReference);
if (!MeshComp || !MeshComp->GetOwner()) return;
if (UPoiseComponent* PoiseComp = MeshComp->GetOwner()->FindComponentByClass<UPoiseComponent>())
{
PoiseComp->SetHyperArmorActive(true, ArmorDamageAttenuation);
}
}
void UAnimNotifyState_HyperArmor::NotifyEnd(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference)
{
Super::NotifyEnd(MeshComp, Animation, EventReference);
if (!MeshComp || !MeshComp->GetOwner()) return;
if (UPoiseComponent* PoiseComp = MeshComp->GetOwner()->FindComponentByClass<UPoiseComponent>())
{
PoiseComp->SetHyperArmorActive(false, 1.0f);
}
}Replacing Ticks with Event-Driven Poise Regeneration
A common performance pitfall in action game architectures is leaving `PrimaryComponentTick.bCanEverTick = true` on passive status components. Across 50 active AI combatants, continuous per-frame tick evaluation destroys your CPU cache budget. Instead, drive poise regeneration entirely through engine timer handles (`FTimerHandle`), resetting and clearing timers on demand when incoming hits occur.
void UPoiseComponent::ReceivePoiseDamage(const FPoiseHitContext& HitContext)
{
// Clear active regeneration timer upon taking damage
if (GetWorld()->GetTimerManager().IsTimerActive(RegenTimerHandle))
{
GetWorld()->GetTimerManager().ClearTimer(RegenTimerHandle);
}
float EffectiveDamage = HitContext.PoiseDamage;
if (bIsHyperArmorActive)
{
EffectiveDamage *= HyperArmorAttenuation;
}
CurrentPoise = FMath::Clamp(CurrentPoise - EffectiveDamage, 0.0f, MaxPoise);
if (CurrentPoise <= 0.0f)
{
// Trigger Stagger / Break State
CurrentPoise = MaxPoise; // Or apply deep stagger logic
}
// Schedule poise recovery
GetWorld()->GetTimerManager().SetTimer(RegenTimerHandle, this, &UPoiseComponent::ResetPoise, PoiseRegenDelay, false);
}
void UPoiseComponent::ResetPoise()
{
CurrentPoise = MaxPoise;
}Designing an Explicit Hit Resolution Pipeline
To keep combat predictable and fair, all damage and poise calculations must pass through a single, deterministic arbitration pipeline. By handling validation, state checking, and reaction dispatching in strict sequential order, you eliminate unpredictable race conditions between overlapping hitboxes and state changes.
When structuring your character classes, instantiate your combat components directly inside the constructor using `CreateDefaultSubobject`. This ensures proper memory layout and avoids initialization order bugs during level streaming.