C++ API
Public C++ headers, types and signatures of SDF 2.0 - the SoulsDestructionRuntime module with its shared Behavior and Material assets, persistence and network relay, attachments, breakers and diagnosis - plus the editor-only authoring, regeneration and batch service facades.
Taken from the shipped public headers of SDF 2.0.1. Every symbol below exists in the plugin source; nothing is paraphrased into a name that does not compile. Blueprint-exposed members are listed in Blueprint API; this page adds the C++ view and the members that are C++ only.
Modules and headers
| Module | Type | Public headers |
|---|---|---|
SoulsDestructionRuntime | Runtime | SDFDestructionTypes.h, SDFDestructibleComponent.h, SDFDestructibleActor.h, SDFPhysicsDestructibleActor.h, SDFAnimatedDestructibleActor.h, SDFGlassCompositeActor.h, SDFGlassTypes.h, SDFDestructionProfile.h, SDFDestructionBehavior.h, SDFDestructionMaterial.h, SDFProfileResolver.h, SDFAttackDamageTable.h, SDFSurfaceResponseTable.h, SDFDestructionSubsystem.h, SDFDestructionPersistenceSubsystem.h, SDFNetworkRelay.h, SDFBreakableAttachmentComponent.h, SDFBreakerInterface.h, SDFDestructibleInterface.h, SDFDestructibleRouting.h, SDFBlueprintLibrary.h, SDFDataValidation.h, SDFDeveloperSettings.h, SDFGameplayTags.h, SDFDebrisSettings.h, SDFDebrisVFX.h, SDFDebrisPhysicsRequirements.h, SDFMeleeTypes.h, SDFMeleeHitSenderComponent.h, SDFCollisionTypes.h, SDFCollisionHitSenderComponent.h, SDFProjectileTypes.h, SDFProjectileHitSenderComponent.h, SDFProjectileImpactComponent.h, SDFProjectileMovementComponent.h, SDFWeaponTraceComponent.h, SDFBodyHitComponent.h, SDFAnimNotifyWindows.h, SDFFireArrowComponent.h, SDFRadialTypes.h, SDFPropagationTypes.h, SDFAudioTypes.h, SDFVFXTypes.h, SDFDamagePresentationTypes.h, SDFLootTypes.h, SDFLog.h |
SoulsDestructionEditor | Editor | SDFAuthoringTypes.h, SDFDestructionAuthoringPreset.h, SDFDestructionAuthoringService.h, SDFDestructionAuthoringSession.h, SDFDestructionAuthoringSettings.h, SDFDestructionAuthoringManifest.h, SDFDestructionModifySettings.h, SDFDestructionRegenerationService.h, SDFDestructionBatchService.h, SDFDestructionBatchSession.h, SDFStaticMeshAnalyzer.h, SDFDemoContentUtility.h, SoulsDestructionEditorModule.h |
SoulsDestructionDemo | Runtime (demo) | The playable demo’s character, game mode, stands and projectiles. Not needed by your game |
The export macros are SOULSDESTRUCTIONRUNTIME_API, SOULSDESTRUCTIONEDITOR_API and
SOULSDESTRUCTIONDEMO_API. Diagnostics log to the LogSDF category (SDFLog.h).
Never link the editor module from runtime code
SoulsDestructionRuntime has no dependency on SoulsDestructionEditor, the demo module or
UnrealEd. Adding the editor module to a runtime target will break packaging.
FSDFDestructionHit
USTRUCT(BlueprintType)
struct SOULSDESTRUCTIONRUNTIME_API FSDFDestructionHit
{
float Damage = 0.0f;
ESDFDestructionPower DestructionPower = ESDFDestructionPower::None;
FVector ImpactLocation = FVector::ZeroVector;
FVector ImpactNormal = FVector::ZeroVector;
FVector ImpactDirection = FVector::ZeroVector; // the way the source travelled toward the target
float ImpulseStrength = 0.0f;
float ImpactSpeed = 0.0f; // cm/s; 0 = unknown, the speed gate is skipped
TObjectPtr<AController> Instigator = nullptr;
TObjectPtr<AActor> DamageCauser = nullptr;
TSubclassOf<UDamageType> DamageType;
FGameplayTagContainer GameplayTags;
TObjectPtr<UPhysicalMaterial> PhysicalMaterial = nullptr;
TWeakObjectPtr<UPrimitiveComponent> HitComponent; // routes a hit to one region of a composite prop
TObjectPtr<UObject> Weapon = nullptr;
int32 RandomSeed = INDEX_NONE;
uint8 PropagationDepth = 0;
};
FSDFDestructionResult
USTRUCT(BlueprintType)
struct SOULSDESTRUCTIONRUNTIME_API FSDFDestructionResult
{
ESDFDestructionOutcome Outcome = ESDFDestructionOutcome::Ignored;
ESDFRejectionReason RejectionReason = ESDFRejectionReason::None; // why it did not break
ESDFDestructionState PreviousState = ESDFDestructionState::Intact;
ESDFDestructionState NewState = ESDFDestructionState::Intact;
ESDFDestructionMode ModeUsed = ESDFDestructionMode::None;
float AppliedDamage = 0.0f;
float RemainingHealth = 0.0f;
int32 RandomSeed = INDEX_NONE;
int32 SpawnedDebrisCount = 0;
bool bDestructionTriggered = false;
bool bUsedFallback = false;
bool bPresentationSuppressedByBudget = false;
bool bRejectedByImpactSpeed = false;
bool bRejectedByProjectilePolicy = false;
bool bIntactRepresentationRetained = false;
bool bRestored = false;
bool bPartialBreak = false; // Partial Break: pieces fell, the prop still stands
};
FSDFForceDestroyParams
USTRUCT(BlueprintType)
struct SOULSDESTRUCTIONRUNTIME_API FSDFForceDestroyParams
{
bool bUseImpactLocation = false; // unticked: the break starts at the centre of the prop
FVector ImpactLocation = FVector::ZeroVector;
FVector ImpactDirection = FVector::ZeroVector; // zero: away from the impact point only
float ImpulseStrength = 0.0f;
TObjectPtr<AActor> DamageCauser = nullptr;
int32 RandomSeed = INDEX_NONE;
};
USDFDestructibleComponent
UCLASS(BlueprintType, ClassGroup = (SoulsDestruction), meta = (BlueprintSpawnableComponent))
class SOULSDESTRUCTIONRUNTIME_API USDFDestructibleComponent : public UActorComponent
{
public:
// Damage and state
FSDFDestructionResult ApplyDestructionDamage(const FSDFDestructionHit& Hit);
FSDFDestructionResult ForceDestroy(const FSDFForceDestroyParams& Params);
bool SetDestructionEnabled(bool bEnabled);
bool IsDestructionEnabled() const;
bool ResetDestruction();
void ApplyPersistedBrokenState();
ESDFDestructionState GetDestructionState() const;
float GetCurrentHealth() const; // the hits left when its Health Mode is Number of Hits
FVector GetIntactCentre();
// Effective values and diagnosis
USDFDestructionProfile* GetDestructionProfile() const;
USDFDestructionProfile* GetEffectiveProfile() const;
void RefreshEffectiveProfile();
FSDFDiagnosis Diagnose() const;
FText DescribeDiagnosis() const; // C++ only: the panel's plain text
FText DescribeDiagnosisDetails() const; // C++ only: the panel's Advanced part
static constexpr int32 DiagnosedDecisionCount = 8;
// Fire
bool Ignite(AController* Instigator = nullptr);
bool Extinguish();
ESDFFireState GetFireState() const;
float GetBurnProgress() const;
bool IsFlammable() const;
// Partial and animated breaks
bool IsPartlyBroken() const;
TArray<int32> GetFallenPieces() const; // C++ only
float GetFallenShare() const;
int32 GetAnimatedBreakVariant() const;
// Persistence
FName GetPersistentDestructionId() const;
FName GetDestructionZoneId() const;
bool IsStartBroken() const;
#if WITH_EDITOR
void BakeBrokenLayout(); // CallInEditor button
#endif
// Explosions and cover
int32 GetBreakExplosionCount() const;
bool CoversSegment(const FVector& From, const FVector& To, float& OutDistance); // C++ only
// Physics, projectiles, configuration, presentation and loot: as in SDF 1.0, see below
};
The component also keeps every 1.0 member: GetEffectiveDebrisSettings, GetCurrentDamageStageIndex,
GetActiveImpactDecalCount, GetLastHitReactionRequest, GetLastDamageStageChange,
GetLastImpactDecalRequest, GetLastLootRequest, GetLootRequestCount,
GetEffectiveProjectilePolicy, ResolveProjectileReaction, GetEmbeddedProjectileCount,
GetEffectivePhysicsMode, SetPhysicsModeOverride, GetIntactPhysicsStatus,
GetLastSupportWakeCount, GetLastFallHeightCm, GetLastFallDamage, SetDestructionProfile,
SetIntactComponent, GetIntactPrimitive, SetIntactCollisionComponent,
GetIntactCollisionPrimitive, SetIntactHitAssistCollisionMode, SetLootSpawnComponent,
AddActorToReveal, ClearActorsToReveal, RequestAudioEvent, RequestVFXEvent and the static
SelectWeightedSoundVariation, SelectWeightedVFXVariation, SelectWeightedDecalVariation,
SelectWeightedLootEntry. Their signatures are on the
Blueprint API page.
GetFireEffect() and GetBurnLoop() return the burning prop’s Niagara and audio components, or
null. Members the header marks as called by the subsystem or the network relay — for example
ApplyNetworkState, RestoreFromNetwork, SetHiddenForView, SetFullFireEffect,
BeginSurfaceContact — are internal plumbing, not a game API.
Delegate types
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FSDFDamageReceivedSignature, const FSDFDestructionHit&, Hit, const FSDFDestructionResult&, Result);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FSDFStateChangedSignature, ESDFDestructionState, PreviousState, ESDFDestructionState, NewState);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FSDFDestructionEventSignature, const FSDFDestructionHit&, Hit, const FSDFDestructionResult&, Result);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSDFDebrisSpawnedSignature, AActor*, DebrisActor);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSDFAudioRequestedSignature, const FSDFDestructionAudioRequest&, Request);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSDFVFXRequestedSignature, const FSDFDestructionVFXRequest&, Request);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSDFHitReactionRequestedSignature, const FSDFHitReactionRequest&, Request);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSDFDamageStageChangedSignature, const FSDFDamageStageChange&, Change);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSDFDecalRequestedSignature, const FSDFDecalRequest&, Request);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSDFLootRequestedSignature, const FSDFLootRequest&, Request);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSDFPawnTouchedSignature, APawn*, Pawn);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FSDFBreakExplosionSignature, FVector, Origin, const FSDFRadialDestructionResult&, PropsResult);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FSDFDestructionResetSignature);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FSDFFireChangedSignature, ESDFFireState, PreviousState, ESDFFireState, NewState);
Members: OnDestructionDamageReceived, OnDestructionStateChanged, OnDestructionStarted,
OnDestroyed, OnDebrisSpawned, OnDestructionAudioRequested, OnDestructionVFXRequested,
OnHitReactionRequested, OnDamageStageChanged, OnImpactDecalRequested, OnLootRequested,
OnPawnTouched, OnBreakExplosion, OnDestructionReset, OnFireChanged.
The component can tick, but starts with its tick disabled. It enables it only while its profile has
bEnableFallDamage set, to follow a falling intact body.
Profile, Behavior and Material
USDFDestructionProfile is a prop’s setup. In 2.0 it references the shared assets and carries the
setup’s exceptions:
UCLASS(BlueprintType)
class SOULSDESTRUCTIONRUNTIME_API USDFDestructionProfile : public UPrimaryDataAsset
{
public:
TObjectPtr<USDFDestructionBehavior> Behavior; // EditDefaultsOnly, BlueprintReadOnly
TObjectPtr<USDFDestructionMaterial> Material;
FSDFLocalOverrides Overrides;
// Health (2.0.1): Health Points, or Number of Hits with HitsToBreak
ESDFHealthMode HealthMode = ESDFHealthMode::Points;
int32 HitsToBreak = 3;
float GetStartingHealth() const; // C++ only: MaxHealth, or HitsToBreak when it counts hits
UFUNCTION(BlueprintPure) float ComputeFallDamage(float DropHeightCm) const;
UFUNCTION(BlueprintPure) float ComputeLaunchScale(float HitImpulseStrength) const;
// ... every value a destructible uses, listed in Destruction profiles
};
UENUM(BlueprintType)
enum class ESDFHealthMode : uint8
{
Points, // Health Points: each hit's damage lowers its health
Hits // Number of Hits: it breaks on its HitsToBreak-th valid hit, whatever the weapon's damage
};
UCLASS(BlueprintType)
class SOULSDESTRUCTIONRUNTIME_API USDFDestructionBehavior : public UPrimaryDataAsset
{
public:
TArray<TObjectPtr<USDFBehaviorModule>> Modules; // Instanced: only the modules added here are active
const USDFBehaviorModule* FindModule(const UClass* ModuleClass) const;
// health (HealthMode and HitsToBreak included), resistance, breakers, persistence, camera and
// characters, navigation, cover, launch, physics and debris settings
};
UCLASS(BlueprintType)
class SOULSDESTRUCTIONRUNTIME_API USDFDestructionMaterial : public UPrimaryDataAsset
{
// projectile policy, impact presentation cooldown, sounds, effects, surface responses, decals
};
USDFBehaviorModule is Abstract, EditInlineNew, DefaultToInstanced; its subclasses are
USDFContactModule, USDFFallModule, USDFPropagationModule, USDFHitReactionModule,
USDFBreakNoiseModule, USDFExplosionModule and USDFFireModule. A Behavior without a module of a
kind has that function off, as in SDF 1.0.
FSDFProfileResolver composes the profile a destructible plays: the setup, then its Behavior and
Material, then the setup’s exceptions, then the placed instance’s. With nothing shared or overridden
it returns the setup itself — an SDF 1.0 profile, used exactly as before.
struct SOULSDESTRUCTIONRUNTIME_API FSDFProfileResolver
{
static USDFDestructionProfile* Resolve(USDFDestructionProfile* Setup, const FSDFLocalOverrides& InstanceOverrides, UObject* Outer);
static TArray<FName> CopyTwins(const UObject& Source, USDFDestructionProfile& Target);
static void CopyTwinsFromProfile(const USDFDestructionProfile& Source, UObject& Target);
static const TSet<FName>& SetupFields();
static const TSet<FName>& BehaviorFields();
static const TSet<FName>& MaterialFields();
static const TArray<const UClass*>& ModuleClasses();
};
After changing a Behavior, Material or exception at runtime, call RefreshEffectiveProfile() on the
components that use it.
Attack Damage and Surface Response tables
USTRUCT(BlueprintType)
struct SOULSDESTRUCTIONRUNTIME_API FSDFAttackDamage
{
FGameplayTag AttackTag;
float Damage = 25.0f;
ESDFDestructionPower DestructionPower = ESDFDestructionPower::Light;
bool bOverrideImpulse = false;
float ImpulseStrength = 500.0f;
};
UCLASS(BlueprintType)
class SOULSDESTRUCTIONRUNTIME_API USDFAttackDamageTable : public UPrimaryDataAsset
{
public:
TArray<FSDFAttackDamage> Attacks;
const FSDFAttackDamage* Find(const FGameplayTagContainer& HitTags) const; // most specific tag, or null
};
USTRUCT(BlueprintType)
struct SOULSDESTRUCTIONRUNTIME_API FSDFSurfaceResponse
{
TEnumAsByte<EPhysicalSurface> Surface = SurfaceType_Default;
TArray<FSDFWeightedSound> Sounds;
TArray<FSDFWeightedNiagaraSystem> Effects;
};
UCLASS(BlueprintType)
class SOULSDESTRUCTIONRUNTIME_API USDFSurfaceResponseTable : public UPrimaryDataAsset
{
public:
TArray<FSDFSurfaceResponse> Responses;
const FSDFSurfaceResponse* Find(EPhysicalSurface Surface) const;
static EPhysicalSurface ResolveSurface(const UPrimitiveComponent* Other, const FVector& Location, const FVector& Normal);
};
USDFDestructionSubsystem
UCLASS()
class SOULSDESTRUCTIONRUNTIME_API USDFDestructionSubsystem : public UWorldSubsystem
{
public:
// Clearing, finding, cover and breakers (2.0)
int32 BreakIntactInSphere(FVector Centre, float Radius);
TArray<USDFDestructibleComponent*> FindDestructiblesInRadius(FVector Origin, float Radius, bool bIncludeBroken = false) const;
USDFDestructibleComponent* FindDamageCover(FVector From, FVector To, AActor* IgnoredActor = nullptr) const;
void SetBreakerFilter(FSDFBreakerFilter Filter);
void ClearBreakerFilter();
bool BreakerFilterAllows(AActor* Breaker, USDFDestructibleComponent* Destructible, const FSDFDestructionHit& Hit) const;
// Calls for a game with its own cameras (run automatically otherwise)
void UpdateViewBlockers(const FVector& View, const FVector& Target);
void UpdateDebrisDistances(TConstArrayView<FVector> Views);
void UpdateBurningEffects(TConstArrayView<FVector> Views);
int32 GetBurningCount() const;
// Networked games
ASDFNetworkRelay* GetNetworkRelay(bool bCreate);
USDFDestructibleComponent* FindDestructibleByPersistentId(FName PersistentId) const;
// Budgets and diagnostics
void ConfigureBudgetLimits(const FSDFDestructionBudgetLimits& NewLimits);
FSDFDestructionBudgetLimits GetBudgetLimits() const;
FSDFDestructionBudgetStats GetBudgetStats() const;
void ResetBudgetStatistics();
int32 GetActiveDebrisCount() const;
int32 GetSettledDebrisCount() const;
// Radial and propagation
FSDFRadialDestructionResult ApplyRadialDestruction(const FSDFRadialDestructionRequest& Request);
static float CalculateRadialFalloffMultiplier(float Distance, float Radius, ESDFRadialFalloff Falloff, float MinimumFalloffMultiplier = 0.0f);
static int32 CalculateRadialTargetSeed(int32 AggregateSeed, int32 StableTargetIndex);
static int32 CalculatePropagationSeed(int32 ParentSeed, uint8 SourceDepth, const AActor* SourceActor);
FSDFPropagationChainResult GetLastPropagationChainResult() const;
// Audio and VFX diagnostics
FSDFDestructionAudioStats GetAudioStats() const;
FSDFDestructionAudioRequest GetLastAudioRequest() const;
void ResetAudioStatistics();
FSDFDestructionVFXStats GetVFXStats() const;
FSDFDestructionVFXRequest GetLastVFXRequest() const;
void ResetVFXStatistics();
// Cleanup
void ReleaseTrackedActorsOwnedBy(const AActor* OwnerActor);
void ReleaseTrackedActorsForComponent(const USDFDestructibleComponent* SourceComponent);
};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FSDFDestructibleBrokenSignature, USDFDestructibleComponent*, Destructible,
const FSDFDestructionHit&, Hit, const FSDFDestructionResult&, Result);
DECLARE_DYNAMIC_DELEGATE_RetVal_ThreeParams(bool, FSDFBreakerFilter, AActor*, Breaker, USDFDestructibleComponent*, Destructible,
const FSDFDestructionHit&, Hit);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FSDFDestructibleTouchedSignature, USDFDestructibleComponent*, Destructible, APawn*, Pawn);
Delegates: OnDestructibleBroken, OnDestructibleTouched, OnPropagationChainCompleted,
OnDestructionAudioRequested, OnDestructionVFXRequested.
Internal admission API
Budget admission, Chaos reservation, debris registration and the collision-level bookkeeping
(TryAdmitDestructionEvent, TryReserveChaosRepresentation, ClaimDebrisCollisionLevel and
related) are reserved for the framework’s own backends. Gameplay code configures limits and reads
diagnostics.
USDFDestructionPersistenceSubsystem
UCLASS()
class SOULSDESTRUCTIONRUNTIME_API USDFDestructionPersistenceSubsystem : public UGameInstanceSubsystem
{
public:
bool IsBroken(FName PersistentId) const;
int32 GetBrokenCount() const;
int32 ResetZone(FName ZoneId);
int32 ResetAllZones();
int32 NotifyPlayerDeath(FName ZoneId = NAME_None);
int32 NotifyRestAtCheckpoint(FName ZoneId = NAME_None);
TArray<FSDFPersistedDestruction> GetPersistedDestructions() const;
void ApplyPersistedDestructions(const TArray<FSDFPersistedDestruction>& Records);
FSDFZoneRestoredSignature OnZoneRestored; // (FName ZoneId)
};
USTRUCT(BlueprintType)
struct SOULSDESTRUCTIONRUNTIME_API FSDFPersistedDestruction
{
FName PersistentId;
FName ZoneId;
bool bPermanent = false; // false in saves written before it existed
TArray<uint8> DebrisLayout; // Remember Debris Layout
TArray<int32> FallenPieces; // Partial Break
int32 BreakVariant = INDEX_NONE; // Animated Break
};
ASDFNetworkRelay
UCLASS(NotPlaceable, Transient)
class SOULSDESTRUCTIONRUNTIME_API ASDFNetworkRelay : public AActor
{
public:
const FSDFReplicatedProp* Find(const USDFDestructibleComponent& Prop) const;
int32 GetEntryCount() const;
float GetServerTime() const;
float GetKnownServerTime() const; // -1 on a client that cannot know it yet
static bool IsRecent(float ServerTime, float Now);
static constexpr float RecentWindow = 2.0f; // seconds: a break this recent is seen and heard
};
The server makes one per world the first time one of its props changes; SDF makes it, it is never
placed. FSDFReplicatedProp (a fast-array item) holds the prop’s persistent key, whether it is
broken, its Partial Break hits and fallen pieces, its Animated Break variant, its damage stage, its
fire and when it caught, the hit and seed of its last break and, with Remember Debris Layout, its
settled debris layout. Edit, Commit, Forget, Receive and Withdraw are the server’s and the
client’s plumbing, not a game API. See
Networked games.
USDFBreakableAttachmentComponent
UCLASS(ClassGroup = (SoulsDestruction), meta = (BlueprintSpawnableComponent, DisplayName = "SDF Breakable Attachment"))
class SOULSDESTRUCTIONRUNTIME_API USDFBreakableAttachmentComponent : public USceneComponent
{
public:
ESDFAttachmentAnchor Anchor = ESDFAttachmentAnchor::WorldPoint;
float ChainLength = 100.0f; // cm, World Point
TObjectPtr<AActor> AnchorActor = nullptr;
FName AnchorSocket = NAME_None;
float BreakForce = 0.0f; // N; 0 never gives way to a pull
float SwingDamping = 1.0f;
TObjectPtr<AActor> Chain = nullptr;
float ChainHitReach = 0.0f; // cm
void BreakAttachment();
bool IsAttached() const;
FVector GetAnchorLocation() const;
FSDFAttachmentBrokenSignature OnAttachmentBroken; // (ESDFAttachmentBreakCause Cause)
};
Actors
UCLASS(BlueprintType, Blueprintable)
class SOULSDESTRUCTIONRUNTIME_API ASDFDestructibleActor : public AActor, public ISDFDestructibleInterface
{
public:
USDFDestructibleComponent* GetDestructibleComponent() const;
UStaticMeshComponent* GetIntactMeshComponent() const;
UBoxComponent* GetIntactCollisionComponent() const;
USceneComponent* GetLootSpawnPoint() const;
UBoxComponent* GetHitAssistComponent() const;
bool PrepareIntactForSimulation(); // C++ only: re-roots on the intact mesh when Simulated
// 2.0.1, off by default: collide with the Static Mesh's own simple collision while intact
UPROPERTY(EditAnywhere, BlueprintReadOnly) bool bUseMeshCollisionWhenIntact = false;
};
UCLASS(BlueprintType, Blueprintable)
class SOULSDESTRUCTIONRUNTIME_API ASDFPhysicsDestructibleActor : public ASDFDestructibleActor
{
public:
ASDFPhysicsDestructibleActor();
virtual void OnConstruction(const FTransform& Transform) override;
};
UCLASS(BlueprintType, Blueprintable)
class SOULSDESTRUCTIONRUNTIME_API ASDFAnimatedDestructibleActor : public AActor, public ISDFDestructibleInterface
{
public:
USkeletalMeshComponent* GetAnimatedMeshComponent() const;
USDFDestructibleComponent* GetDestructibleComponent() const;
UBoxComponent* GetHitAssistComponent() const; // 2.0.1: the box weapons strike
// 2.0.1, on by default: weapon sweeps by object type find the prop within its mesh's bounds
UPROPERTY(EditAnywhere, BlueprintReadOnly) bool bWeaponHitAssist = true;
};
With bUseMeshCollisionWhenIntact, a mesh without simple collision keeps the bounds box, and every
channel ignores the hit assist box while weapon traces by object type still find it. See
Intact collision and
Animated break.
ASDFGlassCompositeActor keeps its 1.0 accessors (GetPanelCount, GetPanelComponent,
GetPanelDestructible, GetFrameComponent, and the C++ GetFrameMesh, GetPanelMeshes,
GetPanelProfile); see Runtime glass fracture.
Interfaces and routing
class SOULSDESTRUCTIONRUNTIME_API ISDFDestructibleInterface
{
public:
UFUNCTION(BlueprintNativeEvent, BlueprintCallable) bool CanReceiveDestructionHit(const FSDFDestructionHit& Hit) const;
UFUNCTION(BlueprintNativeEvent, BlueprintCallable) FSDFDestructionResult ReceiveDestructionHit(const FSDFDestructionHit& Hit);
UFUNCTION(BlueprintNativeEvent, BlueprintCallable) bool CanDestroyFromHit(const FSDFDestructionHit& Hit) const;
UFUNCTION(BlueprintNativeEvent, BlueprintCallable) ESDFDestructionState GetDestructionState() const;
};
class SOULSDESTRUCTIONRUNTIME_API ISDFBreakerInterface
{
public:
UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
bool CanBreakDestructible(USDFDestructibleComponent* Destructible, const FSDFDestructionHit& Hit) const;
};
class SOULSDESTRUCTIONRUNTIME_API FSDFDestructibleRouting
{
public:
static USDFDestructibleComponent* Resolve(AActor* Actor, UPrimitiveComponent* TouchedPrimitive);
};
ASDFDestructibleActor and ASDFAnimatedDestructibleActor implement the destructible interface
through the _Implementation functions. FSDFDestructibleRouting::Resolve picks which destructible
of an Actor a hit belongs to: on an Actor with several destructibles, a valid primitive that none
owns resolves to null, so a blow on a window’s glass never dismantles its stone surround.
Hit senders
// Melee
int32 BeginMeleeSwing(int32 RequestedSwingId = -1, float SwingSpeed = 0.0f);
void EndMeleeSwing();
FSDFMeleeDeliveryResult SendMeleeHit(
AActor* TargetActor,
const FHitResult& HitResult,
FVector AttackDirection,
AController* InstigatorController,
AActor* DamageCauser,
UObject* Weapon,
int32 RandomSeed = -1);
bool IsMeleeSwingActive() const;
int32 GetActiveSwingId() const;
// OnMeleeHitDelivered, OnMeleeRecoil; FSDFMeleeDeliveryResult::bShouldRecoil
// Collision
int32 BeginCollisionWindow(int32 RequestedWindowId = -1);
void EndCollisionWindow();
FSDFCollisionDeliveryResult SendCollisionHit(
AActor* TargetActor,
const FHitResult& HitResult,
FVector SourceVelocity,
float Damage,
ESDFDestructionPower DestructionPower,
AController* InstigatorController,
AActor* DamageCauser,
UObject* SourceObject,
int32 RandomSeed = -1);
bool IsCollisionWindowActive() const;
int32 GetActiveCollisionWindowId() const;
// Projectile
void ResetProjectileImpacts();
FSDFProjectileDeliveryResult SendProjectileHit(
AActor* TargetActor,
const FHitResult& HitResult,
FVector ProjectileVelocity,
AController* InstigatorController,
AActor* DamageCauser,
UObject* ProjectileObject,
int32 RandomSeed = -1);
void SetProjectileProfile(USDFProjectileHitProfile* NewProfile);
USDFProjectileHitProfile* GetProjectileProfile() const;
// Projectile impact adapter (USDFProjectileImpactComponent)
FSDFProjectileDeliveryResult NotifyProjectileImpact(
AActor* TargetActor,
const FHitResult& HitResult,
FVector IncomingVelocity,
AController* InstigatorController = nullptr,
AActor* DamageCauser = nullptr,
int32 RandomSeed = -1);
void ReleaseEmbed(ESDFProjectileReleaseReason Reason = ESDFProjectileReleaseReason::Manual);
bool IsEmbedded() const;
Delegates: OnMeleeHitDelivered, OnMeleeRecoil, OnCollisionHitDelivered,
OnProjectileHitDelivered, OnProjectileReactionResolved, OnProjectileEmbedded,
OnProjectileReleased. USDFProjectileMovementComponent replaces UProjectileMovementComponent
for automatic swept projectiles; in flight its body collides by query only, so it shoves nothing it
is let into. It overrides HandleBlockingHit so a projectile can continue through a contact: a
standard UProjectileMovementComponent stops on every blocking hit it does not bounce off. On
Continue, USDFProjectileHitSenderComponent has the projectile’s root body ignore the pieces that
break made, for the rest of its flight, when the sender sits on the projectile; ResetProjectileImpacts
gives them back.
Integration kit
New in 2.0.1. Each opens on the server and in single player only, never on a client.
// SDFWeaponTraceComponent.h — "SDF Weapon Trace"
UCLASS(ClassGroup = "Souls Destruction", meta = (BlueprintSpawnableComponent, DisplayName = "SDF Weapon Trace"))
class SOULSDESTRUCTIONRUNTIME_API USDFWeaponTraceComponent : public UActorComponent
{
public:
FComponentReference WeaponMesh;
FName BladeBaseSocket = TEXT("BladeBase");
FName BladeTipSocket = TEXT("BladeTip");
float TraceRadius = 6.0f; // cm, never under 0.5
float ReachBelowBlade = 0.0f; // cm, never below 10 cm above a wielding character's feet
bool bIgnoreBehindWielder = true;
bool bDrawDebug = false; // development builds
void BeginTrace(); // Begin SDF Weapon Trace
void BeginTraceWithHitSettings(const FSDFMeleeHitSettings& HitSettings);
void EndTrace(); // End SDF Weapon Trace
bool IsTracing() const;
USDFMeleeHitSenderComponent* GetMeleeHitSender() const;
FSDFMeleeHitSettings GetEffectiveHitSettings() const;
AActor* GetWielder() const;
bool GetBladeSegment(FVector& OutBase, FVector& OutTip) const; // C++ only
};
// SDFBodyHitComponent.h — "SDF Body Hit"
UCLASS(ClassGroup = "Souls Destruction", meta = (BlueprintSpawnableComponent, DisplayName = "SDF Body Hit"))
class SOULSDESTRUCTIONRUNTIME_API USDFBodyHitComponent : public UActorComponent
{
public:
FComponentReference Body; // empty: the actor's root
float Damage = 0.0f;
ESDFDestructionPower DestructionPower = ESDFDestructionPower::Light;
void BeginBodyWindow(); // Begin SDF Body Window
void BeginBodyWindowWithPower(float InDamage, ESDFDestructionPower InDestructionPower);
void EndBodyWindow(); // End SDF Body Window
bool IsBodyWindowOpen() const;
float GetContactDamage() const;
ESDFDestructionPower GetContactPower() const;
USDFCollisionHitSenderComponent* GetCollisionHitSender() const;
void Strike(AActor* Other, UPrimitiveComponent* OtherComponent, const FHitResult* SweepHit); // C++ only
};
// SDFAnimNotifyWindows.h
UCLASS(meta = (DisplayName = "SDF Melee Window"))
class SOULSDESTRUCTIONRUNTIME_API USDFAnimNotifyState_MeleeWindow : public UAnimNotifyState
{
bool bOverrideHitSettings = false;
FSDFMeleeHitSettings HitSettings;
};
UCLASS(meta = (DisplayName = "SDF Body Window"))
class SOULSDESTRUCTIONRUNTIME_API USDFAnimNotifyState_BodyWindow : public UAnimNotifyState
{
bool bOverridePower = false;
float Damage = 0.0f;
ESDFDestructionPower DestructionPower = ESDFDestructionPower::Light;
};
// SDFFireArrowComponent.h — "SDF Fire Arrow"
UCLASS(ClassGroup = "Souls Destruction", meta = (BlueprintSpawnableComponent, DisplayName = "SDF Fire Arrow"))
class SOULSDESTRUCTIONRUNTIME_API USDFFireArrowComponent : public USceneComponent
{
public:
TSoftObjectPtr<UNiagaraSystem> Effect; // NS_SDF_FlamingArrow by default
bool bPlaceBehindTip = false;
float WrapBehindTip = 12.0f; // cm
float BurnSeconds = 4.0f;
float DieDownSeconds = 3.0f;
float SmoulderSeconds = 5.0f;
float SmoulderStrength = 0.15f;
FLinearColor LightColor;
float LightRadius = 450.0f; // cm
bool IsBurning() const;
bool HasLanded() const;
float GetBurnStrength() const;
void PutOut();
UNiagaraComponent* GetFireComponent() const; // C++ only
UNiagaraComponent* GetImpactComponent() const; // C++ only
float StrengthAfter(double Seconds) const; // C++ only
};
The trace’s blows go through its actor’s USDFMeleeHitSenderComponent, and the body’s contacts
through the actor’s USDFCollisionHitSenderComponent; each is added when the actor has none. The
notify states call OpenWindow and CloseWindow on them: windows that overlap merge, and a window
whose end never comes closes by itself after twice its length and a second. See
Your own character.
Result descriptions
UCLASS()
class SOULSDESTRUCTIONRUNTIME_API USDFBlueprintLibrary : public UBlueprintFunctionLibrary
{
public:
static FText DescribeDestructionResult(const FSDFDestructionResult& Result); // Describe SDF Result
static FText DescribeRadialResult(const FSDFRadialDestructionResult& Result); // Describe SDF Radial Result
static FText DescribeRejectionReason(ESDFRejectionReason Reason); // Describe SDF Rejection Reason
};
The words do not come from editor-only metadata, so they work in packaged games.
Data validation
SDFDataValidation.h is editor-only (WITH_EDITOR). FSDFDataValidation holds the read-only checks
behind IsDataValid and SDF.Validate: CheckFields, CheckStruct, GetRole, CheckEffective,
CheckProfile and Report, with ESDFProfileRole (Setup, Template) and findings
(FSDFValidationFinding: bError, Code, Text). Nothing there changes data. See
Diagnostics.
Gameplay tags
From SDFGameplayTags.h, in the SDFGameplayTags namespace: TAG_SDF_Source_Projectile,
TAG_SDF_Source_Melee, TAG_SDF_Source_Collision, TAG_SDF_Source_Collision_Fall,
TAG_SDF_Source_Collision_Pawn, TAG_SDF_Source_Collision_Contact, TAG_SDF_Source_Collision_Ride,
TAG_SDF_Source_Collision_Land, TAG_SDF_Source_Chain, TAG_SDF_Source_Script,
TAG_SDF_Source_Radial, TAG_SDF_Source_Fire, and the projectile children
TAG_SDF_Source_Projectile_Arrow, _CrossbowBolt, _ThrownRock, _Magic. Their strings are
SDF.Source.Projectile, SDF.Source.Collision.Fall and so on; see the
Blueprint API.
USDFDeveloperSettings
UCLASS(Config = Game, DefaultConfig, meta = (DisplayName = "Souls Destruction Framework"))
class SOULSDESTRUCTIONRUNTIME_API USDFDeveloperSettings : public UDeveloperSettings
{
public:
UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category = "Performance Budget")
FSDFDestructionBudgetLimits BudgetLimits;
};
Category Plugins, section Souls Destruction Framework. FSDFDestructionBudgetLimits adds in 2.0
MaxDebrisPushesPerSecond (40), DebrisShadowsBeyond (3000 cm), HideDebrisBeyond (0),
MaxActiveDebrisPieces (200) and MaxBurningEffects (16); see
Performance.
Editor-only services
Available to editor modules and automation only.
class SOULSDESTRUCTIONEDITOR_API FSDFStaticMeshAnalyzer final
{
public:
static FSDFStaticMeshAnalysis Analyze(
const UStaticMesh* SourceMesh,
const USDFDestructionAuthoringPreset* Preset,
const USDFDestructionAuthoringSettings* Settings);
static FSDFResolvedAuthoringPlan BuildPlan(
const UStaticMesh* SourceMesh,
const FSDFStaticMeshAnalysis& Analysis,
const USDFDestructionAuthoringPreset* Preset,
const USDFDestructionAuthoringSettings* Settings,
ESDFAuthoringDestructionMode RequestedMode,
ESDFAuthoringFractureDensity Density,
int32 CustomFragmentCount,
ESDFOutputFolderPolicy OutputPolicy,
const FString& CustomOutputFolder,
bool bCreateActor);
static FString MakeBaseAssetName(const UStaticMesh* SourceMesh);
static FString MakeInternalsFolder(const FString& OutputFolder);
static FString ResolveOutputFolder(
const UStaticMesh* SourceMesh,
const USDFDestructionAuthoringSettings* Settings,
ESDFOutputFolderPolicy Policy,
const FString& CustomOutputFolder);
};
class SOULSDESTRUCTIONEDITOR_API FSDFDestructionAuthoringService
{
public:
static FVector ComputeBasePivotOffset(const UStaticMesh* SourceMesh);
static ESDFSimulationCollisionState AssessSimulationCollision(const UStaticMesh* Mesh);
static UStaticMesh* CreateSimulationMeshCopy(UStaticMesh* Source, const FString& PackageName,
const FString& AssetName, FString& OutError);
static bool RefreshSimulationMeshCopy(UStaticMesh* Source, UStaticMesh* Copy, FString& OutError);
static FSDFStaticMeshSourceSignature CaptureSourceSignature(const UStaticMesh* SourceMesh);
static FSDFValidationReport Generate(const FSDFDestructionAuthoringRequest& Request);
static bool LoadedPackageContainsAsset(const FString& PackageName);
static FSDFValidationReport ValidateGeneratedSetup(
const FSDFDestructionAuthoringRequest& Request,
UGeometryCollection* GeometryCollection,
UObject* DestructionProfile,
UObject* DestructibleActor,
const FSDFStaticMeshSourceSignature& BeforeSignature,
bool bSkipGeometryCollectionChecks = false);
};
class SOULSDESTRUCTIONEDITOR_API FSDFDestructionRegenerationService
{
public:
static constexpr int32 CurrentManifestSchemaVersion = 4;
static FSDFAssetFingerprint CaptureFingerprint(const FSoftObjectPath& ObjectPath);
static FSDFDestructionSetupValidationReport Validate(const USDFDestructionAuthoringManifest* Manifest);
static bool UpgradeLegacyManifestOwnership(
USDFDestructionAuthoringManifest* Manifest,
USDFDestructionAuthoringPreset* Preset,
bool bExplicitlyConfirmed,
TArray<FSDFValidationIssue>* OutIssues = nullptr);
static FSDFRegenerationReport Regenerate(const FSDFRegenerationRequest& Request);
static bool StampCurrentOwnership(USDFDestructionAuthoringManifest* Manifest, bool bSaveManifest);
};
class SOULSDESTRUCTIONEDITOR_API FSDFDestructionBatchService
{
public:
using FShouldCancel = TFunction<bool()>;
using FProgress = TFunction<void(int32 Completed, int32 Total, const UStaticMesh* Current, const FText& Stage)>;
static FSDFBatchReport Preflight(const FSDFBatchRequest& Request);
static bool IsPreflightCurrent(const FSDFBatchRequest& Request, const FSDFBatchReport& Report);
static FSDFBatchReport Execute(
const FSDFBatchRequest& Request,
const FSDFBatchReport& ApprovedPreflight,
FShouldCancel ShouldCancel = {},
FProgress Progress = {});
static bool ExportReportCsv(FSDFBatchReport& Report, const FString& OptionalAbsolutePath = FString());
};
FSDFRegenerationRequest adds ApplyChanges (TFunction<void(USDFDestructionAuthoringManifest&)>):
the authoring changes Modify Destructible applies to a transient copy of the manifest before the
rebuild. Switching between the Glass family and any other one is refused.
New in the 2.0 requests and manifest:
FSDFDestructionAuthoringRequestcarriesBehavior(USDFDestructionBehavior*) andMaterial(USDFDestructionMaterial*) — null keeps the SDF 1.0 per-prop profile — plusbPushWhenHit,AnchoredBaseHeightandbReleaseBaseOnHit.PieceCollisionShapedefaults toPreciseConvex.FSDFBatchRequestcarriesBehavior,Material,bPushWhenHitandCustomFragmentCount(28 by default, as in the Create window).- The manifest records
BehaviorandMaterial(soft paths),bPushWhenHit,AnchoredBaseHeightandbReleaseBaseOnHit; its schema stays at version 4. A manifest made before 2.0 readsPieceCollisionShapeasBoxes(Preset Recipe). - New in 2.0.1:
HitsToBreak(int32, 0 = health points) onFSDFDestructionAuthoringRequest,FSDFBatchRequest, the manifest andUSDFDestructionModifySettings. Above 0, the generated setup gets the health exceptions with Health Mode Number of Hits, and Max Health is not used. USDFDestructionAuthoringPreset::OffersPieceCollisionShape()is true for every preset that produces a Geometry Collection (every family except Glass).MaximumAllowedFragmentCountdefaults to 150; the project-wideUSDFDestructionAuthoringSettings::MaximumFragmentCountto 400.
The editor module also registers console commands — editor tools, not a runtime or Blueprint API:
| Command | Does |
|---|---|
SDF.ModifyDestructible <Asset> [Preset=] [Density=] [Fragments=] [Cuts=] [Collision=] [Fragile=] [MaxHealth=] [Hits=] [Push=] [ReplaceManual] [Exit] | Rebuilds an existing setup with new choices. Collision takes PreciseConvex, Convex or Boxes; Hits sets Hits To Break (0 keeps health points); Push takes 0 or 1. See Modify Destructible |
SDF.ConvertSetups [Preview] [Root=/Path] [Exit] | Converts SDF 1.0 setups outside /Game; see Upgrading from SDF 1.0 |
SDF.Validate [Root=/Game] | Validates every SDF asset under a folder; see Diagnostics |
SDF.MigrateToSimulatedPhysics [VerifyOnly] [Root=/Game/Path] [Exit] | Switches generated setups to Simulated; see Intact physics and fall damage |
SDF.SetIntactMass <Asset> <Kg> | Sets a profile’s Intact Mass |
Editor enumerations
| Enum | Values |
|---|---|
ESDFAuthoringPresetFamily | Wood, Ceramic, Stone, Generic, Custom, Glass (display Glass Pane), GlassVessel (display Glass Vessel), Metal, Rope |
ESDFAuthoringDestructionMode | Automatic, GeometryCollection, SwapAndScatter, CustomAuthoredDebris, Glass |
ESDFAuthoringFractureDensity | Low, Medium, High, Custom |
ESDFOutputFolderPolicy | SourceSiblingGenerated, ProjectDefault, Custom |
ESDFPieceCollisionShape | Boxes (display Preset Recipe), Convex, PreciseConvex (display Precise Convex) |
ESDFValidationSeverity | Pass, Warning, Error |
ESDFAuthoringDriftKind | None, LegacyManifest, SourceChanged, PresetChanged, InteriorMaterialChanged, GeometryCollectionChanged, RuntimeProfileChanged, DestructibleActorChanged, OutputMissing, ReferenceMismatch, UnsavedChanges |
ESDFBatchOperation | Generate, Validate, Regenerate |
ESDFBatchItemStatus | Ready, Warning, Blocked, Running, Success, Failed, Skipped, Cancelled |
Build integration
// MyGame.Build.cs
PublicDependencyModuleNames.AddRange(new string[]
{
"Core",
"CoreUObject",
"Engine",
"GameplayTags",
"SoulsDestructionRuntime"
});
Minimal integration example
#include "SDFDestructibleComponent.h"
#include "SDFDestructionTypes.h"
void AMyWeapon::OnBladeContact(const FHitResult& HitResult)
{
AActor* Target = HitResult.GetActor();
if (Target == nullptr)
{
return;
}
USDFDestructibleComponent* Destructible =
Target->FindComponentByClass<USDFDestructibleComponent>();
if (Destructible == nullptr)
{
return;
}
FSDFDestructionHit Hit;
Hit.Damage = 40.f;
Hit.DestructionPower = ESDFDestructionPower::Heavy;
Hit.ImpactLocation = HitResult.ImpactPoint;
Hit.ImpactNormal = HitResult.ImpactNormal;
Hit.ImpactDirection = (Target->GetActorLocation() - GetActorLocation()).GetSafeNormal();
Hit.ImpulseStrength = 800.f;
Hit.HitComponent = HitResult.GetComponent();
Hit.Instigator = GetInstigatorController();
Hit.DamageCauser = this;
const FSDFDestructionResult Result = Destructible->ApplyDestructionDamage(Hit);
if (Result.Outcome == ESDFDestructionOutcome::Destroyed)
{
// Award resources, trigger hit stop, spawn a reward...
}
else if (Result.RejectionReason != ESDFRejectionReason::None)
{
UE_LOG(LogTemp, Verbose, TEXT("%s"), *USDFBlueprintLibrary::DescribeRejectionReason(Result.RejectionReason).ToString());
}
}
The example also needs #include "SDFBlueprintLibrary.h". On a prop with several destructibles,
FSDFDestructibleRouting::Resolve(Target, HitResult.GetComponent()) picks the region that was
struck instead of FindComponentByClass.
Scripted control example
#include "SDFDestructibleComponent.h"
#include "SDFDestructionSubsystem.h"
void AMyArenaScript::OnBossDefeated(USDFDestructibleComponent* Barricade)
{
Barricade->SetDestructionEnabled(true); // unlock
FSDFForceDestroyParams Params;
Params.bUseImpactLocation = false; // break from the centre of the prop
Params.ImpulseStrength = 600.f;
Barricade->ForceDestroy(Params); // tagged SDF.Source.Script, Massive power
}
void AMyGameMode::RespawnPlayer(const FVector& SpawnPoint)
{
if (USDFDestructionSubsystem* SDF = GetWorld()->GetSubsystem<USDFDestructionSubsystem>())
{
SDF->BreakIntactInSphere(SpawnPoint, 120.f); // nobody spawns stuck inside a prop
}
} Last updated: 2026-10-29