diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySet.cpp b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySet.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a4ba96f4e97257ee5030e55449f115ec41ceafa7 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySet.cpp @@ -0,0 +1,148 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraAbilitySet.h" + +#include "AbilitySystem/Abilities/LyraGameplayAbility.h" +#include "LyraAbilitySystemComponent.h" +#include "LyraLogChannels.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraAbilitySet) + +void FLyraAbilitySet_GrantedHandles::AddAbilitySpecHandle(const FGameplayAbilitySpecHandle& Handle) +{ + if (Handle.IsValid()) + { + AbilitySpecHandles.Add(Handle); + } +} + +void FLyraAbilitySet_GrantedHandles::AddGameplayEffectHandle(const FActiveGameplayEffectHandle& Handle) +{ + if (Handle.IsValid()) + { + GameplayEffectHandles.Add(Handle); + } +} + +void FLyraAbilitySet_GrantedHandles::AddAttributeSet(UAttributeSet* Set) +{ + GrantedAttributeSets.Add(Set); +} + +void FLyraAbilitySet_GrantedHandles::TakeFromAbilitySystem(ULyraAbilitySystemComponent* LyraASC) +{ + check(LyraASC); + + if (!LyraASC->IsOwnerActorAuthoritative()) + { + // Must be authoritative to give or take ability sets. + return; + } + + for (const FGameplayAbilitySpecHandle& Handle : AbilitySpecHandles) + { + if (Handle.IsValid()) + { + LyraASC->ClearAbility(Handle); + } + } + + for (const FActiveGameplayEffectHandle& Handle : GameplayEffectHandles) + { + if (Handle.IsValid()) + { + LyraASC->RemoveActiveGameplayEffect(Handle); + } + } + + for (UAttributeSet* Set : GrantedAttributeSets) + { + LyraASC->RemoveSpawnedAttribute(Set); + } + + AbilitySpecHandles.Reset(); + GameplayEffectHandles.Reset(); + GrantedAttributeSets.Reset(); +} + +ULyraAbilitySet::ULyraAbilitySet(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void ULyraAbilitySet::GiveToAbilitySystem(ULyraAbilitySystemComponent* LyraASC, FLyraAbilitySet_GrantedHandles* OutGrantedHandles, UObject* SourceObject) const +{ + check(LyraASC); + + if (!LyraASC->IsOwnerActorAuthoritative()) + { + // Must be authoritative to give or take ability sets. + return; + } + + // Grant the attribute sets. + for (int32 SetIndex = 0; SetIndex < GrantedAttributes.Num(); ++SetIndex) + { + const FLyraAbilitySet_AttributeSet& SetToGrant = GrantedAttributes[SetIndex]; + + if (!IsValid(SetToGrant.AttributeSet)) + { + UE_LOG(LogLyraAbilitySystem, Error, TEXT("GrantedAttributes[%d] on ability set [%s] is not valid"), SetIndex, *GetNameSafe(this)); + continue; + } + + UAttributeSet* NewSet = NewObject(LyraASC->GetOwner(), SetToGrant.AttributeSet); + LyraASC->AddAttributeSetSubobject(NewSet); + + if (OutGrantedHandles) + { + OutGrantedHandles->AddAttributeSet(NewSet); + } + } + + // Grant the gameplay abilities. + for (int32 AbilityIndex = 0; AbilityIndex < GrantedGameplayAbilities.Num(); ++AbilityIndex) + { + const FLyraAbilitySet_GameplayAbility& AbilityToGrant = GrantedGameplayAbilities[AbilityIndex]; + + if (!IsValid(AbilityToGrant.Ability)) + { + UE_LOG(LogLyraAbilitySystem, Error, TEXT("GrantedGameplayAbilities[%d] on ability set [%s] is not valid."), AbilityIndex, *GetNameSafe(this)); + continue; + } + + ULyraGameplayAbility* AbilityCDO = AbilityToGrant.Ability->GetDefaultObject(); + + FGameplayAbilitySpec AbilitySpec(AbilityCDO, AbilityToGrant.AbilityLevel); + AbilitySpec.SourceObject = SourceObject; + AbilitySpec.GetDynamicSpecSourceTags().AddTag(AbilityToGrant.InputTag); + + const FGameplayAbilitySpecHandle AbilitySpecHandle = LyraASC->GiveAbility(AbilitySpec); + + if (OutGrantedHandles) + { + OutGrantedHandles->AddAbilitySpecHandle(AbilitySpecHandle); + } + } + + // Grant the gameplay effects. + for (int32 EffectIndex = 0; EffectIndex < GrantedGameplayEffects.Num(); ++EffectIndex) + { + const FLyraAbilitySet_GameplayEffect& EffectToGrant = GrantedGameplayEffects[EffectIndex]; + + if (!IsValid(EffectToGrant.GameplayEffect)) + { + UE_LOG(LogLyraAbilitySystem, Error, TEXT("GrantedGameplayEffects[%d] on ability set [%s] is not valid"), EffectIndex, *GetNameSafe(this)); + continue; + } + + const UGameplayEffect* GameplayEffect = EffectToGrant.GameplayEffect->GetDefaultObject(); + const FActiveGameplayEffectHandle GameplayEffectHandle = LyraASC->ApplyGameplayEffectToSelf(GameplayEffect, EffectToGrant.EffectLevel, LyraASC->MakeEffectContext()); + + if (OutGrantedHandles) + { + OutGrantedHandles->AddGameplayEffectHandle(GameplayEffectHandle); + } + } +} + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySet.h b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySet.h new file mode 100644 index 0000000000000000000000000000000000000000..748e83fb562a98472eba3faa2f41ee0a98b2983e --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySet.h @@ -0,0 +1,149 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "ActiveGameplayEffectHandle.h" +#include "Engine/DataAsset.h" +#include "AttributeSet.h" +#include "GameplayTagContainer.h" + +#include "GameplayAbilitySpecHandle.h" +#include "LyraAbilitySet.generated.h" + +class UAttributeSet; +class UGameplayEffect; +class ULyraAbilitySystemComponent; +class ULyraGameplayAbility; +class UObject; + + +/** + * FLyraAbilitySet_GameplayAbility + * + * Data used by the ability set to grant gameplay abilities. + */ +USTRUCT(BlueprintType) +struct FLyraAbilitySet_GameplayAbility +{ + GENERATED_BODY() + +public: + + // Gameplay ability to grant. + UPROPERTY(EditDefaultsOnly) + TSubclassOf Ability = nullptr; + + // Level of ability to grant. + UPROPERTY(EditDefaultsOnly) + int32 AbilityLevel = 1; + + // Tag used to process input for the ability. + UPROPERTY(EditDefaultsOnly, Meta = (Categories = "InputTag")) + FGameplayTag InputTag; +}; + + +/** + * FLyraAbilitySet_GameplayEffect + * + * Data used by the ability set to grant gameplay effects. + */ +USTRUCT(BlueprintType) +struct FLyraAbilitySet_GameplayEffect +{ + GENERATED_BODY() + +public: + + // Gameplay effect to grant. + UPROPERTY(EditDefaultsOnly) + TSubclassOf GameplayEffect = nullptr; + + // Level of gameplay effect to grant. + UPROPERTY(EditDefaultsOnly) + float EffectLevel = 1.0f; +}; + +/** + * FLyraAbilitySet_AttributeSet + * + * Data used by the ability set to grant attribute sets. + */ +USTRUCT(BlueprintType) +struct FLyraAbilitySet_AttributeSet +{ + GENERATED_BODY() + +public: + // Gameplay effect to grant. + UPROPERTY(EditDefaultsOnly) + TSubclassOf AttributeSet; + +}; + +/** + * FLyraAbilitySet_GrantedHandles + * + * Data used to store handles to what has been granted by the ability set. + */ +USTRUCT(BlueprintType) +struct FLyraAbilitySet_GrantedHandles +{ + GENERATED_BODY() + +public: + + void AddAbilitySpecHandle(const FGameplayAbilitySpecHandle& Handle); + void AddGameplayEffectHandle(const FActiveGameplayEffectHandle& Handle); + void AddAttributeSet(UAttributeSet* Set); + + void TakeFromAbilitySystem(ULyraAbilitySystemComponent* LyraASC); + +protected: + + // Handles to the granted abilities. + UPROPERTY() + TArray AbilitySpecHandles; + + // Handles to the granted gameplay effects. + UPROPERTY() + TArray GameplayEffectHandles; + + // Pointers to the granted attribute sets + UPROPERTY() + TArray> GrantedAttributeSets; +}; + + +/** + * ULyraAbilitySet + * + * Non-mutable data asset used to grant gameplay abilities and gameplay effects. + */ +UCLASS(BlueprintType, Const) +class ULyraAbilitySet : public UPrimaryDataAsset +{ + GENERATED_BODY() + +public: + + ULyraAbilitySet(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + // Grants the ability set to the specified ability system component. + // The returned handles can be used later to take away anything that was granted. + void GiveToAbilitySystem(ULyraAbilitySystemComponent* LyraASC, FLyraAbilitySet_GrantedHandles* OutGrantedHandles, UObject* SourceObject = nullptr) const; + +protected: + + // Gameplay abilities to grant when this ability set is granted. + UPROPERTY(EditDefaultsOnly, Category = "Gameplay Abilities", meta=(TitleProperty=Ability)) + TArray GrantedGameplayAbilities; + + // Gameplay effects to grant when this ability set is granted. + UPROPERTY(EditDefaultsOnly, Category = "Gameplay Effects", meta=(TitleProperty=GameplayEffect)) + TArray GrantedGameplayEffects; + + // Attribute sets to grant when this ability set is granted. + UPROPERTY(EditDefaultsOnly, Category = "Attribute Sets", meta=(TitleProperty=AttributeSet)) + TArray GrantedAttributes; +}; diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySourceInterface.cpp b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySourceInterface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3406992177417dc9ce8645afa449edf23a0b9e84 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySourceInterface.cpp @@ -0,0 +1,10 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraAbilitySourceInterface.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraAbilitySourceInterface) + +ULyraAbilitySourceInterface::ULyraAbilitySourceInterface(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{} + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySourceInterface.h b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySourceInterface.h new file mode 100644 index 0000000000000000000000000000000000000000..8287eb7550cd82a0574592f34d7bb766818b8960 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySourceInterface.h @@ -0,0 +1,36 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "UObject/Interface.h" + +#include "LyraAbilitySourceInterface.generated.h" + +class UObject; +class UPhysicalMaterial; +struct FGameplayTagContainer; + +/** Base interface for anything acting as a ability calculation source */ +UINTERFACE() +class ULyraAbilitySourceInterface : public UInterface +{ + GENERATED_UINTERFACE_BODY() +}; + +class ILyraAbilitySourceInterface +{ + GENERATED_IINTERFACE_BODY() + + /** + * Compute the multiplier for effect falloff with distance + * + * @param Distance Distance from source to target for ability calculations (distance bullet traveled for a gun, etc...) + * @param SourceTags Aggregated Tags from the source + * @param TargetTags Aggregated Tags currently on the target + * + * @return Multiplier to apply to the base attribute value due to distance + */ + virtual float GetDistanceAttenuation(float Distance, const FGameplayTagContainer* SourceTags = nullptr, const FGameplayTagContainer* TargetTags = nullptr) const = 0; + + virtual float GetPhysicalMaterialAttenuation(const UPhysicalMaterial* PhysicalMaterial, const FGameplayTagContainer* SourceTags = nullptr, const FGameplayTagContainer* TargetTags = nullptr) const = 0; +}; diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemComponent.cpp b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemComponent.cpp new file mode 100644 index 0000000000000000000000000000000000000000..272d3b63831e35f34fcfdcb304e3c6e40891a0a2 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemComponent.cpp @@ -0,0 +1,528 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraAbilitySystemComponent.h" + +#include "AbilitySystem/Abilities/LyraGameplayAbility.h" +#include "AbilitySystem/LyraAbilityTagRelationshipMapping.h" +#include "Animation/LyraAnimInstance.h" +#include "Engine/World.h" +#include "GameFramework/Pawn.h" +#include "LyraGlobalAbilitySystem.h" +#include "LyraLogChannels.h" +#include "System/LyraAssetManager.h" +#include "System/LyraGameData.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraAbilitySystemComponent) + +UE_DEFINE_GAMEPLAY_TAG(TAG_Gameplay_AbilityInputBlocked, "Gameplay.AbilityInputBlocked"); + +ULyraAbilitySystemComponent::ULyraAbilitySystemComponent(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + InputPressedSpecHandles.Reset(); + InputReleasedSpecHandles.Reset(); + InputHeldSpecHandles.Reset(); + + FMemory::Memset(ActivationGroupCounts, 0, sizeof(ActivationGroupCounts)); +} + +void ULyraAbilitySystemComponent::EndPlay(const EEndPlayReason::Type EndPlayReason) +{ + if (ULyraGlobalAbilitySystem* GlobalAbilitySystem = UWorld::GetSubsystem(GetWorld())) + { + GlobalAbilitySystem->UnregisterASC(this); + } + + Super::EndPlay(EndPlayReason); +} + +void ULyraAbilitySystemComponent::InitAbilityActorInfo(AActor* InOwnerActor, AActor* InAvatarActor) +{ + FGameplayAbilityActorInfo* ActorInfo = AbilityActorInfo.Get(); + check(ActorInfo); + check(InOwnerActor); + + const bool bHasNewPawnAvatar = Cast(InAvatarActor) && (InAvatarActor != ActorInfo->AvatarActor); + + Super::InitAbilityActorInfo(InOwnerActor, InAvatarActor); + + if (bHasNewPawnAvatar) + { + // Notify all abilities that a new pawn avatar has been set + for (const FGameplayAbilitySpec& AbilitySpec : ActivatableAbilities.Items) + { +PRAGMA_DISABLE_DEPRECATION_WARNINGS + ensureMsgf(AbilitySpec.Ability && AbilitySpec.Ability->GetInstancingPolicy() != EGameplayAbilityInstancingPolicy::NonInstanced, TEXT("InitAbilityActorInfo: All Abilities should be Instanced (NonInstanced is being deprecated due to usability issues).")); +PRAGMA_ENABLE_DEPRECATION_WARNINGS + + TArray Instances = AbilitySpec.GetAbilityInstances(); + for (UGameplayAbility* AbilityInstance : Instances) + { + ULyraGameplayAbility* LyraAbilityInstance = Cast(AbilityInstance); + if (LyraAbilityInstance) + { + // Ability instances may be missing for replays + LyraAbilityInstance->OnPawnAvatarSet(); + } + } + } + + // Register with the global system once we actually have a pawn avatar. We wait until this time since some globally-applied effects may require an avatar. + if (ULyraGlobalAbilitySystem* GlobalAbilitySystem = UWorld::GetSubsystem(GetWorld())) + { + GlobalAbilitySystem->RegisterASC(this); + } + + if (ULyraAnimInstance* LyraAnimInst = Cast(ActorInfo->GetAnimInstance())) + { + LyraAnimInst->InitializeWithAbilitySystem(this); + } + + TryActivateAbilitiesOnSpawn(); + } +} + +void ULyraAbilitySystemComponent::TryActivateAbilitiesOnSpawn() +{ + ABILITYLIST_SCOPE_LOCK(); + for (const FGameplayAbilitySpec& AbilitySpec : ActivatableAbilities.Items) + { + if (const ULyraGameplayAbility* LyraAbilityCDO = Cast(AbilitySpec.Ability)) + { + LyraAbilityCDO->TryActivateAbilityOnSpawn(AbilityActorInfo.Get(), AbilitySpec); + } + } +} + +void ULyraAbilitySystemComponent::CancelAbilitiesByFunc(TShouldCancelAbilityFunc ShouldCancelFunc, bool bReplicateCancelAbility) +{ + ABILITYLIST_SCOPE_LOCK(); + for (const FGameplayAbilitySpec& AbilitySpec : ActivatableAbilities.Items) + { + if (!AbilitySpec.IsActive()) + { + continue; + } + + ULyraGameplayAbility* LyraAbilityCDO = Cast(AbilitySpec.Ability); + if (!LyraAbilityCDO) + { + UE_LOG(LogLyraAbilitySystem, Error, TEXT("CancelAbilitiesByFunc: Non-LyraGameplayAbility %s was Granted to ASC. Skipping."), *AbilitySpec.Ability.GetName()); + continue; + } + +PRAGMA_DISABLE_DEPRECATION_WARNINGS + ensureMsgf(AbilitySpec.Ability->GetInstancingPolicy() != EGameplayAbilityInstancingPolicy::NonInstanced, TEXT("CancelAbilitiesByFunc: All Abilities should be Instanced (NonInstanced is being deprecated due to usability issues).")); +PRAGMA_ENABLE_DEPRECATION_WARNINGS + + // Cancel all the spawned instances. + TArray Instances = AbilitySpec.GetAbilityInstances(); + for (UGameplayAbility* AbilityInstance : Instances) + { + ULyraGameplayAbility* LyraAbilityInstance = CastChecked(AbilityInstance); + + if (ShouldCancelFunc(LyraAbilityInstance, AbilitySpec.Handle)) + { + if (LyraAbilityInstance->CanBeCanceled()) + { + LyraAbilityInstance->CancelAbility(AbilitySpec.Handle, AbilityActorInfo.Get(), LyraAbilityInstance->GetCurrentActivationInfo(), bReplicateCancelAbility); + } + else + { + UE_LOG(LogLyraAbilitySystem, Error, TEXT("CancelAbilitiesByFunc: Can't cancel ability [%s] because CanBeCanceled is false."), *LyraAbilityInstance->GetName()); + } + } + } + } +} + +void ULyraAbilitySystemComponent::CancelInputActivatedAbilities(bool bReplicateCancelAbility) +{ + auto ShouldCancelFunc = [this](const ULyraGameplayAbility* LyraAbility, FGameplayAbilitySpecHandle Handle) + { + const ELyraAbilityActivationPolicy ActivationPolicy = LyraAbility->GetActivationPolicy(); + return ((ActivationPolicy == ELyraAbilityActivationPolicy::OnInputTriggered) || (ActivationPolicy == ELyraAbilityActivationPolicy::WhileInputActive)); + }; + + CancelAbilitiesByFunc(ShouldCancelFunc, bReplicateCancelAbility); +} + +void ULyraAbilitySystemComponent::AbilitySpecInputPressed(FGameplayAbilitySpec& Spec) +{ + Super::AbilitySpecInputPressed(Spec); + + // We don't support UGameplayAbility::bReplicateInputDirectly. + // Use replicated events instead so that the WaitInputPress ability task works. + if (Spec.IsActive()) + { +PRAGMA_DISABLE_DEPRECATION_WARNINGS + const UGameplayAbility* Instance = Spec.GetPrimaryInstance(); + FPredictionKey OriginalPredictionKey = Instance ? Instance->GetCurrentActivationInfo().GetActivationPredictionKey() : Spec.ActivationInfo.GetActivationPredictionKey(); +PRAGMA_ENABLE_DEPRECATION_WARNINGS + + // Invoke the InputPressed event. This is not replicated here. If someone is listening, they may replicate the InputPressed event to the server. + InvokeReplicatedEvent(EAbilityGenericReplicatedEvent::InputPressed, Spec.Handle, OriginalPredictionKey); + } +} + +void ULyraAbilitySystemComponent::AbilitySpecInputReleased(FGameplayAbilitySpec& Spec) +{ + Super::AbilitySpecInputReleased(Spec); + + // We don't support UGameplayAbility::bReplicateInputDirectly. + // Use replicated events instead so that the WaitInputRelease ability task works. + if (Spec.IsActive()) + { +PRAGMA_DISABLE_DEPRECATION_WARNINGS + const UGameplayAbility* Instance = Spec.GetPrimaryInstance(); + FPredictionKey OriginalPredictionKey = Instance ? Instance->GetCurrentActivationInfo().GetActivationPredictionKey() : Spec.ActivationInfo.GetActivationPredictionKey(); +PRAGMA_ENABLE_DEPRECATION_WARNINGS + + // Invoke the InputReleased event. This is not replicated here. If someone is listening, they may replicate the InputReleased event to the server. + InvokeReplicatedEvent(EAbilityGenericReplicatedEvent::InputReleased, Spec.Handle, OriginalPredictionKey); + } +} + +void ULyraAbilitySystemComponent::AbilityInputTagPressed(const FGameplayTag& InputTag) +{ + if (InputTag.IsValid()) + { + for (const FGameplayAbilitySpec& AbilitySpec : ActivatableAbilities.Items) + { + if (AbilitySpec.Ability && (AbilitySpec.GetDynamicSpecSourceTags().HasTagExact(InputTag))) + { + InputPressedSpecHandles.AddUnique(AbilitySpec.Handle); + InputHeldSpecHandles.AddUnique(AbilitySpec.Handle); + } + } + } +} + +void ULyraAbilitySystemComponent::AbilityInputTagReleased(const FGameplayTag& InputTag) +{ + if (InputTag.IsValid()) + { + for (const FGameplayAbilitySpec& AbilitySpec : ActivatableAbilities.Items) + { + if (AbilitySpec.Ability && (AbilitySpec.GetDynamicSpecSourceTags().HasTagExact(InputTag))) + { + InputReleasedSpecHandles.AddUnique(AbilitySpec.Handle); + InputHeldSpecHandles.Remove(AbilitySpec.Handle); + } + } + } +} + +void ULyraAbilitySystemComponent::ProcessAbilityInput(float DeltaTime, bool bGamePaused) +{ + if (HasMatchingGameplayTag(TAG_Gameplay_AbilityInputBlocked)) + { + ClearAbilityInput(); + return; + } + + static TArray AbilitiesToActivate; + AbilitiesToActivate.Reset(); + + //@TODO: See if we can use FScopedServerAbilityRPCBatcher ScopedRPCBatcher in some of these loops + + // + // Process all abilities that activate when the input is held. + // + for (const FGameplayAbilitySpecHandle& SpecHandle : InputHeldSpecHandles) + { + if (const FGameplayAbilitySpec* AbilitySpec = FindAbilitySpecFromHandle(SpecHandle)) + { + if (AbilitySpec->Ability && !AbilitySpec->IsActive()) + { + const ULyraGameplayAbility* LyraAbilityCDO = Cast(AbilitySpec->Ability); + if (LyraAbilityCDO && LyraAbilityCDO->GetActivationPolicy() == ELyraAbilityActivationPolicy::WhileInputActive) + { + AbilitiesToActivate.AddUnique(AbilitySpec->Handle); + } + } + } + } + + // + // Process all abilities that had their input pressed this frame. + // + for (const FGameplayAbilitySpecHandle& SpecHandle : InputPressedSpecHandles) + { + if (FGameplayAbilitySpec* AbilitySpec = FindAbilitySpecFromHandle(SpecHandle)) + { + if (AbilitySpec->Ability) + { + AbilitySpec->InputPressed = true; + + if (AbilitySpec->IsActive()) + { + // Ability is active so pass along the input event. + AbilitySpecInputPressed(*AbilitySpec); + } + else + { + const ULyraGameplayAbility* LyraAbilityCDO = Cast(AbilitySpec->Ability); + + if (LyraAbilityCDO && LyraAbilityCDO->GetActivationPolicy() == ELyraAbilityActivationPolicy::OnInputTriggered) + { + AbilitiesToActivate.AddUnique(AbilitySpec->Handle); + } + } + } + } + } + + // + // Try to activate all the abilities that are from presses and holds. + // We do it all at once so that held inputs don't activate the ability + // and then also send a input event to the ability because of the press. + // + for (const FGameplayAbilitySpecHandle& AbilitySpecHandle : AbilitiesToActivate) + { + TryActivateAbility(AbilitySpecHandle); + } + + // + // Process all abilities that had their input released this frame. + // + for (const FGameplayAbilitySpecHandle& SpecHandle : InputReleasedSpecHandles) + { + if (FGameplayAbilitySpec* AbilitySpec = FindAbilitySpecFromHandle(SpecHandle)) + { + if (AbilitySpec->Ability) + { + AbilitySpec->InputPressed = false; + + if (AbilitySpec->IsActive()) + { + // Ability is active so pass along the input event. + AbilitySpecInputReleased(*AbilitySpec); + } + } + } + } + + // + // Clear the cached ability handles. + // + InputPressedSpecHandles.Reset(); + InputReleasedSpecHandles.Reset(); +} + +void ULyraAbilitySystemComponent::ClearAbilityInput() +{ + InputPressedSpecHandles.Reset(); + InputReleasedSpecHandles.Reset(); + InputHeldSpecHandles.Reset(); +} + +void ULyraAbilitySystemComponent::NotifyAbilityActivated(const FGameplayAbilitySpecHandle Handle, UGameplayAbility* Ability) +{ + Super::NotifyAbilityActivated(Handle, Ability); + + if (ULyraGameplayAbility* LyraAbility = Cast(Ability)) + { + AddAbilityToActivationGroup(LyraAbility->GetActivationGroup(), LyraAbility); + } +} + +void ULyraAbilitySystemComponent::NotifyAbilityFailed(const FGameplayAbilitySpecHandle Handle, UGameplayAbility* Ability, const FGameplayTagContainer& FailureReason) +{ + Super::NotifyAbilityFailed(Handle, Ability, FailureReason); + + if (APawn* Avatar = Cast(GetAvatarActor())) + { + if (!Avatar->IsLocallyControlled() && Ability->IsSupportedForNetworking()) + { + ClientNotifyAbilityFailed(Ability, FailureReason); + return; + } + } + + HandleAbilityFailed(Ability, FailureReason); +} + +void ULyraAbilitySystemComponent::NotifyAbilityEnded(FGameplayAbilitySpecHandle Handle, UGameplayAbility* Ability, bool bWasCancelled) +{ + Super::NotifyAbilityEnded(Handle, Ability, bWasCancelled); + + if (ULyraGameplayAbility* LyraAbility = Cast(Ability)) + { + RemoveAbilityFromActivationGroup(LyraAbility->GetActivationGroup(), LyraAbility); + } +} + +void ULyraAbilitySystemComponent::ApplyAbilityBlockAndCancelTags(const FGameplayTagContainer& AbilityTags, UGameplayAbility* RequestingAbility, bool bEnableBlockTags, const FGameplayTagContainer& BlockTags, bool bExecuteCancelTags, const FGameplayTagContainer& CancelTags) +{ + FGameplayTagContainer ModifiedBlockTags = BlockTags; + FGameplayTagContainer ModifiedCancelTags = CancelTags; + + if (TagRelationshipMapping) + { + // Use the mapping to expand the ability tags into block and cancel tag + TagRelationshipMapping->GetAbilityTagsToBlockAndCancel(AbilityTags, &ModifiedBlockTags, &ModifiedCancelTags); + } + + Super::ApplyAbilityBlockAndCancelTags(AbilityTags, RequestingAbility, bEnableBlockTags, ModifiedBlockTags, bExecuteCancelTags, ModifiedCancelTags); + + //@TODO: Apply any special logic like blocking input or movement +} + +void ULyraAbilitySystemComponent::HandleChangeAbilityCanBeCanceled(const FGameplayTagContainer& AbilityTags, UGameplayAbility* RequestingAbility, bool bCanBeCanceled) +{ + Super::HandleChangeAbilityCanBeCanceled(AbilityTags, RequestingAbility, bCanBeCanceled); + + //@TODO: Apply any special logic like blocking input or movement +} + +void ULyraAbilitySystemComponent::GetAdditionalActivationTagRequirements(const FGameplayTagContainer& AbilityTags, FGameplayTagContainer& OutActivationRequired, FGameplayTagContainer& OutActivationBlocked) const +{ + if (TagRelationshipMapping) + { + TagRelationshipMapping->GetRequiredAndBlockedActivationTags(AbilityTags, &OutActivationRequired, &OutActivationBlocked); + } +} + +void ULyraAbilitySystemComponent::SetTagRelationshipMapping(ULyraAbilityTagRelationshipMapping* NewMapping) +{ + TagRelationshipMapping = NewMapping; +} + +void ULyraAbilitySystemComponent::ClientNotifyAbilityFailed_Implementation(const UGameplayAbility* Ability, const FGameplayTagContainer& FailureReason) +{ + HandleAbilityFailed(Ability, FailureReason); +} + +void ULyraAbilitySystemComponent::HandleAbilityFailed(const UGameplayAbility* Ability, const FGameplayTagContainer& FailureReason) +{ + //UE_LOG(LogLyraAbilitySystem, Warning, TEXT("Ability %s failed to activate (tags: %s)"), *GetPathNameSafe(Ability), *FailureReason.ToString()); + + if (const ULyraGameplayAbility* LyraAbility = Cast(Ability)) + { + LyraAbility->OnAbilityFailedToActivate(FailureReason); + } +} + +bool ULyraAbilitySystemComponent::IsActivationGroupBlocked(ELyraAbilityActivationGroup Group) const +{ + bool bBlocked = false; + + switch (Group) + { + case ELyraAbilityActivationGroup::Independent: + // Independent abilities are never blocked. + bBlocked = false; + break; + + case ELyraAbilityActivationGroup::Exclusive_Replaceable: + case ELyraAbilityActivationGroup::Exclusive_Blocking: + // Exclusive abilities can activate if nothing is blocking. + bBlocked = (ActivationGroupCounts[(uint8)ELyraAbilityActivationGroup::Exclusive_Blocking] > 0); + break; + + default: + checkf(false, TEXT("IsActivationGroupBlocked: Invalid ActivationGroup [%d]\n"), (uint8)Group); + break; + } + + return bBlocked; +} + +void ULyraAbilitySystemComponent::AddAbilityToActivationGroup(ELyraAbilityActivationGroup Group, ULyraGameplayAbility* LyraAbility) +{ + check(LyraAbility); + check(ActivationGroupCounts[(uint8)Group] < INT32_MAX); + + ActivationGroupCounts[(uint8)Group]++; + + const bool bReplicateCancelAbility = false; + + switch (Group) + { + case ELyraAbilityActivationGroup::Independent: + // Independent abilities do not cancel any other abilities. + break; + + case ELyraAbilityActivationGroup::Exclusive_Replaceable: + case ELyraAbilityActivationGroup::Exclusive_Blocking: + CancelActivationGroupAbilities(ELyraAbilityActivationGroup::Exclusive_Replaceable, LyraAbility, bReplicateCancelAbility); + break; + + default: + checkf(false, TEXT("AddAbilityToActivationGroup: Invalid ActivationGroup [%d]\n"), (uint8)Group); + break; + } + + const int32 ExclusiveCount = ActivationGroupCounts[(uint8)ELyraAbilityActivationGroup::Exclusive_Replaceable] + ActivationGroupCounts[(uint8)ELyraAbilityActivationGroup::Exclusive_Blocking]; + if (!ensure(ExclusiveCount <= 1)) + { + UE_LOG(LogLyraAbilitySystem, Error, TEXT("AddAbilityToActivationGroup: Multiple exclusive abilities are running.")); + } +} + +void ULyraAbilitySystemComponent::RemoveAbilityFromActivationGroup(ELyraAbilityActivationGroup Group, ULyraGameplayAbility* LyraAbility) +{ + check(LyraAbility); + check(ActivationGroupCounts[(uint8)Group] > 0); + + ActivationGroupCounts[(uint8)Group]--; +} + +void ULyraAbilitySystemComponent::CancelActivationGroupAbilities(ELyraAbilityActivationGroup Group, ULyraGameplayAbility* IgnoreLyraAbility, bool bReplicateCancelAbility) +{ + auto ShouldCancelFunc = [this, Group, IgnoreLyraAbility](const ULyraGameplayAbility* LyraAbility, FGameplayAbilitySpecHandle Handle) + { + return ((LyraAbility->GetActivationGroup() == Group) && (LyraAbility != IgnoreLyraAbility)); + }; + + CancelAbilitiesByFunc(ShouldCancelFunc, bReplicateCancelAbility); +} + +void ULyraAbilitySystemComponent::AddDynamicTagGameplayEffect(const FGameplayTag& Tag) +{ + const TSubclassOf DynamicTagGE = ULyraAssetManager::GetSubclass(ULyraGameData::Get().DynamicTagGameplayEffect); + if (!DynamicTagGE) + { + UE_LOG(LogLyraAbilitySystem, Warning, TEXT("AddDynamicTagGameplayEffect: Unable to find DynamicTagGameplayEffect [%s]."), *ULyraGameData::Get().DynamicTagGameplayEffect.GetAssetName()); + return; + } + + const FGameplayEffectSpecHandle SpecHandle = MakeOutgoingSpec(DynamicTagGE, 1.0f, MakeEffectContext()); + FGameplayEffectSpec* Spec = SpecHandle.Data.Get(); + + if (!Spec) + { + UE_LOG(LogLyraAbilitySystem, Warning, TEXT("AddDynamicTagGameplayEffect: Unable to make outgoing spec for [%s]."), *GetNameSafe(DynamicTagGE)); + return; + } + + Spec->DynamicGrantedTags.AddTag(Tag); + + ApplyGameplayEffectSpecToSelf(*Spec); +} + +void ULyraAbilitySystemComponent::RemoveDynamicTagGameplayEffect(const FGameplayTag& Tag) +{ + const TSubclassOf DynamicTagGE = ULyraAssetManager::GetSubclass(ULyraGameData::Get().DynamicTagGameplayEffect); + if (!DynamicTagGE) + { + UE_LOG(LogLyraAbilitySystem, Warning, TEXT("RemoveDynamicTagGameplayEffect: Unable to find gameplay effect [%s]."), *ULyraGameData::Get().DynamicTagGameplayEffect.GetAssetName()); + return; + } + + FGameplayEffectQuery Query = FGameplayEffectQuery::MakeQuery_MatchAnyOwningTags(FGameplayTagContainer(Tag)); + Query.EffectDefinition = DynamicTagGE; + + RemoveActiveEffects(Query); +} + +void ULyraAbilitySystemComponent::GetAbilityTargetData(const FGameplayAbilitySpecHandle AbilityHandle, FGameplayAbilityActivationInfo ActivationInfo, FGameplayAbilityTargetDataHandle& OutTargetDataHandle) +{ + TSharedPtr ReplicatedData = AbilityTargetDataMap.Find(FGameplayAbilitySpecHandleAndPredictionKey(AbilityHandle, ActivationInfo.GetActivationPredictionKey())); + if (ReplicatedData.IsValid()) + { + OutTargetDataHandle = ReplicatedData->TargetData; + } +} + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemComponent.h b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemComponent.h new file mode 100644 index 0000000000000000000000000000000000000000..7bdb30d291049fcd79a0fac057dab7f7c04a3853 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemComponent.h @@ -0,0 +1,110 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Abilities/LyraGameplayAbility.h" +#include "AbilitySystemComponent.h" +#include "NativeGameplayTags.h" + +#include "LyraAbilitySystemComponent.generated.h" + +#define UE_API LYRAGAME_API + +class AActor; +class UGameplayAbility; +class ULyraAbilityTagRelationshipMapping; +class UObject; +struct FFrame; +struct FGameplayAbilityTargetDataHandle; + +LYRAGAME_API UE_DECLARE_GAMEPLAY_TAG_EXTERN(TAG_Gameplay_AbilityInputBlocked); + +/** + * ULyraAbilitySystemComponent + * + * Base ability system component class used by this project. + */ +UCLASS(MinimalAPI) +class ULyraAbilitySystemComponent : public UAbilitySystemComponent +{ + GENERATED_BODY() + +public: + + UE_API ULyraAbilitySystemComponent(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + //~UActorComponent interface + UE_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; + //~End of UActorComponent interface + + UE_API virtual void InitAbilityActorInfo(AActor* InOwnerActor, AActor* InAvatarActor) override; + + typedef TFunctionRef TShouldCancelAbilityFunc; + UE_API void CancelAbilitiesByFunc(TShouldCancelAbilityFunc ShouldCancelFunc, bool bReplicateCancelAbility); + + UE_API void CancelInputActivatedAbilities(bool bReplicateCancelAbility); + + UE_API void AbilityInputTagPressed(const FGameplayTag& InputTag); + UE_API void AbilityInputTagReleased(const FGameplayTag& InputTag); + + UE_API void ProcessAbilityInput(float DeltaTime, bool bGamePaused); + UE_API void ClearAbilityInput(); + + UE_API bool IsActivationGroupBlocked(ELyraAbilityActivationGroup Group) const; + UE_API void AddAbilityToActivationGroup(ELyraAbilityActivationGroup Group, ULyraGameplayAbility* LyraAbility); + UE_API void RemoveAbilityFromActivationGroup(ELyraAbilityActivationGroup Group, ULyraGameplayAbility* LyraAbility); + UE_API void CancelActivationGroupAbilities(ELyraAbilityActivationGroup Group, ULyraGameplayAbility* IgnoreLyraAbility, bool bReplicateCancelAbility); + + // Uses a gameplay effect to add the specified dynamic granted tag. + UE_API void AddDynamicTagGameplayEffect(const FGameplayTag& Tag); + + // Removes all active instances of the gameplay effect that was used to add the specified dynamic granted tag. + UE_API void RemoveDynamicTagGameplayEffect(const FGameplayTag& Tag); + + /** Gets the ability target data associated with the given ability handle and activation info */ + UE_API void GetAbilityTargetData(const FGameplayAbilitySpecHandle AbilityHandle, FGameplayAbilityActivationInfo ActivationInfo, FGameplayAbilityTargetDataHandle& OutTargetDataHandle); + + /** Sets the current tag relationship mapping, if null it will clear it out */ + UE_API void SetTagRelationshipMapping(ULyraAbilityTagRelationshipMapping* NewMapping); + + /** Looks at ability tags and gathers additional required and blocking tags */ + UE_API void GetAdditionalActivationTagRequirements(const FGameplayTagContainer& AbilityTags, FGameplayTagContainer& OutActivationRequired, FGameplayTagContainer& OutActivationBlocked) const; + + UE_API void TryActivateAbilitiesOnSpawn(); + +protected: + + UE_API virtual void AbilitySpecInputPressed(FGameplayAbilitySpec& Spec) override; + UE_API virtual void AbilitySpecInputReleased(FGameplayAbilitySpec& Spec) override; + + UE_API virtual void NotifyAbilityActivated(const FGameplayAbilitySpecHandle Handle, UGameplayAbility* Ability) override; + UE_API virtual void NotifyAbilityFailed(const FGameplayAbilitySpecHandle Handle, UGameplayAbility* Ability, const FGameplayTagContainer& FailureReason) override; + UE_API virtual void NotifyAbilityEnded(FGameplayAbilitySpecHandle Handle, UGameplayAbility* Ability, bool bWasCancelled) override; + UE_API virtual void ApplyAbilityBlockAndCancelTags(const FGameplayTagContainer& AbilityTags, UGameplayAbility* RequestingAbility, bool bEnableBlockTags, const FGameplayTagContainer& BlockTags, bool bExecuteCancelTags, const FGameplayTagContainer& CancelTags) override; + UE_API virtual void HandleChangeAbilityCanBeCanceled(const FGameplayTagContainer& AbilityTags, UGameplayAbility* RequestingAbility, bool bCanBeCanceled) override; + + /** Notify client that an ability failed to activate */ + UFUNCTION(Client, Unreliable) + UE_API void ClientNotifyAbilityFailed(const UGameplayAbility* Ability, const FGameplayTagContainer& FailureReason); + + UE_API void HandleAbilityFailed(const UGameplayAbility* Ability, const FGameplayTagContainer& FailureReason); +protected: + + // If set, this table is used to look up tag relationships for activate and cancel + UPROPERTY() + TObjectPtr TagRelationshipMapping; + + // Handles to abilities that had their input pressed this frame. + TArray InputPressedSpecHandles; + + // Handles to abilities that had their input released this frame. + TArray InputReleasedSpecHandles; + + // Handles to abilities that have their input held. + TArray InputHeldSpecHandles; + + // Number of abilities running in each activation group. + int32 ActivationGroupCounts[(uint8)ELyraAbilityActivationGroup::MAX]; +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemGlobals.cpp b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemGlobals.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6afb8eea26fd5e5f7e7847536be3885f688e5cf0 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemGlobals.cpp @@ -0,0 +1,20 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraAbilitySystemGlobals.h" + +#include "LyraGameplayEffectContext.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraAbilitySystemGlobals) + +struct FGameplayEffectContext; + +ULyraAbilitySystemGlobals::ULyraAbilitySystemGlobals(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +FGameplayEffectContext* ULyraAbilitySystemGlobals::AllocGameplayEffectContext() const +{ + return new FLyraGameplayEffectContext(); +} + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemGlobals.h b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemGlobals.h new file mode 100644 index 0000000000000000000000000000000000000000..0a68c9b42fc18cd916ffbe58c2be133d34843972 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilitySystemGlobals.h @@ -0,0 +1,20 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "AbilitySystemGlobals.h" + +#include "LyraAbilitySystemGlobals.generated.h" + +class UObject; +struct FGameplayEffectContext; + +UCLASS(Config=Game) +class ULyraAbilitySystemGlobals : public UAbilitySystemGlobals +{ + GENERATED_UCLASS_BODY() + + //~UAbilitySystemGlobals interface + virtual FGameplayEffectContext* AllocGameplayEffectContext() const override; + //~End of UAbilitySystemGlobals interface +}; diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilityTagRelationshipMapping.cpp b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilityTagRelationshipMapping.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1aab2d950a437b546561d1b876af754c9d27b513 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilityTagRelationshipMapping.cpp @@ -0,0 +1,63 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "AbilitySystem/LyraAbilityTagRelationshipMapping.h" + + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraAbilityTagRelationshipMapping) + +void ULyraAbilityTagRelationshipMapping::GetAbilityTagsToBlockAndCancel(const FGameplayTagContainer& AbilityTags, FGameplayTagContainer* OutTagsToBlock, FGameplayTagContainer* OutTagsToCancel) const +{ + // Simple iteration for now + for (int32 i = 0; i < AbilityTagRelationships.Num(); i++) + { + const FLyraAbilityTagRelationship& Tags = AbilityTagRelationships[i]; + if (AbilityTags.HasTag(Tags.AbilityTag)) + { + if (OutTagsToBlock) + { + OutTagsToBlock->AppendTags(Tags.AbilityTagsToBlock); + } + if (OutTagsToCancel) + { + OutTagsToCancel->AppendTags(Tags.AbilityTagsToCancel); + } + } + } +} + +void ULyraAbilityTagRelationshipMapping::GetRequiredAndBlockedActivationTags(const FGameplayTagContainer& AbilityTags, FGameplayTagContainer* OutActivationRequired, FGameplayTagContainer* OutActivationBlocked) const +{ + // Simple iteration for now + for (int32 i = 0; i < AbilityTagRelationships.Num(); i++) + { + const FLyraAbilityTagRelationship& Tags = AbilityTagRelationships[i]; + if (AbilityTags.HasTag(Tags.AbilityTag)) + { + if (OutActivationRequired) + { + OutActivationRequired->AppendTags(Tags.ActivationRequiredTags); + } + if (OutActivationBlocked) + { + OutActivationBlocked->AppendTags(Tags.ActivationBlockedTags); + } + } + } +} + +bool ULyraAbilityTagRelationshipMapping::IsAbilityCancelledByTag(const FGameplayTagContainer& AbilityTags, const FGameplayTag& ActionTag) const +{ + // Simple iteration for now + for (int32 i = 0; i < AbilityTagRelationships.Num(); i++) + { + const FLyraAbilityTagRelationship& Tags = AbilityTagRelationships[i]; + + if (Tags.AbilityTag == ActionTag && Tags.AbilityTagsToCancel.HasAny(AbilityTags)) + { + return true; + } + } + + return false; +} + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilityTagRelationshipMapping.h b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilityTagRelationshipMapping.h new file mode 100644 index 0000000000000000000000000000000000000000..33e0fd7c1898d97e3c7b392530c1afc6324d7af0 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraAbilityTagRelationshipMapping.h @@ -0,0 +1,60 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Engine/DataAsset.h" +#include "GameplayTagContainer.h" + +#include "LyraAbilityTagRelationshipMapping.generated.h" + +class UObject; + +/** Struct that defines the relationship between different ability tags */ +USTRUCT() +struct FLyraAbilityTagRelationship +{ + GENERATED_BODY() + + /** The tag that this container relationship is about. Single tag, but abilities can have multiple of these */ + UPROPERTY(EditAnywhere, Category = Ability, meta = (Categories = "Gameplay.Action")) + FGameplayTag AbilityTag; + + /** The other ability tags that will be blocked by any ability using this tag */ + UPROPERTY(EditAnywhere, Category = Ability) + FGameplayTagContainer AbilityTagsToBlock; + + /** The other ability tags that will be canceled by any ability using this tag */ + UPROPERTY(EditAnywhere, Category = Ability) + FGameplayTagContainer AbilityTagsToCancel; + + /** If an ability has the tag, this is implicitly added to the activation required tags of the ability */ + UPROPERTY(EditAnywhere, Category = Ability) + FGameplayTagContainer ActivationRequiredTags; + + /** If an ability has the tag, this is implicitly added to the activation blocked tags of the ability */ + UPROPERTY(EditAnywhere, Category = Ability) + FGameplayTagContainer ActivationBlockedTags; +}; + + +/** Mapping of how ability tags block or cancel other abilities */ +UCLASS() +class ULyraAbilityTagRelationshipMapping : public UDataAsset +{ + GENERATED_BODY() + +private: + /** The list of relationships between different gameplay tags (which ones block or cancel others) */ + UPROPERTY(EditAnywhere, Category = Ability, meta=(TitleProperty="AbilityTag")) + TArray AbilityTagRelationships; + +public: + /** Given a set of ability tags, parse the tag relationship and fill out tags to block and cancel */ + void GetAbilityTagsToBlockAndCancel(const FGameplayTagContainer& AbilityTags, FGameplayTagContainer* OutTagsToBlock, FGameplayTagContainer* OutTagsToCancel) const; + + /** Given a set of ability tags, add additional required and blocking tags */ + void GetRequiredAndBlockedActivationTags(const FGameplayTagContainer& AbilityTags, FGameplayTagContainer* OutActivationRequired, FGameplayTagContainer* OutActivationBlocked) const; + + /** Returns true if the specified ability tags are canceled by the passed in action tag */ + bool IsAbilityCancelledByTag(const FGameplayTagContainer& AbilityTags, const FGameplayTag& ActionTag) const; +}; diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayAbilityTargetData_SingleTargetHit.cpp b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayAbilityTargetData_SingleTargetHit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0c41944d30d7a3e12ae20bd232f4eee7d63f1bee --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayAbilityTargetData_SingleTargetHit.cpp @@ -0,0 +1,32 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraGameplayAbilityTargetData_SingleTargetHit.h" + +#include "LyraGameplayEffectContext.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraGameplayAbilityTargetData_SingleTargetHit) + +struct FGameplayEffectContextHandle; + +////////////////////////////////////////////////////////////////////// + +void FLyraGameplayAbilityTargetData_SingleTargetHit::AddTargetDataToContext(FGameplayEffectContextHandle& Context, bool bIncludeActorArray) const +{ + FGameplayAbilityTargetData_SingleTargetHit::AddTargetDataToContext(Context, bIncludeActorArray); + + // Add game-specific data + if (FLyraGameplayEffectContext* TypedContext = FLyraGameplayEffectContext::ExtractEffectContext(Context)) + { + TypedContext->CartridgeID = CartridgeID; + } +} + +bool FLyraGameplayAbilityTargetData_SingleTargetHit::NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess) +{ + FGameplayAbilityTargetData_SingleTargetHit::NetSerialize(Ar, Map, bOutSuccess); + + Ar << CartridgeID; + + return true; +} + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayAbilityTargetData_SingleTargetHit.h b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayAbilityTargetData_SingleTargetHit.h new file mode 100644 index 0000000000000000000000000000000000000000..68ff37e1b37b118c297e9c01b6a8c60cf5e6a577 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayAbilityTargetData_SingleTargetHit.h @@ -0,0 +1,45 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Abilities/GameplayAbilityTargetTypes.h" + +#include "LyraGameplayAbilityTargetData_SingleTargetHit.generated.h" + +class FArchive; +struct FGameplayEffectContextHandle; + + +/** Game-specific additions to SingleTargetHit tracking */ +USTRUCT() +struct FLyraGameplayAbilityTargetData_SingleTargetHit : public FGameplayAbilityTargetData_SingleTargetHit +{ + GENERATED_BODY() + + FLyraGameplayAbilityTargetData_SingleTargetHit() + : CartridgeID(-1) + { } + + virtual void AddTargetDataToContext(FGameplayEffectContextHandle& Context, bool bIncludeActorArray) const override; + + /** ID to allow the identification of multiple bullets that were part of the same cartridge */ + UPROPERTY() + int32 CartridgeID; + + bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess); + + virtual UScriptStruct* GetScriptStruct() const override + { + return FLyraGameplayAbilityTargetData_SingleTargetHit::StaticStruct(); + } +}; + +template<> +struct TStructOpsTypeTraits : public TStructOpsTypeTraitsBase2 +{ + enum + { + WithNetSerializer = true // For now this is REQUIRED for FGameplayAbilityTargetDataHandle net serialization to work + }; +}; + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayCueManager.cpp b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayCueManager.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4b2fc413c502d3c4c862dcad3a7daf3a27da9e93 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayCueManager.cpp @@ -0,0 +1,406 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraGameplayCueManager.h" +#include "Engine/AssetManager.h" +#include "LyraLogChannels.h" +#include "GameplayCueSet.h" +#include "AbilitySystemGlobals.h" +#include "GameplayTagsManager.h" +#include "UObject/UObjectThreadContext.h" +#include "Async/Async.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraGameplayCueManager) + +////////////////////////////////////////////////////////////////////// + +enum class ELyraEditorLoadMode +{ + // Loads all cues upfront; longer loading speed in the editor but short PIE times and effects never fail to play + LoadUpfront, + + // Outside of editor: Async loads as cue tag are registered + // In editor: Async loads when cues are invoked + // Note: This can cause some 'why didn't I see the effect for X' issues in PIE and is good for iteration speed but otherwise bad for designers + PreloadAsCuesAreReferenced_GameOnly, + + // Async loads as cue tag are registered + PreloadAsCuesAreReferenced +}; + +namespace LyraGameplayCueManagerCvars +{ + static FAutoConsoleCommand CVarDumpGameplayCues( + TEXT("Lyra.DumpGameplayCues"), + TEXT("Shows all assets that were loaded via LyraGameplayCueManager and are currently in memory."), + FConsoleCommandWithArgsDelegate::CreateStatic(ULyraGameplayCueManager::DumpGameplayCues)); + + static ELyraEditorLoadMode LoadMode = ELyraEditorLoadMode::LoadUpfront; +} + +const bool bPreloadEvenInEditor = true; + +////////////////////////////////////////////////////////////////////// + +struct FGameplayCueTagThreadSynchronizeGraphTask : public FAsyncGraphTaskBase +{ + TFunction TheTask; + FGameplayCueTagThreadSynchronizeGraphTask(TFunction&& Task) : TheTask(MoveTemp(Task)) { } + void DoTask(ENamedThreads::Type CurrentThread, const FGraphEventRef& MyCompletionGraphEvent) { TheTask(); } + ENamedThreads::Type GetDesiredThread() { return ENamedThreads::GameThread; } +}; + +////////////////////////////////////////////////////////////////////// + +ULyraGameplayCueManager::ULyraGameplayCueManager(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +ULyraGameplayCueManager* ULyraGameplayCueManager::Get() +{ + return Cast(UAbilitySystemGlobals::Get().GetGameplayCueManager()); +} + +void ULyraGameplayCueManager::OnCreated() +{ + Super::OnCreated(); + + UpdateDelayLoadDelegateListeners(); +} + +void ULyraGameplayCueManager::LoadAlwaysLoadedCues() +{ + if (ShouldDelayLoadGameplayCues()) + { + UGameplayTagsManager& TagManager = UGameplayTagsManager::Get(); + + //@TODO: Try to collect these by filtering GameplayCue. tags out of native gameplay tags? + TArray AdditionalAlwaysLoadedCueTags; + + for (const FName& CueTagName : AdditionalAlwaysLoadedCueTags) + { + FGameplayTag CueTag = TagManager.RequestGameplayTag(CueTagName, /*ErrorIfNotFound=*/ false); + if (CueTag.IsValid()) + { + ProcessTagToPreload(CueTag, nullptr); + } + else + { + UE_LOG(LogLyra, Warning, TEXT("ULyraGameplayCueManager::AdditionalAlwaysLoadedCueTags contains invalid tag %s"), *CueTagName.ToString()); + } + } + } +} + +bool ULyraGameplayCueManager::ShouldAsyncLoadRuntimeObjectLibraries() const +{ + switch (LyraGameplayCueManagerCvars::LoadMode) + { + case ELyraEditorLoadMode::LoadUpfront: + return true; + case ELyraEditorLoadMode::PreloadAsCuesAreReferenced_GameOnly: +#if WITH_EDITOR + if (GIsEditor) + { + return false; + } +#endif + break; + case ELyraEditorLoadMode::PreloadAsCuesAreReferenced: + break; + } + + return !ShouldDelayLoadGameplayCues(); +} + +bool ULyraGameplayCueManager::ShouldSyncLoadMissingGameplayCues() const +{ + return false; +} + +bool ULyraGameplayCueManager::ShouldAsyncLoadMissingGameplayCues() const +{ + return true; +} + +void ULyraGameplayCueManager::DumpGameplayCues(const TArray& Args) +{ + ULyraGameplayCueManager* GCM = Cast(UAbilitySystemGlobals::Get().GetGameplayCueManager()); + if (!GCM) + { + UE_LOG(LogLyra, Error, TEXT("DumpGameplayCues failed. No ULyraGameplayCueManager found.")); + return; + } + + const bool bIncludeRefs = Args.Contains(TEXT("Refs")); + + UE_LOG(LogLyra, Log, TEXT("=========== Dumping Always Loaded Gameplay Cue Notifies ===========")); + for (UClass* CueClass : GCM->AlwaysLoadedCues) + { + UE_LOG(LogLyra, Log, TEXT(" %s"), *GetPathNameSafe(CueClass)); + } + + UE_LOG(LogLyra, Log, TEXT("=========== Dumping Preloaded Gameplay Cue Notifies ===========")); + for (UClass* CueClass : GCM->PreloadedCues) + { + TSet* ReferencerSet = GCM->PreloadedCueReferencers.Find(CueClass); + int32 NumRefs = ReferencerSet ? ReferencerSet->Num() : 0; + UE_LOG(LogLyra, Log, TEXT(" %s (%d refs)"), *GetPathNameSafe(CueClass), NumRefs); + if (bIncludeRefs && ReferencerSet) + { + for (const FObjectKey& Ref : *ReferencerSet) + { + UObject* RefObject = Ref.ResolveObjectPtr(); + UE_LOG(LogLyra, Log, TEXT(" ^- %s"), *GetPathNameSafe(RefObject)); + } + } + } + + UE_LOG(LogLyra, Log, TEXT("=========== Dumping Gameplay Cue Notifies loaded on demand ===========")); + int32 NumMissingCuesLoaded = 0; + if (GCM->RuntimeGameplayCueObjectLibrary.CueSet) + { + for (const FGameplayCueNotifyData& CueData : GCM->RuntimeGameplayCueObjectLibrary.CueSet->GameplayCueData) + { + if (CueData.LoadedGameplayCueClass && !GCM->AlwaysLoadedCues.Contains(CueData.LoadedGameplayCueClass) && !GCM->PreloadedCues.Contains(CueData.LoadedGameplayCueClass)) + { + NumMissingCuesLoaded++; + UE_LOG(LogLyra, Log, TEXT(" %s"), *CueData.LoadedGameplayCueClass->GetPathName()); + } + } + } + + UE_LOG(LogLyra, Log, TEXT("=========== Gameplay Cue Notify summary ===========")); + UE_LOG(LogLyra, Log, TEXT(" ... %d cues in always loaded list"), GCM->AlwaysLoadedCues.Num()); + UE_LOG(LogLyra, Log, TEXT(" ... %d cues in preloaded list"), GCM->PreloadedCues.Num()); + UE_LOG(LogLyra, Log, TEXT(" ... %d cues loaded on demand"), NumMissingCuesLoaded); + UE_LOG(LogLyra, Log, TEXT(" ... %d cues in total"), GCM->AlwaysLoadedCues.Num() + GCM->PreloadedCues.Num() + NumMissingCuesLoaded); +} + +void ULyraGameplayCueManager::OnGameplayTagLoaded(const FGameplayTag& Tag) +{ + FScopeLock ScopeLock(&LoadedGameplayTagsToProcessCS); + bool bStartTask = LoadedGameplayTagsToProcess.Num() == 0; + FUObjectSerializeContext* LoadContext = FUObjectThreadContext::Get().GetSerializeContext(); + UObject* OwningObject = LoadContext ? LoadContext->SerializedObject : nullptr; + LoadedGameplayTagsToProcess.Emplace(Tag, OwningObject); + if (bStartTask) + { + TGraphTask::CreateTask().ConstructAndDispatchWhenReady([]() + { + if (GIsRunning) + { + if (ULyraGameplayCueManager* StrongThis = Get()) + { + // If we are garbage collecting we cannot call StaticFindObject (or a few other static uobject functions), so we'll just wait until the GC is over and process the tags then + if (IsGarbageCollecting()) + { + StrongThis->bProcessLoadedTagsAfterGC = true; + } + else + { + StrongThis->ProcessLoadedTags(); + } + } + } + }); + } +} + +void ULyraGameplayCueManager::HandlePostGarbageCollect() +{ + if (bProcessLoadedTagsAfterGC) + { + ProcessLoadedTags(); + } + bProcessLoadedTagsAfterGC = false; +} + +void ULyraGameplayCueManager::ProcessLoadedTags() +{ + TArray TaskLoadedGameplayTagsToProcess; + { + // Lock LoadedGameplayTagsToProcess just long enough to make a copy and clear + FScopeLock TaskScopeLock(&LoadedGameplayTagsToProcessCS); + TaskLoadedGameplayTagsToProcess = LoadedGameplayTagsToProcess; + LoadedGameplayTagsToProcess.Empty(); + } + + // This might return during shutdown, and we don't want to proceed if that is the case + if (GIsRunning) + { + if (RuntimeGameplayCueObjectLibrary.CueSet) + { + for (const FLoadedGameplayTagToProcessData& LoadedTagData : TaskLoadedGameplayTagsToProcess) + { + if (RuntimeGameplayCueObjectLibrary.CueSet->GameplayCueDataMap.Contains(LoadedTagData.Tag)) + { + if (!LoadedTagData.WeakOwner.IsStale()) + { + ProcessTagToPreload(LoadedTagData.Tag, LoadedTagData.WeakOwner.Get()); + } + } + } + } + else + { + UE_LOG(LogLyra, Warning, TEXT("ULyraGameplayCueManager::OnGameplayTagLoaded processed loaded tag(s) but RuntimeGameplayCueObjectLibrary.CueSet was null. Skipping processing.")); + } + } +} + +void ULyraGameplayCueManager::ProcessTagToPreload(const FGameplayTag& Tag, UObject* OwningObject) +{ + switch (LyraGameplayCueManagerCvars::LoadMode) + { + case ELyraEditorLoadMode::LoadUpfront: + return; + case ELyraEditorLoadMode::PreloadAsCuesAreReferenced_GameOnly: +#if WITH_EDITOR + if (GIsEditor) + { + return; + } +#endif + break; + case ELyraEditorLoadMode::PreloadAsCuesAreReferenced: + break; + } + + check(RuntimeGameplayCueObjectLibrary.CueSet); + + int32* DataIdx = RuntimeGameplayCueObjectLibrary.CueSet->GameplayCueDataMap.Find(Tag); + if (DataIdx && RuntimeGameplayCueObjectLibrary.CueSet->GameplayCueData.IsValidIndex(*DataIdx)) + { + const FGameplayCueNotifyData& CueData = RuntimeGameplayCueObjectLibrary.CueSet->GameplayCueData[*DataIdx]; + + UClass* LoadedGameplayCueClass = FindObject(nullptr, *CueData.GameplayCueNotifyObj.ToString()); + if (LoadedGameplayCueClass) + { + RegisterPreloadedCue(LoadedGameplayCueClass, OwningObject); + } + else + { + bool bAlwaysLoadedCue = OwningObject == nullptr; + TWeakObjectPtr WeakOwner = OwningObject; + StreamableManager.RequestAsyncLoad(CueData.GameplayCueNotifyObj, FStreamableDelegate::CreateUObject(this, &ThisClass::OnPreloadCueComplete, CueData.GameplayCueNotifyObj, WeakOwner, bAlwaysLoadedCue), FStreamableManager::DefaultAsyncLoadPriority, false, false, TEXT("GameplayCueManager")); + } + } +} + +void ULyraGameplayCueManager::OnPreloadCueComplete(FSoftObjectPath Path, TWeakObjectPtr OwningObject, bool bAlwaysLoadedCue) +{ + if (bAlwaysLoadedCue || OwningObject.IsValid()) + { + if (UClass* LoadedGameplayCueClass = Cast(Path.ResolveObject())) + { + RegisterPreloadedCue(LoadedGameplayCueClass, OwningObject.Get()); + } + } +} + +void ULyraGameplayCueManager::RegisterPreloadedCue(UClass* LoadedGameplayCueClass, UObject* OwningObject) +{ + check(LoadedGameplayCueClass); + + const bool bAlwaysLoadedCue = OwningObject == nullptr; + if (bAlwaysLoadedCue) + { + AlwaysLoadedCues.Add(LoadedGameplayCueClass); + PreloadedCues.Remove(LoadedGameplayCueClass); + PreloadedCueReferencers.Remove(LoadedGameplayCueClass); + } + else if ((OwningObject != LoadedGameplayCueClass) && (OwningObject != LoadedGameplayCueClass->GetDefaultObject()) && !AlwaysLoadedCues.Contains(LoadedGameplayCueClass)) + { + PreloadedCues.Add(LoadedGameplayCueClass); + TSet& ReferencerSet = PreloadedCueReferencers.FindOrAdd(LoadedGameplayCueClass); + ReferencerSet.Add(OwningObject); + } +} + +void ULyraGameplayCueManager::HandlePostLoadMap(UWorld* NewWorld) +{ + if (RuntimeGameplayCueObjectLibrary.CueSet) + { + for (UClass* CueClass : AlwaysLoadedCues) + { + RuntimeGameplayCueObjectLibrary.CueSet->RemoveLoadedClass(CueClass); + } + + for (UClass* CueClass : PreloadedCues) + { + RuntimeGameplayCueObjectLibrary.CueSet->RemoveLoadedClass(CueClass); + } + } + + for (auto CueIt = PreloadedCues.CreateIterator(); CueIt; ++CueIt) + { + TSet& ReferencerSet = PreloadedCueReferencers.FindChecked(*CueIt); + for (auto RefIt = ReferencerSet.CreateIterator(); RefIt; ++RefIt) + { + if (!RefIt->ResolveObjectPtr()) + { + RefIt.RemoveCurrent(); + } + } + if (ReferencerSet.Num() == 0) + { + PreloadedCueReferencers.Remove(*CueIt); + CueIt.RemoveCurrent(); + } + } +} + +void ULyraGameplayCueManager::UpdateDelayLoadDelegateListeners() +{ + UGameplayTagsManager::Get().OnGameplayTagLoadedDelegate.RemoveAll(this); + FCoreUObjectDelegates::GetPostGarbageCollect().RemoveAll(this); + FCoreUObjectDelegates::PostLoadMapWithWorld.RemoveAll(this); + + switch (LyraGameplayCueManagerCvars::LoadMode) + { + case ELyraEditorLoadMode::LoadUpfront: + return; + case ELyraEditorLoadMode::PreloadAsCuesAreReferenced_GameOnly: +#if WITH_EDITOR + if (GIsEditor) + { + return; + } +#endif + break; + case ELyraEditorLoadMode::PreloadAsCuesAreReferenced: + break; + } + + UGameplayTagsManager::Get().OnGameplayTagLoadedDelegate.AddUObject(this, &ThisClass::OnGameplayTagLoaded); + FCoreUObjectDelegates::GetPostGarbageCollect().AddUObject(this, &ThisClass::HandlePostGarbageCollect); + FCoreUObjectDelegates::PostLoadMapWithWorld.AddUObject(this, &ThisClass::HandlePostLoadMap); +} + +bool ULyraGameplayCueManager::ShouldDelayLoadGameplayCues() const +{ + const bool bClientDelayLoadGameplayCues = true; + return !IsRunningDedicatedServer() && bClientDelayLoadGameplayCues; +} + +const FPrimaryAssetType UFortAssetManager_GameplayCueRefsType = TEXT("GameplayCueRefs"); +const FName UFortAssetManager_GameplayCueRefsName = TEXT("GameplayCueReferences"); +const FName UFortAssetManager_LoadStateClient = FName(TEXT("Client")); + +void ULyraGameplayCueManager::RefreshGameplayCuePrimaryAsset() +{ + TArray CuePaths; + UGameplayCueSet* RuntimeGameplayCueSet = GetRuntimeCueSet(); + if (RuntimeGameplayCueSet) + { + RuntimeGameplayCueSet->GetSoftObjectPaths(CuePaths); + } + + FAssetBundleData BundleData; + BundleData.AddBundleAssetsTruncated(UFortAssetManager_LoadStateClient, CuePaths); + + FPrimaryAssetId PrimaryAssetId = FPrimaryAssetId(UFortAssetManager_GameplayCueRefsType, UFortAssetManager_GameplayCueRefsName); + UAssetManager::Get().AddDynamicAsset(PrimaryAssetId, FSoftObjectPath(), BundleData); +} + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayCueManager.h b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayCueManager.h new file mode 100644 index 0000000000000000000000000000000000000000..b8569078c71de952f876cd879de2ee82e39021b9 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayCueManager.h @@ -0,0 +1,79 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "GameplayCueManager.h" + +#include "LyraGameplayCueManager.generated.h" + +class FString; +class UClass; +class UObject; +class UWorld; +struct FObjectKey; + +/** + * ULyraGameplayCueManager + * + * Game-specific manager for gameplay cues + */ +UCLASS() +class ULyraGameplayCueManager : public UGameplayCueManager +{ + GENERATED_BODY() + +public: + ULyraGameplayCueManager(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + static ULyraGameplayCueManager* Get(); + + //~UGameplayCueManager interface + virtual void OnCreated() override; + virtual bool ShouldAsyncLoadRuntimeObjectLibraries() const override; + virtual bool ShouldSyncLoadMissingGameplayCues() const override; + virtual bool ShouldAsyncLoadMissingGameplayCues() const override; + //~End of UGameplayCueManager interface + + static void DumpGameplayCues(const TArray& Args); + + // When delay loading cues, this will load the cues that must be always loaded anyway + void LoadAlwaysLoadedCues(); + + // Updates the bundles for the singular gameplay cue primary asset + void RefreshGameplayCuePrimaryAsset(); + +private: + void OnGameplayTagLoaded(const FGameplayTag& Tag); + void HandlePostGarbageCollect(); + void ProcessLoadedTags(); + void ProcessTagToPreload(const FGameplayTag& Tag, UObject* OwningObject); + void OnPreloadCueComplete(FSoftObjectPath Path, TWeakObjectPtr OwningObject, bool bAlwaysLoadedCue); + void RegisterPreloadedCue(UClass* LoadedGameplayCueClass, UObject* OwningObject); + void HandlePostLoadMap(UWorld* NewWorld); + void UpdateDelayLoadDelegateListeners(); + bool ShouldDelayLoadGameplayCues() const; + +private: + struct FLoadedGameplayTagToProcessData + { + FGameplayTag Tag; + TWeakObjectPtr WeakOwner; + + FLoadedGameplayTagToProcessData() {} + FLoadedGameplayTagToProcessData(const FGameplayTag& InTag, const TWeakObjectPtr& InWeakOwner) : Tag(InTag), WeakOwner(InWeakOwner) {} + }; + +private: + // Cues that were preloaded on the client due to being referenced by content + UPROPERTY(transient) + TSet> PreloadedCues; + TMap> PreloadedCueReferencers; + + // Cues that were preloaded on the client and will always be loaded (code referenced or explicitly always loaded) + UPROPERTY(transient) + TSet> AlwaysLoadedCues; + + TArray LoadedGameplayTagsToProcess; + FCriticalSection LoadedGameplayTagsToProcessCS; + bool bProcessLoadedTagsAfterGC = false; +}; diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayEffectContext.cpp b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayEffectContext.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b2ed9dff919cce6f0f8eebd30b23ef0b49342de3 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayEffectContext.cpp @@ -0,0 +1,67 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraGameplayEffectContext.h" + +#include "AbilitySystem/LyraAbilitySourceInterface.h" +#include "Engine/HitResult.h" +#include "PhysicalMaterials/PhysicalMaterial.h" + +#if UE_WITH_IRIS +#include "Iris/ReplicationState/PropertyNetSerializerInfoRegistry.h" +#include "Serialization/GameplayEffectContextNetSerializer.h" +#endif + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraGameplayEffectContext) + +class FArchive; + +FLyraGameplayEffectContext* FLyraGameplayEffectContext::ExtractEffectContext(struct FGameplayEffectContextHandle Handle) +{ + FGameplayEffectContext* BaseEffectContext = Handle.Get(); + if ((BaseEffectContext != nullptr) && BaseEffectContext->GetScriptStruct()->IsChildOf(FLyraGameplayEffectContext::StaticStruct())) + { + return (FLyraGameplayEffectContext*)BaseEffectContext; + } + + return nullptr; +} + +bool FLyraGameplayEffectContext::NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess) +{ + FGameplayEffectContext::NetSerialize(Ar, Map, bOutSuccess); + + // Not serialized for post-activation use: + // CartridgeID + + return true; +} + +#if UE_WITH_IRIS +namespace UE::Net +{ + // Forward to FGameplayEffectContextNetSerializer + // Note: If FLyraGameplayEffectContext::NetSerialize() is modified, a custom NetSerializesr must be implemented as the current fallback will no longer be sufficient. + UE_NET_IMPLEMENT_FORWARDING_NETSERIALIZER_AND_REGISTRY_DELEGATES(LyraGameplayEffectContext, FGameplayEffectContextNetSerializer); +} +#endif + +void FLyraGameplayEffectContext::SetAbilitySource(const ILyraAbilitySourceInterface* InObject, float InSourceLevel) +{ + AbilitySourceObject = MakeWeakObjectPtr(Cast(InObject)); + //SourceLevel = InSourceLevel; +} + +const ILyraAbilitySourceInterface* FLyraGameplayEffectContext::GetAbilitySource() const +{ + return Cast(AbilitySourceObject.Get()); +} + +const UPhysicalMaterial* FLyraGameplayEffectContext::GetPhysicalMaterial() const +{ + if (const FHitResult* HitResultPtr = GetHitResult()) + { + return HitResultPtr->PhysMaterial.Get(); + } + return nullptr; +} + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayEffectContext.h b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayEffectContext.h new file mode 100644 index 0000000000000000000000000000000000000000..97ad10f09eb16b8a18a7b133e90a46f3b69cf0ee --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayEffectContext.h @@ -0,0 +1,82 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "GameplayEffectTypes.h" + +#include "LyraGameplayEffectContext.generated.h" + +class AActor; +class FArchive; +class ILyraAbilitySourceInterface; +class UObject; +class UPhysicalMaterial; + +USTRUCT() +struct FLyraGameplayEffectContext : public FGameplayEffectContext +{ + GENERATED_BODY() + + FLyraGameplayEffectContext() + : FGameplayEffectContext() + { + } + + FLyraGameplayEffectContext(AActor* InInstigator, AActor* InEffectCauser) + : FGameplayEffectContext(InInstigator, InEffectCauser) + { + } + + /** Returns the wrapped FLyraGameplayEffectContext from the handle, or nullptr if it doesn't exist or is the wrong type */ + static LYRAGAME_API FLyraGameplayEffectContext* ExtractEffectContext(struct FGameplayEffectContextHandle Handle); + + /** Sets the object used as the ability source */ + void SetAbilitySource(const ILyraAbilitySourceInterface* InObject, float InSourceLevel); + + /** Returns the ability source interface associated with the source object. Only valid on the authority. */ + const ILyraAbilitySourceInterface* GetAbilitySource() const; + + virtual FGameplayEffectContext* Duplicate() const override + { + FLyraGameplayEffectContext* NewContext = new FLyraGameplayEffectContext(); + *NewContext = *this; + if (GetHitResult()) + { + // Does a deep copy of the hit result + NewContext->AddHitResult(*GetHitResult(), true); + } + return NewContext; + } + + virtual UScriptStruct* GetScriptStruct() const override + { + return FLyraGameplayEffectContext::StaticStruct(); + } + + /** Overridden to serialize new fields */ + virtual bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess) override; + + /** Returns the physical material from the hit result if there is one */ + const UPhysicalMaterial* GetPhysicalMaterial() const; + +public: + /** ID to allow the identification of multiple bullets that were part of the same cartridge */ + UPROPERTY() + int32 CartridgeID = -1; + +protected: + /** Ability Source object (should implement ILyraAbilitySourceInterface). NOT replicated currently */ + UPROPERTY() + TWeakObjectPtr AbilitySourceObject; +}; + +template<> +struct TStructOpsTypeTraits : public TStructOpsTypeTraitsBase2 +{ + enum + { + WithNetSerializer = true, + WithCopy = true + }; +}; + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGlobalAbilitySystem.cpp b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGlobalAbilitySystem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b2a06aabf5c7976bd71de059171f73260bfa07ae --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGlobalAbilitySystem.cpp @@ -0,0 +1,156 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraGlobalAbilitySystem.h" + +#include "AbilitySystem/LyraAbilitySystemComponent.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraGlobalAbilitySystem) + +void FGlobalAppliedAbilityList::AddToASC(TSubclassOf Ability, ULyraAbilitySystemComponent* ASC) +{ + if (FGameplayAbilitySpecHandle* SpecHandle = Handles.Find(ASC)) + { + RemoveFromASC(ASC); + } + + UGameplayAbility* AbilityCDO = Ability->GetDefaultObject(); + FGameplayAbilitySpec AbilitySpec(AbilityCDO); + const FGameplayAbilitySpecHandle AbilitySpecHandle = ASC->GiveAbility(AbilitySpec); + Handles.Add(ASC, AbilitySpecHandle); +} + +void FGlobalAppliedAbilityList::RemoveFromASC(ULyraAbilitySystemComponent* ASC) +{ + if (FGameplayAbilitySpecHandle* SpecHandle = Handles.Find(ASC)) + { + ASC->ClearAbility(*SpecHandle); + Handles.Remove(ASC); + } +} + +void FGlobalAppliedAbilityList::RemoveFromAll() +{ + for (auto& KVP : Handles) + { + if (KVP.Key != nullptr) + { + KVP.Key->ClearAbility(KVP.Value); + } + } + Handles.Empty(); +} + + + +void FGlobalAppliedEffectList::AddToASC(TSubclassOf Effect, ULyraAbilitySystemComponent* ASC) +{ + if (FActiveGameplayEffectHandle* EffectHandle = Handles.Find(ASC)) + { + RemoveFromASC(ASC); + } + + const UGameplayEffect* GameplayEffectCDO = Effect->GetDefaultObject(); + const FActiveGameplayEffectHandle GameplayEffectHandle = ASC->ApplyGameplayEffectToSelf(GameplayEffectCDO, /*Level=*/ 1, ASC->MakeEffectContext()); + Handles.Add(ASC, GameplayEffectHandle); +} + +void FGlobalAppliedEffectList::RemoveFromASC(ULyraAbilitySystemComponent* ASC) +{ + if (FActiveGameplayEffectHandle* EffectHandle = Handles.Find(ASC)) + { + ASC->RemoveActiveGameplayEffect(*EffectHandle); + Handles.Remove(ASC); + } +} + +void FGlobalAppliedEffectList::RemoveFromAll() +{ + for (auto& KVP : Handles) + { + if (KVP.Key != nullptr) + { + KVP.Key->RemoveActiveGameplayEffect(KVP.Value); + } + } + Handles.Empty(); +} + +ULyraGlobalAbilitySystem::ULyraGlobalAbilitySystem() +{ +} + +void ULyraGlobalAbilitySystem::ApplyAbilityToAll(TSubclassOf Ability) +{ + if ((Ability.Get() != nullptr) && (!AppliedAbilities.Contains(Ability))) + { + FGlobalAppliedAbilityList& Entry = AppliedAbilities.Add(Ability); + for (ULyraAbilitySystemComponent* ASC : RegisteredASCs) + { + Entry.AddToASC(Ability, ASC); + } + } +} + +void ULyraGlobalAbilitySystem::ApplyEffectToAll(TSubclassOf Effect) +{ + if ((Effect.Get() != nullptr) && (!AppliedEffects.Contains(Effect))) + { + FGlobalAppliedEffectList& Entry = AppliedEffects.Add(Effect); + for (ULyraAbilitySystemComponent* ASC : RegisteredASCs) + { + Entry.AddToASC(Effect, ASC); + } + } +} + +void ULyraGlobalAbilitySystem::RemoveAbilityFromAll(TSubclassOf Ability) +{ + if ((Ability.Get() != nullptr) && AppliedAbilities.Contains(Ability)) + { + FGlobalAppliedAbilityList& Entry = AppliedAbilities[Ability]; + Entry.RemoveFromAll(); + AppliedAbilities.Remove(Ability); + } +} + +void ULyraGlobalAbilitySystem::RemoveEffectFromAll(TSubclassOf Effect) +{ + if ((Effect.Get() != nullptr) && AppliedEffects.Contains(Effect)) + { + FGlobalAppliedEffectList& Entry = AppliedEffects[Effect]; + Entry.RemoveFromAll(); + AppliedEffects.Remove(Effect); + } +} + +void ULyraGlobalAbilitySystem::RegisterASC(ULyraAbilitySystemComponent* ASC) +{ + check(ASC); + + for (auto& Entry : AppliedAbilities) + { + Entry.Value.AddToASC(Entry.Key, ASC); + } + for (auto& Entry : AppliedEffects) + { + Entry.Value.AddToASC(Entry.Key, ASC); + } + + RegisteredASCs.AddUnique(ASC); +} + +void ULyraGlobalAbilitySystem::UnregisterASC(ULyraAbilitySystemComponent* ASC) +{ + check(ASC); + for (auto& Entry : AppliedAbilities) + { + Entry.Value.RemoveFromASC(ASC); + } + for (auto& Entry : AppliedEffects) + { + Entry.Value.RemoveFromASC(ASC); + } + + RegisteredASCs.Remove(ASC); +} + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGlobalAbilitySystem.h b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGlobalAbilitySystem.h new file mode 100644 index 0000000000000000000000000000000000000000..ebc0d45c169985bd7e6a6721a6554d832aace308 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGlobalAbilitySystem.h @@ -0,0 +1,81 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "ActiveGameplayEffectHandle.h" +#include "Subsystems/WorldSubsystem.h" +#include "GameplayAbilitySpecHandle.h" +#include "Templates/SubclassOf.h" + +#include "LyraGlobalAbilitySystem.generated.h" + +class UGameplayAbility; +class UGameplayEffect; +class ULyraAbilitySystemComponent; +class UObject; +struct FActiveGameplayEffectHandle; +struct FFrame; +struct FGameplayAbilitySpecHandle; + +USTRUCT() +struct FGlobalAppliedAbilityList +{ + GENERATED_BODY() + + UPROPERTY() + TMap, FGameplayAbilitySpecHandle> Handles; + + void AddToASC(TSubclassOf Ability, ULyraAbilitySystemComponent* ASC); + void RemoveFromASC(ULyraAbilitySystemComponent* ASC); + void RemoveFromAll(); +}; + +USTRUCT() +struct FGlobalAppliedEffectList +{ + GENERATED_BODY() + + UPROPERTY() + TMap, FActiveGameplayEffectHandle> Handles; + + void AddToASC(TSubclassOf Effect, ULyraAbilitySystemComponent* ASC); + void RemoveFromASC(ULyraAbilitySystemComponent* ASC); + void RemoveFromAll(); +}; + +UCLASS() +class ULyraGlobalAbilitySystem : public UWorldSubsystem +{ + GENERATED_BODY() + +public: + ULyraGlobalAbilitySystem(); + + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category="Lyra") + void ApplyAbilityToAll(TSubclassOf Ability); + + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category="Lyra") + void ApplyEffectToAll(TSubclassOf Effect); + + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category = "Lyra") + void RemoveAbilityFromAll(TSubclassOf Ability); + + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category = "Lyra") + void RemoveEffectFromAll(TSubclassOf Effect); + + /** Register an ASC with global system and apply any active global effects/abilities. */ + void RegisterASC(ULyraAbilitySystemComponent* ASC); + + /** Removes an ASC from the global system, along with any active global effects/abilities. */ + void UnregisterASC(ULyraAbilitySystemComponent* ASC); + +private: + UPROPERTY() + TMap, FGlobalAppliedAbilityList> AppliedAbilities; + + UPROPERTY() + TMap, FGlobalAppliedEffectList> AppliedEffects; + + UPROPERTY() + TArray> RegisteredASCs; +}; diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraTaggedActor.cpp b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraTaggedActor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..eda800ab6459f2afc3982a4119b309f8fee3b83d --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraTaggedActor.cpp @@ -0,0 +1,30 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraTaggedActor.h" +#include "UObject/UnrealType.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraTaggedActor) + +ALyraTaggedActor::ALyraTaggedActor(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void ALyraTaggedActor::GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const +{ + TagContainer.AppendTags(StaticGameplayTags); +} + +#if WITH_EDITOR +bool ALyraTaggedActor::CanEditChange(const FProperty* InProperty) const +{ + // Prevent editing of the other tags property + if (InProperty->GetFName() == GET_MEMBER_NAME_CHECKED(AActor, Tags)) + { + return false; + } + + return Super::CanEditChange(InProperty); +} +#endif + diff --git a/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraTaggedActor.h b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraTaggedActor.h new file mode 100644 index 0000000000000000000000000000000000000000..4e95f800aa319266baf01de5143a1cdc6afb0ded --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraTaggedActor.h @@ -0,0 +1,36 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "GameFramework/Actor.h" +#include "GameplayTagAssetInterface.h" +#include "GameplayTagContainer.h" + +#include "LyraTaggedActor.generated.h" + +// An actor that implements the gameplay tag asset interface +UCLASS() +class ALyraTaggedActor : public AActor, public IGameplayTagAssetInterface +{ + GENERATED_BODY() + +public: + + ALyraTaggedActor(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + //~IGameplayTagAssetInterface + virtual void GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const override; + //~End of IGameplayTagAssetInterface + + //~UObject interface +#if WITH_EDITOR + virtual bool CanEditChange(const FProperty* InProperty) const override; +#endif + //~End of UObject interface + +protected: + // Gameplay-related tags associated with this actor + UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Actor) + FGameplayTagContainer StaticGameplayTags; +}; + diff --git a/LyraStarterGame/Source/LyraGame/Animation/LyraAnimInstance.cpp b/LyraStarterGame/Source/LyraGame/Animation/LyraAnimInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..feaf8298c82b00fe5c3b40f16679996a1c07f65a --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Animation/LyraAnimInstance.cpp @@ -0,0 +1,65 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraAnimInstance.h" +#include "AbilitySystemGlobals.h" +#include "Character/LyraCharacter.h" +#include "Character/LyraCharacterMovementComponent.h" + +#if WITH_EDITOR +#include "Misc/DataValidation.h" +#endif + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraAnimInstance) + + +ULyraAnimInstance::ULyraAnimInstance(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void ULyraAnimInstance::InitializeWithAbilitySystem(UAbilitySystemComponent* ASC) +{ + check(ASC); + + GameplayTagPropertyMap.Initialize(this, ASC); +} + +#if WITH_EDITOR +EDataValidationResult ULyraAnimInstance::IsDataValid(FDataValidationContext& Context) const +{ + Super::IsDataValid(Context); + + GameplayTagPropertyMap.IsDataValid(this, Context); + + return ((Context.GetNumErrors() > 0) ? EDataValidationResult::Invalid : EDataValidationResult::Valid); +} +#endif // WITH_EDITOR + +void ULyraAnimInstance::NativeInitializeAnimation() +{ + Super::NativeInitializeAnimation(); + + if (AActor* OwningActor = GetOwningActor()) + { + if (UAbilitySystemComponent* ASC = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(OwningActor)) + { + InitializeWithAbilitySystem(ASC); + } + } +} + +void ULyraAnimInstance::NativeUpdateAnimation(float DeltaSeconds) +{ + Super::NativeUpdateAnimation(DeltaSeconds); + + const ALyraCharacter* Character = Cast(GetOwningActor()); + if (!Character) + { + return; + } + + ULyraCharacterMovementComponent* CharMoveComp = CastChecked(Character->GetCharacterMovement()); + const FLyraCharacterGroundInfo& GroundInfo = CharMoveComp->GetGroundInfo(); + GroundDistance = GroundInfo.GroundDistance; +} + diff --git a/LyraStarterGame/Source/LyraGame/Animation/LyraAnimInstance.h b/LyraStarterGame/Source/LyraGame/Animation/LyraAnimInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..04ddb6cbadc7bce7c154a3a40e3242cdd1944cb6 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Animation/LyraAnimInstance.h @@ -0,0 +1,46 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Animation/AnimInstance.h" +#include "GameplayEffectTypes.h" +#include "LyraAnimInstance.generated.h" + +class UAbilitySystemComponent; + + +/** + * ULyraAnimInstance + * + * The base game animation instance class used by this project. + */ +UCLASS(Config = Game) +class ULyraAnimInstance : public UAnimInstance +{ + GENERATED_BODY() + +public: + + ULyraAnimInstance(const FObjectInitializer& ObjectInitializer); + + virtual void InitializeWithAbilitySystem(UAbilitySystemComponent* ASC); + +protected: + +#if WITH_EDITOR + virtual EDataValidationResult IsDataValid(class FDataValidationContext& Context) const override; +#endif // WITH_EDITOR + + virtual void NativeInitializeAnimation() override; + virtual void NativeUpdateAnimation(float DeltaSeconds) override; + +protected: + + // Gameplay tags that can be mapped to blueprint variables. The variables will automatically update as the tags are added or removed. + // These should be used instead of manually querying for the gameplay tags. + UPROPERTY(EditDefaultsOnly, Category = "GameplayTags") + FGameplayTagBlueprintPropertyMap GameplayTagPropertyMap; + + UPROPERTY(BlueprintReadOnly, Category = "Character State Data") + float GroundDistance = -1.0f; +}; diff --git a/LyraStarterGame/Source/LyraGame/Audio/LyraAudioMixEffectsSubsystem.cpp b/LyraStarterGame/Source/LyraGame/Audio/LyraAudioMixEffectsSubsystem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..945a03ce371f8a7ced00ad4ec544f4f4c5e04671 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Audio/LyraAudioMixEffectsSubsystem.cpp @@ -0,0 +1,353 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + + +#include "Audio/LyraAudioMixEffectsSubsystem.h" + +#include "AudioMixerBlueprintLibrary.h" +#include "AudioModulationStatics.h" +#include "Engine/GameInstance.h" +#include "Engine/World.h" +#include "LoadingScreenManager.h" +#include "LyraAudioSettings.h" +#include "Settings/LyraSettingsLocal.h" +#include "Sound/SoundEffectSubmix.h" +#include "SoundControlBus.h" +#include "SoundControlBusMix.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraAudioMixEffectsSubsystem) + +class FSubsystemCollectionBase; + +void ULyraAudioMixEffectsSubsystem::Initialize(FSubsystemCollectionBase& Collection) +{ + Super::Initialize(Collection); +} + +void ULyraAudioMixEffectsSubsystem::Deinitialize() +{ + if (ULoadingScreenManager* LoadingScreenManager = UGameInstance::GetSubsystem(GetWorld()->GetGameInstance())) + { + LoadingScreenManager->OnLoadingScreenVisibilityChangedDelegate().RemoveAll(this); + ApplyOrRemoveLoadingScreenMix(false); + } + + Super::Deinitialize(); +} + +bool ULyraAudioMixEffectsSubsystem::ShouldCreateSubsystem(UObject* Outer) const +{ + bool bShouldCreateSubsystem = Super::ShouldCreateSubsystem(Outer); + + if (Outer) + { + if (UWorld* World = Outer->GetWorld()) + { + bShouldCreateSubsystem = DoesSupportWorldType(World->WorldType) && bShouldCreateSubsystem; + } + } + + return bShouldCreateSubsystem; +} + +void ULyraAudioMixEffectsSubsystem::PostInitialize() +{ + if (const ULyraAudioSettings* LyraAudioSettings = GetDefault()) + { + if (UObject* ObjPath = LyraAudioSettings->DefaultControlBusMix.TryLoad()) + { + if (USoundControlBusMix* SoundControlBusMix = Cast(ObjPath)) + { + DefaultBaseMix = SoundControlBusMix; + } + else + { + ensureMsgf(SoundControlBusMix, TEXT("Default Control Bus Mix reference missing from Lyra Audio Settings.")); + } + } + + if (UObject* ObjPath = LyraAudioSettings->LoadingScreenControlBusMix.TryLoad()) + { + if (USoundControlBusMix* SoundControlBusMix = Cast(ObjPath)) + { + LoadingScreenMix = SoundControlBusMix; + } + else + { + ensureMsgf(SoundControlBusMix, TEXT("Loading Screen Control Bus Mix reference missing from Lyra Audio Settings.")); + } + } + + if (UObject* ObjPath = LyraAudioSettings->UserSettingsControlBusMix.TryLoad()) + { + if (USoundControlBusMix* SoundControlBusMix = Cast(ObjPath)) + { + UserMix = SoundControlBusMix; + } + else + { + ensureMsgf(SoundControlBusMix, TEXT("User Control Bus Mix reference missing from Lyra Audio Settings.")); + } + } + + if (UObject* ObjPath = LyraAudioSettings->OverallVolumeControlBus.TryLoad()) + { + if (USoundControlBus* SoundControlBus = Cast(ObjPath)) + { + OverallControlBus = SoundControlBus; + } + else + { + ensureMsgf(SoundControlBus, TEXT("Overall Control Bus reference missing from Lyra Audio Settings.")); + } + } + + if (UObject* ObjPath = LyraAudioSettings->MusicVolumeControlBus.TryLoad()) + { + if (USoundControlBus* SoundControlBus = Cast(ObjPath)) + { + MusicControlBus = SoundControlBus; + } + else + { + ensureMsgf(SoundControlBus, TEXT("Music Control Bus reference missing from Lyra Audio Settings.")); + } + } + + if (UObject* ObjPath = LyraAudioSettings->SoundFXVolumeControlBus.TryLoad()) + { + if (USoundControlBus* SoundControlBus = Cast(ObjPath)) + { + SoundFXControlBus = SoundControlBus; + } + else + { + ensureMsgf(SoundControlBus, TEXT("SoundFX Control Bus reference missing from Lyra Audio Settings.")); + } + } + + if (UObject* ObjPath = LyraAudioSettings->DialogueVolumeControlBus.TryLoad()) + { + if (USoundControlBus* SoundControlBus = Cast(ObjPath)) + { + DialogueControlBus = SoundControlBus; + } + else + { + ensureMsgf(SoundControlBus, TEXT("Dialogue Control Bus reference missing from Lyra Audio Settings.")); + } + } + + if (UObject* ObjPath = LyraAudioSettings->VoiceChatVolumeControlBus.TryLoad()) + { + if (USoundControlBus* SoundControlBus = Cast(ObjPath)) + { + VoiceChatControlBus = SoundControlBus; + } + else + { + ensureMsgf(SoundControlBus, TEXT("VoiceChat Control Bus reference missing from Lyra Audio Settings.")); + } + } + + // Load HDR Submix Effect Chain + for (const FLyraSubmixEffectChainMap& SoftSubmixEffectChain : LyraAudioSettings->HDRAudioSubmixEffectChain) + { + FLyraAudioSubmixEffectsChain NewEffectChain; + + if (UObject* SubmixObjPath = SoftSubmixEffectChain.Submix.LoadSynchronous()) + { + if (USoundSubmix* Submix = Cast(SubmixObjPath)) + { + NewEffectChain.Submix = Submix; + TArray NewPresetChain; + + for (const TSoftObjectPtr& SoftEffect : SoftSubmixEffectChain.SubmixEffectChain) + { + if (UObject* EffectObjPath = SoftEffect.LoadSynchronous()) + { + if (USoundEffectSubmixPreset* SubmixPreset = Cast(EffectObjPath)) + { + NewPresetChain.Add(SubmixPreset); + } + } + } + + NewEffectChain.SubmixEffectChain.Append(NewPresetChain); + } + } + + HDRSubmixEffectChain.Add(NewEffectChain); + } + + // Load LDR Submix Effect Chain + for (const FLyraSubmixEffectChainMap& SoftSubmixEffectChain : LyraAudioSettings->LDRAudioSubmixEffectChain) + { + FLyraAudioSubmixEffectsChain NewEffectChain; + + if (UObject* SubmixObjPath = SoftSubmixEffectChain.Submix.LoadSynchronous()) + { + if (USoundSubmix* Submix = Cast(SubmixObjPath)) + { + NewEffectChain.Submix = Submix; + TArray NewPresetChain; + + for (const TSoftObjectPtr& SoftEffect : SoftSubmixEffectChain.SubmixEffectChain) + { + if (UObject* EffectObjPath = SoftEffect.LoadSynchronous()) + { + if (USoundEffectSubmixPreset* SubmixPreset = Cast(EffectObjPath)) + { + NewPresetChain.Add(SubmixPreset); + } + } + } + + NewEffectChain.SubmixEffectChain.Append(NewPresetChain); + } + } + + LDRSubmixEffectChain.Add(NewEffectChain); + } + } + + // Register with the loading screen manager + if (ULoadingScreenManager* LoadingScreenManager = UGameInstance::GetSubsystem(GetWorld()->GetGameInstance())) + { + LoadingScreenManager->OnLoadingScreenVisibilityChangedDelegate().AddUObject(this, &ThisClass::OnLoadingScreenStatusChanged); + ApplyOrRemoveLoadingScreenMix(LoadingScreenManager->GetLoadingScreenDisplayStatus()); + } +} + +void ULyraAudioMixEffectsSubsystem::OnWorldBeginPlay(UWorld& InWorld) +{ + if (const UWorld* World = InWorld.GetWorld()) + { + // Activate the default base mix + if (DefaultBaseMix) + { + UAudioModulationStatics::ActivateBusMix(World, DefaultBaseMix); + } + + // Retrieve the user settings + if (const ULyraSettingsLocal* LyraSettingsLocal = GetDefault()) + { + // Activate the User Mix + if (UserMix) + { + UAudioModulationStatics::ActivateBusMix(World, UserMix); + + if (OverallControlBus && MusicControlBus && SoundFXControlBus && DialogueControlBus && VoiceChatControlBus) + { + const FSoundControlBusMixStage OverallControlBusMixStage = UAudioModulationStatics::CreateBusMixStage(World, OverallControlBus, LyraSettingsLocal->GetOverallVolume()); + const FSoundControlBusMixStage MusicControlBusMixStage = UAudioModulationStatics::CreateBusMixStage(World, MusicControlBus, LyraSettingsLocal->GetMusicVolume()); + const FSoundControlBusMixStage SoundFXControlBusMixStage = UAudioModulationStatics::CreateBusMixStage(World, SoundFXControlBus, LyraSettingsLocal->GetSoundFXVolume()); + const FSoundControlBusMixStage DialogueControlBusMixStage = UAudioModulationStatics::CreateBusMixStage(World, DialogueControlBus, LyraSettingsLocal->GetDialogueVolume()); + const FSoundControlBusMixStage VoiceChatControlBusMixStage = UAudioModulationStatics::CreateBusMixStage(World, VoiceChatControlBus, LyraSettingsLocal->GetVoiceChatVolume()); + + TArray ControlBusMixStageArray; + ControlBusMixStageArray.Add(OverallControlBusMixStage); + ControlBusMixStageArray.Add(MusicControlBusMixStage); + ControlBusMixStageArray.Add(SoundFXControlBusMixStage); + ControlBusMixStageArray.Add(DialogueControlBusMixStage); + ControlBusMixStageArray.Add(VoiceChatControlBusMixStage); + + UAudioModulationStatics::UpdateMix(World, UserMix, ControlBusMixStageArray); + } + } + + ApplyDynamicRangeEffectsChains(LyraSettingsLocal->IsHDRAudioModeEnabled()); + } + } +} + +void ULyraAudioMixEffectsSubsystem::ApplyDynamicRangeEffectsChains(bool bHDRAudio) +{ + TArray AudioSubmixEffectsChainToApply; + TArray AudioSubmixEffectsChainToClear; + + // If HDR Audio is selected, then we clear out any existing LDR Submix Effect Chain Overrides + // otherwise the reverse is the case. + if (bHDRAudio) + { + AudioSubmixEffectsChainToApply.Append(HDRSubmixEffectChain); + AudioSubmixEffectsChainToClear.Append(LDRSubmixEffectChain); + } + else + { + AudioSubmixEffectsChainToApply.Append(LDRSubmixEffectChain); + AudioSubmixEffectsChainToClear.Append(HDRSubmixEffectChain); + } + + // We want to collect just the submixes we need to actually clear, otherwise they'll be overridden by the new settings + TArray SubmixesLeftToClear; + + // We want to get the submixes that are not being overridden by the new effect chains, so we can clear those out separately + for (const FLyraAudioSubmixEffectsChain& EffectChainToClear : AudioSubmixEffectsChainToClear) + { + bool bAddToList = true; + + for (const FLyraAudioSubmixEffectsChain& SubmixEffectChain : AudioSubmixEffectsChainToApply) + { + if (SubmixEffectChain.Submix == EffectChainToClear.Submix) + { + bAddToList = false; + + break; + } + } + + if (bAddToList) + { + SubmixesLeftToClear.Add(EffectChainToClear.Submix); + } + } + + + // Override submixes + for (const FLyraAudioSubmixEffectsChain& SubmixEffectChain : AudioSubmixEffectsChainToApply) + { + if (SubmixEffectChain.Submix) + { + UAudioMixerBlueprintLibrary::SetSubmixEffectChainOverride(GetWorld(), SubmixEffectChain.Submix, SubmixEffectChain.SubmixEffectChain, 0.1f); + + } + } + + // Clear remaining submixes + for (USoundSubmix* Submix : SubmixesLeftToClear) + { + UAudioMixerBlueprintLibrary::ClearSubmixEffectChainOverride(GetWorld(), Submix, 0.1f); + } +} + +void ULyraAudioMixEffectsSubsystem::OnLoadingScreenStatusChanged(bool bShowingLoadingScreen) +{ + ApplyOrRemoveLoadingScreenMix(bShowingLoadingScreen); +} + +void ULyraAudioMixEffectsSubsystem::ApplyOrRemoveLoadingScreenMix(bool bWantsLoadingScreenMix) +{ + UWorld* World = GetWorld(); + + if (bAppliedLoadingScreenMix != bWantsLoadingScreenMix && LoadingScreenMix && World) + { + if (bWantsLoadingScreenMix) + { + // Apply the mix + UAudioModulationStatics::ActivateBusMix(World, LoadingScreenMix); + } + else + { + // Remove the mix + UAudioModulationStatics::DeactivateBusMix(World, LoadingScreenMix); + } + bAppliedLoadingScreenMix = bWantsLoadingScreenMix; + } +} + +bool ULyraAudioMixEffectsSubsystem::DoesSupportWorldType(const EWorldType::Type World) const +{ + // We only need this subsystem on Game worlds (PIE included) + return (World == EWorldType::Game || World == EWorldType::PIE); +} + diff --git a/LyraStarterGame/Source/LyraGame/Audio/LyraAudioMixEffectsSubsystem.h b/LyraStarterGame/Source/LyraGame/Audio/LyraAudioMixEffectsSubsystem.h new file mode 100644 index 0000000000000000000000000000000000000000..cbb5b987242b5befcf36838931fed5f5bf690fe6 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Audio/LyraAudioMixEffectsSubsystem.h @@ -0,0 +1,112 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Subsystems/WorldSubsystem.h" + +#include "LyraAudioMixEffectsSubsystem.generated.h" + +#define UE_API LYRAGAME_API + +class FSubsystemCollectionBase; +class UObject; +class USoundControlBus; +class USoundControlBusMix; +class USoundEffectSubmixPreset; +class USoundSubmix; +class UWorld; + +USTRUCT() +struct FLyraAudioSubmixEffectsChain +{ + GENERATED_BODY() + + // Submix on which to apply the Submix Effect Chain Override + UPROPERTY(Transient) + TObjectPtr Submix = nullptr; + + // Submix Effect Chain Override (Effects processed in Array index order) + UPROPERTY(Transient) + TArray> SubmixEffectChain; +}; + +/** + * This subsystem is meant to automatically engage default and user control bus mixes + * to retrieve previously saved user settings and apply them to the activated user mix. + * Additionally, this subsystem will automatically apply HDR/LDR Audio Submix Effect Chain Overrides + * based on the user's preference for HDR Audio. Submix Effect Chain Overrides are defined in the + * Lyra Audio Settings. + */ +UCLASS(MinimalAPI) +class ULyraAudioMixEffectsSubsystem : public UWorldSubsystem +{ + GENERATED_BODY() + +public: + // USubsystem implementation Begin + UE_API virtual void Initialize(FSubsystemCollectionBase& Collection) override; + UE_API virtual void Deinitialize() override; + // USubsystem implementation End + + UE_API virtual bool ShouldCreateSubsystem(UObject* Outer) const override; + + /** Called once all UWorldSubsystems have been initialized */ + UE_API virtual void PostInitialize() override; + + /** Called when world is ready to start gameplay before the game mode transitions to the correct state and call BeginPlay on all actors */ + UE_API virtual void OnWorldBeginPlay(UWorld& InWorld) override; + + /** Set whether the HDR Audio Submix Effect Chain Override settings are applied */ + UE_API void ApplyDynamicRangeEffectsChains(bool bHDRAudio); + +protected: + UE_API void OnLoadingScreenStatusChanged(bool bShowingLoadingScreen); + UE_API void ApplyOrRemoveLoadingScreenMix(bool bWantsLoadingScreenMix); + + // Called when determining whether to create this Subsystem + UE_API virtual bool DoesSupportWorldType(const EWorldType::Type WorldType) const override; + + // Default Sound Control Bus Mix retrieved from the Lyra Audio Settings + UPROPERTY(Transient) + TObjectPtr DefaultBaseMix = nullptr; + + // Loading Screen Sound Control Bus Mix retrieved from the Lyra Audio Settings + UPROPERTY(Transient) + TObjectPtr LoadingScreenMix = nullptr; + + // User Sound Control Bus Mix retrieved from the Lyra Audio Settings + UPROPERTY(Transient) + TObjectPtr UserMix = nullptr; + + // Overall Sound Control Bus retrieved from the Lyra Audio Settings and linked to the UI and game settings in LyraSettingsLocal + UPROPERTY(Transient) + TObjectPtr OverallControlBus = nullptr; + + // Music Sound Control Bus retrieved from the Lyra Audio Settings and linked to the UI and game settings in LyraSettingsLocal + UPROPERTY(Transient) + TObjectPtr MusicControlBus = nullptr; + + // SoundFX Sound Control Bus retrieved from the Lyra Audio Settings and linked to the UI and game settings in LyraSettingsLocal + UPROPERTY(Transient) + TObjectPtr SoundFXControlBus = nullptr; + + // Dialogue Sound Control Bus retrieved from the Lyra Audio Settings and linked to the UI and game settings in LyraSettingsLocal + UPROPERTY(Transient) + TObjectPtr DialogueControlBus = nullptr; + + // VoiceChat Sound Control Bus retrieved from the Lyra Audio Settings and linked to the UI and game settings in LyraSettingsLocal + UPROPERTY(Transient) + TObjectPtr VoiceChatControlBus = nullptr; + + // Submix Effect Chain Overrides to apply when HDR Audio is turned on + UPROPERTY(Transient) + TArray HDRSubmixEffectChain; + + // Submix Effect hain Overrides to apply when HDR Audio is turned off + UPROPERTY(Transient) + TArray LDRSubmixEffectChain; + + bool bAppliedLoadingScreenMix = false; +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/Audio/LyraAudioSettings.cpp b/LyraStarterGame/Source/LyraGame/Audio/LyraAudioSettings.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a25cf6a3dd4a5b7afcf0ee93d36b5ceea16d009b --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Audio/LyraAudioSettings.cpp @@ -0,0 +1,8 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + + +#include "Audio/LyraAudioSettings.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraAudioSettings) + + diff --git a/LyraStarterGame/Source/LyraGame/Audio/LyraAudioSettings.h b/LyraStarterGame/Source/LyraGame/Audio/LyraAudioSettings.h new file mode 100644 index 0000000000000000000000000000000000000000..0f1aeb343c79384dce5f1521d534a6672cd4be99 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Audio/LyraAudioSettings.h @@ -0,0 +1,80 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Engine/DeveloperSettings.h" +#include "UObject/SoftObjectPtr.h" + +#include "LyraAudioSettings.generated.h" + +class UObject; +class USoundEffectSubmixPreset; +class USoundSubmix; + +USTRUCT() +struct FLyraSubmixEffectChainMap +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, meta = (AllowedClasses = "/Script/Engine.SoundSubmix")) + TSoftObjectPtr Submix = nullptr; + + UPROPERTY(EditAnywhere, meta = (AllowedClasses = "/Script/Engine.SoundEffectSubmixPreset")) + TArray> SubmixEffectChain; + +}; + +/** + * + */ +UCLASS(MinimalAPI, config = Game, defaultconfig, meta = (DisplayName = "LyraAudioSettings")) +class ULyraAudioSettings : public UDeveloperSettings +{ + GENERATED_BODY() + +public: + + /** The Default Base Control Bus Mix */ + UPROPERTY(config, EditAnywhere, Category = MixSettings, meta = (AllowedClasses = "/Script/AudioModulation.SoundControlBusMix")) + FSoftObjectPath DefaultControlBusMix; + + /** The Loading Screen Control Bus Mix - Called during loading screens to cover background audio events */ + UPROPERTY(config, EditAnywhere, Category = MixSettings, meta = (AllowedClasses = "/Script/AudioModulation.SoundControlBusMix")) + FSoftObjectPath LoadingScreenControlBusMix; + + /** The Default Base Control Bus Mix */ + UPROPERTY(config, EditAnywhere, Category = UserMixSettings, meta = (AllowedClasses = "/Script/AudioModulation.SoundControlBusMix")) + FSoftObjectPath UserSettingsControlBusMix; + + /** Control Bus assigned to the Overall sound volume setting */ + UPROPERTY(config, EditAnywhere, Category = UserMixSettings, meta = (AllowedClasses = "/Script/AudioModulation.SoundControlBus")) + FSoftObjectPath OverallVolumeControlBus; + + /** Control Bus assigned to the Music sound volume setting */ + UPROPERTY(config, EditAnywhere, Category = UserMixSettings, meta = (AllowedClasses = "/Script/AudioModulation.SoundControlBus")) + FSoftObjectPath MusicVolumeControlBus; + + /** Control Bus assigned to the SoundFX sound volume setting */ + UPROPERTY(config, EditAnywhere, Category = UserMixSettings, meta = (AllowedClasses = "/Script/AudioModulation.SoundControlBus")) + FSoftObjectPath SoundFXVolumeControlBus; + + /** Control Bus assigned to the Dialogue sound volume setting */ + UPROPERTY(config, EditAnywhere, Category = UserMixSettings, meta = (AllowedClasses = "/Script/AudioModulation.SoundControlBus")) + FSoftObjectPath DialogueVolumeControlBus; + + /** Control Bus assigned to the VoiceChat sound volume setting */ + UPROPERTY(config, EditAnywhere, Category = UserMixSettings, meta = (AllowedClasses = "/Script/AudioModulation.SoundControlBus")) + FSoftObjectPath VoiceChatVolumeControlBus; + + /** Submix Processing Chains to achieve high dynamic range audio output */ + UPROPERTY(config, EditAnywhere, Category = EffectSettings) + TArray HDRAudioSubmixEffectChain; + + /** Submix Processing Chains to achieve low dynamic range audio output */ + UPROPERTY(config, EditAnywhere, Category = EffectSettings) + TArray LDRAudioSubmixEffectChain; + +private: + + +}; diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraCameraAssistInterface.h b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraAssistInterface.h new file mode 100644 index 0000000000000000000000000000000000000000..4a6ff72060f7ac81a7d4d1dbc053e2b4d8e21a28 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraAssistInterface.h @@ -0,0 +1,41 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "CoreMinimal.h" +#include "UObject/Interface.h" + +#include "LyraCameraAssistInterface.generated.h" + +/** */ +UINTERFACE(BlueprintType) +class ULyraCameraAssistInterface : public UInterface +{ + GENERATED_BODY() +}; + +class ILyraCameraAssistInterface +{ + GENERATED_BODY() + +public: + /** + * Get the list of actors that we're allowing the camera to penetrate. Useful in 3rd person cameras + * when you need the following camera to ignore things like the a collection of view targets, the pawn, + * a vehicle..etc. + */ + virtual void GetIgnoredActorsForCameraPentration(TArray& OutActorsAllowPenetration) const { } + + /** + * The target actor to prevent penetration on. Normally, this is almost always the view target, which if + * unimplemented will remain true. However, sometimes the view target, isn't the same as the root actor + * you need to keep in frame. + */ + virtual TOptional GetCameraPreventPenetrationTarget() const + { + return TOptional(); + } + + /** Called if the camera penetrates the focal target. Useful if you want to hide the target actor when being overlapped. */ + virtual void OnCameraPenetratingTarget() { } +}; diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraCameraComponent.cpp b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraComponent.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1f638e8c73719d011cc1e9ca39ecf06307db8570 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraComponent.cpp @@ -0,0 +1,126 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraCameraComponent.h" + +#include "Engine/Canvas.h" +#include "Engine/Engine.h" +#include "GameFramework/Pawn.h" +#include "GameFramework/PlayerController.h" +#include "LyraCameraMode.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraCameraComponent) + + +ULyraCameraComponent::ULyraCameraComponent(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + CameraModeStack = nullptr; + FieldOfViewOffset = 0.0f; +} + +void ULyraCameraComponent::OnRegister() +{ + Super::OnRegister(); + + if (!CameraModeStack) + { + CameraModeStack = NewObject(this); + check(CameraModeStack); + } +} + +void ULyraCameraComponent::GetCameraView(float DeltaTime, FMinimalViewInfo& DesiredView) +{ + check(CameraModeStack); + + UpdateCameraModes(); + + FLyraCameraModeView CameraModeView; + CameraModeStack->EvaluateStack(DeltaTime, CameraModeView); + + // Keep player controller in sync with the latest view. + if (APawn* TargetPawn = Cast(GetTargetActor())) + { + if (APlayerController* PC = TargetPawn->GetController()) + { + PC->SetControlRotation(CameraModeView.ControlRotation); + } + } + + // Apply any offset that was added to the field of view. + CameraModeView.FieldOfView += FieldOfViewOffset; + FieldOfViewOffset = 0.0f; + + // Keep camera component in sync with the latest view. + SetWorldLocationAndRotation(CameraModeView.Location, CameraModeView.Rotation); + FieldOfView = CameraModeView.FieldOfView; + + // Fill in desired view. + DesiredView.Location = CameraModeView.Location; + DesiredView.Rotation = CameraModeView.Rotation; + DesiredView.FOV = CameraModeView.FieldOfView; + DesiredView.OrthoWidth = OrthoWidth; + DesiredView.OrthoNearClipPlane = OrthoNearClipPlane; + DesiredView.OrthoFarClipPlane = OrthoFarClipPlane; + DesiredView.AspectRatio = AspectRatio; + DesiredView.bConstrainAspectRatio = bConstrainAspectRatio; + DesiredView.bUseFieldOfViewForLOD = bUseFieldOfViewForLOD; + DesiredView.ProjectionMode = ProjectionMode; + + // See if the CameraActor wants to override the PostProcess settings used. + DesiredView.PostProcessBlendWeight = PostProcessBlendWeight; + if (PostProcessBlendWeight > 0.0f) + { + DesiredView.PostProcessSettings = PostProcessSettings; + } + + + if (IsXRHeadTrackedCamera()) + { + // In XR much of the camera behavior above is irrellevant, but the post process settings are not. + Super::GetCameraView(DeltaTime, DesiredView); + } +} + +void ULyraCameraComponent::UpdateCameraModes() +{ + check(CameraModeStack); + + if (CameraModeStack->IsStackActivate()) + { + if (DetermineCameraModeDelegate.IsBound()) + { + if (const TSubclassOf CameraMode = DetermineCameraModeDelegate.Execute()) + { + CameraModeStack->PushCameraMode(CameraMode); + } + } + } +} + +void ULyraCameraComponent::DrawDebug(UCanvas* Canvas) const +{ + check(Canvas); + + FDisplayDebugManager& DisplayDebugManager = Canvas->DisplayDebugManager; + + DisplayDebugManager.SetFont(GEngine->GetSmallFont()); + DisplayDebugManager.SetDrawColor(FColor::Yellow); + DisplayDebugManager.DrawString(FString::Printf(TEXT("LyraCameraComponent: %s"), *GetNameSafe(GetTargetActor()))); + + DisplayDebugManager.SetDrawColor(FColor::White); + DisplayDebugManager.DrawString(FString::Printf(TEXT(" Location: %s"), *GetComponentLocation().ToCompactString())); + DisplayDebugManager.DrawString(FString::Printf(TEXT(" Rotation: %s"), *GetComponentRotation().ToCompactString())); + DisplayDebugManager.DrawString(FString::Printf(TEXT(" FOV: %f"), FieldOfView)); + + check(CameraModeStack); + CameraModeStack->DrawDebug(Canvas); +} + +void ULyraCameraComponent::GetBlendInfo(float& OutWeightOfTopLayer, FGameplayTag& OutTagOfTopLayer) const +{ + check(CameraModeStack); + CameraModeStack->GetBlendInfo(/*out*/ OutWeightOfTopLayer, /*out*/ OutTagOfTopLayer); +} + + diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraCameraComponent.h b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraComponent.h new file mode 100644 index 0000000000000000000000000000000000000000..40ba9f5fad7d7a6a3a031c1869c842694bc7df21 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraComponent.h @@ -0,0 +1,70 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Camera/CameraComponent.h" +#include "GameFramework/Actor.h" + +#include "LyraCameraComponent.generated.h" + +class UCanvas; +class ULyraCameraMode; +class ULyraCameraModeStack; +class UObject; +struct FFrame; +struct FGameplayTag; +struct FMinimalViewInfo; +template class TSubclassOf; + +DECLARE_DELEGATE_RetVal(TSubclassOf, FLyraCameraModeDelegate); + + +/** + * ULyraCameraComponent + * + * The base camera component class used by this project. + */ +UCLASS() +class ULyraCameraComponent : public UCameraComponent +{ + GENERATED_BODY() + +public: + + ULyraCameraComponent(const FObjectInitializer& ObjectInitializer); + + // Returns the camera component if one exists on the specified actor. + UFUNCTION(BlueprintPure, Category = "Lyra|Camera") + static ULyraCameraComponent* FindCameraComponent(const AActor* Actor) { return (Actor ? Actor->FindComponentByClass() : nullptr); } + + // Returns the target actor that the camera is looking at. + virtual AActor* GetTargetActor() const { return GetOwner(); } + + // Delegate used to query for the best camera mode. + FLyraCameraModeDelegate DetermineCameraModeDelegate; + + // Add an offset to the field of view. The offset is only for one frame, it gets cleared once it is applied. + void AddFieldOfViewOffset(float FovOffset) { FieldOfViewOffset += FovOffset; } + + virtual void DrawDebug(UCanvas* Canvas) const; + + // Gets the tag associated with the top layer and the blend weight of it + void GetBlendInfo(float& OutWeightOfTopLayer, FGameplayTag& OutTagOfTopLayer) const; + +protected: + + virtual void OnRegister() override; + virtual void GetCameraView(float DeltaTime, FMinimalViewInfo& DesiredView) override; + + virtual void UpdateCameraModes(); + +protected: + + // Stack used to blend the camera modes. + UPROPERTY() + TObjectPtr CameraModeStack; + + // Offset applied to the field of view. The offset is only for one frame, it gets cleared once it is applied. + float FieldOfViewOffset; + +}; diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode.cpp b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d14b86bc8c212127d925932d70f0b113a0ae691c --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode.cpp @@ -0,0 +1,465 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraCameraMode.h" + +#include "Components/CapsuleComponent.h" +#include "Engine/Canvas.h" +#include "GameFramework/Character.h" +#include "LyraCameraComponent.h" +#include "LyraPlayerCameraManager.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraCameraMode) + + +////////////////////////////////////////////////////////////////////////// +// FLyraCameraModeView +////////////////////////////////////////////////////////////////////////// +FLyraCameraModeView::FLyraCameraModeView() + : Location(ForceInit) + , Rotation(ForceInit) + , ControlRotation(ForceInit) + , FieldOfView(LYRA_CAMERA_DEFAULT_FOV) +{ +} + +void FLyraCameraModeView::Blend(const FLyraCameraModeView& Other, float OtherWeight) +{ + if (OtherWeight <= 0.0f) + { + return; + } + else if (OtherWeight >= 1.0f) + { + *this = Other; + return; + } + + Location = FMath::Lerp(Location, Other.Location, OtherWeight); + + const FRotator DeltaRotation = (Other.Rotation - Rotation).GetNormalized(); + Rotation = Rotation + (OtherWeight * DeltaRotation); + + const FRotator DeltaControlRotation = (Other.ControlRotation - ControlRotation).GetNormalized(); + ControlRotation = ControlRotation + (OtherWeight * DeltaControlRotation); + + FieldOfView = FMath::Lerp(FieldOfView, Other.FieldOfView, OtherWeight); +} + + +////////////////////////////////////////////////////////////////////////// +// ULyraCameraMode +////////////////////////////////////////////////////////////////////////// +ULyraCameraMode::ULyraCameraMode() +{ + FieldOfView = LYRA_CAMERA_DEFAULT_FOV; + ViewPitchMin = LYRA_CAMERA_DEFAULT_PITCH_MIN; + ViewPitchMax = LYRA_CAMERA_DEFAULT_PITCH_MAX; + + BlendTime = 0.5f; + BlendFunction = ELyraCameraModeBlendFunction::EaseOut; + BlendExponent = 4.0f; + BlendAlpha = 1.0f; + BlendWeight = 1.0f; +} + +ULyraCameraComponent* ULyraCameraMode::GetLyraCameraComponent() const +{ + return CastChecked(GetOuter()); +} + +UWorld* ULyraCameraMode::GetWorld() const +{ + return HasAnyFlags(RF_ClassDefaultObject) ? nullptr : GetOuter()->GetWorld(); +} + +AActor* ULyraCameraMode::GetTargetActor() const +{ + const ULyraCameraComponent* LyraCameraComponent = GetLyraCameraComponent(); + + return LyraCameraComponent->GetTargetActor(); +} + +FVector ULyraCameraMode::GetPivotLocation() const +{ + const AActor* TargetActor = GetTargetActor(); + check(TargetActor); + + if (const APawn* TargetPawn = Cast(TargetActor)) + { + // Height adjustments for characters to account for crouching. + if (const ACharacter* TargetCharacter = Cast(TargetPawn)) + { + const ACharacter* TargetCharacterCDO = TargetCharacter->GetClass()->GetDefaultObject(); + check(TargetCharacterCDO); + + const UCapsuleComponent* CapsuleComp = TargetCharacter->GetCapsuleComponent(); + check(CapsuleComp); + + const UCapsuleComponent* CapsuleCompCDO = TargetCharacterCDO->GetCapsuleComponent(); + check(CapsuleCompCDO); + + const float DefaultHalfHeight = CapsuleCompCDO->GetUnscaledCapsuleHalfHeight(); + const float ActualHalfHeight = CapsuleComp->GetUnscaledCapsuleHalfHeight(); + const float HeightAdjustment = (DefaultHalfHeight - ActualHalfHeight) + TargetCharacterCDO->BaseEyeHeight; + + return TargetCharacter->GetActorLocation() + (FVector::UpVector * HeightAdjustment); + } + + return TargetPawn->GetPawnViewLocation(); + } + + return TargetActor->GetActorLocation(); +} + +FRotator ULyraCameraMode::GetPivotRotation() const +{ + const AActor* TargetActor = GetTargetActor(); + check(TargetActor); + + if (const APawn* TargetPawn = Cast(TargetActor)) + { + return TargetPawn->GetViewRotation(); + } + + return TargetActor->GetActorRotation(); +} + +void ULyraCameraMode::UpdateCameraMode(float DeltaTime) +{ + UpdateView(DeltaTime); + UpdateBlending(DeltaTime); +} + +void ULyraCameraMode::UpdateView(float DeltaTime) +{ + FVector PivotLocation = GetPivotLocation(); + FRotator PivotRotation = GetPivotRotation(); + + PivotRotation.Pitch = FMath::ClampAngle(PivotRotation.Pitch, ViewPitchMin, ViewPitchMax); + + View.Location = PivotLocation; + View.Rotation = PivotRotation; + View.ControlRotation = View.Rotation; + View.FieldOfView = FieldOfView; +} + +void ULyraCameraMode::SetBlendWeight(float Weight) +{ + BlendWeight = FMath::Clamp(Weight, 0.0f, 1.0f); + + // Since we're setting the blend weight directly, we need to calculate the blend alpha to account for the blend function. + const float InvExponent = (BlendExponent > 0.0f) ? (1.0f / BlendExponent) : 1.0f; + + switch (BlendFunction) + { + case ELyraCameraModeBlendFunction::Linear: + BlendAlpha = BlendWeight; + break; + + case ELyraCameraModeBlendFunction::EaseIn: + BlendAlpha = FMath::InterpEaseIn(0.0f, 1.0f, BlendWeight, InvExponent); + break; + + case ELyraCameraModeBlendFunction::EaseOut: + BlendAlpha = FMath::InterpEaseOut(0.0f, 1.0f, BlendWeight, InvExponent); + break; + + case ELyraCameraModeBlendFunction::EaseInOut: + BlendAlpha = FMath::InterpEaseInOut(0.0f, 1.0f, BlendWeight, InvExponent); + break; + + default: + checkf(false, TEXT("SetBlendWeight: Invalid BlendFunction [%d]\n"), (uint8)BlendFunction); + break; + } +} + +void ULyraCameraMode::UpdateBlending(float DeltaTime) +{ + if (BlendTime > 0.0f) + { + BlendAlpha += (DeltaTime / BlendTime); + BlendAlpha = FMath::Min(BlendAlpha, 1.0f); + } + else + { + BlendAlpha = 1.0f; + } + + const float Exponent = (BlendExponent > 0.0f) ? BlendExponent : 1.0f; + + switch (BlendFunction) + { + case ELyraCameraModeBlendFunction::Linear: + BlendWeight = BlendAlpha; + break; + + case ELyraCameraModeBlendFunction::EaseIn: + BlendWeight = FMath::InterpEaseIn(0.0f, 1.0f, BlendAlpha, Exponent); + break; + + case ELyraCameraModeBlendFunction::EaseOut: + BlendWeight = FMath::InterpEaseOut(0.0f, 1.0f, BlendAlpha, Exponent); + break; + + case ELyraCameraModeBlendFunction::EaseInOut: + BlendWeight = FMath::InterpEaseInOut(0.0f, 1.0f, BlendAlpha, Exponent); + break; + + default: + checkf(false, TEXT("UpdateBlending: Invalid BlendFunction [%d]\n"), (uint8)BlendFunction); + break; + } +} + +void ULyraCameraMode::DrawDebug(UCanvas* Canvas) const +{ + check(Canvas); + + FDisplayDebugManager& DisplayDebugManager = Canvas->DisplayDebugManager; + + DisplayDebugManager.SetDrawColor(FColor::White); + DisplayDebugManager.DrawString(FString::Printf(TEXT(" LyraCameraMode: %s (%f)"), *GetName(), BlendWeight)); +} + + +////////////////////////////////////////////////////////////////////////// +// ULyraCameraModeStack +////////////////////////////////////////////////////////////////////////// +ULyraCameraModeStack::ULyraCameraModeStack() +{ + bIsActive = true; +} + +void ULyraCameraModeStack::ActivateStack() +{ + if (!bIsActive) + { + bIsActive = true; + + // Notify camera modes that they are being activated. + for (ULyraCameraMode* CameraMode : CameraModeStack) + { + check(CameraMode); + CameraMode->OnActivation(); + } + } +} + +void ULyraCameraModeStack::DeactivateStack() +{ + if (bIsActive) + { + bIsActive = false; + + // Notify camera modes that they are being deactivated. + for (ULyraCameraMode* CameraMode : CameraModeStack) + { + check(CameraMode); + CameraMode->OnDeactivation(); + } + } +} + +void ULyraCameraModeStack::PushCameraMode(TSubclassOf CameraModeClass) +{ + if (!CameraModeClass) + { + return; + } + + ULyraCameraMode* CameraMode = GetCameraModeInstance(CameraModeClass); + check(CameraMode); + + int32 StackSize = CameraModeStack.Num(); + + if ((StackSize > 0) && (CameraModeStack[0] == CameraMode)) + { + // Already top of stack. + return; + } + + // See if it's already in the stack and remove it. + // Figure out how much it was contributing to the stack. + int32 ExistingStackIndex = INDEX_NONE; + float ExistingStackContribution = 1.0f; + + for (int32 StackIndex = 0; StackIndex < StackSize; ++StackIndex) + { + if (CameraModeStack[StackIndex] == CameraMode) + { + ExistingStackIndex = StackIndex; + ExistingStackContribution *= CameraMode->GetBlendWeight(); + break; + } + else + { + ExistingStackContribution *= (1.0f - CameraModeStack[StackIndex]->GetBlendWeight()); + } + } + + if (ExistingStackIndex != INDEX_NONE) + { + CameraModeStack.RemoveAt(ExistingStackIndex); + StackSize--; + } + else + { + ExistingStackContribution = 0.0f; + } + + // Decide what initial weight to start with. + const bool bShouldBlend = ((CameraMode->GetBlendTime() > 0.0f) && (StackSize > 0)); + const float BlendWeight = (bShouldBlend ? ExistingStackContribution : 1.0f); + + CameraMode->SetBlendWeight(BlendWeight); + + // Add new entry to top of stack. + CameraModeStack.Insert(CameraMode, 0); + + // Make sure stack bottom is always weighted 100%. + CameraModeStack.Last()->SetBlendWeight(1.0f); + + // Let the camera mode know if it's being added to the stack. + if (ExistingStackIndex == INDEX_NONE) + { + CameraMode->OnActivation(); + } +} + +bool ULyraCameraModeStack::EvaluateStack(float DeltaTime, FLyraCameraModeView& OutCameraModeView) +{ + if (!bIsActive) + { + return false; + } + + UpdateStack(DeltaTime); + BlendStack(OutCameraModeView); + + return true; +} + +ULyraCameraMode* ULyraCameraModeStack::GetCameraModeInstance(TSubclassOf CameraModeClass) +{ + check(CameraModeClass); + + // First see if we already created one. + for (ULyraCameraMode* CameraMode : CameraModeInstances) + { + if ((CameraMode != nullptr) && (CameraMode->GetClass() == CameraModeClass)) + { + return CameraMode; + } + } + + // Not found, so we need to create it. + ULyraCameraMode* NewCameraMode = NewObject(GetOuter(), CameraModeClass, NAME_None, RF_NoFlags); + check(NewCameraMode); + + CameraModeInstances.Add(NewCameraMode); + + return NewCameraMode; +} + +void ULyraCameraModeStack::UpdateStack(float DeltaTime) +{ + const int32 StackSize = CameraModeStack.Num(); + if (StackSize <= 0) + { + return; + } + + int32 RemoveCount = 0; + int32 RemoveIndex = INDEX_NONE; + + for (int32 StackIndex = 0; StackIndex < StackSize; ++StackIndex) + { + ULyraCameraMode* CameraMode = CameraModeStack[StackIndex]; + check(CameraMode); + + CameraMode->UpdateCameraMode(DeltaTime); + + if (CameraMode->GetBlendWeight() >= 1.0f) + { + // Everything below this mode is now irrelevant and can be removed. + RemoveIndex = (StackIndex + 1); + RemoveCount = (StackSize - RemoveIndex); + break; + } + } + + if (RemoveCount > 0) + { + // Let the camera modes know they being removed from the stack. + for (int32 StackIndex = RemoveIndex; StackIndex < StackSize; ++StackIndex) + { + ULyraCameraMode* CameraMode = CameraModeStack[StackIndex]; + check(CameraMode); + + CameraMode->OnDeactivation(); + } + + CameraModeStack.RemoveAt(RemoveIndex, RemoveCount); + } +} + +void ULyraCameraModeStack::BlendStack(FLyraCameraModeView& OutCameraModeView) const +{ + const int32 StackSize = CameraModeStack.Num(); + if (StackSize <= 0) + { + return; + } + + // Start at the bottom and blend up the stack + const ULyraCameraMode* CameraMode = CameraModeStack[StackSize - 1]; + check(CameraMode); + + OutCameraModeView = CameraMode->GetCameraModeView(); + + for (int32 StackIndex = (StackSize - 2); StackIndex >= 0; --StackIndex) + { + CameraMode = CameraModeStack[StackIndex]; + check(CameraMode); + + OutCameraModeView.Blend(CameraMode->GetCameraModeView(), CameraMode->GetBlendWeight()); + } +} + +void ULyraCameraModeStack::DrawDebug(UCanvas* Canvas) const +{ + check(Canvas); + + FDisplayDebugManager& DisplayDebugManager = Canvas->DisplayDebugManager; + + DisplayDebugManager.SetDrawColor(FColor::Green); + DisplayDebugManager.DrawString(FString(TEXT(" --- Camera Modes (Begin) ---"))); + + for (const ULyraCameraMode* CameraMode : CameraModeStack) + { + check(CameraMode); + CameraMode->DrawDebug(Canvas); + } + + DisplayDebugManager.SetDrawColor(FColor::Green); + DisplayDebugManager.DrawString(FString::Printf(TEXT(" --- Camera Modes (End) ---"))); +} + +void ULyraCameraModeStack::GetBlendInfo(float& OutWeightOfTopLayer, FGameplayTag& OutTagOfTopLayer) const +{ + if (CameraModeStack.Num() == 0) + { + OutWeightOfTopLayer = 1.0f; + OutTagOfTopLayer = FGameplayTag(); + return; + } + else + { + ULyraCameraMode* TopEntry = CameraModeStack.Last(); + check(TopEntry); + OutWeightOfTopLayer = TopEntry->GetBlendWeight(); + OutTagOfTopLayer = TopEntry->GetCameraTypeTag(); + } +} + diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode.h b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode.h new file mode 100644 index 0000000000000000000000000000000000000000..6dbbb34ce06765a120508fc76697319e430e974e --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode.h @@ -0,0 +1,203 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Engine/World.h" +#include "GameplayTagContainer.h" + +#include "LyraCameraMode.generated.h" + +#define UE_API LYRAGAME_API + +class AActor; +class UCanvas; +class ULyraCameraComponent; + +/** + * ELyraCameraModeBlendFunction + * + * Blend function used for transitioning between camera modes. + */ +UENUM(BlueprintType) +enum class ELyraCameraModeBlendFunction : uint8 +{ + // Does a simple linear interpolation. + Linear, + + // Immediately accelerates, but smoothly decelerates into the target. Ease amount controlled by the exponent. + EaseIn, + + // Smoothly accelerates, but does not decelerate into the target. Ease amount controlled by the exponent. + EaseOut, + + // Smoothly accelerates and decelerates. Ease amount controlled by the exponent. + EaseInOut, + + COUNT UMETA(Hidden) +}; + + +/** + * FLyraCameraModeView + * + * View data produced by the camera mode that is used to blend camera modes. + */ +struct FLyraCameraModeView +{ +public: + + FLyraCameraModeView(); + + void Blend(const FLyraCameraModeView& Other, float OtherWeight); + +public: + + FVector Location; + FRotator Rotation; + FRotator ControlRotation; + float FieldOfView; +}; + + +/** + * ULyraCameraMode + * + * Base class for all camera modes. + */ +UCLASS(MinimalAPI, Abstract, NotBlueprintable) +class ULyraCameraMode : public UObject +{ + GENERATED_BODY() + +public: + + UE_API ULyraCameraMode(); + + UE_API ULyraCameraComponent* GetLyraCameraComponent() const; + + UE_API virtual UWorld* GetWorld() const override; + + UE_API AActor* GetTargetActor() const; + + const FLyraCameraModeView& GetCameraModeView() const { return View; } + + // Called when this camera mode is activated on the camera mode stack. + virtual void OnActivation() {}; + + // Called when this camera mode is deactivated on the camera mode stack. + virtual void OnDeactivation() {}; + + UE_API void UpdateCameraMode(float DeltaTime); + + float GetBlendTime() const { return BlendTime; } + float GetBlendWeight() const { return BlendWeight; } + UE_API void SetBlendWeight(float Weight); + + FGameplayTag GetCameraTypeTag() const + { + return CameraTypeTag; + } + + UE_API virtual void DrawDebug(UCanvas* Canvas) const; + +protected: + + UE_API virtual FVector GetPivotLocation() const; + UE_API virtual FRotator GetPivotRotation() const; + + UE_API virtual void UpdateView(float DeltaTime); + UE_API virtual void UpdateBlending(float DeltaTime); + +protected: + // A tag that can be queried by gameplay code that cares when a kind of camera mode is active + // without having to ask about a specific mode (e.g., when aiming downsights to get more accuracy) + UPROPERTY(EditDefaultsOnly, Category = "Blending") + FGameplayTag CameraTypeTag; + + // View output produced by the camera mode. + FLyraCameraModeView View; + + // The horizontal field of view (in degrees). + UPROPERTY(EditDefaultsOnly, Category = "View", Meta = (UIMin = "5.0", UIMax = "170", ClampMin = "5.0", ClampMax = "170.0")) + float FieldOfView; + + // Minimum view pitch (in degrees). + UPROPERTY(EditDefaultsOnly, Category = "View", Meta = (UIMin = "-89.9", UIMax = "89.9", ClampMin = "-89.9", ClampMax = "89.9")) + float ViewPitchMin; + + // Maximum view pitch (in degrees). + UPROPERTY(EditDefaultsOnly, Category = "View", Meta = (UIMin = "-89.9", UIMax = "89.9", ClampMin = "-89.9", ClampMax = "89.9")) + float ViewPitchMax; + + // How long it takes to blend in this mode. + UPROPERTY(EditDefaultsOnly, Category = "Blending") + float BlendTime; + + // Function used for blending. + UPROPERTY(EditDefaultsOnly, Category = "Blending") + ELyraCameraModeBlendFunction BlendFunction; + + // Exponent used by blend functions to control the shape of the curve. + UPROPERTY(EditDefaultsOnly, Category = "Blending") + float BlendExponent; + + // Linear blend alpha used to determine the blend weight. + float BlendAlpha; + + // Blend weight calculated using the blend alpha and function. + float BlendWeight; + +protected: + /** If true, skips all interpolation and puts camera in ideal location. Automatically set to false next frame. */ + UPROPERTY(transient) + uint32 bResetInterpolation:1; +}; + + +/** + * ULyraCameraModeStack + * + * Stack used for blending camera modes. + */ +UCLASS() +class ULyraCameraModeStack : public UObject +{ + GENERATED_BODY() + +public: + + ULyraCameraModeStack(); + + void ActivateStack(); + void DeactivateStack(); + + bool IsStackActivate() const { return bIsActive; } + + void PushCameraMode(TSubclassOf CameraModeClass); + + bool EvaluateStack(float DeltaTime, FLyraCameraModeView& OutCameraModeView); + + void DrawDebug(UCanvas* Canvas) const; + + // Gets the tag associated with the top layer and the blend weight of it + void GetBlendInfo(float& OutWeightOfTopLayer, FGameplayTag& OutTagOfTopLayer) const; + +protected: + + ULyraCameraMode* GetCameraModeInstance(TSubclassOf CameraModeClass); + + void UpdateStack(float DeltaTime); + void BlendStack(FLyraCameraModeView& OutCameraModeView) const; + +protected: + + bool bIsActive; + + UPROPERTY() + TArray> CameraModeInstances; + + UPROPERTY() + TArray> CameraModeStack; +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode_ThirdPerson.cpp b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode_ThirdPerson.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3a3c358824127bdf5fbb51191b4e5458c559a9b5 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode_ThirdPerson.cpp @@ -0,0 +1,373 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraCameraMode_ThirdPerson.h" +#include "Camera/LyraCameraMode.h" +#include "Components/PrimitiveComponent.h" +#include "Camera/LyraPenetrationAvoidanceFeeler.h" +#include "Curves/CurveVector.h" +#include "Engine/Canvas.h" +#include "GameFramework/CameraBlockingVolume.h" +#include "LyraCameraAssistInterface.h" +#include "GameFramework/Controller.h" +#include "GameFramework/Character.h" +#include "Math/RotationMatrix.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraCameraMode_ThirdPerson) + +namespace LyraCameraMode_ThirdPerson_Statics +{ + static const FName NAME_IgnoreCameraCollision = TEXT("IgnoreCameraCollision"); +} + +ULyraCameraMode_ThirdPerson::ULyraCameraMode_ThirdPerson() +{ + TargetOffsetCurve = nullptr; + + PenetrationAvoidanceFeelers.Add(FLyraPenetrationAvoidanceFeeler(FRotator(+00.0f, +00.0f, 0.0f), 1.00f, 1.00f, 14.f, 0)); + PenetrationAvoidanceFeelers.Add(FLyraPenetrationAvoidanceFeeler(FRotator(+00.0f, +16.0f, 0.0f), 0.75f, 0.75f, 00.f, 3)); + PenetrationAvoidanceFeelers.Add(FLyraPenetrationAvoidanceFeeler(FRotator(+00.0f, -16.0f, 0.0f), 0.75f, 0.75f, 00.f, 3)); + PenetrationAvoidanceFeelers.Add(FLyraPenetrationAvoidanceFeeler(FRotator(+00.0f, +32.0f, 0.0f), 0.50f, 0.50f, 00.f, 5)); + PenetrationAvoidanceFeelers.Add(FLyraPenetrationAvoidanceFeeler(FRotator(+00.0f, -32.0f, 0.0f), 0.50f, 0.50f, 00.f, 5)); + PenetrationAvoidanceFeelers.Add(FLyraPenetrationAvoidanceFeeler(FRotator(+20.0f, +00.0f, 0.0f), 1.00f, 1.00f, 00.f, 4)); + PenetrationAvoidanceFeelers.Add(FLyraPenetrationAvoidanceFeeler(FRotator(-20.0f, +00.0f, 0.0f), 0.50f, 0.50f, 00.f, 4)); +} + +void ULyraCameraMode_ThirdPerson::UpdateView(float DeltaTime) +{ + UpdateForTarget(DeltaTime); + UpdateCrouchOffset(DeltaTime); + + FVector PivotLocation = GetPivotLocation() + CurrentCrouchOffset; + FRotator PivotRotation = GetPivotRotation(); + + PivotRotation.Pitch = FMath::ClampAngle(PivotRotation.Pitch, ViewPitchMin, ViewPitchMax); + + View.Location = PivotLocation; + View.Rotation = PivotRotation; + View.ControlRotation = View.Rotation; + View.FieldOfView = FieldOfView; + + // Apply third person offset using pitch. + if (!bUseRuntimeFloatCurves) + { + if (TargetOffsetCurve) + { + const FVector TargetOffset = TargetOffsetCurve->GetVectorValue(PivotRotation.Pitch); + View.Location = PivotLocation + PivotRotation.RotateVector(TargetOffset); + } + } + else + { + FVector TargetOffset(0.0f); + + TargetOffset.X = TargetOffsetX.GetRichCurveConst()->Eval(PivotRotation.Pitch); + TargetOffset.Y = TargetOffsetY.GetRichCurveConst()->Eval(PivotRotation.Pitch); + TargetOffset.Z = TargetOffsetZ.GetRichCurveConst()->Eval(PivotRotation.Pitch); + + View.Location = PivotLocation + PivotRotation.RotateVector(TargetOffset); + } + + // Adjust final desired camera location to prevent any penetration + UpdatePreventPenetration(DeltaTime); +} + +void ULyraCameraMode_ThirdPerson::UpdateForTarget(float DeltaTime) +{ + + if (const ACharacter* TargetCharacter = Cast(GetTargetActor())) + { + if (TargetCharacter->IsCrouched()) + { + const ACharacter* TargetCharacterCDO = TargetCharacter->GetClass()->GetDefaultObject(); + const float CrouchedHeightAdjustment = TargetCharacterCDO->CrouchedEyeHeight - TargetCharacterCDO->BaseEyeHeight; + + SetTargetCrouchOffset(FVector(0.f, 0.f, CrouchedHeightAdjustment)); + + return; + } + } + + SetTargetCrouchOffset(FVector::ZeroVector); +} + +void ULyraCameraMode_ThirdPerson::DrawDebug(UCanvas* Canvas) const +{ + Super::DrawDebug(Canvas); + +#if ENABLE_DRAW_DEBUG + FDisplayDebugManager& DisplayDebugManager = Canvas->DisplayDebugManager; + for (int i = 0; i < DebugActorsHitDuringCameraPenetration.Num(); i++) + { + DisplayDebugManager.DrawString( + FString::Printf(TEXT("HitActorDuringPenetration[%d]: %s") + , i + , *DebugActorsHitDuringCameraPenetration[i]->GetName())); + } + + LastDrawDebugTime = GetWorld()->GetTimeSeconds(); +#endif +} + +void ULyraCameraMode_ThirdPerson::UpdatePreventPenetration(float DeltaTime) +{ + if (!bPreventPenetration) + { + return; + } + + AActor* TargetActor = GetTargetActor(); + + APawn* TargetPawn = Cast(TargetActor); + AController* TargetController = TargetPawn ? TargetPawn->GetController() : nullptr; + ILyraCameraAssistInterface* TargetControllerAssist = Cast(TargetController); + + ILyraCameraAssistInterface* TargetActorAssist = Cast(TargetActor); + + TOptional OptionalPPTarget = TargetActorAssist ? TargetActorAssist->GetCameraPreventPenetrationTarget() : TOptional(); + AActor* PPActor = OptionalPPTarget.IsSet() ? OptionalPPTarget.GetValue() : TargetActor; + ILyraCameraAssistInterface* PPActorAssist = OptionalPPTarget.IsSet() ? Cast(PPActor) : nullptr; + + const UPrimitiveComponent* PPActorRootComponent = Cast(PPActor->GetRootComponent()); + if (PPActorRootComponent) + { + // Attempt at picking SafeLocation automatically, so we reduce camera translation when aiming. + // Our camera is our reticle, so we want to preserve our aim and keep that as steady and smooth as possible. + // Pick closest point on capsule to our aim line. + FVector ClosestPointOnLineToCapsuleCenter; + FVector SafeLocation = PPActor->GetActorLocation(); + FMath::PointDistToLine(SafeLocation, View.Rotation.Vector(), View.Location, ClosestPointOnLineToCapsuleCenter); + + // Adjust Safe distance height to be same as aim line, but within capsule. + float const PushInDistance = PenetrationAvoidanceFeelers[0].Extent + CollisionPushOutDistance; + float const MaxHalfHeight = PPActor->GetSimpleCollisionHalfHeight() - PushInDistance; + SafeLocation.Z = FMath::Clamp(ClosestPointOnLineToCapsuleCenter.Z, SafeLocation.Z - MaxHalfHeight, SafeLocation.Z + MaxHalfHeight); + + float DistanceSqr; + PPActorRootComponent->GetSquaredDistanceToCollision(ClosestPointOnLineToCapsuleCenter, DistanceSqr, SafeLocation); + // Push back inside capsule to avoid initial penetration when doing line checks. + if (PenetrationAvoidanceFeelers.Num() > 0) + { + SafeLocation += (SafeLocation - ClosestPointOnLineToCapsuleCenter).GetSafeNormal() * PushInDistance; + } + + // Then aim line to desired camera position + bool const bSingleRayPenetrationCheck = !bDoPredictiveAvoidance; + PreventCameraPenetration(*PPActor, SafeLocation, View.Location, DeltaTime, AimLineToDesiredPosBlockedPct, bSingleRayPenetrationCheck); + + ILyraCameraAssistInterface* AssistArray[] = { TargetControllerAssist, TargetActorAssist, PPActorAssist }; + + if (AimLineToDesiredPosBlockedPct < ReportPenetrationPercent) + { + for (ILyraCameraAssistInterface* Assist : AssistArray) + { + if (Assist) + { + // camera is too close, tell the assists + Assist->OnCameraPenetratingTarget(); + } + } + } + } +} + +void ULyraCameraMode_ThirdPerson::PreventCameraPenetration(class AActor const& ViewTarget, FVector const& SafeLoc, FVector& CameraLoc, float const& DeltaTime, float& DistBlockedPct, bool bSingleRayOnly) +{ +#if ENABLE_DRAW_DEBUG + DebugActorsHitDuringCameraPenetration.Reset(); +#endif + + float HardBlockedPct = DistBlockedPct; + float SoftBlockedPct = DistBlockedPct; + + FVector BaseRay = CameraLoc - SafeLoc; + FRotationMatrix BaseRayMatrix(BaseRay.Rotation()); + FVector BaseRayLocalUp, BaseRayLocalFwd, BaseRayLocalRight; + + BaseRayMatrix.GetScaledAxes(BaseRayLocalFwd, BaseRayLocalRight, BaseRayLocalUp); + + float DistBlockedPctThisFrame = 1.f; + + int32 const NumRaysToShoot = bSingleRayOnly ? FMath::Min(1, PenetrationAvoidanceFeelers.Num()) : PenetrationAvoidanceFeelers.Num(); + FCollisionQueryParams SphereParams(SCENE_QUERY_STAT(CameraPen), false, nullptr/*PlayerCamera*/); + + SphereParams.AddIgnoredActor(&ViewTarget); + + //TODO ILyraCameraTarget.GetIgnoredActorsForCameraPentration(); + //if (IgnoreActorForCameraPenetration) + //{ + // SphereParams.AddIgnoredActor(IgnoreActorForCameraPenetration); + //} + + FCollisionShape SphereShape = FCollisionShape::MakeSphere(0.f); + UWorld* World = GetWorld(); + + for (int32 RayIdx = 0; RayIdx < NumRaysToShoot; ++RayIdx) + { + FLyraPenetrationAvoidanceFeeler& Feeler = PenetrationAvoidanceFeelers[RayIdx]; + if (Feeler.FramesUntilNextTrace <= 0) + { + // calc ray target + FVector RayTarget; + { + FVector RotatedRay = BaseRay.RotateAngleAxis(Feeler.AdjustmentRot.Yaw, BaseRayLocalUp); + RotatedRay = RotatedRay.RotateAngleAxis(Feeler.AdjustmentRot.Pitch, BaseRayLocalRight); + RayTarget = SafeLoc + RotatedRay; + } + + // cast for world and pawn hits separately. this is so we can safely ignore the + // camera's target pawn + SphereShape.Sphere.Radius = Feeler.Extent; + ECollisionChannel TraceChannel = ECC_Camera; //(Feeler.PawnWeight > 0.f) ? ECC_Pawn : ECC_Camera; + + // do multi-line check to make sure the hits we throw out aren't + // masking real hits behind (these are important rays). + + // MT-> passing camera as actor so that camerablockingvolumes know when it's the camera doing traces + FHitResult Hit; + const bool bHit = World->SweepSingleByChannel(Hit, SafeLoc, RayTarget, FQuat::Identity, TraceChannel, SphereShape, SphereParams); +#if ENABLE_DRAW_DEBUG + if (World->TimeSince(LastDrawDebugTime) < 1.f) + { + DrawDebugSphere(World, SafeLoc, SphereShape.Sphere.Radius, 8, FColor::Red); + DrawDebugSphere(World, bHit ? Hit.Location : RayTarget, SphereShape.Sphere.Radius, 8, FColor::Red); + DrawDebugLine(World, SafeLoc, bHit ? Hit.Location : RayTarget, FColor::Red); + } +#endif // ENABLE_DRAW_DEBUG + + Feeler.FramesUntilNextTrace = Feeler.TraceInterval; + + const AActor* HitActor = Hit.GetActor(); + + if (bHit && HitActor) + { + bool bIgnoreHit = false; + + if (HitActor->ActorHasTag(LyraCameraMode_ThirdPerson_Statics::NAME_IgnoreCameraCollision)) + { + bIgnoreHit = true; + SphereParams.AddIgnoredActor(HitActor); + } + + // Ignore CameraBlockingVolume hits that occur in front of the ViewTarget. + if (!bIgnoreHit && HitActor->IsA()) + { + const FVector ViewTargetForwardXY = ViewTarget.GetActorForwardVector().GetSafeNormal2D(); + const FVector ViewTargetLocation = ViewTarget.GetActorLocation(); + const FVector HitOffset = Hit.Location - ViewTargetLocation; + const FVector HitDirectionXY = HitOffset.GetSafeNormal2D(); + const float DotHitDirection = FVector::DotProduct(ViewTargetForwardXY, HitDirectionXY); + if (DotHitDirection > 0.0f) + { + bIgnoreHit = true; + // Ignore this CameraBlockingVolume on the remaining sweeps. + SphereParams.AddIgnoredActor(HitActor); + } + else + { +#if ENABLE_DRAW_DEBUG + DebugActorsHitDuringCameraPenetration.AddUnique(TObjectPtr(HitActor)); +#endif + } + } + + if (!bIgnoreHit) + { + float const Weight = Cast(Hit.GetActor()) ? Feeler.PawnWeight : Feeler.WorldWeight; + float NewBlockPct = Hit.Time; + NewBlockPct += (1.f - NewBlockPct) * (1.f - Weight); + + // Recompute blocked pct taking into account pushout distance. + NewBlockPct = ((Hit.Location - SafeLoc).Size() - CollisionPushOutDistance) / (RayTarget - SafeLoc).Size(); + DistBlockedPctThisFrame = FMath::Min(NewBlockPct, DistBlockedPctThisFrame); + + // This feeler got a hit, so do another trace next frame + Feeler.FramesUntilNextTrace = 0; + +#if ENABLE_DRAW_DEBUG + DebugActorsHitDuringCameraPenetration.AddUnique(TObjectPtr(HitActor)); +#endif + } + } + + if (RayIdx == 0) + { + // don't interpolate toward this one, snap to it + // assumes ray 0 is the center/main ray + HardBlockedPct = DistBlockedPctThisFrame; + } + else + { + SoftBlockedPct = DistBlockedPctThisFrame; + } + } + else + { + --Feeler.FramesUntilNextTrace; + } + } + + if (bResetInterpolation) + { + DistBlockedPct = DistBlockedPctThisFrame; + } + else if (DistBlockedPct < DistBlockedPctThisFrame) + { + // interpolate smoothly out + if (PenetrationBlendOutTime > DeltaTime) + { + DistBlockedPct = DistBlockedPct + DeltaTime / PenetrationBlendOutTime * (DistBlockedPctThisFrame - DistBlockedPct); + } + else + { + DistBlockedPct = DistBlockedPctThisFrame; + } + } + else + { + if (DistBlockedPct > HardBlockedPct) + { + DistBlockedPct = HardBlockedPct; + } + else if (DistBlockedPct > SoftBlockedPct) + { + // interpolate smoothly in + if (PenetrationBlendInTime > DeltaTime) + { + DistBlockedPct = DistBlockedPct - DeltaTime / PenetrationBlendInTime * (DistBlockedPct - SoftBlockedPct); + } + else + { + DistBlockedPct = SoftBlockedPct; + } + } + } + + DistBlockedPct = FMath::Clamp(DistBlockedPct, 0.f, 1.f); + if (DistBlockedPct < (1.f - ZERO_ANIMWEIGHT_THRESH)) + { + CameraLoc = SafeLoc + (CameraLoc - SafeLoc) * DistBlockedPct; + } +} + +void ULyraCameraMode_ThirdPerson::SetTargetCrouchOffset(FVector NewTargetOffset) +{ + CrouchOffsetBlendPct = 0.0f; + InitialCrouchOffset = CurrentCrouchOffset; + TargetCrouchOffset = NewTargetOffset; +} + + +void ULyraCameraMode_ThirdPerson::UpdateCrouchOffset(float DeltaTime) +{ + if (CrouchOffsetBlendPct < 1.0f) + { + CrouchOffsetBlendPct = FMath::Min(CrouchOffsetBlendPct + DeltaTime * CrouchOffsetBlendMultiplier, 1.0f); + CurrentCrouchOffset = FMath::InterpEaseInOut(InitialCrouchOffset, TargetCrouchOffset, CrouchOffsetBlendPct, 1.0f); + } + else + { + CurrentCrouchOffset = TargetCrouchOffset; + CrouchOffsetBlendPct = 1.0f; + } +} + diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode_ThirdPerson.h b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode_ThirdPerson.h new file mode 100644 index 0000000000000000000000000000000000000000..319d9a2312cf2c9243d928fb33e83a26f5f170b4 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraCameraMode_ThirdPerson.h @@ -0,0 +1,114 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "LyraCameraMode.h" +#include "Curves/CurveFloat.h" +#include "LyraPenetrationAvoidanceFeeler.h" +#include "DrawDebugHelpers.h" +#include "LyraCameraMode_ThirdPerson.generated.h" + +class UCurveVector; + +/** + * ULyraCameraMode_ThirdPerson + * + * A basic third person camera mode. + */ +UCLASS(Abstract, Blueprintable) +class ULyraCameraMode_ThirdPerson : public ULyraCameraMode +{ + GENERATED_BODY() + +public: + + ULyraCameraMode_ThirdPerson(); + +protected: + + virtual void UpdateView(float DeltaTime) override; + + void UpdateForTarget(float DeltaTime); + void UpdatePreventPenetration(float DeltaTime); + void PreventCameraPenetration(class AActor const& ViewTarget, FVector const& SafeLoc, FVector& CameraLoc, float const& DeltaTime, float& DistBlockedPct, bool bSingleRayOnly); + + virtual void DrawDebug(UCanvas* Canvas) const override; + +protected: + + // Curve that defines local-space offsets from the target using the view pitch to evaluate the curve. + UPROPERTY(EditDefaultsOnly, Category = "Third Person", Meta = (EditCondition = "!bUseRuntimeFloatCurves")) + TObjectPtr TargetOffsetCurve; + + // UE-103986: Live editing of RuntimeFloatCurves during PIE does not work (unlike curve assets). + // Once that is resolved this will become the default and TargetOffsetCurve will be removed. + UPROPERTY(EditDefaultsOnly, Category = "Third Person") + bool bUseRuntimeFloatCurves; + + UPROPERTY(EditDefaultsOnly, Category = "Third Person", Meta = (EditCondition = "bUseRuntimeFloatCurves")) + FRuntimeFloatCurve TargetOffsetX; + + UPROPERTY(EditDefaultsOnly, Category = "Third Person", Meta = (EditCondition = "bUseRuntimeFloatCurves")) + FRuntimeFloatCurve TargetOffsetY; + + UPROPERTY(EditDefaultsOnly, Category = "Third Person", Meta = (EditCondition = "bUseRuntimeFloatCurves")) + FRuntimeFloatCurve TargetOffsetZ; + + // Alters the speed that a crouch offset is blended in or out + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Third Person") + float CrouchOffsetBlendMultiplier = 5.0f; + + // Penetration prevention +public: + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Collision") + float PenetrationBlendInTime = 0.1f; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Collision") + float PenetrationBlendOutTime = 0.15f; + + /** If true, does collision checks to keep the camera out of the world. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Collision") + bool bPreventPenetration = true; + + /** If true, try to detect nearby walls and move the camera in anticipation. Helps prevent popping. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Collision") + bool bDoPredictiveAvoidance = true; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Collision") + float CollisionPushOutDistance = 2.f; + + /** When the camera's distance is pushed into this percentage of its full distance due to penetration */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Collision") + float ReportPenetrationPercent = 0.f; + + /** + * These are the feeler rays that are used to find where to place the camera. + * Index: 0 : This is the normal feeler we use to prevent collisions. + * Index: 1+ : These feelers are used if you bDoPredictiveAvoidance=true, to scan for potential impacts if the player + * were to rotate towards that direction and primitively collide the camera so that it pulls in before + * impacting the occluder. + */ + UPROPERTY(EditDefaultsOnly, Category = "Collision") + TArray PenetrationAvoidanceFeelers; + + UPROPERTY(Transient) + float AimLineToDesiredPosBlockedPct; + + UPROPERTY(Transient) + TArray> DebugActorsHitDuringCameraPenetration; + +#if ENABLE_DRAW_DEBUG + mutable float LastDrawDebugTime = -MAX_FLT; +#endif + +protected: + + void SetTargetCrouchOffset(FVector NewTargetOffset); + void UpdateCrouchOffset(float DeltaTime); + + FVector InitialCrouchOffset = FVector::ZeroVector; + FVector TargetCrouchOffset = FVector::ZeroVector; + float CrouchOffsetBlendPct = 1.0f; + FVector CurrentCrouchOffset = FVector::ZeroVector; + +}; diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraPenetrationAvoidanceFeeler.h b/LyraStarterGame/Source/LyraGame/Camera/LyraPenetrationAvoidanceFeeler.h new file mode 100644 index 0000000000000000000000000000000000000000..458f39b0627fac06aa869f477330afaf440bb3da --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraPenetrationAvoidanceFeeler.h @@ -0,0 +1,66 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "CoreMinimal.h" + +#include "LyraPenetrationAvoidanceFeeler.generated.h" + +/** + * Struct defining a feeler ray used for camera penetration avoidance. + */ +USTRUCT() +struct FLyraPenetrationAvoidanceFeeler +{ + GENERATED_BODY() + + /** FRotator describing deviance from main ray */ + UPROPERTY(EditAnywhere, Category=PenetrationAvoidanceFeeler) + FRotator AdjustmentRot; + + /** how much this feeler affects the final position if it hits the world */ + UPROPERTY(EditAnywhere, Category=PenetrationAvoidanceFeeler) + float WorldWeight; + + /** how much this feeler affects the final position if it hits a APawn (setting to 0 will not attempt to collide with pawns at all) */ + UPROPERTY(EditAnywhere, Category=PenetrationAvoidanceFeeler) + float PawnWeight; + + /** extent to use for collision when tracing this feeler */ + UPROPERTY(EditAnywhere, Category=PenetrationAvoidanceFeeler) + float Extent; + + /** minimum frame interval between traces with this feeler if nothing was hit last frame */ + UPROPERTY(EditAnywhere, Category=PenetrationAvoidanceFeeler) + int32 TraceInterval; + + /** number of frames since this feeler was used */ + UPROPERTY(transient) + int32 FramesUntilNextTrace; + + + FLyraPenetrationAvoidanceFeeler() + : AdjustmentRot(ForceInit) + , WorldWeight(0) + , PawnWeight(0) + , Extent(0) + , TraceInterval(0) + , FramesUntilNextTrace(0) + { + } + + FLyraPenetrationAvoidanceFeeler(const FRotator& InAdjustmentRot, + const float& InWorldWeight, + const float& InPawnWeight, + const float& InExtent, + const int32& InTraceInterval = 0, + const int32& InFramesUntilNextTrace = 0) + : AdjustmentRot(InAdjustmentRot) + , WorldWeight(InWorldWeight) + , PawnWeight(InPawnWeight) + , Extent(InExtent) + , TraceInterval(InTraceInterval) + , FramesUntilNextTrace(InFramesUntilNextTrace) + { + } +}; \ No newline at end of file diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraPlayerCameraManager.cpp b/LyraStarterGame/Source/LyraGame/Camera/LyraPlayerCameraManager.cpp new file mode 100644 index 0000000000000000000000000000000000000000..64716352deb8d3c4ee334e6ba6dc219931bcccc4 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraPlayerCameraManager.cpp @@ -0,0 +1,66 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraPlayerCameraManager.h" + +#include "Async/TaskGraphInterfaces.h" +#include "Engine/Canvas.h" +#include "Engine/Engine.h" +#include "GameFramework/Pawn.h" +#include "GameFramework/PlayerController.h" +#include "LyraCameraComponent.h" +#include "LyraUICameraManagerComponent.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraPlayerCameraManager) + +class FDebugDisplayInfo; + +static FName UICameraComponentName(TEXT("UICamera")); + +ALyraPlayerCameraManager::ALyraPlayerCameraManager(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + DefaultFOV = LYRA_CAMERA_DEFAULT_FOV; + ViewPitchMin = LYRA_CAMERA_DEFAULT_PITCH_MIN; + ViewPitchMax = LYRA_CAMERA_DEFAULT_PITCH_MAX; + + UICamera = CreateDefaultSubobject(UICameraComponentName); +} + +ULyraUICameraManagerComponent* ALyraPlayerCameraManager::GetUICameraComponent() const +{ + return UICamera; +} + +void ALyraPlayerCameraManager::UpdateViewTarget(FTViewTarget& OutVT, float DeltaTime) +{ + // If the UI Camera is looking at something, let it have priority. + if (UICamera->NeedsToUpdateViewTarget()) + { + Super::UpdateViewTarget(OutVT, DeltaTime); + UICamera->UpdateViewTarget(OutVT, DeltaTime); + return; + } + + Super::UpdateViewTarget(OutVT, DeltaTime); +} + +void ALyraPlayerCameraManager::DisplayDebug(UCanvas* Canvas, const FDebugDisplayInfo& DebugDisplay, float& YL, float& YPos) +{ + check(Canvas); + + FDisplayDebugManager& DisplayDebugManager = Canvas->DisplayDebugManager; + + DisplayDebugManager.SetFont(GEngine->GetSmallFont()); + DisplayDebugManager.SetDrawColor(FColor::Yellow); + DisplayDebugManager.DrawString(FString::Printf(TEXT("LyraPlayerCameraManager: %s"), *GetNameSafe(this))); + + Super::DisplayDebug(Canvas, DebugDisplay, YL, YPos); + + const APawn* Pawn = (PCOwner ? PCOwner->GetPawn() : nullptr); + + if (const ULyraCameraComponent* CameraComponent = ULyraCameraComponent::FindCameraComponent(Pawn)) + { + CameraComponent->DrawDebug(Canvas); + } +} + diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraPlayerCameraManager.h b/LyraStarterGame/Source/LyraGame/Camera/LyraPlayerCameraManager.h new file mode 100644 index 0000000000000000000000000000000000000000..865550daab5cfbfca8b248b6ceb722fbe137ef1a --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraPlayerCameraManager.h @@ -0,0 +1,46 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Camera/PlayerCameraManager.h" + +#include "LyraPlayerCameraManager.generated.h" + +class FDebugDisplayInfo; +class UCanvas; +class UObject; + + +#define LYRA_CAMERA_DEFAULT_FOV (80.0f) +#define LYRA_CAMERA_DEFAULT_PITCH_MIN (-89.0f) +#define LYRA_CAMERA_DEFAULT_PITCH_MAX (89.0f) + +class ULyraUICameraManagerComponent; + +/** + * ALyraPlayerCameraManager + * + * The base player camera manager class used by this project. + */ +UCLASS(notplaceable, MinimalAPI) +class ALyraPlayerCameraManager : public APlayerCameraManager +{ + GENERATED_BODY() + +public: + + ALyraPlayerCameraManager(const FObjectInitializer& ObjectInitializer); + + ULyraUICameraManagerComponent* GetUICameraComponent() const; + +protected: + + virtual void UpdateViewTarget(FTViewTarget& OutVT, float DeltaTime) override; + + virtual void DisplayDebug(UCanvas* Canvas, const FDebugDisplayInfo& DebugDisplay, float& YL, float& YPos) override; + +private: + /** The UI Camera Component, controls the camera when UI is doing something important that gameplay doesn't get priority over. */ + UPROPERTY(Transient) + TObjectPtr UICamera; +}; diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraUICameraManagerComponent.cpp b/LyraStarterGame/Source/LyraGame/Camera/LyraUICameraManagerComponent.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3ba942de2c4280381efc29bfb08b64fc671a6926 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraUICameraManagerComponent.cpp @@ -0,0 +1,65 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraUICameraManagerComponent.h" + +#include "GameFramework/HUD.h" +#include "GameFramework/PlayerController.h" +#include "LyraPlayerCameraManager.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraUICameraManagerComponent) + +class AActor; +class FDebugDisplayInfo; + +ULyraUICameraManagerComponent* ULyraUICameraManagerComponent::GetComponent(APlayerController* PC) +{ + if (PC != nullptr) + { + if (ALyraPlayerCameraManager* PCCamera = Cast(PC->PlayerCameraManager)) + { + return PCCamera->GetUICameraComponent(); + } + } + + return nullptr; +} + +ULyraUICameraManagerComponent::ULyraUICameraManagerComponent() +{ + bWantsInitializeComponent = true; + + if (!HasAnyFlags(RF_ClassDefaultObject)) + { + // Register "showdebug" hook. + if (!IsRunningDedicatedServer()) + { + AHUD::OnShowDebugInfo.AddUObject(this, &ThisClass::OnShowDebugInfo); + } + } +} + +void ULyraUICameraManagerComponent::InitializeComponent() +{ + Super::InitializeComponent(); +} + +void ULyraUICameraManagerComponent::SetViewTarget(AActor* InViewTarget, FViewTargetTransitionParams TransitionParams) +{ + TGuardValue UpdatingViewTargetGuard(bUpdatingViewTarget, true); + + ViewTarget = InViewTarget; + CastChecked(GetOwner())->SetViewTarget(ViewTarget, TransitionParams); +} + +bool ULyraUICameraManagerComponent::NeedsToUpdateViewTarget() const +{ + return false; +} + +void ULyraUICameraManagerComponent::UpdateViewTarget(struct FTViewTarget& OutVT, float DeltaTime) +{ +} + +void ULyraUICameraManagerComponent::OnShowDebugInfo(AHUD* HUD, UCanvas* Canvas, const FDebugDisplayInfo& DisplayInfo, float& YL, float& YPos) +{ +} diff --git a/LyraStarterGame/Source/LyraGame/Camera/LyraUICameraManagerComponent.h b/LyraStarterGame/Source/LyraGame/Camera/LyraUICameraManagerComponent.h new file mode 100644 index 0000000000000000000000000000000000000000..1d118b56f8852fc7b4c0cd6692a1eaa766eb206d --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Camera/LyraUICameraManagerComponent.h @@ -0,0 +1,45 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Camera/PlayerCameraManager.h" + +#include "LyraUICameraManagerComponent.generated.h" + +class ALyraPlayerCameraManager; + +class AActor; +class AHUD; +class APlayerController; +class FDebugDisplayInfo; +class UCanvas; +class UObject; + +UCLASS( Transient, Within=LyraPlayerCameraManager ) +class ULyraUICameraManagerComponent : public UActorComponent +{ + GENERATED_BODY() + +public: + static ULyraUICameraManagerComponent* GetComponent(APlayerController* PC); + +public: + ULyraUICameraManagerComponent(); + virtual void InitializeComponent() override; + + bool IsSettingViewTarget() const { return bUpdatingViewTarget; } + AActor* GetViewTarget() const { return ViewTarget; } + void SetViewTarget(AActor* InViewTarget, FViewTargetTransitionParams TransitionParams = FViewTargetTransitionParams()); + + bool NeedsToUpdateViewTarget() const; + void UpdateViewTarget(struct FTViewTarget& OutVT, float DeltaTime); + + void OnShowDebugInfo(AHUD* HUD, UCanvas* Canvas, const FDebugDisplayInfo& DisplayInfo, float& YL, float& YPos); + +private: + UPROPERTY(Transient) + TObjectPtr ViewTarget; + + UPROPERTY(Transient) + bool bUpdatingViewTarget; +}; diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraCharacter.cpp b/LyraStarterGame/Source/LyraGame/Character/LyraCharacter.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b4d9ded1986007742f8c4192b8fe9c57d9dc461a --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraCharacter.cpp @@ -0,0 +1,682 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraCharacter.h" + +#include "AbilitySystem/LyraAbilitySystemComponent.h" +#include "Camera/LyraCameraComponent.h" +#include "Character/LyraHealthComponent.h" +#include "Character/LyraPawnExtensionComponent.h" +#include "Components/CapsuleComponent.h" +#include "Components/SkeletalMeshComponent.h" +#include "LyraCharacterMovementComponent.h" +#include "LyraGameplayTags.h" +#include "LyraLogChannels.h" +#include "Net/UnrealNetwork.h" +#include "Player/LyraPlayerController.h" +#include "Player/LyraPlayerState.h" +#include "System/LyraSignificanceManager.h" +#include "TimerManager.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraCharacter) + +class AActor; +class FLifetimeProperty; +class IRepChangedPropertyTracker; +class UInputComponent; + +static FName NAME_LyraCharacterCollisionProfile_Capsule(TEXT("LyraPawnCapsule")); +static FName NAME_LyraCharacterCollisionProfile_Mesh(TEXT("LyraPawnMesh")); + +ALyraCharacter::ALyraCharacter(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer.SetDefaultSubobjectClass(ACharacter::CharacterMovementComponentName)) +{ + // Avoid ticking characters if possible. + PrimaryActorTick.bCanEverTick = false; + PrimaryActorTick.bStartWithTickEnabled = false; + + SetNetCullDistanceSquared(900000000.0f); + + UCapsuleComponent* CapsuleComp = GetCapsuleComponent(); + check(CapsuleComp); + CapsuleComp->InitCapsuleSize(40.0f, 90.0f); + CapsuleComp->SetCollisionProfileName(NAME_LyraCharacterCollisionProfile_Capsule); + + USkeletalMeshComponent* MeshComp = GetMesh(); + check(MeshComp); + MeshComp->SetRelativeRotation(FRotator(0.0f, -90.0f, 0.0f)); // Rotate mesh to be X forward since it is exported as Y forward. + MeshComp->SetCollisionProfileName(NAME_LyraCharacterCollisionProfile_Mesh); + + ULyraCharacterMovementComponent* LyraMoveComp = CastChecked(GetCharacterMovement()); + LyraMoveComp->GravityScale = 1.0f; + LyraMoveComp->MaxAcceleration = 2400.0f; + LyraMoveComp->BrakingFrictionFactor = 1.0f; + LyraMoveComp->BrakingFriction = 6.0f; + LyraMoveComp->GroundFriction = 8.0f; + LyraMoveComp->BrakingDecelerationWalking = 1400.0f; + LyraMoveComp->bUseControllerDesiredRotation = false; + LyraMoveComp->bOrientRotationToMovement = false; + LyraMoveComp->RotationRate = FRotator(0.0f, 720.0f, 0.0f); + LyraMoveComp->bAllowPhysicsRotationDuringAnimRootMotion = false; + LyraMoveComp->GetNavAgentPropertiesRef().bCanCrouch = true; + LyraMoveComp->bCanWalkOffLedgesWhenCrouching = true; + LyraMoveComp->SetCrouchedHalfHeight(65.0f); + + PawnExtComponent = CreateDefaultSubobject(TEXT("PawnExtensionComponent")); + PawnExtComponent->OnAbilitySystemInitialized_RegisterAndCall(FSimpleMulticastDelegate::FDelegate::CreateUObject(this, &ThisClass::OnAbilitySystemInitialized)); + PawnExtComponent->OnAbilitySystemUninitialized_Register(FSimpleMulticastDelegate::FDelegate::CreateUObject(this, &ThisClass::OnAbilitySystemUninitialized)); + + HealthComponent = CreateDefaultSubobject(TEXT("HealthComponent")); + HealthComponent->OnDeathStarted.AddDynamic(this, &ThisClass::OnDeathStarted); + HealthComponent->OnDeathFinished.AddDynamic(this, &ThisClass::OnDeathFinished); + + CameraComponent = CreateDefaultSubobject(TEXT("CameraComponent")); + CameraComponent->SetRelativeLocation(FVector(-300.0f, 0.0f, 75.0f)); + + bUseControllerRotationPitch = false; + bUseControllerRotationYaw = true; + bUseControllerRotationRoll = false; + + BaseEyeHeight = 80.0f; + CrouchedEyeHeight = 50.0f; +} + +void ALyraCharacter::PreInitializeComponents() +{ + Super::PreInitializeComponents(); +} + +void ALyraCharacter::BeginPlay() +{ + Super::BeginPlay(); + + UWorld* World = GetWorld(); + + const bool bRegisterWithSignificanceManager = !IsNetMode(NM_DedicatedServer); + if (bRegisterWithSignificanceManager) + { + if (ULyraSignificanceManager* SignificanceManager = USignificanceManager::Get(World)) + { +//@TODO: SignificanceManager->RegisterObject(this, (EFortSignificanceType)SignificanceType); + } + } +} + +void ALyraCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason) +{ + Super::EndPlay(EndPlayReason); + + UWorld* World = GetWorld(); + + const bool bRegisterWithSignificanceManager = !IsNetMode(NM_DedicatedServer); + if (bRegisterWithSignificanceManager) + { + if (ULyraSignificanceManager* SignificanceManager = USignificanceManager::Get(World)) + { + SignificanceManager->UnregisterObject(this); + } + } +} + +void ALyraCharacter::Reset() +{ + DisableMovementAndCollision(); + + K2_OnReset(); + + UninitAndDestroy(); +} + +void ALyraCharacter::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const +{ + Super::GetLifetimeReplicatedProps(OutLifetimeProps); + + DOREPLIFETIME_CONDITION(ThisClass, ReplicatedAcceleration, COND_SimulatedOnly); + DOREPLIFETIME(ThisClass, MyTeamID) +} + +void ALyraCharacter::PreReplication(IRepChangedPropertyTracker& ChangedPropertyTracker) +{ + Super::PreReplication(ChangedPropertyTracker); + + if (UCharacterMovementComponent* MovementComponent = GetCharacterMovement()) + { + // Compress Acceleration: XY components as direction + magnitude, Z component as direct value + const double MaxAccel = MovementComponent->MaxAcceleration; + const FVector CurrentAccel = MovementComponent->GetCurrentAcceleration(); + double AccelXYRadians, AccelXYMagnitude; + FMath::CartesianToPolar(CurrentAccel.X, CurrentAccel.Y, AccelXYMagnitude, AccelXYRadians); + + ReplicatedAcceleration.AccelXYRadians = FMath::FloorToInt((AccelXYRadians / TWO_PI) * 255.0); // [0, 2PI] -> [0, 255] + ReplicatedAcceleration.AccelXYMagnitude = FMath::FloorToInt((AccelXYMagnitude / MaxAccel) * 255.0); // [0, MaxAccel] -> [0, 255] + ReplicatedAcceleration.AccelZ = FMath::FloorToInt((CurrentAccel.Z / MaxAccel) * 127.0); // [-MaxAccel, MaxAccel] -> [-127, 127] + } +} + +void ALyraCharacter::NotifyControllerChanged() +{ + const FGenericTeamId OldTeamId = GetGenericTeamId(); + + Super::NotifyControllerChanged(); + + // Update our team ID based on the controller + if (HasAuthority() && (GetController() != nullptr)) + { + if (ILyraTeamAgentInterface* ControllerWithTeam = Cast(GetController())) + { + MyTeamID = ControllerWithTeam->GetGenericTeamId(); + ConditionalBroadcastTeamChanged(this, OldTeamId, MyTeamID); + } + } +} + +ALyraPlayerController* ALyraCharacter::GetLyraPlayerController() const +{ + return CastChecked(GetController(), ECastCheckedType::NullAllowed); +} + +ALyraPlayerState* ALyraCharacter::GetLyraPlayerState() const +{ + return CastChecked(GetPlayerState(), ECastCheckedType::NullAllowed); +} + +ULyraAbilitySystemComponent* ALyraCharacter::GetLyraAbilitySystemComponent() const +{ + return Cast(GetAbilitySystemComponent()); +} + +UAbilitySystemComponent* ALyraCharacter::GetAbilitySystemComponent() const +{ + if (PawnExtComponent == nullptr) + { + return nullptr; + } + + return PawnExtComponent->GetLyraAbilitySystemComponent(); +} + +void ALyraCharacter::OnAbilitySystemInitialized() +{ + ULyraAbilitySystemComponent* LyraASC = GetLyraAbilitySystemComponent(); + check(LyraASC); + + HealthComponent->InitializeWithAbilitySystem(LyraASC); + + InitializeGameplayTags(); +} + +void ALyraCharacter::OnAbilitySystemUninitialized() +{ + HealthComponent->UninitializeFromAbilitySystem(); +} + +void ALyraCharacter::PossessedBy(AController* NewController) +{ + const FGenericTeamId OldTeamID = MyTeamID; + + Super::PossessedBy(NewController); + + PawnExtComponent->HandleControllerChanged(); + + // Grab the current team ID and listen for future changes + if (ILyraTeamAgentInterface* ControllerAsTeamProvider = Cast(NewController)) + { + MyTeamID = ControllerAsTeamProvider->GetGenericTeamId(); + ControllerAsTeamProvider->GetTeamChangedDelegateChecked().AddDynamic(this, &ThisClass::OnControllerChangedTeam); + } + ConditionalBroadcastTeamChanged(this, OldTeamID, MyTeamID); +} + +void ALyraCharacter::UnPossessed() +{ + AController* const OldController = GetController(); + + // Stop listening for changes from the old controller + const FGenericTeamId OldTeamID = MyTeamID; + if (ILyraTeamAgentInterface* ControllerAsTeamProvider = Cast(OldController)) + { + ControllerAsTeamProvider->GetTeamChangedDelegateChecked().RemoveAll(this); + } + + Super::UnPossessed(); + + PawnExtComponent->HandleControllerChanged(); + + // Determine what the new team ID should be afterwards + MyTeamID = DetermineNewTeamAfterPossessionEnds(OldTeamID); + ConditionalBroadcastTeamChanged(this, OldTeamID, MyTeamID); +} + +void ALyraCharacter::OnRep_Controller() +{ + Super::OnRep_Controller(); + + PawnExtComponent->HandleControllerChanged(); +} + +void ALyraCharacter::OnRep_PlayerState() +{ + Super::OnRep_PlayerState(); + + PawnExtComponent->HandlePlayerStateReplicated(); +} + +void ALyraCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) +{ + Super::SetupPlayerInputComponent(PlayerInputComponent); + + PawnExtComponent->SetupPlayerInputComponent(); +} + +void ALyraCharacter::InitializeGameplayTags() +{ + // Clear tags that may be lingering on the ability system from the previous pawn. + if (ULyraAbilitySystemComponent* LyraASC = GetLyraAbilitySystemComponent()) + { + for (const TPair& TagMapping : LyraGameplayTags::MovementModeTagMap) + { + if (TagMapping.Value.IsValid()) + { + LyraASC->SetLooseGameplayTagCount(TagMapping.Value, 0); + } + } + + for (const TPair& TagMapping : LyraGameplayTags::CustomMovementModeTagMap) + { + if (TagMapping.Value.IsValid()) + { + LyraASC->SetLooseGameplayTagCount(TagMapping.Value, 0); + } + } + + ULyraCharacterMovementComponent* LyraMoveComp = CastChecked(GetCharacterMovement()); + SetMovementModeTag(LyraMoveComp->MovementMode, LyraMoveComp->CustomMovementMode, true); + } +} + +void ALyraCharacter::GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const +{ + if (const ULyraAbilitySystemComponent* LyraASC = GetLyraAbilitySystemComponent()) + { + LyraASC->GetOwnedGameplayTags(TagContainer); + } +} + +bool ALyraCharacter::HasMatchingGameplayTag(FGameplayTag TagToCheck) const +{ + if (const ULyraAbilitySystemComponent* LyraASC = GetLyraAbilitySystemComponent()) + { + return LyraASC->HasMatchingGameplayTag(TagToCheck); + } + + return false; +} + +bool ALyraCharacter::HasAllMatchingGameplayTags(const FGameplayTagContainer& TagContainer) const +{ + if (const ULyraAbilitySystemComponent* LyraASC = GetLyraAbilitySystemComponent()) + { + return LyraASC->HasAllMatchingGameplayTags(TagContainer); + } + + return false; +} + +bool ALyraCharacter::HasAnyMatchingGameplayTags(const FGameplayTagContainer& TagContainer) const +{ + if (const ULyraAbilitySystemComponent* LyraASC = GetLyraAbilitySystemComponent()) + { + return LyraASC->HasAnyMatchingGameplayTags(TagContainer); + } + + return false; +} + +void ALyraCharacter::FellOutOfWorld(const class UDamageType& dmgType) +{ + HealthComponent->DamageSelfDestruct(/*bFellOutOfWorld=*/ true); +} + +void ALyraCharacter::OnDeathStarted(AActor*) +{ + DisableMovementAndCollision(); +} + +void ALyraCharacter::OnDeathFinished(AActor*) +{ + GetWorld()->GetTimerManager().SetTimerForNextTick(this, &ThisClass::DestroyDueToDeath); +} + + +void ALyraCharacter::DisableMovementAndCollision() +{ + if (GetController()) + { + GetController()->SetIgnoreMoveInput(true); + } + + UCapsuleComponent* CapsuleComp = GetCapsuleComponent(); + check(CapsuleComp); + CapsuleComp->SetCollisionEnabled(ECollisionEnabled::NoCollision); + CapsuleComp->SetCollisionResponseToAllChannels(ECR_Ignore); + + ULyraCharacterMovementComponent* LyraMoveComp = CastChecked(GetCharacterMovement()); + LyraMoveComp->StopMovementImmediately(); + LyraMoveComp->DisableMovement(); +} + +void ALyraCharacter::DestroyDueToDeath() +{ + K2_OnDeathFinished(); + + UninitAndDestroy(); +} + + +void ALyraCharacter::UninitAndDestroy() +{ + if (GetLocalRole() == ROLE_Authority) + { + DetachFromControllerPendingDestroy(); + SetLifeSpan(0.1f); + } + + // Uninitialize the ASC if we're still the avatar actor (otherwise another pawn already did it when they became the avatar actor) + if (ULyraAbilitySystemComponent* LyraASC = GetLyraAbilitySystemComponent()) + { + if (LyraASC->GetAvatarActor() == this) + { + PawnExtComponent->UninitializeAbilitySystem(); + } + } + + SetActorHiddenInGame(true); +} + +void ALyraCharacter::OnMovementModeChanged(EMovementMode PrevMovementMode, uint8 PreviousCustomMode) +{ + Super::OnMovementModeChanged(PrevMovementMode, PreviousCustomMode); + + ULyraCharacterMovementComponent* LyraMoveComp = CastChecked(GetCharacterMovement()); + + SetMovementModeTag(PrevMovementMode, PreviousCustomMode, false); + SetMovementModeTag(LyraMoveComp->MovementMode, LyraMoveComp->CustomMovementMode, true); +} + +void ALyraCharacter::SetMovementModeTag(EMovementMode MovementMode, uint8 CustomMovementMode, bool bTagEnabled) +{ + if (ULyraAbilitySystemComponent* LyraASC = GetLyraAbilitySystemComponent()) + { + const FGameplayTag* MovementModeTag = nullptr; + if (MovementMode == MOVE_Custom) + { + MovementModeTag = LyraGameplayTags::CustomMovementModeTagMap.Find(CustomMovementMode); + } + else + { + MovementModeTag = LyraGameplayTags::MovementModeTagMap.Find(MovementMode); + } + + if (MovementModeTag && MovementModeTag->IsValid()) + { + LyraASC->SetLooseGameplayTagCount(*MovementModeTag, (bTagEnabled ? 1 : 0)); + } + } +} + +void ALyraCharacter::ToggleCrouch() +{ + const ULyraCharacterMovementComponent* LyraMoveComp = CastChecked(GetCharacterMovement()); + + if (IsCrouched() || LyraMoveComp->bWantsToCrouch) + { + UnCrouch(); + } + else if (LyraMoveComp->IsMovingOnGround()) + { + Crouch(); + } +} + +void ALyraCharacter::OnStartCrouch(float HalfHeightAdjust, float ScaledHalfHeightAdjust) +{ + if (ULyraAbilitySystemComponent* LyraASC = GetLyraAbilitySystemComponent()) + { + LyraASC->SetLooseGameplayTagCount(LyraGameplayTags::Status_Crouching, 1); + } + + + Super::OnStartCrouch(HalfHeightAdjust, ScaledHalfHeightAdjust); +} + +void ALyraCharacter::OnEndCrouch(float HalfHeightAdjust, float ScaledHalfHeightAdjust) +{ + if (ULyraAbilitySystemComponent* LyraASC = GetLyraAbilitySystemComponent()) + { + LyraASC->SetLooseGameplayTagCount(LyraGameplayTags::Status_Crouching, 0); + } + + Super::OnEndCrouch(HalfHeightAdjust, ScaledHalfHeightAdjust); +} + +bool ALyraCharacter::CanJumpInternal_Implementation() const +{ + // same as ACharacter's implementation but without the crouch check + return JumpIsAllowedInternal(); +} + +void ALyraCharacter::OnRep_ReplicatedAcceleration() +{ + if (ULyraCharacterMovementComponent* LyraMovementComponent = Cast(GetCharacterMovement())) + { + // Decompress Acceleration + const double MaxAccel = LyraMovementComponent->MaxAcceleration; + const double AccelXYMagnitude = double(ReplicatedAcceleration.AccelXYMagnitude) * MaxAccel / 255.0; // [0, 255] -> [0, MaxAccel] + const double AccelXYRadians = double(ReplicatedAcceleration.AccelXYRadians) * TWO_PI / 255.0; // [0, 255] -> [0, 2PI] + + FVector UnpackedAcceleration(FVector::ZeroVector); + FMath::PolarToCartesian(AccelXYMagnitude, AccelXYRadians, UnpackedAcceleration.X, UnpackedAcceleration.Y); + UnpackedAcceleration.Z = double(ReplicatedAcceleration.AccelZ) * MaxAccel / 127.0; // [-127, 127] -> [-MaxAccel, MaxAccel] + + LyraMovementComponent->SetReplicatedAcceleration(UnpackedAcceleration); + } +} + +void ALyraCharacter::SetGenericTeamId(const FGenericTeamId& NewTeamID) +{ + if (GetController() == nullptr) + { + if (HasAuthority()) + { + const FGenericTeamId OldTeamID = MyTeamID; + MyTeamID = NewTeamID; + ConditionalBroadcastTeamChanged(this, OldTeamID, MyTeamID); + } + else + { + UE_LOG(LogLyraTeams, Error, TEXT("You can't set the team ID on a character (%s) except on the authority"), *GetPathNameSafe(this)); + } + } + else + { + UE_LOG(LogLyraTeams, Error, TEXT("You can't set the team ID on a possessed character (%s); it's driven by the associated controller"), *GetPathNameSafe(this)); + } +} + +FGenericTeamId ALyraCharacter::GetGenericTeamId() const +{ + return MyTeamID; +} + +FOnLyraTeamIndexChangedDelegate* ALyraCharacter::GetOnTeamIndexChangedDelegate() +{ + return &OnTeamChangedDelegate; +} + +void ALyraCharacter::OnControllerChangedTeam(UObject* TeamAgent, int32 OldTeam, int32 NewTeam) +{ + const FGenericTeamId MyOldTeamID = MyTeamID; + MyTeamID = IntegerToGenericTeamId(NewTeam); + ConditionalBroadcastTeamChanged(this, MyOldTeamID, MyTeamID); +} + +void ALyraCharacter::OnRep_MyTeamID(FGenericTeamId OldTeamID) +{ + ConditionalBroadcastTeamChanged(this, OldTeamID, MyTeamID); +} + +bool ALyraCharacter::UpdateSharedReplication() +{ + if (GetLocalRole() == ROLE_Authority) + { + FSharedRepMovement SharedMovement; + if (SharedMovement.FillForCharacter(this)) + { + // Only call FastSharedReplication if data has changed since the last frame. + // Skipping this call will cause replication to reuse the same bunch that we previously + // produced, but not send it to clients that already received. (But a new client who has not received + // it, will get it this frame) + if (!SharedMovement.Equals(LastSharedReplication, this)) + { + LastSharedReplication = SharedMovement; + SetReplicatedMovementMode(SharedMovement.RepMovementMode); + + FastSharedReplication(SharedMovement); + } + return true; + } + } + + // We cannot fastrep right now. Don't send anything. + return false; +} + +void ALyraCharacter::FastSharedReplication_Implementation(const FSharedRepMovement& SharedRepMovement) +{ + if (GetWorld()->IsPlayingReplay()) + { + return; + } + + // Timestamp is checked to reject old moves. + if (GetLocalRole() == ROLE_SimulatedProxy) + { + // Timestamp + SetReplicatedServerLastTransformUpdateTimeStamp(SharedRepMovement.RepTimeStamp); + + // Movement mode + if (GetReplicatedMovementMode() != SharedRepMovement.RepMovementMode) + { + SetReplicatedMovementMode(SharedRepMovement.RepMovementMode); + GetCharacterMovement()->bNetworkMovementModeChanged = true; + GetCharacterMovement()->bNetworkUpdateReceived = true; + } + + // Location, Rotation, Velocity, etc. + FRepMovement& MutableRepMovement = GetReplicatedMovement_Mutable(); + MutableRepMovement = SharedRepMovement.RepMovement; + + // This also sets LastRepMovement + OnRep_ReplicatedMovement(); + + // Jump force + SetProxyIsJumpForceApplied(SharedRepMovement.bProxyIsJumpForceApplied); + + // Crouch + if (IsCrouched() != SharedRepMovement.bIsCrouched) + { + SetIsCrouched(SharedRepMovement.bIsCrouched); + OnRep_IsCrouched(); + } + } +} + +FSharedRepMovement::FSharedRepMovement() +{ + RepMovement.LocationQuantizationLevel = EVectorQuantization::RoundTwoDecimals; +} + +bool FSharedRepMovement::FillForCharacter(ACharacter* Character) +{ + if (USceneComponent* PawnRootComponent = Character->GetRootComponent()) + { + UCharacterMovementComponent* CharacterMovement = Character->GetCharacterMovement(); + + RepMovement.Location = FRepMovement::RebaseOntoZeroOrigin(PawnRootComponent->GetComponentLocation(), Character); + RepMovement.Rotation = PawnRootComponent->GetComponentRotation(); + RepMovement.LinearVelocity = CharacterMovement->Velocity; + RepMovementMode = CharacterMovement->PackNetworkMovementMode(); + bProxyIsJumpForceApplied = Character->GetProxyIsJumpForceApplied() || (Character->JumpForceTimeRemaining > 0.0f); + bIsCrouched = Character->IsCrouched(); + + // Timestamp is sent as zero if unused + if ((CharacterMovement->NetworkSmoothingMode == ENetworkSmoothingMode::Linear) || CharacterMovement->bNetworkAlwaysReplicateTransformUpdateTimestamp) + { + RepTimeStamp = CharacterMovement->GetServerLastTransformUpdateTimeStamp(); + } + else + { + RepTimeStamp = 0.f; + } + + return true; + } + return false; +} + +bool FSharedRepMovement::Equals(const FSharedRepMovement& Other, ACharacter* Character) const +{ + if (RepMovement.Location != Other.RepMovement.Location) + { + return false; + } + + if (RepMovement.Rotation != Other.RepMovement.Rotation) + { + return false; + } + + if (RepMovement.LinearVelocity != Other.RepMovement.LinearVelocity) + { + return false; + } + + if (RepMovementMode != Other.RepMovementMode) + { + return false; + } + + if (bProxyIsJumpForceApplied != Other.bProxyIsJumpForceApplied) + { + return false; + } + + if (bIsCrouched != Other.bIsCrouched) + { + return false; + } + + return true; +} + +bool FSharedRepMovement::NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess) +{ + bOutSuccess = true; + RepMovement.NetSerialize(Ar, Map, bOutSuccess); + Ar << RepMovementMode; + Ar << bProxyIsJumpForceApplied; + Ar << bIsCrouched; + + // Timestamp, if non-zero. + uint8 bHasTimeStamp = (RepTimeStamp != 0.f); + Ar.SerializeBits(&bHasTimeStamp, 1); + if (bHasTimeStamp) + { + Ar << RepTimeStamp; + } + else + { + RepTimeStamp = 0.f; + } + + return true; +} \ No newline at end of file diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraCharacter.h b/LyraStarterGame/Source/LyraGame/Character/LyraCharacter.h new file mode 100644 index 0000000000000000000000000000000000000000..220c2cb172c99b42d5954ba10f6c6f7f90f26e9c --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraCharacter.h @@ -0,0 +1,231 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "AbilitySystemInterface.h" +#include "GameplayCueInterface.h" +#include "GameplayTagAssetInterface.h" +#include "ModularCharacter.h" +#include "Teams/LyraTeamAgentInterface.h" + +#include "LyraCharacter.generated.h" + +#define UE_API LYRAGAME_API + +class AActor; +class AController; +class ALyraPlayerController; +class ALyraPlayerState; +class FLifetimeProperty; +class IRepChangedPropertyTracker; +class UAbilitySystemComponent; +class UInputComponent; +class ULyraAbilitySystemComponent; +class ULyraCameraComponent; +class ULyraHealthComponent; +class ULyraPawnExtensionComponent; +class UObject; +struct FFrame; +struct FGameplayTag; +struct FGameplayTagContainer; + + +/** + * FLyraReplicatedAcceleration: Compressed representation of acceleration + */ +USTRUCT() +struct FLyraReplicatedAcceleration +{ + GENERATED_BODY() + + UPROPERTY() + uint8 AccelXYRadians = 0; // Direction of XY accel component, quantized to represent [0, 2*pi] + + UPROPERTY() + uint8 AccelXYMagnitude = 0; //Accel rate of XY component, quantized to represent [0, MaxAcceleration] + + UPROPERTY() + int8 AccelZ = 0; // Raw Z accel rate component, quantized to represent [-MaxAcceleration, MaxAcceleration] +}; + +/** The type we use to send FastShared movement updates. */ +USTRUCT() +struct FSharedRepMovement +{ + GENERATED_BODY() + + FSharedRepMovement(); + + bool FillForCharacter(ACharacter* Character); + bool Equals(const FSharedRepMovement& Other, ACharacter* Character) const; + + bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess); + + UPROPERTY(Transient) + FRepMovement RepMovement; + + UPROPERTY(Transient) + float RepTimeStamp = 0.0f; + + UPROPERTY(Transient) + uint8 RepMovementMode = 0; + + UPROPERTY(Transient) + bool bProxyIsJumpForceApplied = false; + + UPROPERTY(Transient) + bool bIsCrouched = false; +}; + +template<> +struct TStructOpsTypeTraits : public TStructOpsTypeTraitsBase2 +{ + enum + { + WithNetSerializer = true, + WithNetSharedSerialization = true, + }; +}; + +/** + * ALyraCharacter + * + * The base character pawn class used by this project. + * Responsible for sending events to pawn components. + * New behavior should be added via pawn components when possible. + */ +UCLASS(MinimalAPI, Config = Game, Meta = (ShortTooltip = "The base character pawn class used by this project.")) +class ALyraCharacter : public AModularCharacter, public IAbilitySystemInterface, public IGameplayCueInterface, public IGameplayTagAssetInterface, public ILyraTeamAgentInterface +{ + GENERATED_BODY() + +public: + + UE_API ALyraCharacter(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + UFUNCTION(BlueprintCallable, Category = "Lyra|Character") + UE_API ALyraPlayerController* GetLyraPlayerController() const; + + UFUNCTION(BlueprintCallable, Category = "Lyra|Character") + UE_API ALyraPlayerState* GetLyraPlayerState() const; + + UFUNCTION(BlueprintCallable, Category = "Lyra|Character") + UE_API ULyraAbilitySystemComponent* GetLyraAbilitySystemComponent() const; + UE_API virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override; + + UE_API virtual void GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const override; + UE_API virtual bool HasMatchingGameplayTag(FGameplayTag TagToCheck) const override; + UE_API virtual bool HasAllMatchingGameplayTags(const FGameplayTagContainer& TagContainer) const override; + UE_API virtual bool HasAnyMatchingGameplayTags(const FGameplayTagContainer& TagContainer) const override; + + UE_API void ToggleCrouch(); + + //~AActor interface + UE_API virtual void PreInitializeComponents() override; + UE_API virtual void BeginPlay() override; + UE_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; + UE_API virtual void Reset() override; + UE_API virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; + UE_API virtual void PreReplication(IRepChangedPropertyTracker& ChangedPropertyTracker) override; + //~End of AActor interface + + //~APawn interface + UE_API virtual void NotifyControllerChanged() override; + //~End of APawn interface + + //~ILyraTeamAgentInterface interface + UE_API virtual void SetGenericTeamId(const FGenericTeamId& NewTeamID) override; + UE_API virtual FGenericTeamId GetGenericTeamId() const override; + UE_API virtual FOnLyraTeamIndexChangedDelegate* GetOnTeamIndexChangedDelegate() override; + //~End of ILyraTeamAgentInterface interface + + /** RPCs that is called on frames when default property replication is skipped. This replicates a single movement update to everyone. */ + UFUNCTION(NetMulticast, unreliable) + UE_API void FastSharedReplication(const FSharedRepMovement& SharedRepMovement); + + // Last FSharedRepMovement we sent, to avoid sending repeatedly. + FSharedRepMovement LastSharedReplication; + + UE_API virtual bool UpdateSharedReplication(); + +protected: + + UE_API virtual void OnAbilitySystemInitialized(); + UE_API virtual void OnAbilitySystemUninitialized(); + + UE_API virtual void PossessedBy(AController* NewController) override; + UE_API virtual void UnPossessed() override; + + UE_API virtual void OnRep_Controller() override; + UE_API virtual void OnRep_PlayerState() override; + + UE_API virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override; + + UE_API void InitializeGameplayTags(); + + UE_API virtual void FellOutOfWorld(const class UDamageType& dmgType) override; + + // Begins the death sequence for the character (disables collision, disables movement, etc...) + UFUNCTION() + UE_API virtual void OnDeathStarted(AActor* OwningActor); + + // Ends the death sequence for the character (detaches controller, destroys pawn, etc...) + UFUNCTION() + UE_API virtual void OnDeathFinished(AActor* OwningActor); + + UE_API void DisableMovementAndCollision(); + UE_API void DestroyDueToDeath(); + UE_API void UninitAndDestroy(); + + // Called when the death sequence for the character has completed + UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName="OnDeathFinished")) + UE_API void K2_OnDeathFinished(); + + UE_API virtual void OnMovementModeChanged(EMovementMode PrevMovementMode, uint8 PreviousCustomMode) override; + UE_API void SetMovementModeTag(EMovementMode MovementMode, uint8 CustomMovementMode, bool bTagEnabled); + + UE_API virtual void OnStartCrouch(float HalfHeightAdjust, float ScaledHalfHeightAdjust) override; + UE_API virtual void OnEndCrouch(float HalfHeightAdjust, float ScaledHalfHeightAdjust) override; + + UE_API virtual bool CanJumpInternal_Implementation() const; + +private: + + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Lyra|Character", Meta = (AllowPrivateAccess = "true")) + TObjectPtr PawnExtComponent; + + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Lyra|Character", Meta = (AllowPrivateAccess = "true")) + TObjectPtr HealthComponent; + + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Lyra|Character", Meta = (AllowPrivateAccess = "true")) + TObjectPtr CameraComponent; + + UPROPERTY(Transient, ReplicatedUsing = OnRep_ReplicatedAcceleration) + FLyraReplicatedAcceleration ReplicatedAcceleration; + + UPROPERTY(ReplicatedUsing = OnRep_MyTeamID) + FGenericTeamId MyTeamID; + + UPROPERTY() + FOnLyraTeamIndexChangedDelegate OnTeamChangedDelegate; + +protected: + // Called to determine what happens to the team ID when possession ends + virtual FGenericTeamId DetermineNewTeamAfterPossessionEnds(FGenericTeamId OldTeamID) const + { + // This could be changed to return, e.g., OldTeamID if you want to keep it assigned afterwards, or return an ID for some neutral faction, or etc... + return FGenericTeamId::NoTeam; + } + +private: + UFUNCTION() + UE_API void OnControllerChangedTeam(UObject* TeamAgent, int32 OldTeam, int32 NewTeam); + + UFUNCTION() + UE_API void OnRep_ReplicatedAcceleration(); + + UFUNCTION() + UE_API void OnRep_MyTeamID(FGenericTeamId OldTeamID); +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraCharacterMovementComponent.cpp b/LyraStarterGame/Source/LyraGame/Character/LyraCharacterMovementComponent.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1dce508cfec93d965672c6f8cd68125b60b664b3 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraCharacterMovementComponent.cpp @@ -0,0 +1,131 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraCharacterMovementComponent.h" + +#include "AbilitySystemComponent.h" +#include "AbilitySystemGlobals.h" +#include "Components/CapsuleComponent.h" +#include "Engine/World.h" +#include "GameFramework/Character.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraCharacterMovementComponent) + +UE_DEFINE_GAMEPLAY_TAG(TAG_Gameplay_MovementStopped, "Gameplay.MovementStopped"); + +namespace LyraCharacter +{ + static float GroundTraceDistance = 100000.0f; + FAutoConsoleVariableRef CVar_GroundTraceDistance(TEXT("LyraCharacter.GroundTraceDistance"), GroundTraceDistance, TEXT("Distance to trace down when generating ground information."), ECVF_Cheat); +}; + + +ULyraCharacterMovementComponent::ULyraCharacterMovementComponent(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void ULyraCharacterMovementComponent::SimulateMovement(float DeltaTime) +{ + if (bHasReplicatedAcceleration) + { + // Preserve our replicated acceleration + const FVector OriginalAcceleration = Acceleration; + Super::SimulateMovement(DeltaTime); + Acceleration = OriginalAcceleration; + } + else + { + Super::SimulateMovement(DeltaTime); + } +} + +bool ULyraCharacterMovementComponent::CanAttemptJump() const +{ + // Same as UCharacterMovementComponent's implementation but without the crouch check + return IsJumpAllowed() && + (IsMovingOnGround() || IsFalling()); // Falling included for double-jump and non-zero jump hold time, but validated by character. +} + +void ULyraCharacterMovementComponent::InitializeComponent() +{ + Super::InitializeComponent(); +} + +const FLyraCharacterGroundInfo& ULyraCharacterMovementComponent::GetGroundInfo() +{ + if (!CharacterOwner || (GFrameCounter == CachedGroundInfo.LastUpdateFrame)) + { + return CachedGroundInfo; + } + + if (MovementMode == MOVE_Walking) + { + CachedGroundInfo.GroundHitResult = CurrentFloor.HitResult; + CachedGroundInfo.GroundDistance = 0.0f; + } + else + { + const UCapsuleComponent* CapsuleComp = CharacterOwner->GetCapsuleComponent(); + check(CapsuleComp); + + const float CapsuleHalfHeight = CapsuleComp->GetUnscaledCapsuleHalfHeight(); + const ECollisionChannel CollisionChannel = (UpdatedComponent ? UpdatedComponent->GetCollisionObjectType() : ECC_Pawn); + const FVector TraceStart(GetActorLocation()); + const FVector TraceEnd(TraceStart.X, TraceStart.Y, (TraceStart.Z - LyraCharacter::GroundTraceDistance - CapsuleHalfHeight)); + + FCollisionQueryParams QueryParams(SCENE_QUERY_STAT(LyraCharacterMovementComponent_GetGroundInfo), false, CharacterOwner); + FCollisionResponseParams ResponseParam; + InitCollisionParams(QueryParams, ResponseParam); + + FHitResult HitResult; + GetWorld()->LineTraceSingleByChannel(HitResult, TraceStart, TraceEnd, CollisionChannel, QueryParams, ResponseParam); + + CachedGroundInfo.GroundHitResult = HitResult; + CachedGroundInfo.GroundDistance = LyraCharacter::GroundTraceDistance; + + if (MovementMode == MOVE_NavWalking) + { + CachedGroundInfo.GroundDistance = 0.0f; + } + else if (HitResult.bBlockingHit) + { + CachedGroundInfo.GroundDistance = FMath::Max((HitResult.Distance - CapsuleHalfHeight), 0.0f); + } + } + + CachedGroundInfo.LastUpdateFrame = GFrameCounter; + + return CachedGroundInfo; +} + +void ULyraCharacterMovementComponent::SetReplicatedAcceleration(const FVector& InAcceleration) +{ + bHasReplicatedAcceleration = true; + Acceleration = InAcceleration; +} + +FRotator ULyraCharacterMovementComponent::GetDeltaRotation(float DeltaTime) const +{ + if (UAbilitySystemComponent* ASC = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(GetOwner())) + { + if (ASC->HasMatchingGameplayTag(TAG_Gameplay_MovementStopped)) + { + return FRotator(0,0,0); + } + } + + return Super::GetDeltaRotation(DeltaTime); +} + +float ULyraCharacterMovementComponent::GetMaxSpeed() const +{ + if (UAbilitySystemComponent* ASC = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(GetOwner())) + { + if (ASC->HasMatchingGameplayTag(TAG_Gameplay_MovementStopped)) + { + return 0; + } + } + + return Super::GetMaxSpeed(); +} diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraCharacterMovementComponent.h b/LyraStarterGame/Source/LyraGame/Character/LyraCharacterMovementComponent.h new file mode 100644 index 0000000000000000000000000000000000000000..e4a9e0dc2c1eaa9b076b779ec6fa9d569632feec --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraCharacterMovementComponent.h @@ -0,0 +1,84 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "GameFramework/CharacterMovementComponent.h" +#include "NativeGameplayTags.h" + +#include "LyraCharacterMovementComponent.generated.h" + +#define UE_API LYRAGAME_API + +class UObject; +struct FFrame; + +LYRAGAME_API UE_DECLARE_GAMEPLAY_TAG_EXTERN(TAG_Gameplay_MovementStopped); + +/** + * FLyraCharacterGroundInfo + * + * Information about the ground under the character. It only gets updated as needed. + */ +USTRUCT(BlueprintType) +struct FLyraCharacterGroundInfo +{ + GENERATED_BODY() + + FLyraCharacterGroundInfo() + : LastUpdateFrame(0) + , GroundDistance(0.0f) + {} + + uint64 LastUpdateFrame; + + UPROPERTY(BlueprintReadOnly) + FHitResult GroundHitResult; + + UPROPERTY(BlueprintReadOnly) + float GroundDistance; +}; + + +/** + * ULyraCharacterMovementComponent + * + * The base character movement component class used by this project. + */ +UCLASS(MinimalAPI, Config = Game) +class ULyraCharacterMovementComponent : public UCharacterMovementComponent +{ + GENERATED_BODY() + +public: + + UE_API ULyraCharacterMovementComponent(const FObjectInitializer& ObjectInitializer); + + UE_API virtual void SimulateMovement(float DeltaTime) override; + + UE_API virtual bool CanAttemptJump() const override; + + // Returns the current ground info. Calling this will update the ground info if it's out of date. + UFUNCTION(BlueprintCallable, Category = "Lyra|CharacterMovement") + UE_API const FLyraCharacterGroundInfo& GetGroundInfo(); + + UE_API void SetReplicatedAcceleration(const FVector& InAcceleration); + + //~UMovementComponent interface + UE_API virtual FRotator GetDeltaRotation(float DeltaTime) const override; + UE_API virtual float GetMaxSpeed() const override; + //~End of UMovementComponent interface + +protected: + + UE_API virtual void InitializeComponent() override; + +protected: + + // Cached ground info for the character. Do not access this directly! It's only updated when accessed via GetGroundInfo(). + FLyraCharacterGroundInfo CachedGroundInfo; + + UPROPERTY(Transient) + bool bHasReplicatedAcceleration = false; +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraCharacterWithAbilities.cpp b/LyraStarterGame/Source/LyraGame/Character/LyraCharacterWithAbilities.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ea8b5775f3a5787697ebb78fbfe4cff38053f33 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraCharacterWithAbilities.cpp @@ -0,0 +1,39 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraCharacterWithAbilities.h" + +#include "AbilitySystem/Attributes/LyraCombatSet.h" +#include "AbilitySystem/Attributes/LyraHealthSet.h" +#include "AbilitySystem/LyraAbilitySystemComponent.h" +#include "Async/TaskGraphInterfaces.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraCharacterWithAbilities) + +ALyraCharacterWithAbilities::ALyraCharacterWithAbilities(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + AbilitySystemComponent = ObjectInitializer.CreateDefaultSubobject(this, TEXT("AbilitySystemComponent")); + AbilitySystemComponent->SetIsReplicated(true); + AbilitySystemComponent->SetReplicationMode(EGameplayEffectReplicationMode::Mixed); + + // These attribute sets will be detected by AbilitySystemComponent::InitializeComponent. Keeping a reference so that the sets don't get garbage collected before that. + HealthSet = CreateDefaultSubobject(TEXT("HealthSet")); + CombatSet = CreateDefaultSubobject(TEXT("CombatSet")); + + // AbilitySystemComponent needs to be updated at a high frequency. + SetNetUpdateFrequency(100.0f); +} + +void ALyraCharacterWithAbilities::PostInitializeComponents() +{ + Super::PostInitializeComponents(); + + check(AbilitySystemComponent); + AbilitySystemComponent->InitAbilityActorInfo(this, this); +} + +UAbilitySystemComponent* ALyraCharacterWithAbilities::GetAbilitySystemComponent() const +{ + return AbilitySystemComponent; +} + diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraCharacterWithAbilities.h b/LyraStarterGame/Source/LyraGame/Character/LyraCharacterWithAbilities.h new file mode 100644 index 0000000000000000000000000000000000000000..33ee6ee8f68c83101197f67a8ed6317f42c88f0d --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraCharacterWithAbilities.h @@ -0,0 +1,43 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Character/LyraCharacter.h" + +#include "LyraCharacterWithAbilities.generated.h" + +#define UE_API LYRAGAME_API + +class UAbilitySystemComponent; +class ULyraAbilitySystemComponent; +class UObject; + +// ALyraCharacter typically gets the ability system component from the possessing player state +// This represents a character with a self-contained ability system component. +UCLASS(MinimalAPI, Blueprintable) +class ALyraCharacterWithAbilities : public ALyraCharacter +{ + GENERATED_BODY() + +public: + UE_API ALyraCharacterWithAbilities(const FObjectInitializer& ObjectInitializer); + + UE_API virtual void PostInitializeComponents() override; + + UE_API virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override; + +private: + + // The ability system component sub-object used by player characters. + UPROPERTY(VisibleAnywhere, Category = "Lyra|PlayerState") + TObjectPtr AbilitySystemComponent; + + // Health attribute set used by this actor. + UPROPERTY() + TObjectPtr HealthSet; + // Combat attribute set used by this actor. + UPROPERTY() + TObjectPtr CombatSet; +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraHealthComponent.cpp b/LyraStarterGame/Source/LyraGame/Character/LyraHealthComponent.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8fa7a7a105778b03bb5340a3ebaefa0f2d89ccc8 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraHealthComponent.cpp @@ -0,0 +1,312 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "Character/LyraHealthComponent.h" + +#include "AbilitySystem/Attributes/LyraAttributeSet.h" +#include "LyraLogChannels.h" +#include "System/LyraAssetManager.h" +#include "System/LyraGameData.h" +#include "LyraGameplayTags.h" +#include "Net/UnrealNetwork.h" +#include "GameplayEffectExtension.h" +#include "AbilitySystem/LyraAbilitySystemComponent.h" +#include "AbilitySystem/Attributes/LyraHealthSet.h" +#include "Messages/LyraVerbMessage.h" +#include "Messages/LyraVerbMessageHelpers.h" +#include "GameFramework/GameplayMessageSubsystem.h" +#include "GameFramework/PlayerState.h" +#include "Engine/World.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraHealthComponent) + +UE_DEFINE_GAMEPLAY_TAG_STATIC(TAG_Lyra_Elimination_Message, "Lyra.Elimination.Message"); + + +ULyraHealthComponent::ULyraHealthComponent(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + PrimaryComponentTick.bStartWithTickEnabled = false; + PrimaryComponentTick.bCanEverTick = false; + + SetIsReplicatedByDefault(true); + + AbilitySystemComponent = nullptr; + HealthSet = nullptr; + DeathState = ELyraDeathState::NotDead; +} + +void ULyraHealthComponent::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const +{ + Super::GetLifetimeReplicatedProps(OutLifetimeProps); + + DOREPLIFETIME(ULyraHealthComponent, DeathState); +} + +void ULyraHealthComponent::OnUnregister() +{ + UninitializeFromAbilitySystem(); + + Super::OnUnregister(); +} + +void ULyraHealthComponent::InitializeWithAbilitySystem(ULyraAbilitySystemComponent* InASC) +{ + AActor* Owner = GetOwner(); + check(Owner); + + if (AbilitySystemComponent) + { + UE_LOG(LogLyra, Error, TEXT("LyraHealthComponent: Health component for owner [%s] has already been initialized with an ability system."), *GetNameSafe(Owner)); + return; + } + + AbilitySystemComponent = InASC; + if (!AbilitySystemComponent) + { + UE_LOG(LogLyra, Error, TEXT("LyraHealthComponent: Cannot initialize health component for owner [%s] with NULL ability system."), *GetNameSafe(Owner)); + return; + } + + HealthSet = AbilitySystemComponent->GetSet(); + if (!HealthSet) + { + UE_LOG(LogLyra, Error, TEXT("LyraHealthComponent: Cannot initialize health component for owner [%s] with NULL health set on the ability system."), *GetNameSafe(Owner)); + return; + } + + // Register to listen for attribute changes. + HealthSet->OnHealthChanged.AddUObject(this, &ThisClass::HandleHealthChanged); + HealthSet->OnMaxHealthChanged.AddUObject(this, &ThisClass::HandleMaxHealthChanged); + HealthSet->OnOutOfHealth.AddUObject(this, &ThisClass::HandleOutOfHealth); + + // TEMP: Reset attributes to default values. Eventually this will be driven by a spread sheet. + AbilitySystemComponent->SetNumericAttributeBase(ULyraHealthSet::GetHealthAttribute(), HealthSet->GetMaxHealth()); + + ClearGameplayTags(); + + OnHealthChanged.Broadcast(this, HealthSet->GetHealth(), HealthSet->GetHealth(), nullptr); + OnMaxHealthChanged.Broadcast(this, HealthSet->GetHealth(), HealthSet->GetHealth(), nullptr); +} + +void ULyraHealthComponent::UninitializeFromAbilitySystem() +{ + ClearGameplayTags(); + + if (HealthSet) + { + HealthSet->OnHealthChanged.RemoveAll(this); + HealthSet->OnMaxHealthChanged.RemoveAll(this); + HealthSet->OnOutOfHealth.RemoveAll(this); + } + + HealthSet = nullptr; + AbilitySystemComponent = nullptr; +} + +void ULyraHealthComponent::ClearGameplayTags() +{ + if (AbilitySystemComponent) + { + AbilitySystemComponent->SetLooseGameplayTagCount(LyraGameplayTags::Status_Death_Dying, 0); + AbilitySystemComponent->SetLooseGameplayTagCount(LyraGameplayTags::Status_Death_Dead, 0); + } +} + +float ULyraHealthComponent::GetHealth() const +{ + return (HealthSet ? HealthSet->GetHealth() : 0.0f); +} + +float ULyraHealthComponent::GetMaxHealth() const +{ + return (HealthSet ? HealthSet->GetMaxHealth() : 0.0f); +} + +float ULyraHealthComponent::GetHealthNormalized() const +{ + if (HealthSet) + { + const float Health = HealthSet->GetHealth(); + const float MaxHealth = HealthSet->GetMaxHealth(); + + return ((MaxHealth > 0.0f) ? (Health / MaxHealth) : 0.0f); + } + + return 0.0f; +} + +void ULyraHealthComponent::HandleHealthChanged(AActor* DamageInstigator, AActor* DamageCauser, const FGameplayEffectSpec* DamageEffectSpec, float DamageMagnitude, float OldValue, float NewValue) +{ + OnHealthChanged.Broadcast(this, OldValue, NewValue, DamageInstigator); +} + +void ULyraHealthComponent::HandleMaxHealthChanged(AActor* DamageInstigator, AActor* DamageCauser, const FGameplayEffectSpec* DamageEffectSpec, float DamageMagnitude, float OldValue, float NewValue) +{ + OnMaxHealthChanged.Broadcast(this, OldValue, NewValue, DamageInstigator); +} + +void ULyraHealthComponent::HandleOutOfHealth(AActor* DamageInstigator, AActor* DamageCauser, const FGameplayEffectSpec* DamageEffectSpec, float DamageMagnitude, float OldValue, float NewValue) +{ +#if WITH_SERVER_CODE + if (AbilitySystemComponent && DamageEffectSpec) + { + // Send the "GameplayEvent.Death" gameplay event through the owner's ability system. This can be used to trigger a death gameplay ability. + { + FGameplayEventData Payload; + Payload.EventTag = LyraGameplayTags::GameplayEvent_Death; + Payload.Instigator = DamageInstigator; + Payload.Target = AbilitySystemComponent->GetAvatarActor(); + Payload.OptionalObject = DamageEffectSpec->Def; + Payload.ContextHandle = DamageEffectSpec->GetEffectContext(); + Payload.InstigatorTags = *DamageEffectSpec->CapturedSourceTags.GetAggregatedTags(); + Payload.TargetTags = *DamageEffectSpec->CapturedTargetTags.GetAggregatedTags(); + Payload.EventMagnitude = DamageMagnitude; + + FScopedPredictionWindow NewScopedWindow(AbilitySystemComponent, true); + AbilitySystemComponent->HandleGameplayEvent(Payload.EventTag, &Payload); + } + + // Send a standardized verb message that other systems can observe + { + FLyraVerbMessage Message; + Message.Verb = TAG_Lyra_Elimination_Message; + Message.Instigator = DamageInstigator; + Message.InstigatorTags = *DamageEffectSpec->CapturedSourceTags.GetAggregatedTags(); + Message.Target = ULyraVerbMessageHelpers::GetPlayerStateFromObject(AbilitySystemComponent->GetAvatarActor()); + Message.TargetTags = *DamageEffectSpec->CapturedTargetTags.GetAggregatedTags(); + //@TODO: Fill out context tags, and any non-ability-system source/instigator tags + //@TODO: Determine if it's an opposing team kill, self-own, team kill, etc... + + UGameplayMessageSubsystem& MessageSystem = UGameplayMessageSubsystem::Get(GetWorld()); + MessageSystem.BroadcastMessage(Message.Verb, Message); + } + + //@TODO: assist messages (could compute from damage dealt elsewhere)? + } + +#endif // #if WITH_SERVER_CODE +} + +void ULyraHealthComponent::OnRep_DeathState(ELyraDeathState OldDeathState) +{ + const ELyraDeathState NewDeathState = DeathState; + + // Revert the death state for now since we rely on StartDeath and FinishDeath to change it. + DeathState = OldDeathState; + + if (OldDeathState > NewDeathState) + { + // The server is trying to set us back but we've already predicted past the server state. + UE_LOG(LogLyra, Warning, TEXT("LyraHealthComponent: Predicted past server death state [%d] -> [%d] for owner [%s]."), (uint8)OldDeathState, (uint8)NewDeathState, *GetNameSafe(GetOwner())); + return; + } + + if (OldDeathState == ELyraDeathState::NotDead) + { + if (NewDeathState == ELyraDeathState::DeathStarted) + { + StartDeath(); + } + else if (NewDeathState == ELyraDeathState::DeathFinished) + { + StartDeath(); + FinishDeath(); + } + else + { + UE_LOG(LogLyra, Error, TEXT("LyraHealthComponent: Invalid death transition [%d] -> [%d] for owner [%s]."), (uint8)OldDeathState, (uint8)NewDeathState, *GetNameSafe(GetOwner())); + } + } + else if (OldDeathState == ELyraDeathState::DeathStarted) + { + if (NewDeathState == ELyraDeathState::DeathFinished) + { + FinishDeath(); + } + else + { + UE_LOG(LogLyra, Error, TEXT("LyraHealthComponent: Invalid death transition [%d] -> [%d] for owner [%s]."), (uint8)OldDeathState, (uint8)NewDeathState, *GetNameSafe(GetOwner())); + } + } + + ensureMsgf((DeathState == NewDeathState), TEXT("LyraHealthComponent: Death transition failed [%d] -> [%d] for owner [%s]."), (uint8)OldDeathState, (uint8)NewDeathState, *GetNameSafe(GetOwner())); +} + +void ULyraHealthComponent::StartDeath() +{ + if (DeathState != ELyraDeathState::NotDead) + { + return; + } + + DeathState = ELyraDeathState::DeathStarted; + + if (AbilitySystemComponent) + { + AbilitySystemComponent->SetLooseGameplayTagCount(LyraGameplayTags::Status_Death_Dying, 1); + } + + AActor* Owner = GetOwner(); + check(Owner); + + OnDeathStarted.Broadcast(Owner); + + Owner->ForceNetUpdate(); +} + +void ULyraHealthComponent::FinishDeath() +{ + if (DeathState != ELyraDeathState::DeathStarted) + { + return; + } + + DeathState = ELyraDeathState::DeathFinished; + + if (AbilitySystemComponent) + { + AbilitySystemComponent->SetLooseGameplayTagCount(LyraGameplayTags::Status_Death_Dead, 1); + } + + AActor* Owner = GetOwner(); + check(Owner); + + OnDeathFinished.Broadcast(Owner); + + Owner->ForceNetUpdate(); +} + +void ULyraHealthComponent::DamageSelfDestruct(bool bFellOutOfWorld) +{ + if ((DeathState == ELyraDeathState::NotDead) && AbilitySystemComponent) + { + const TSubclassOf DamageGE = ULyraAssetManager::GetSubclass(ULyraGameData::Get().DamageGameplayEffect_SetByCaller); + if (!DamageGE) + { + UE_LOG(LogLyra, Error, TEXT("LyraHealthComponent: DamageSelfDestruct failed for owner [%s]. Unable to find gameplay effect [%s]."), *GetNameSafe(GetOwner()), *ULyraGameData::Get().DamageGameplayEffect_SetByCaller.GetAssetName()); + return; + } + + FGameplayEffectSpecHandle SpecHandle = AbilitySystemComponent->MakeOutgoingSpec(DamageGE, 1.0f, AbilitySystemComponent->MakeEffectContext()); + FGameplayEffectSpec* Spec = SpecHandle.Data.Get(); + + if (!Spec) + { + UE_LOG(LogLyra, Error, TEXT("LyraHealthComponent: DamageSelfDestruct failed for owner [%s]. Unable to make outgoing spec for [%s]."), *GetNameSafe(GetOwner()), *GetNameSafe(DamageGE)); + return; + } + + Spec->AddDynamicAssetTag(TAG_Gameplay_DamageSelfDestruct); + + if (bFellOutOfWorld) + { + Spec->AddDynamicAssetTag(TAG_Gameplay_FellOutOfWorld); + } + + const float DamageAmount = GetMaxHealth(); + + Spec->SetSetByCallerMagnitude(LyraGameplayTags::SetByCaller_Damage, DamageAmount); + AbilitySystemComponent->ApplyGameplayEffectSpecToSelf(*Spec); + } +} + diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraHealthComponent.h b/LyraStarterGame/Source/LyraGame/Character/LyraHealthComponent.h new file mode 100644 index 0000000000000000000000000000000000000000..04bc70d012c226db9f538581fbf2451c1def0702 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraHealthComponent.h @@ -0,0 +1,135 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Components/GameFrameworkComponent.h" + +#include "LyraHealthComponent.generated.h" + +#define UE_API LYRAGAME_API + +class ULyraHealthComponent; + +class ULyraAbilitySystemComponent; +class ULyraHealthSet; +class UObject; +struct FFrame; +struct FGameplayEffectSpec; + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FLyraHealth_DeathEvent, AActor*, OwningActor); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams(FLyraHealth_AttributeChanged, ULyraHealthComponent*, HealthComponent, float, OldValue, float, NewValue, AActor*, Instigator); + +/** + * ELyraDeathState + * + * Defines current state of death. + */ +UENUM(BlueprintType) +enum class ELyraDeathState : uint8 +{ + NotDead = 0, + DeathStarted, + DeathFinished +}; + + +/** + * ULyraHealthComponent + * + * An actor component used to handle anything related to health. + */ +UCLASS(MinimalAPI, Blueprintable, Meta=(BlueprintSpawnableComponent)) +class ULyraHealthComponent : public UGameFrameworkComponent +{ + GENERATED_BODY() + +public: + + UE_API ULyraHealthComponent(const FObjectInitializer& ObjectInitializer); + + // Returns the health component if one exists on the specified actor. + UFUNCTION(BlueprintPure, Category = "Lyra|Health") + static ULyraHealthComponent* FindHealthComponent(const AActor* Actor) { return (Actor ? Actor->FindComponentByClass() : nullptr); } + + // Initialize the component using an ability system component. + UFUNCTION(BlueprintCallable, Category = "Lyra|Health") + UE_API void InitializeWithAbilitySystem(ULyraAbilitySystemComponent* InASC); + + // Uninitialize the component, clearing any references to the ability system. + UFUNCTION(BlueprintCallable, Category = "Lyra|Health") + UE_API void UninitializeFromAbilitySystem(); + + // Returns the current health value. + UFUNCTION(BlueprintCallable, Category = "Lyra|Health") + UE_API float GetHealth() const; + + // Returns the current maximum health value. + UFUNCTION(BlueprintCallable, Category = "Lyra|Health") + UE_API float GetMaxHealth() const; + + // Returns the current health in the range [0.0, 1.0]. + UFUNCTION(BlueprintCallable, Category = "Lyra|Health") + UE_API float GetHealthNormalized() const; + + UFUNCTION(BlueprintCallable, Category = "Lyra|Health") + ELyraDeathState GetDeathState() const { return DeathState; } + + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "Lyra|Health", Meta = (ExpandBoolAsExecs = "ReturnValue")) + bool IsDeadOrDying() const { return (DeathState > ELyraDeathState::NotDead); } + + // Begins the death sequence for the owner. + UE_API virtual void StartDeath(); + + // Ends the death sequence for the owner. + UE_API virtual void FinishDeath(); + + // Applies enough damage to kill the owner. + UE_API virtual void DamageSelfDestruct(bool bFellOutOfWorld = false); + +public: + + // Delegate fired when the health value has changed. This is called on the client but the instigator may not be valid + UPROPERTY(BlueprintAssignable) + FLyraHealth_AttributeChanged OnHealthChanged; + + // Delegate fired when the max health value has changed. This is called on the client but the instigator may not be valid + UPROPERTY(BlueprintAssignable) + FLyraHealth_AttributeChanged OnMaxHealthChanged; + + // Delegate fired when the death sequence has started. + UPROPERTY(BlueprintAssignable) + FLyraHealth_DeathEvent OnDeathStarted; + + // Delegate fired when the death sequence has finished. + UPROPERTY(BlueprintAssignable) + FLyraHealth_DeathEvent OnDeathFinished; + +protected: + + UE_API virtual void OnUnregister() override; + + UE_API void ClearGameplayTags(); + + UE_API virtual void HandleHealthChanged(AActor* DamageInstigator, AActor* DamageCauser, const FGameplayEffectSpec* DamageEffectSpec, float DamageMagnitude, float OldValue, float NewValue); + UE_API virtual void HandleMaxHealthChanged(AActor* DamageInstigator, AActor* DamageCauser, const FGameplayEffectSpec* DamageEffectSpec, float DamageMagnitude, float OldValue, float NewValue); + UE_API virtual void HandleOutOfHealth(AActor* DamageInstigator, AActor* DamageCauser, const FGameplayEffectSpec* DamageEffectSpec, float DamageMagnitude, float OldValue, float NewValue); + + UFUNCTION() + UE_API virtual void OnRep_DeathState(ELyraDeathState OldDeathState); + +protected: + + // Ability system used by this component. + UPROPERTY() + TObjectPtr AbilitySystemComponent; + + // Health set used by this component. + UPROPERTY() + TObjectPtr HealthSet; + + // Replicated state used to handle dying. + UPROPERTY(ReplicatedUsing = OnRep_DeathState) + ELyraDeathState DeathState; +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraHeroComponent.cpp b/LyraStarterGame/Source/LyraGame/Character/LyraHeroComponent.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d90dc36184351e3094cc798cc3e0148c6b53d688 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraHeroComponent.cpp @@ -0,0 +1,512 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraHeroComponent.h" +#include "Components/GameFrameworkComponentDelegates.h" +#include "Logging/MessageLog.h" +#include "LyraLogChannels.h" +#include "EnhancedInputSubsystems.h" +#include "Player/LyraPlayerController.h" +#include "Player/LyraPlayerState.h" +#include "Player/LyraLocalPlayer.h" +#include "Character/LyraPawnExtensionComponent.h" +#include "Character/LyraPawnData.h" +#include "Character/LyraCharacter.h" +#include "AbilitySystem/LyraAbilitySystemComponent.h" +#include "Input/LyraInputConfig.h" +#include "Input/LyraInputComponent.h" +#include "Camera/LyraCameraComponent.h" +#include "LyraGameplayTags.h" +#include "Components/GameFrameworkComponentManager.h" +#include "PlayerMappableInputConfig.h" +#include "Camera/LyraCameraMode.h" +#include "UserSettings/EnhancedInputUserSettings.h" +#include "InputMappingContext.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraHeroComponent) + +#if WITH_EDITOR +#include "Misc/UObjectToken.h" +#endif // WITH_EDITOR + +namespace LyraHero +{ + static const float LookYawRate = 300.0f; + static const float LookPitchRate = 165.0f; +}; + +const FName ULyraHeroComponent::NAME_BindInputsNow("BindInputsNow"); +const FName ULyraHeroComponent::NAME_ActorFeatureName("Hero"); + +ULyraHeroComponent::ULyraHeroComponent(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + AbilityCameraMode = nullptr; + bReadyToBindInputs = false; +} + +void ULyraHeroComponent::OnRegister() +{ + Super::OnRegister(); + + if (!GetPawn()) + { + UE_LOG(LogLyra, Error, TEXT("[ULyraHeroComponent::OnRegister] This component has been added to a blueprint whose base class is not a Pawn. To use this component, it MUST be placed on a Pawn Blueprint.")); + +#if WITH_EDITOR + if (GIsEditor) + { + static const FText Message = NSLOCTEXT("LyraHeroComponent", "NotOnPawnError", "has been added to a blueprint whose base class is not a Pawn. To use this component, it MUST be placed on a Pawn Blueprint. This will cause a crash if you PIE!"); + static const FName HeroMessageLogName = TEXT("LyraHeroComponent"); + + FMessageLog(HeroMessageLogName).Error() + ->AddToken(FUObjectToken::Create(this, FText::FromString(GetNameSafe(this)))) + ->AddToken(FTextToken::Create(Message)); + + FMessageLog(HeroMessageLogName).Open(); + } +#endif + } + else + { + // Register with the init state system early, this will only work if this is a game world + RegisterInitStateFeature(); + } +} + +bool ULyraHeroComponent::CanChangeInitState(UGameFrameworkComponentManager* Manager, FGameplayTag CurrentState, FGameplayTag DesiredState) const +{ + check(Manager); + + APawn* Pawn = GetPawn(); + + if (!CurrentState.IsValid() && DesiredState == LyraGameplayTags::InitState_Spawned) + { + // As long as we have a real pawn, let us transition + if (Pawn) + { + return true; + } + } + else if (CurrentState == LyraGameplayTags::InitState_Spawned && DesiredState == LyraGameplayTags::InitState_DataAvailable) + { + // The player state is required. + if (!GetPlayerState()) + { + return false; + } + + // If we're authority or autonomous, we need to wait for a controller with registered ownership of the player state. + if (Pawn->GetLocalRole() != ROLE_SimulatedProxy) + { + AController* Controller = GetController(); + + const bool bHasControllerPairedWithPS = (Controller != nullptr) && \ + (Controller->PlayerState != nullptr) && \ + (Controller->PlayerState->GetOwner() == Controller); + + if (!bHasControllerPairedWithPS) + { + return false; + } + } + + const bool bIsLocallyControlled = Pawn->IsLocallyControlled(); + const bool bIsBot = Pawn->IsBotControlled(); + + if (bIsLocallyControlled && !bIsBot) + { + ALyraPlayerController* LyraPC = GetController(); + + // The input component and local player is required when locally controlled. + if (!Pawn->InputComponent || !LyraPC || !LyraPC->GetLocalPlayer()) + { + return false; + } + } + + return true; + } + else if (CurrentState == LyraGameplayTags::InitState_DataAvailable && DesiredState == LyraGameplayTags::InitState_DataInitialized) + { + // Wait for player state and extension component + ALyraPlayerState* LyraPS = GetPlayerState(); + + return LyraPS && Manager->HasFeatureReachedInitState(Pawn, ULyraPawnExtensionComponent::NAME_ActorFeatureName, LyraGameplayTags::InitState_DataInitialized); + } + else if (CurrentState == LyraGameplayTags::InitState_DataInitialized && DesiredState == LyraGameplayTags::InitState_GameplayReady) + { + // TODO add ability initialization checks? + return true; + } + + return false; +} + +void ULyraHeroComponent::HandleChangeInitState(UGameFrameworkComponentManager* Manager, FGameplayTag CurrentState, FGameplayTag DesiredState) +{ + if (CurrentState == LyraGameplayTags::InitState_DataAvailable && DesiredState == LyraGameplayTags::InitState_DataInitialized) + { + APawn* Pawn = GetPawn(); + ALyraPlayerState* LyraPS = GetPlayerState(); + if (!ensure(Pawn && LyraPS)) + { + return; + } + + const ULyraPawnData* PawnData = nullptr; + + if (ULyraPawnExtensionComponent* PawnExtComp = ULyraPawnExtensionComponent::FindPawnExtensionComponent(Pawn)) + { + PawnData = PawnExtComp->GetPawnData(); + + // The player state holds the persistent data for this player (state that persists across deaths and multiple pawns). + // The ability system component and attribute sets live on the player state. + PawnExtComp->InitializeAbilitySystem(LyraPS->GetLyraAbilitySystemComponent(), LyraPS); + } + + if (ALyraPlayerController* LyraPC = GetController()) + { + if (Pawn->InputComponent != nullptr) + { + InitializePlayerInput(Pawn->InputComponent); + } + } + + // Hook up the delegate for all pawns, in case we spectate later + if (PawnData) + { + if (ULyraCameraComponent* CameraComponent = ULyraCameraComponent::FindCameraComponent(Pawn)) + { + CameraComponent->DetermineCameraModeDelegate.BindUObject(this, &ThisClass::DetermineCameraMode); + } + } + } +} + +void ULyraHeroComponent::OnActorInitStateChanged(const FActorInitStateChangedParams& Params) +{ + if (Params.FeatureName == ULyraPawnExtensionComponent::NAME_ActorFeatureName) + { + if (Params.FeatureState == LyraGameplayTags::InitState_DataInitialized) + { + // If the extension component says all all other components are initialized, try to progress to next state + CheckDefaultInitialization(); + } + } +} + +void ULyraHeroComponent::CheckDefaultInitialization() +{ + static const TArray StateChain = { LyraGameplayTags::InitState_Spawned, LyraGameplayTags::InitState_DataAvailable, LyraGameplayTags::InitState_DataInitialized, LyraGameplayTags::InitState_GameplayReady }; + + // This will try to progress from spawned (which is only set in BeginPlay) through the data initialization stages until it gets to gameplay ready + ContinueInitStateChain(StateChain); +} + +void ULyraHeroComponent::BeginPlay() +{ + Super::BeginPlay(); + + // Listen for when the pawn extension component changes init state + BindOnActorInitStateChanged(ULyraPawnExtensionComponent::NAME_ActorFeatureName, FGameplayTag(), false); + + // Notifies that we are done spawning, then try the rest of initialization + ensure(TryToChangeInitState(LyraGameplayTags::InitState_Spawned)); + CheckDefaultInitialization(); +} + +void ULyraHeroComponent::EndPlay(const EEndPlayReason::Type EndPlayReason) +{ + UnregisterInitStateFeature(); + + Super::EndPlay(EndPlayReason); +} + +void ULyraHeroComponent::InitializePlayerInput(UInputComponent* PlayerInputComponent) +{ + check(PlayerInputComponent); + + const APawn* Pawn = GetPawn(); + if (!Pawn) + { + return; + } + + const APlayerController* PC = GetController(); + check(PC); + + const ULyraLocalPlayer* LP = Cast(PC->GetLocalPlayer()); + check(LP); + + UEnhancedInputLocalPlayerSubsystem* Subsystem = LP->GetSubsystem(); + check(Subsystem); + + Subsystem->ClearAllMappings(); + + if (const ULyraPawnExtensionComponent* PawnExtComp = ULyraPawnExtensionComponent::FindPawnExtensionComponent(Pawn)) + { + if (const ULyraPawnData* PawnData = PawnExtComp->GetPawnData()) + { + if (const ULyraInputConfig* InputConfig = PawnData->InputConfig) + { + for (const FInputMappingContextAndPriority& Mapping : DefaultInputMappings) + { + if (UInputMappingContext* IMC = Mapping.InputMapping.LoadSynchronous()) + { + if (Mapping.bRegisterWithSettings) + { + if (UEnhancedInputUserSettings* Settings = Subsystem->GetUserSettings()) + { + Settings->RegisterInputMappingContext(IMC); + } + + FModifyContextOptions Options = {}; + Options.bIgnoreAllPressedKeysUntilRelease = false; + // Actually add the config to the local player + Subsystem->AddMappingContext(IMC, Mapping.Priority, Options); + } + } + } + + // The Lyra Input Component has some additional functions to map Gameplay Tags to an Input Action. + // If you want this functionality but still want to change your input component class, make it a subclass + // of the ULyraInputComponent or modify this component accordingly. + ULyraInputComponent* LyraIC = Cast(PlayerInputComponent); + if (ensureMsgf(LyraIC, TEXT("Unexpected Input Component class! The Gameplay Abilities will not be bound to their inputs. Change the input component to ULyraInputComponent or a subclass of it."))) + { + // Add the key mappings that may have been set by the player + LyraIC->AddInputMappings(InputConfig, Subsystem); + + // This is where we actually bind and input action to a gameplay tag, which means that Gameplay Ability Blueprints will + // be triggered directly by these input actions Triggered events. + TArray BindHandles; + LyraIC->BindAbilityActions(InputConfig, this, &ThisClass::Input_AbilityInputTagPressed, &ThisClass::Input_AbilityInputTagReleased, /*out*/ BindHandles); + + LyraIC->BindNativeAction(InputConfig, LyraGameplayTags::InputTag_Move, ETriggerEvent::Triggered, this, &ThisClass::Input_Move, /*bLogIfNotFound=*/ false); + LyraIC->BindNativeAction(InputConfig, LyraGameplayTags::InputTag_Look_Mouse, ETriggerEvent::Triggered, this, &ThisClass::Input_LookMouse, /*bLogIfNotFound=*/ false); + LyraIC->BindNativeAction(InputConfig, LyraGameplayTags::InputTag_Look_Stick, ETriggerEvent::Triggered, this, &ThisClass::Input_LookStick, /*bLogIfNotFound=*/ false); + LyraIC->BindNativeAction(InputConfig, LyraGameplayTags::InputTag_Crouch, ETriggerEvent::Triggered, this, &ThisClass::Input_Crouch, /*bLogIfNotFound=*/ false); + LyraIC->BindNativeAction(InputConfig, LyraGameplayTags::InputTag_AutoRun, ETriggerEvent::Triggered, this, &ThisClass::Input_AutoRun, /*bLogIfNotFound=*/ false); + } + } + } + } + + if (ensure(!bReadyToBindInputs)) + { + bReadyToBindInputs = true; + } + + UGameFrameworkComponentManager::SendGameFrameworkComponentExtensionEvent(const_cast(PC), NAME_BindInputsNow); + UGameFrameworkComponentManager::SendGameFrameworkComponentExtensionEvent(const_cast(Pawn), NAME_BindInputsNow); +} + +void ULyraHeroComponent::AddAdditionalInputConfig(const ULyraInputConfig* InputConfig) +{ + TArray BindHandles; + + const APawn* Pawn = GetPawn(); + if (!Pawn) + { + return; + } + + const APlayerController* PC = GetController(); + check(PC); + + const ULocalPlayer* LP = PC->GetLocalPlayer(); + check(LP); + + UEnhancedInputLocalPlayerSubsystem* Subsystem = LP->GetSubsystem(); + check(Subsystem); + + if (const ULyraPawnExtensionComponent* PawnExtComp = ULyraPawnExtensionComponent::FindPawnExtensionComponent(Pawn)) + { + ULyraInputComponent* LyraIC = Pawn->FindComponentByClass(); + if (ensureMsgf(LyraIC, TEXT("Unexpected Input Component class! The Gameplay Abilities will not be bound to their inputs. Change the input component to ULyraInputComponent or a subclass of it."))) + { + LyraIC->BindAbilityActions(InputConfig, this, &ThisClass::Input_AbilityInputTagPressed, &ThisClass::Input_AbilityInputTagReleased, /*out*/ BindHandles); + } + } +} + +void ULyraHeroComponent::RemoveAdditionalInputConfig(const ULyraInputConfig* InputConfig) +{ + //@TODO: Implement me! +} + +bool ULyraHeroComponent::IsReadyToBindInputs() const +{ + return bReadyToBindInputs; +} + +void ULyraHeroComponent::Input_AbilityInputTagPressed(FGameplayTag InputTag) +{ + if (const APawn* Pawn = GetPawn()) + { + if (const ULyraPawnExtensionComponent* PawnExtComp = ULyraPawnExtensionComponent::FindPawnExtensionComponent(Pawn)) + { + if (ULyraAbilitySystemComponent* LyraASC = PawnExtComp->GetLyraAbilitySystemComponent()) + { + LyraASC->AbilityInputTagPressed(InputTag); + } + } + } +} + +void ULyraHeroComponent::Input_AbilityInputTagReleased(FGameplayTag InputTag) +{ + const APawn* Pawn = GetPawn(); + if (!Pawn) + { + return; + } + + if (const ULyraPawnExtensionComponent* PawnExtComp = ULyraPawnExtensionComponent::FindPawnExtensionComponent(Pawn)) + { + if (ULyraAbilitySystemComponent* LyraASC = PawnExtComp->GetLyraAbilitySystemComponent()) + { + LyraASC->AbilityInputTagReleased(InputTag); + } + } +} + +void ULyraHeroComponent::Input_Move(const FInputActionValue& InputActionValue) +{ + APawn* Pawn = GetPawn(); + AController* Controller = Pawn ? Pawn->GetController() : nullptr; + + // If the player has attempted to move again then cancel auto running + if (ALyraPlayerController* LyraController = Cast(Controller)) + { + LyraController->SetIsAutoRunning(false); + } + + if (Controller) + { + const FVector2D Value = InputActionValue.Get(); + const FRotator MovementRotation(0.0f, Controller->GetControlRotation().Yaw, 0.0f); + + if (Value.X != 0.0f) + { + const FVector MovementDirection = MovementRotation.RotateVector(FVector::RightVector); + Pawn->AddMovementInput(MovementDirection, Value.X); + } + + if (Value.Y != 0.0f) + { + const FVector MovementDirection = MovementRotation.RotateVector(FVector::ForwardVector); + Pawn->AddMovementInput(MovementDirection, Value.Y); + } + } +} + +void ULyraHeroComponent::Input_LookMouse(const FInputActionValue& InputActionValue) +{ + APawn* Pawn = GetPawn(); + + if (!Pawn) + { + return; + } + + const FVector2D Value = InputActionValue.Get(); + + if (Value.X != 0.0f) + { + Pawn->AddControllerYawInput(Value.X); + } + + if (Value.Y != 0.0f) + { + Pawn->AddControllerPitchInput(Value.Y); + } +} + +void ULyraHeroComponent::Input_LookStick(const FInputActionValue& InputActionValue) +{ + APawn* Pawn = GetPawn(); + + if (!Pawn) + { + return; + } + + const FVector2D Value = InputActionValue.Get(); + + const UWorld* World = GetWorld(); + check(World); + + if (Value.X != 0.0f) + { + Pawn->AddControllerYawInput(Value.X * LyraHero::LookYawRate * World->GetDeltaSeconds()); + } + + if (Value.Y != 0.0f) + { + Pawn->AddControllerPitchInput(Value.Y * LyraHero::LookPitchRate * World->GetDeltaSeconds()); + } +} + +void ULyraHeroComponent::Input_Crouch(const FInputActionValue& InputActionValue) +{ + if (ALyraCharacter* Character = GetPawn()) + { + Character->ToggleCrouch(); + } +} + +void ULyraHeroComponent::Input_AutoRun(const FInputActionValue& InputActionValue) +{ + if (APawn* Pawn = GetPawn()) + { + if (ALyraPlayerController* Controller = Cast(Pawn->GetController())) + { + // Toggle auto running + Controller->SetIsAutoRunning(!Controller->GetIsAutoRunning()); + } + } +} + +TSubclassOf ULyraHeroComponent::DetermineCameraMode() const +{ + if (AbilityCameraMode) + { + return AbilityCameraMode; + } + + const APawn* Pawn = GetPawn(); + if (!Pawn) + { + return nullptr; + } + + if (ULyraPawnExtensionComponent* PawnExtComp = ULyraPawnExtensionComponent::FindPawnExtensionComponent(Pawn)) + { + if (const ULyraPawnData* PawnData = PawnExtComp->GetPawnData()) + { + return PawnData->DefaultCameraMode; + } + } + + return nullptr; +} + +void ULyraHeroComponent::SetAbilityCameraMode(TSubclassOf CameraMode, const FGameplayAbilitySpecHandle& OwningSpecHandle) +{ + if (CameraMode) + { + AbilityCameraMode = CameraMode; + AbilityCameraModeOwningSpecHandle = OwningSpecHandle; + } +} + +void ULyraHeroComponent::ClearAbilityCameraMode(const FGameplayAbilitySpecHandle& OwningSpecHandle) +{ + if (AbilityCameraModeOwningSpecHandle == OwningSpecHandle) + { + AbilityCameraMode = nullptr; + AbilityCameraModeOwningSpecHandle = FGameplayAbilitySpecHandle(); + } +} + diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraHeroComponent.h b/LyraStarterGame/Source/LyraGame/Character/LyraHeroComponent.h new file mode 100644 index 0000000000000000000000000000000000000000..b47fa3699c2a72d7db82be0542b5479befca52a2 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraHeroComponent.h @@ -0,0 +1,108 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Components/GameFrameworkInitStateInterface.h" +#include "Components/PawnComponent.h" +#include "GameFeatures/GameFeatureAction_AddInputContextMapping.h" +#include "GameplayAbilitySpecHandle.h" +#include "LyraHeroComponent.generated.h" + +#define UE_API LYRAGAME_API + +namespace EEndPlayReason { enum Type : int; } +struct FLoadedMappableConfigPair; +struct FMappableConfigPair; + +class UGameFrameworkComponentManager; +class UInputComponent; +class ULyraCameraMode; +class ULyraInputConfig; +class UObject; +struct FActorInitStateChangedParams; +struct FFrame; +struct FGameplayTag; +struct FInputActionValue; + +/** + * Component that sets up input and camera handling for player controlled pawns (or bots that simulate players). + * This depends on a PawnExtensionComponent to coordinate initialization. + */ +UCLASS(MinimalAPI, Blueprintable, Meta=(BlueprintSpawnableComponent)) +class ULyraHeroComponent : public UPawnComponent, public IGameFrameworkInitStateInterface +{ + GENERATED_BODY() + +public: + + UE_API ULyraHeroComponent(const FObjectInitializer& ObjectInitializer); + + /** Returns the hero component if one exists on the specified actor. */ + UFUNCTION(BlueprintPure, Category = "Lyra|Hero") + static ULyraHeroComponent* FindHeroComponent(const AActor* Actor) { return (Actor ? Actor->FindComponentByClass() : nullptr); } + + /** Overrides the camera from an active gameplay ability */ + UE_API void SetAbilityCameraMode(TSubclassOf CameraMode, const FGameplayAbilitySpecHandle& OwningSpecHandle); + + /** Clears the camera override if it is set */ + UE_API void ClearAbilityCameraMode(const FGameplayAbilitySpecHandle& OwningSpecHandle); + + /** Adds mode-specific input config */ + UE_API void AddAdditionalInputConfig(const ULyraInputConfig* InputConfig); + + /** Removes a mode-specific input config if it has been added */ + UE_API void RemoveAdditionalInputConfig(const ULyraInputConfig* InputConfig); + + /** True if this is controlled by a real player and has progressed far enough in initialization where additional input bindings can be added */ + UE_API bool IsReadyToBindInputs() const; + + /** The name of the extension event sent via UGameFrameworkComponentManager when ability inputs are ready to bind */ + static UE_API const FName NAME_BindInputsNow; + + /** The name of this component-implemented feature */ + static UE_API const FName NAME_ActorFeatureName; + + //~ Begin IGameFrameworkInitStateInterface interface + virtual FName GetFeatureName() const override { return NAME_ActorFeatureName; } + UE_API virtual bool CanChangeInitState(UGameFrameworkComponentManager* Manager, FGameplayTag CurrentState, FGameplayTag DesiredState) const override; + UE_API virtual void HandleChangeInitState(UGameFrameworkComponentManager* Manager, FGameplayTag CurrentState, FGameplayTag DesiredState) override; + UE_API virtual void OnActorInitStateChanged(const FActorInitStateChangedParams& Params) override; + UE_API virtual void CheckDefaultInitialization() override; + //~ End IGameFrameworkInitStateInterface interface + +protected: + + UE_API virtual void OnRegister() override; + UE_API virtual void BeginPlay() override; + UE_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; + + UE_API virtual void InitializePlayerInput(UInputComponent* PlayerInputComponent); + + UE_API void Input_AbilityInputTagPressed(FGameplayTag InputTag); + UE_API void Input_AbilityInputTagReleased(FGameplayTag InputTag); + + UE_API void Input_Move(const FInputActionValue& InputActionValue); + UE_API void Input_LookMouse(const FInputActionValue& InputActionValue); + UE_API void Input_LookStick(const FInputActionValue& InputActionValue); + UE_API void Input_Crouch(const FInputActionValue& InputActionValue); + UE_API void Input_AutoRun(const FInputActionValue& InputActionValue); + + UE_API TSubclassOf DetermineCameraMode() const; + +protected: + + UPROPERTY(EditAnywhere) + TArray DefaultInputMappings; + + /** Camera mode set by an ability. */ + UPROPERTY() + TSubclassOf AbilityCameraMode; + + /** Spec handle for the last ability to set a camera mode. */ + FGameplayAbilitySpecHandle AbilityCameraModeOwningSpecHandle; + + /** True when player input bindings have been applied, will never be true for non - players */ + bool bReadyToBindInputs; +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraPawn.cpp b/LyraStarterGame/Source/LyraGame/Character/LyraPawn.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f98d029e07700e58091cbf8abdaef92d30c2c99d --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraPawn.cpp @@ -0,0 +1,112 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraPawn.h" + +#include "GameFramework/Controller.h" +#include "LyraLogChannels.h" +#include "Net/UnrealNetwork.h" +#include "UObject/ScriptInterface.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraPawn) + +class FLifetimeProperty; +class UObject; + +ALyraPawn::ALyraPawn(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void ALyraPawn::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const +{ + Super::GetLifetimeReplicatedProps(OutLifetimeProps); + + DOREPLIFETIME(ThisClass, MyTeamID); +} + +void ALyraPawn::PreInitializeComponents() +{ + Super::PreInitializeComponents(); +} + +void ALyraPawn::EndPlay(const EEndPlayReason::Type EndPlayReason) +{ + Super::EndPlay(EndPlayReason); +} + +void ALyraPawn::PossessedBy(AController* NewController) +{ + const FGenericTeamId OldTeamID = MyTeamID; + + Super::PossessedBy(NewController); + + // Grab the current team ID and listen for future changes + if (ILyraTeamAgentInterface* ControllerAsTeamProvider = Cast(NewController)) + { + MyTeamID = ControllerAsTeamProvider->GetGenericTeamId(); + ControllerAsTeamProvider->GetTeamChangedDelegateChecked().AddDynamic(this, &ThisClass::OnControllerChangedTeam); + } + ConditionalBroadcastTeamChanged(this, OldTeamID, MyTeamID); +} + +void ALyraPawn::UnPossessed() +{ + AController* const OldController = GetController(); + + // Stop listening for changes from the old controller + const FGenericTeamId OldTeamID = MyTeamID; + if (ILyraTeamAgentInterface* ControllerAsTeamProvider = Cast(OldController)) + { + ControllerAsTeamProvider->GetTeamChangedDelegateChecked().RemoveAll(this); + } + + Super::UnPossessed(); + + // Determine what the new team ID should be afterwards + MyTeamID = DetermineNewTeamAfterPossessionEnds(OldTeamID); + ConditionalBroadcastTeamChanged(this, OldTeamID, MyTeamID); +} + +void ALyraPawn::SetGenericTeamId(const FGenericTeamId& NewTeamID) +{ + if (GetController() == nullptr) + { + if (HasAuthority()) + { + const FGenericTeamId OldTeamID = MyTeamID; + MyTeamID = NewTeamID; + ConditionalBroadcastTeamChanged(this, OldTeamID, MyTeamID); + } + else + { + UE_LOG(LogLyraTeams, Error, TEXT("You can't set the team ID on a pawn (%s) except on the authority"), *GetPathNameSafe(this)); + } + } + else + { + UE_LOG(LogLyraTeams, Error, TEXT("You can't set the team ID on a possessed pawn (%s); it's driven by the associated controller"), *GetPathNameSafe(this)); + } +} + +FGenericTeamId ALyraPawn::GetGenericTeamId() const +{ + return MyTeamID; +} + +FOnLyraTeamIndexChangedDelegate* ALyraPawn::GetOnTeamIndexChangedDelegate() +{ + return &OnTeamChangedDelegate; +} + +void ALyraPawn::OnControllerChangedTeam(UObject* TeamAgent, int32 OldTeam, int32 NewTeam) +{ + const FGenericTeamId MyOldTeamID = MyTeamID; + MyTeamID = IntegerToGenericTeamId(NewTeam); + ConditionalBroadcastTeamChanged(this, MyOldTeamID, MyTeamID); +} + +void ALyraPawn::OnRep_MyTeamID(FGenericTeamId OldTeamID) +{ + ConditionalBroadcastTeamChanged(this, OldTeamID, MyTeamID); +} + diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraPawn.h b/LyraStarterGame/Source/LyraGame/Character/LyraPawn.h new file mode 100644 index 0000000000000000000000000000000000000000..4f1b880364e75945b8ece9e3e325beb7acbf0b0b --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraPawn.h @@ -0,0 +1,68 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "ModularPawn.h" +#include "Teams/LyraTeamAgentInterface.h" + +#include "LyraPawn.generated.h" + +#define UE_API LYRAGAME_API + +class AController; +class UObject; +struct FFrame; + +/** + * ALyraPawn + */ +UCLASS(MinimalAPI) +class ALyraPawn : public AModularPawn, public ILyraTeamAgentInterface +{ + GENERATED_BODY() + +public: + + UE_API ALyraPawn(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + //~AActor interface + UE_API virtual void PreInitializeComponents() override; + UE_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; + //~End of AActor interface + + //~APawn interface + UE_API virtual void PossessedBy(AController* NewController) override; + UE_API virtual void UnPossessed() override; + //~End of APawn interface + + //~ILyraTeamAgentInterface interface + UE_API virtual void SetGenericTeamId(const FGenericTeamId& NewTeamID) override; + UE_API virtual FGenericTeamId GetGenericTeamId() const override; + UE_API virtual FOnLyraTeamIndexChangedDelegate* GetOnTeamIndexChangedDelegate() override; + //~End of ILyraTeamAgentInterface interface + +protected: + // Called to determine what happens to the team ID when possession ends + virtual FGenericTeamId DetermineNewTeamAfterPossessionEnds(FGenericTeamId OldTeamID) const + { + // This could be changed to return, e.g., OldTeamID if you want to keep it assigned afterwards, or return an ID for some neutral faction, or etc... + return FGenericTeamId::NoTeam; + } + +private: + UFUNCTION() + UE_API void OnControllerChangedTeam(UObject* TeamAgent, int32 OldTeam, int32 NewTeam); + +private: + UPROPERTY(ReplicatedUsing = OnRep_MyTeamID) + FGenericTeamId MyTeamID; + + UPROPERTY() + FOnLyraTeamIndexChangedDelegate OnTeamChangedDelegate; + +private: + UFUNCTION() + UE_API void OnRep_MyTeamID(FGenericTeamId OldTeamID); +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraPawnData.cpp b/LyraStarterGame/Source/LyraGame/Character/LyraPawnData.cpp new file mode 100644 index 0000000000000000000000000000000000000000..59b1423ffb259a4272505952aefee5f37740bd71 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraPawnData.cpp @@ -0,0 +1,14 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraPawnData.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraPawnData) + +ULyraPawnData::ULyraPawnData(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + PawnClass = nullptr; + InputConfig = nullptr; + DefaultCameraMode = nullptr; +} + diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraPawnData.h b/LyraStarterGame/Source/LyraGame/Character/LyraPawnData.h new file mode 100644 index 0000000000000000000000000000000000000000..1afe4a4ad93f1b3659ccdc8010d501b185a24b18 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraPawnData.h @@ -0,0 +1,56 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Engine/DataAsset.h" + +#include "LyraPawnData.generated.h" + +#define UE_API LYRAGAME_API + +class APawn; +class ULyraAbilitySet; +class ULyraAbilityTagRelationshipMapping; +class ULyraCameraMode; +class ULyraInputConfig; +class UObject; + + +/** + * ULyraPawnData + * + * Non-mutable data asset that contains properties used to define a pawn. + */ +UCLASS(MinimalAPI, BlueprintType, Const, Meta = (DisplayName = "Lyra Pawn Data", ShortTooltip = "Data asset used to define a Pawn.")) +class ULyraPawnData : public UPrimaryDataAsset +{ + GENERATED_BODY() + +public: + + UE_API ULyraPawnData(const FObjectInitializer& ObjectInitializer); + +public: + + // Class to instantiate for this pawn (should usually derive from ALyraPawn or ALyraCharacter). + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|Pawn") + TSubclassOf PawnClass; + + // Ability sets to grant to this pawn's ability system. + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|Abilities") + TArray> AbilitySets; + + // What mapping of ability tags to use for actions taking by this pawn + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|Abilities") + TObjectPtr TagRelationshipMapping; + + // Input configuration used by player controlled pawns to create input mappings and bind input actions. + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|Input") + TObjectPtr InputConfig; + + // Default camera mode used by player controlled pawns. + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Lyra|Camera") + TSubclassOf DefaultCameraMode; +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraPawnExtensionComponent.cpp b/LyraStarterGame/Source/LyraGame/Character/LyraPawnExtensionComponent.cpp new file mode 100644 index 0000000000000000000000000000000000000000..018bf96766105169915a5c3ced606f024730efd9 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraPawnExtensionComponent.cpp @@ -0,0 +1,312 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraPawnExtensionComponent.h" + +#include "AbilitySystem/LyraAbilitySystemComponent.h" +#include "Components/GameFrameworkComponentDelegates.h" +#include "Components/GameFrameworkComponentManager.h" +#include "GameFramework/Controller.h" +#include "GameFramework/Pawn.h" +#include "LyraGameplayTags.h" +#include "LyraLogChannels.h" +#include "LyraPawnData.h" +#include "Net/UnrealNetwork.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraPawnExtensionComponent) + +class FLifetimeProperty; +class UActorComponent; + +const FName ULyraPawnExtensionComponent::NAME_ActorFeatureName("PawnExtension"); + +ULyraPawnExtensionComponent::ULyraPawnExtensionComponent(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + PrimaryComponentTick.bStartWithTickEnabled = false; + PrimaryComponentTick.bCanEverTick = false; + + SetIsReplicatedByDefault(true); + + PawnData = nullptr; + AbilitySystemComponent = nullptr; +} + +void ULyraPawnExtensionComponent::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const +{ + Super::GetLifetimeReplicatedProps(OutLifetimeProps); + + DOREPLIFETIME(ULyraPawnExtensionComponent, PawnData); +} + +void ULyraPawnExtensionComponent::OnRegister() +{ + Super::OnRegister(); + + const APawn* Pawn = GetPawn(); + ensureAlwaysMsgf((Pawn != nullptr), TEXT("LyraPawnExtensionComponent on [%s] can only be added to Pawn actors."), *GetNameSafe(GetOwner())); + + TArray PawnExtensionComponents; + Pawn->GetComponents(ULyraPawnExtensionComponent::StaticClass(), PawnExtensionComponents); + ensureAlwaysMsgf((PawnExtensionComponents.Num() == 1), TEXT("Only one LyraPawnExtensionComponent should exist on [%s]."), *GetNameSafe(GetOwner())); + + // Register with the init state system early, this will only work if this is a game world + RegisterInitStateFeature(); +} + +void ULyraPawnExtensionComponent::BeginPlay() +{ + Super::BeginPlay(); + + // Listen for changes to all features + BindOnActorInitStateChanged(NAME_None, FGameplayTag(), false); + + // Notifies state manager that we have spawned, then try rest of default initialization + ensure(TryToChangeInitState(LyraGameplayTags::InitState_Spawned)); + CheckDefaultInitialization(); +} + +void ULyraPawnExtensionComponent::EndPlay(const EEndPlayReason::Type EndPlayReason) +{ + UninitializeAbilitySystem(); + UnregisterInitStateFeature(); + + Super::EndPlay(EndPlayReason); +} + +void ULyraPawnExtensionComponent::SetPawnData(const ULyraPawnData* InPawnData) +{ + check(InPawnData); + + APawn* Pawn = GetPawnChecked(); + + if (Pawn->GetLocalRole() != ROLE_Authority) + { + return; + } + + if (PawnData) + { + UE_LOG(LogLyra, Error, TEXT("Trying to set PawnData [%s] on pawn [%s] that already has valid PawnData [%s]."), *GetNameSafe(InPawnData), *GetNameSafe(Pawn), *GetNameSafe(PawnData)); + return; + } + + PawnData = InPawnData; + + Pawn->ForceNetUpdate(); + + CheckDefaultInitialization(); +} + +void ULyraPawnExtensionComponent::OnRep_PawnData() +{ + CheckDefaultInitialization(); +} + +void ULyraPawnExtensionComponent::InitializeAbilitySystem(ULyraAbilitySystemComponent* InASC, AActor* InOwnerActor) +{ + check(InASC); + check(InOwnerActor); + + if (AbilitySystemComponent == InASC) + { + // The ability system component hasn't changed. + return; + } + + if (AbilitySystemComponent) + { + // Clean up the old ability system component. + UninitializeAbilitySystem(); + } + + APawn* Pawn = GetPawnChecked(); + AActor* ExistingAvatar = InASC->GetAvatarActor(); + + UE_LOG(LogLyra, Verbose, TEXT("Setting up ASC [%s] on pawn [%s] owner [%s], existing [%s] "), *GetNameSafe(InASC), *GetNameSafe(Pawn), *GetNameSafe(InOwnerActor), *GetNameSafe(ExistingAvatar)); + + if ((ExistingAvatar != nullptr) && (ExistingAvatar != Pawn)) + { + UE_LOG(LogLyra, Log, TEXT("Existing avatar (authority=%d)"), ExistingAvatar->HasAuthority() ? 1 : 0); + + // There is already a pawn acting as the ASC's avatar, so we need to kick it out + // This can happen on clients if they're lagged: their new pawn is spawned + possessed before the dead one is removed + ensure(!ExistingAvatar->HasAuthority()); + + if (ULyraPawnExtensionComponent* OtherExtensionComponent = FindPawnExtensionComponent(ExistingAvatar)) + { + OtherExtensionComponent->UninitializeAbilitySystem(); + } + } + + AbilitySystemComponent = InASC; + AbilitySystemComponent->InitAbilityActorInfo(InOwnerActor, Pawn); + + if (ensure(PawnData)) + { + InASC->SetTagRelationshipMapping(PawnData->TagRelationshipMapping); + } + + OnAbilitySystemInitialized.Broadcast(); +} + +void ULyraPawnExtensionComponent::UninitializeAbilitySystem() +{ + if (!AbilitySystemComponent) + { + return; + } + + // Uninitialize the ASC if we're still the avatar actor (otherwise another pawn already did it when they became the avatar actor) + if (AbilitySystemComponent->GetAvatarActor() == GetOwner()) + { + FGameplayTagContainer AbilityTypesToIgnore; + AbilityTypesToIgnore.AddTag(LyraGameplayTags::Ability_Behavior_SurvivesDeath); + + AbilitySystemComponent->CancelAbilities(nullptr, &AbilityTypesToIgnore); + AbilitySystemComponent->ClearAbilityInput(); + AbilitySystemComponent->RemoveAllGameplayCues(); + + if (AbilitySystemComponent->GetOwnerActor() != nullptr) + { + AbilitySystemComponent->SetAvatarActor(nullptr); + } + else + { + // If the ASC doesn't have a valid owner, we need to clear *all* actor info, not just the avatar pairing + AbilitySystemComponent->ClearActorInfo(); + } + + OnAbilitySystemUninitialized.Broadcast(); + } + + AbilitySystemComponent = nullptr; +} + +void ULyraPawnExtensionComponent::HandleControllerChanged() +{ + if (AbilitySystemComponent && (AbilitySystemComponent->GetAvatarActor() == GetPawnChecked())) + { + ensure(AbilitySystemComponent->AbilityActorInfo->OwnerActor == AbilitySystemComponent->GetOwnerActor()); + if (AbilitySystemComponent->GetOwnerActor() == nullptr) + { + UninitializeAbilitySystem(); + } + else + { + AbilitySystemComponent->RefreshAbilityActorInfo(); + } + } + + CheckDefaultInitialization(); +} + +void ULyraPawnExtensionComponent::HandlePlayerStateReplicated() +{ + CheckDefaultInitialization(); +} + +void ULyraPawnExtensionComponent::SetupPlayerInputComponent() +{ + CheckDefaultInitialization(); +} + +void ULyraPawnExtensionComponent::CheckDefaultInitialization() +{ + // Before checking our progress, try progressing any other features we might depend on + CheckDefaultInitializationForImplementers(); + + static const TArray StateChain = { LyraGameplayTags::InitState_Spawned, LyraGameplayTags::InitState_DataAvailable, LyraGameplayTags::InitState_DataInitialized, LyraGameplayTags::InitState_GameplayReady }; + + // This will try to progress from spawned (which is only set in BeginPlay) through the data initialization stages until it gets to gameplay ready + ContinueInitStateChain(StateChain); +} + +bool ULyraPawnExtensionComponent::CanChangeInitState(UGameFrameworkComponentManager* Manager, FGameplayTag CurrentState, FGameplayTag DesiredState) const +{ + check(Manager); + + APawn* Pawn = GetPawn(); + if (!CurrentState.IsValid() && DesiredState == LyraGameplayTags::InitState_Spawned) + { + // As long as we are on a valid pawn, we count as spawned + if (Pawn) + { + return true; + } + } + if (CurrentState == LyraGameplayTags::InitState_Spawned && DesiredState == LyraGameplayTags::InitState_DataAvailable) + { + // Pawn data is required. + if (!PawnData) + { + return false; + } + + const bool bHasAuthority = Pawn->HasAuthority(); + const bool bIsLocallyControlled = Pawn->IsLocallyControlled(); + + if (bHasAuthority || bIsLocallyControlled) + { + // Check for being possessed by a controller. + if (!GetController()) + { + return false; + } + } + + return true; + } + else if (CurrentState == LyraGameplayTags::InitState_DataAvailable && DesiredState == LyraGameplayTags::InitState_DataInitialized) + { + // Transition to initialize if all features have their data available + return Manager->HaveAllFeaturesReachedInitState(Pawn, LyraGameplayTags::InitState_DataAvailable); + } + else if (CurrentState == LyraGameplayTags::InitState_DataInitialized && DesiredState == LyraGameplayTags::InitState_GameplayReady) + { + return true; + } + + return false; +} + +void ULyraPawnExtensionComponent::HandleChangeInitState(UGameFrameworkComponentManager* Manager, FGameplayTag CurrentState, FGameplayTag DesiredState) +{ + if (DesiredState == LyraGameplayTags::InitState_DataInitialized) + { + // This is currently all handled by other components listening to this state change + } +} + +void ULyraPawnExtensionComponent::OnActorInitStateChanged(const FActorInitStateChangedParams& Params) +{ + // If another feature is now in DataAvailable, see if we should transition to DataInitialized + if (Params.FeatureName != NAME_ActorFeatureName) + { + if (Params.FeatureState == LyraGameplayTags::InitState_DataAvailable) + { + CheckDefaultInitialization(); + } + } +} + +void ULyraPawnExtensionComponent::OnAbilitySystemInitialized_RegisterAndCall(FSimpleMulticastDelegate::FDelegate Delegate) +{ + if (!OnAbilitySystemInitialized.IsBoundToObject(Delegate.GetUObject())) + { + OnAbilitySystemInitialized.Add(Delegate); + } + + if (AbilitySystemComponent) + { + Delegate.Execute(); + } +} + +void ULyraPawnExtensionComponent::OnAbilitySystemUninitialized_Register(FSimpleMulticastDelegate::FDelegate Delegate) +{ + if (!OnAbilitySystemUninitialized.IsBoundToObject(Delegate.GetUObject())) + { + OnAbilitySystemUninitialized.Add(Delegate); + } +} + diff --git a/LyraStarterGame/Source/LyraGame/Character/LyraPawnExtensionComponent.h b/LyraStarterGame/Source/LyraGame/Character/LyraPawnExtensionComponent.h new file mode 100644 index 0000000000000000000000000000000000000000..9c958c42ef246557a992defb4465de9b8cb5a034 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Character/LyraPawnExtensionComponent.h @@ -0,0 +1,106 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Components/GameFrameworkInitStateInterface.h" +#include "Components/PawnComponent.h" + +#include "LyraPawnExtensionComponent.generated.h" + +#define UE_API LYRAGAME_API + +namespace EEndPlayReason { enum Type : int; } + +class UGameFrameworkComponentManager; +class ULyraAbilitySystemComponent; +class ULyraPawnData; +class UObject; +struct FActorInitStateChangedParams; +struct FFrame; +struct FGameplayTag; + +/** + * Component that adds functionality to all Pawn classes so it can be used for characters/vehicles/etc. + * This coordinates the initialization of other components. + */ +UCLASS(MinimalAPI) +class ULyraPawnExtensionComponent : public UPawnComponent, public IGameFrameworkInitStateInterface +{ + GENERATED_BODY() + +public: + + UE_API ULyraPawnExtensionComponent(const FObjectInitializer& ObjectInitializer); + + /** The name of this overall feature, this one depends on the other named component features */ + static UE_API const FName NAME_ActorFeatureName; + + //~ Begin IGameFrameworkInitStateInterface interface + virtual FName GetFeatureName() const override { return NAME_ActorFeatureName; } + UE_API virtual bool CanChangeInitState(UGameFrameworkComponentManager* Manager, FGameplayTag CurrentState, FGameplayTag DesiredState) const override; + UE_API virtual void HandleChangeInitState(UGameFrameworkComponentManager* Manager, FGameplayTag CurrentState, FGameplayTag DesiredState) override; + UE_API virtual void OnActorInitStateChanged(const FActorInitStateChangedParams& Params) override; + UE_API virtual void CheckDefaultInitialization() override; + //~ End IGameFrameworkInitStateInterface interface + + /** Returns the pawn extension component if one exists on the specified actor. */ + UFUNCTION(BlueprintPure, Category = "Lyra|Pawn") + static ULyraPawnExtensionComponent* FindPawnExtensionComponent(const AActor* Actor) { return (Actor ? Actor->FindComponentByClass() : nullptr); } + + /** Gets the pawn data, which is used to specify pawn properties in data */ + template + const T* GetPawnData() const { return Cast(PawnData); } + + /** Sets the current pawn data */ + UE_API void SetPawnData(const ULyraPawnData* InPawnData); + + /** Gets the current ability system component, which may be owned by a different actor */ + UFUNCTION(BlueprintPure, Category = "Lyra|Pawn") + ULyraAbilitySystemComponent* GetLyraAbilitySystemComponent() const { return AbilitySystemComponent; } + + /** Should be called by the owning pawn to become the avatar of the ability system. */ + UE_API void InitializeAbilitySystem(ULyraAbilitySystemComponent* InASC, AActor* InOwnerActor); + + /** Should be called by the owning pawn to remove itself as the avatar of the ability system. */ + UE_API void UninitializeAbilitySystem(); + + /** Should be called by the owning pawn when the pawn's controller changes. */ + UE_API void HandleControllerChanged(); + + /** Should be called by the owning pawn when the player state has been replicated. */ + UE_API void HandlePlayerStateReplicated(); + + /** Should be called by the owning pawn when the input component is setup. */ + UE_API void SetupPlayerInputComponent(); + + /** Register with the OnAbilitySystemInitialized delegate and broadcast if our pawn has been registered with the ability system component */ + UE_API void OnAbilitySystemInitialized_RegisterAndCall(FSimpleMulticastDelegate::FDelegate Delegate); + + /** Register with the OnAbilitySystemUninitialized delegate fired when our pawn is removed as the ability system's avatar actor */ + UE_API void OnAbilitySystemUninitialized_Register(FSimpleMulticastDelegate::FDelegate Delegate); + +protected: + + UE_API virtual void OnRegister() override; + UE_API virtual void BeginPlay() override; + UE_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; + + UFUNCTION() + UE_API void OnRep_PawnData(); + + /** Delegate fired when our pawn becomes the ability system's avatar actor */ + FSimpleMulticastDelegate OnAbilitySystemInitialized; + + /** Delegate fired when our pawn is removed as the ability system's avatar actor */ + FSimpleMulticastDelegate OnAbilitySystemUninitialized; + + /** Pawn data used to create the pawn. Specified from a spawn function or on a placed instance. */ + UPROPERTY(EditInstanceOnly, ReplicatedUsing = OnRep_PawnData, Category = "Lyra|Pawn") + TObjectPtr PawnData; + + /** Pointer to the ability system component that is cached for convenience. */ + UPROPERTY(Transient) + TObjectPtr AbilitySystemComponent; +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCharacterPartTypes.h b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCharacterPartTypes.h new file mode 100644 index 0000000000000000000000000000000000000000..d54a93c458285da264eb4255b4d938a9189dfefb --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCharacterPartTypes.h @@ -0,0 +1,77 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" + +#include "LyraCharacterPartTypes.generated.h" + +class UChildActorComponent; +class ULyraPawnComponent_CharacterParts; +struct FLyraCharacterPartList; + +////////////////////////////////////////////////////////////////////// + +// How should collision be configured on the spawned part actor +UENUM() +enum class ECharacterCustomizationCollisionMode : uint8 +{ + // Disable collision on spawned character parts + NoCollision, + + // Leave the collision settings on character parts alone + UseCollisionFromCharacterPart +}; + +////////////////////////////////////////////////////////////////////// + +// A handle created by adding a character part entry, can be used to remove it later +USTRUCT(BlueprintType) +struct FLyraCharacterPartHandle +{ + GENERATED_BODY() + + void Reset() + { + PartHandle = INDEX_NONE; + } + + bool IsValid() const + { + return PartHandle != INDEX_NONE; + } + +private: + UPROPERTY() + int32 PartHandle = INDEX_NONE; + + friend FLyraCharacterPartList; +}; + +////////////////////////////////////////////////////////////////////// +// A character part request + +USTRUCT(BlueprintType) +struct FLyraCharacterPart +{ + GENERATED_BODY() + + // The part to spawn + UPROPERTY(EditAnywhere, BlueprintReadWrite) + TSubclassOf PartClass; + + // The socket to attach the part to (if any) + UPROPERTY(EditAnywhere, BlueprintReadWrite) + FName SocketName; + + // How to handle collision for the primitive components in the part + UPROPERTY(EditAnywhere, BlueprintReadWrite) + ECharacterCustomizationCollisionMode CollisionMode = ECharacterCustomizationCollisionMode::NoCollision; + + // Compares against another part, ignoring the collision mode + static bool AreEquivalentParts(const FLyraCharacterPart& A, const FLyraCharacterPart& B) + { + return (A.PartClass == B.PartClass) && (A.SocketName == B.SocketName); + } +}; diff --git a/LyraStarterGame/Source/LyraGame/Cosmetics/LyraControllerComponent_CharacterParts.cpp b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraControllerComponent_CharacterParts.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a546fd2062c29dddf359e02b8f7715839d16f54a --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraControllerComponent_CharacterParts.cpp @@ -0,0 +1,223 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "Cosmetics/LyraControllerComponent_CharacterParts.h" +#include "Cosmetics/LyraCharacterPartTypes.h" +#include "Cosmetics/LyraPawnComponent_CharacterParts.h" +#include "GameFramework/CheatManagerDefines.h" +#include "LyraCosmeticDeveloperSettings.h" +#include "GameFramework/Pawn.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraControllerComponent_CharacterParts) + +////////////////////////////////////////////////////////////////////// + +ULyraControllerComponent_CharacterParts::ULyraControllerComponent_CharacterParts(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +void ULyraControllerComponent_CharacterParts::BeginPlay() +{ + Super::BeginPlay(); + + // Listen for pawn possession changed events + if (HasAuthority()) + { + if (AController* OwningController = GetController()) + { + OwningController->OnPossessedPawnChanged.AddDynamic(this, &ThisClass::OnPossessedPawnChanged); + + if (APawn* ControlledPawn = GetPawn()) + { + OnPossessedPawnChanged(nullptr, ControlledPawn); + } + } + + ApplyDeveloperSettings(); + } +} + +void ULyraControllerComponent_CharacterParts::EndPlay(const EEndPlayReason::Type EndPlayReason) +{ + RemoveAllCharacterParts(); + Super::EndPlay(EndPlayReason); +} + +ULyraPawnComponent_CharacterParts* ULyraControllerComponent_CharacterParts::GetPawnCustomizer() const +{ + if (APawn* ControlledPawn = GetPawn()) + { + return ControlledPawn->FindComponentByClass(); + } + return nullptr; +} + +void ULyraControllerComponent_CharacterParts::AddCharacterPart(const FLyraCharacterPart& NewPart) +{ + AddCharacterPartInternal(NewPart, ECharacterPartSource::Natural); +} + +void ULyraControllerComponent_CharacterParts::AddCharacterPartInternal(const FLyraCharacterPart& NewPart, ECharacterPartSource Source) +{ + FLyraControllerCharacterPartEntry& NewEntry = CharacterParts.AddDefaulted_GetRef(); + NewEntry.Part = NewPart; + NewEntry.Source = Source; + + if (ULyraPawnComponent_CharacterParts* PawnCustomizer = GetPawnCustomizer()) + { + if (NewEntry.Source != ECharacterPartSource::NaturalSuppressedViaCheat) + { + NewEntry.Handle = PawnCustomizer->AddCharacterPart(NewPart); + } + } + +} + +void ULyraControllerComponent_CharacterParts::RemoveCharacterPart(const FLyraCharacterPart& PartToRemove) +{ + for (auto EntryIt = CharacterParts.CreateIterator(); EntryIt; ++EntryIt) + { + if (FLyraCharacterPart::AreEquivalentParts(EntryIt->Part, PartToRemove)) + { + if (ULyraPawnComponent_CharacterParts* PawnCustomizer = GetPawnCustomizer()) + { + PawnCustomizer->RemoveCharacterPart(EntryIt->Handle); + } + + EntryIt.RemoveCurrent(); + break; + } + } +} + +void ULyraControllerComponent_CharacterParts::RemoveAllCharacterParts() +{ + if (ULyraPawnComponent_CharacterParts* PawnCustomizer = GetPawnCustomizer()) + { + for (FLyraControllerCharacterPartEntry& Entry : CharacterParts) + { + PawnCustomizer->RemoveCharacterPart(Entry.Handle); + } + } + + CharacterParts.Reset(); +} + +void ULyraControllerComponent_CharacterParts::OnPossessedPawnChanged(APawn* OldPawn, APawn* NewPawn) +{ + // Remove from the old pawn + if (ULyraPawnComponent_CharacterParts* OldCustomizer = OldPawn ? OldPawn->FindComponentByClass() : nullptr) + { + for (FLyraControllerCharacterPartEntry& Entry : CharacterParts) + { + OldCustomizer->RemoveCharacterPart(Entry.Handle); + Entry.Handle.Reset(); + } + } + + // Apply to the new pawn + if (ULyraPawnComponent_CharacterParts* NewCustomizer = NewPawn ? NewPawn->FindComponentByClass() : nullptr) + { + for (FLyraControllerCharacterPartEntry& Entry : CharacterParts) + { + // Don't readd if it's already there, this can get called with a null oldpawn + if (!Entry.Handle.IsValid() && Entry.Source != ECharacterPartSource::NaturalSuppressedViaCheat) + { + Entry.Handle = NewCustomizer->AddCharacterPart(Entry.Part); + } + } + } +} + +void ULyraControllerComponent_CharacterParts::ApplyDeveloperSettings() +{ +#if UE_WITH_CHEAT_MANAGER + const ULyraCosmeticDeveloperSettings* Settings = GetDefault(); + + // Suppress or unsuppress natural parts if needed + const bool bSuppressNaturalParts = (Settings->CheatMode == ECosmeticCheatMode::ReplaceParts) && (Settings->CheatCosmeticCharacterParts.Num() > 0); + SetSuppressionOnNaturalParts(bSuppressNaturalParts); + + // Remove anything added by developer settings and re-add it + ULyraPawnComponent_CharacterParts* PawnCustomizer = GetPawnCustomizer(); + for (auto It = CharacterParts.CreateIterator(); It; ++It) + { + if (It->Source == ECharacterPartSource::AppliedViaDeveloperSettingsCheat) + { + if (PawnCustomizer != nullptr) + { + PawnCustomizer->RemoveCharacterPart(It->Handle); + } + It.RemoveCurrent(); + } + } + + // Add new parts + for (const FLyraCharacterPart& PartDesc : Settings->CheatCosmeticCharacterParts) + { + AddCharacterPartInternal(PartDesc, ECharacterPartSource::AppliedViaDeveloperSettingsCheat); + } +#endif +} + + +void ULyraControllerComponent_CharacterParts::AddCheatPart(const FLyraCharacterPart& NewPart, bool bSuppressNaturalParts) +{ +#if UE_WITH_CHEAT_MANAGER + SetSuppressionOnNaturalParts(bSuppressNaturalParts); + AddCharacterPartInternal(NewPart, ECharacterPartSource::AppliedViaCheatManager); +#endif +} + +void ULyraControllerComponent_CharacterParts::ClearCheatParts() +{ +#if UE_WITH_CHEAT_MANAGER + ULyraPawnComponent_CharacterParts* PawnCustomizer = GetPawnCustomizer(); + + // Remove anything added by cheat manager cheats + for (auto It = CharacterParts.CreateIterator(); It; ++It) + { + if (It->Source == ECharacterPartSource::AppliedViaCheatManager) + { + if (PawnCustomizer != nullptr) + { + PawnCustomizer->RemoveCharacterPart(It->Handle); + } + It.RemoveCurrent(); + } + } + + ApplyDeveloperSettings(); +#endif +} + +void ULyraControllerComponent_CharacterParts::SetSuppressionOnNaturalParts(bool bSuppressed) +{ +#if UE_WITH_CHEAT_MANAGER + ULyraPawnComponent_CharacterParts* PawnCustomizer = GetPawnCustomizer(); + + for (FLyraControllerCharacterPartEntry& Entry : CharacterParts) + { + if ((Entry.Source == ECharacterPartSource::Natural) && bSuppressed) + { + // Suppress + if (PawnCustomizer != nullptr) + { + PawnCustomizer->RemoveCharacterPart(Entry.Handle); + Entry.Handle.Reset(); + } + Entry.Source = ECharacterPartSource::NaturalSuppressedViaCheat; + } + else if ((Entry.Source == ECharacterPartSource::NaturalSuppressedViaCheat) && !bSuppressed) + { + // Unsuppress + if (PawnCustomizer != nullptr) + { + Entry.Handle = PawnCustomizer->AddCharacterPart(Entry.Part); + } + Entry.Source = ECharacterPartSource::Natural; + } + } +#endif +} + diff --git a/LyraStarterGame/Source/LyraGame/Cosmetics/LyraControllerComponent_CharacterParts.h b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraControllerComponent_CharacterParts.h new file mode 100644 index 0000000000000000000000000000000000000000..9c6c6b74017bfde6c36a16b3378b6d9e270bbf07 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraControllerComponent_CharacterParts.h @@ -0,0 +1,98 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Components/ControllerComponent.h" +#include "LyraCharacterPartTypes.h" + +#include "LyraControllerComponent_CharacterParts.generated.h" + +class APawn; +class ULyraPawnComponent_CharacterParts; +class UObject; +struct FFrame; + +enum class ECharacterPartSource : uint8 +{ + Natural, + + NaturalSuppressedViaCheat, + + AppliedViaDeveloperSettingsCheat, + + AppliedViaCheatManager +}; + +////////////////////////////////////////////////////////////////////// + +// A character part requested on a controller component +USTRUCT() +struct FLyraControllerCharacterPartEntry +{ + GENERATED_BODY() + + FLyraControllerCharacterPartEntry() + {} + +public: + // The character part being represented + UPROPERTY(EditAnywhere, meta=(ShowOnlyInnerProperties)) + FLyraCharacterPart Part; + + // The handle if already applied to a pawn + FLyraCharacterPartHandle Handle; + + // The source of this part + ECharacterPartSource Source = ECharacterPartSource::Natural; +}; + +////////////////////////////////////////////////////////////////////// + +// A component that configure what cosmetic actors to spawn for the owning controller when it possesses a pawn +UCLASS(meta = (BlueprintSpawnableComponent)) +class ULyraControllerComponent_CharacterParts : public UControllerComponent +{ + GENERATED_BODY() + +public: + ULyraControllerComponent_CharacterParts(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + //~UActorComponent interface + virtual void BeginPlay() override; + virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; + //~End of UActorComponent interface + + // Adds a character part to the actor that owns this customization component, should be called on the authority only + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Cosmetics) + void AddCharacterPart(const FLyraCharacterPart& NewPart); + + // Removes a previously added character part from the actor that owns this customization component, should be called on the authority only + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Cosmetics) + void RemoveCharacterPart(const FLyraCharacterPart& PartToRemove); + + // Removes all added character parts, should be called on the authority only + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Cosmetics) + void RemoveAllCharacterParts(); + + // Applies relevant developer settings if in PIE + void ApplyDeveloperSettings(); + +protected: + UPROPERTY(EditAnywhere, Category=Cosmetics) + TArray CharacterParts; + +private: + ULyraPawnComponent_CharacterParts* GetPawnCustomizer() const; + + UFUNCTION() + void OnPossessedPawnChanged(APawn* OldPawn, APawn* NewPawn); + + void AddCharacterPartInternal(const FLyraCharacterPart& NewPart, ECharacterPartSource Source); + + void AddCheatPart(const FLyraCharacterPart& NewPart, bool bSuppressNaturalParts); + void ClearCheatParts(); + + void SetSuppressionOnNaturalParts(bool bSuppressed); + + friend class ULyraCosmeticCheats; +}; diff --git a/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticAnimationTypes.cpp b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticAnimationTypes.cpp new file mode 100644 index 0000000000000000000000000000000000000000..214e6afc3ba118df2ae1e4bac200df7b0bc8f719 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticAnimationTypes.cpp @@ -0,0 +1,35 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraCosmeticAnimationTypes.h" + +#include "Animation/AnimInstance.h" +#include "Engine/SkeletalMesh.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraCosmeticAnimationTypes) + +TSubclassOf FLyraAnimLayerSelectionSet::SelectBestLayer(const FGameplayTagContainer& CosmeticTags) const +{ + for (const FLyraAnimLayerSelectionEntry& Rule : LayerRules) + { + if ((Rule.Layer != nullptr) && CosmeticTags.HasAll(Rule.RequiredTags)) + { + return Rule.Layer; + } + } + + return DefaultLayer; +} + +USkeletalMesh* FLyraAnimBodyStyleSelectionSet::SelectBestBodyStyle(const FGameplayTagContainer& CosmeticTags) const +{ + for (const FLyraAnimBodyStyleSelectionEntry& Rule : MeshRules) + { + if ((Rule.Mesh != nullptr) && CosmeticTags.HasAll(Rule.RequiredTags)) + { + return Rule.Mesh; + } + } + + return DefaultMesh; +} + diff --git a/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticAnimationTypes.h b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticAnimationTypes.h new file mode 100644 index 0000000000000000000000000000000000000000..7bae82b778eb3ec752a50a753936b0d66227df81 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticAnimationTypes.h @@ -0,0 +1,82 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "GameplayTagContainer.h" +#include "Templates/SubclassOf.h" + +#include "LyraCosmeticAnimationTypes.generated.h" + +class UAnimInstance; +class UPhysicsAsset; +class USkeletalMesh; + +////////////////////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FLyraAnimLayerSelectionEntry +{ + GENERATED_BODY() + + // Layer to apply if the tag matches + UPROPERTY(EditAnywhere, BlueprintReadWrite) + TSubclassOf Layer; + + // Cosmetic tags required (all of these must be present to be considered a match) + UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(Categories="Cosmetic")) + FGameplayTagContainer RequiredTags; +}; + +USTRUCT(BlueprintType) +struct FLyraAnimLayerSelectionSet +{ + GENERATED_BODY() + + // List of layer rules to apply, first one that matches will be used + UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(TitleProperty=Layer)) + TArray LayerRules; + + // The layer to use if none of the LayerRules matches + UPROPERTY(EditAnywhere, BlueprintReadWrite) + TSubclassOf DefaultLayer; + + // Choose the best layer given the rules + TSubclassOf SelectBestLayer(const FGameplayTagContainer& CosmeticTags) const; +}; + +////////////////////////////////////////////////////////////////////// + +USTRUCT(BlueprintType) +struct FLyraAnimBodyStyleSelectionEntry +{ + GENERATED_BODY() + + // Layer to apply if the tag matches + UPROPERTY(EditAnywhere, BlueprintReadWrite) + TObjectPtr Mesh = nullptr; + + // Cosmetic tags required (all of these must be present to be considered a match) + UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(Categories="Cosmetic")) + FGameplayTagContainer RequiredTags; +}; + +USTRUCT(BlueprintType) +struct FLyraAnimBodyStyleSelectionSet +{ + GENERATED_BODY() + + // List of layer rules to apply, first one that matches will be used + UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(TitleProperty=Mesh)) + TArray MeshRules; + + // The layer to use if none of the LayerRules matches + UPROPERTY(EditAnywhere, BlueprintReadWrite) + TObjectPtr DefaultMesh = nullptr; + + // If set, ensures this physics asset is always used + UPROPERTY(EditAnywhere) + TObjectPtr ForcedPhysicsAsset = nullptr; + + // Choose the best body style skeletal mesh given the rules + USkeletalMesh* SelectBestBodyStyle(const FGameplayTagContainer& CosmeticTags) const; +}; diff --git a/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticCheats.cpp b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticCheats.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8cef5e38c5da2d6c2399a372b45792be25a0d0a2 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticCheats.cpp @@ -0,0 +1,70 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraCosmeticCheats.h" +#include "Cosmetics/LyraCharacterPartTypes.h" +#include "LyraControllerComponent_CharacterParts.h" +#include "GameFramework/CheatManagerDefines.h" +#include "System/LyraDevelopmentStatics.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraCosmeticCheats) + +////////////////////////////////////////////////////////////////////// +// ULyraCosmeticCheats + +ULyraCosmeticCheats::ULyraCosmeticCheats() +{ +#if UE_WITH_CHEAT_MANAGER + if (HasAnyFlags(RF_ClassDefaultObject)) + { + UCheatManager::RegisterForOnCheatManagerCreated(FOnCheatManagerCreated::FDelegate::CreateLambda( + [](UCheatManager* CheatManager) + { + CheatManager->AddCheatManagerExtension(NewObject(CheatManager)); + })); + } +#endif +} + +void ULyraCosmeticCheats::AddCharacterPart(const FString& AssetName, bool bSuppressNaturalParts) +{ +#if UE_WITH_CHEAT_MANAGER + if (ULyraControllerComponent_CharacterParts* CosmeticComponent = GetCosmeticComponent()) + { + TSubclassOf PartClass = ULyraDevelopmentStatics::FindClassByShortName(AssetName); + if (PartClass != nullptr) + { + FLyraCharacterPart Part; + Part.PartClass = PartClass; + + CosmeticComponent->AddCheatPart(Part, bSuppressNaturalParts); + } + } +#endif +} + +void ULyraCosmeticCheats::ReplaceCharacterPart(const FString& AssetName, bool bSuppressNaturalParts) +{ + ClearCharacterPartOverrides(); + AddCharacterPart(AssetName, bSuppressNaturalParts); +} + +void ULyraCosmeticCheats::ClearCharacterPartOverrides() +{ +#if UE_WITH_CHEAT_MANAGER + if (ULyraControllerComponent_CharacterParts* CosmeticComponent = GetCosmeticComponent()) + { + CosmeticComponent->ClearCheatParts(); + } +#endif +} + +ULyraControllerComponent_CharacterParts* ULyraCosmeticCheats::GetCosmeticComponent() const +{ + if (APlayerController* PC = GetPlayerController()) + { + return PC->FindComponentByClass(); + } + + return nullptr; +} + diff --git a/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticCheats.h b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticCheats.h new file mode 100644 index 0000000000000000000000000000000000000000..779256e1b85c77a3bab3e28dfd7121744b6a0edf --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticCheats.h @@ -0,0 +1,36 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "GameFramework/CheatManager.h" + +#include "LyraCosmeticCheats.generated.h" + +class ULyraControllerComponent_CharacterParts; +class UObject; +struct FFrame; + +/** Cheats related to bots */ +UCLASS(NotBlueprintable) +class ULyraCosmeticCheats final : public UCheatManagerExtension +{ + GENERATED_BODY() + +public: + ULyraCosmeticCheats(); + + // Adds a character part + UFUNCTION(Exec, BlueprintAuthorityOnly) + void AddCharacterPart(const FString& AssetName, bool bSuppressNaturalParts = true); + + // Replaces previous cheat parts with a new one + UFUNCTION(Exec, BlueprintAuthorityOnly) + void ReplaceCharacterPart(const FString& AssetName, bool bSuppressNaturalParts = true); + + // Clears any existing cheats + UFUNCTION(Exec, BlueprintAuthorityOnly) + void ClearCharacterPartOverrides(); + +private: + ULyraControllerComponent_CharacterParts* GetCosmeticComponent() const; +}; diff --git a/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticDeveloperSettings.cpp b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticDeveloperSettings.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5766e0e233a3bb7d635333e3982f2fe5b22fd12f --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticDeveloperSettings.cpp @@ -0,0 +1,96 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraCosmeticDeveloperSettings.h" +#include "Cosmetics/LyraCharacterPartTypes.h" +#include "Misc/App.h" +#include "Widgets/Notifications/SNotificationList.h" +#include "Framework/Notifications/NotificationManager.h" +#include "System/LyraDevelopmentStatics.h" +#include "TimerManager.h" +#include "Engine/Engine.h" +#include "LyraControllerComponent_CharacterParts.h" +#include "EngineUtils.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraCosmeticDeveloperSettings) + +#define LOCTEXT_NAMESPACE "LyraCheats" + +ULyraCosmeticDeveloperSettings::ULyraCosmeticDeveloperSettings() +{ +} + +FName ULyraCosmeticDeveloperSettings::GetCategoryName() const +{ + return FApp::GetProjectName(); +} + +#if WITH_EDITOR + +void ULyraCosmeticDeveloperSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) +{ + Super::PostEditChangeProperty(PropertyChangedEvent); + + ApplySettings(); +} + +void ULyraCosmeticDeveloperSettings::PostReloadConfig(FProperty* PropertyThatWasLoaded) +{ + Super::PostReloadConfig(PropertyThatWasLoaded); + + ApplySettings(); +} + +void ULyraCosmeticDeveloperSettings::PostInitProperties() +{ + Super::PostInitProperties(); + + ApplySettings(); +} + +void ULyraCosmeticDeveloperSettings::ApplySettings() +{ + if (GIsEditor && (GEngine != nullptr)) + { + ReapplyLoadoutIfInPIE(); + } +} + +void ULyraCosmeticDeveloperSettings::ReapplyLoadoutIfInPIE() +{ +#if WITH_SERVER_CODE + // Update the loadout on all players + UWorld* ServerWorld = ULyraDevelopmentStatics::FindPlayInEditorAuthorityWorld(); + if (ServerWorld != nullptr) + { + ServerWorld->GetTimerManager().SetTimerForNextTick(FTimerDelegate::CreateLambda([=]() + { + for (TActorIterator PCIterator(ServerWorld); PCIterator; ++PCIterator) + { + if (APlayerController* PC = *PCIterator) + { + if (ULyraControllerComponent_CharacterParts* CosmeticComponent = PC->FindComponentByClass()) + { + CosmeticComponent->ApplyDeveloperSettings(); + } + } + } + })); + } +#endif // WITH_SERVER_CODE +} + +void ULyraCosmeticDeveloperSettings::OnPlayInEditorStarted() const +{ + // Show a notification toast to remind the user that there's an experience override set + if (CheatCosmeticCharacterParts.Num() > 0) + { + FNotificationInfo Info(LOCTEXT("CosmeticOverrideActive", "Applying Cosmetic Override")); + Info.ExpireDuration = 2.0f; + FSlateNotificationManager::Get().AddNotification(Info); + } +} + +#endif // WITH_EDITOR + +#undef LOCTEXT_NAMESPACE + diff --git a/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticDeveloperSettings.h b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticDeveloperSettings.h new file mode 100644 index 0000000000000000000000000000000000000000..c9f50d3cb993ce9944733a7b1b91e659cc695746 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraCosmeticDeveloperSettings.h @@ -0,0 +1,66 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Engine/DeveloperSettingsBackedByCVars.h" + +#include "LyraCosmeticDeveloperSettings.generated.h" + +struct FLyraCharacterPart; +struct FPropertyChangedEvent; + +class ULyraExperienceDefinition; + +UENUM() +enum class ECosmeticCheatMode +{ + ReplaceParts, + + AddParts +}; + +/** + * Cosmetic developer settings / editor cheats + */ +UCLASS(config=EditorPerProjectUserSettings, MinimalAPI) +class ULyraCosmeticDeveloperSettings : public UDeveloperSettingsBackedByCVars +{ + GENERATED_BODY() + +public: + ULyraCosmeticDeveloperSettings(); + + //~UDeveloperSettings interface + virtual FName GetCategoryName() const override; + //~End of UDeveloperSettings interface + +public: + UPROPERTY(Transient, EditAnywhere) + TArray CheatCosmeticCharacterParts; + + UPROPERTY(Transient, EditAnywhere) + ECosmeticCheatMode CheatMode; + +#if WITH_EDITOR +public: + // Called by the editor engine to let us pop reminder notifications when cheats are active + LYRAGAME_API void OnPlayInEditorStarted() const; + +private: + void ApplySettings(); + void ReapplyLoadoutIfInPIE(); +#endif + +public: + //~UObject interface +#if WITH_EDITOR + virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; + virtual void PostReloadConfig(FProperty* PropertyThatWasLoaded) override; + virtual void PostInitProperties() override; +#endif + //~End of UObject interface + +private: + + +}; diff --git a/LyraStarterGame/Source/LyraGame/Cosmetics/LyraPawnComponent_CharacterParts.cpp b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraPawnComponent_CharacterParts.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b5dc4477fec6241b7e8f75b46a04bf541b81ede5 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraPawnComponent_CharacterParts.cpp @@ -0,0 +1,357 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "Cosmetics/LyraPawnComponent_CharacterParts.h" + +#include "Components/SkeletalMeshComponent.h" +#include "Cosmetics/LyraCharacterPartTypes.h" +#include "GameFramework/Character.h" +#include "GameplayTagAssetInterface.h" +#include "Net/UnrealNetwork.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraPawnComponent_CharacterParts) + +class FLifetimeProperty; +class UPhysicsAsset; +class USkeletalMesh; +class UWorld; + +////////////////////////////////////////////////////////////////////// + +FString FLyraAppliedCharacterPartEntry::GetDebugString() const +{ + return FString::Printf(TEXT("(PartClass: %s, Socket: %s, Instance: %s)"), *GetPathNameSafe(Part.PartClass), *Part.SocketName.ToString(), *GetPathNameSafe(SpawnedComponent)); +} + +////////////////////////////////////////////////////////////////////// + +void FLyraCharacterPartList::PreReplicatedRemove(const TArrayView RemovedIndices, int32 FinalSize) +{ + bool bDestroyedAnyActors = false; + for (int32 Index : RemovedIndices) + { + FLyraAppliedCharacterPartEntry& Entry = Entries[Index]; + bDestroyedAnyActors |= DestroyActorForEntry(Entry); + } + + if (bDestroyedAnyActors && ensure(OwnerComponent)) + { + OwnerComponent->BroadcastChanged(); + } +} + +void FLyraCharacterPartList::PostReplicatedAdd(const TArrayView AddedIndices, int32 FinalSize) +{ + bool bCreatedAnyActors = false; + for (int32 Index : AddedIndices) + { + FLyraAppliedCharacterPartEntry& Entry = Entries[Index]; + bCreatedAnyActors |= SpawnActorForEntry(Entry); + } + + if (bCreatedAnyActors && ensure(OwnerComponent)) + { + OwnerComponent->BroadcastChanged(); + } +} + +void FLyraCharacterPartList::PostReplicatedChange(const TArrayView ChangedIndices, int32 FinalSize) +{ + bool bChangedAnyActors = false; + + // We don't support dealing with propagating changes, just destroy and recreate + for (int32 Index : ChangedIndices) + { + FLyraAppliedCharacterPartEntry& Entry = Entries[Index]; + + bChangedAnyActors |= DestroyActorForEntry(Entry); + bChangedAnyActors |= SpawnActorForEntry(Entry); + } + + if (bChangedAnyActors && ensure(OwnerComponent)) + { + OwnerComponent->BroadcastChanged(); + } +} + +FLyraCharacterPartHandle FLyraCharacterPartList::AddEntry(FLyraCharacterPart NewPart) +{ + FLyraCharacterPartHandle Result; + Result.PartHandle = PartHandleCounter++; + + if (ensure(OwnerComponent && OwnerComponent->GetOwner() && OwnerComponent->GetOwner()->HasAuthority())) + { + FLyraAppliedCharacterPartEntry& NewEntry = Entries.AddDefaulted_GetRef(); + NewEntry.Part = NewPart; + NewEntry.PartHandle = Result.PartHandle; + + if (SpawnActorForEntry(NewEntry)) + { + OwnerComponent->BroadcastChanged(); + } + + MarkItemDirty(NewEntry); + } + + return Result; +} + +void FLyraCharacterPartList::RemoveEntry(FLyraCharacterPartHandle Handle) +{ + for (auto EntryIt = Entries.CreateIterator(); EntryIt; ++EntryIt) + { + FLyraAppliedCharacterPartEntry& Entry = *EntryIt; + if (Entry.PartHandle == Handle.PartHandle) + { + const bool bDestroyedActor = DestroyActorForEntry(Entry); + EntryIt.RemoveCurrent(); + MarkArrayDirty(); + + if (bDestroyedActor && ensure(OwnerComponent)) + { + OwnerComponent->BroadcastChanged(); + } + + break; + } + } +} + +void FLyraCharacterPartList::ClearAllEntries(bool bBroadcastChangeDelegate) +{ + bool bDestroyedAnyActors = false; + for (FLyraAppliedCharacterPartEntry& Entry : Entries) + { + bDestroyedAnyActors |= DestroyActorForEntry(Entry); + } + Entries.Reset(); + MarkArrayDirty(); + + if (bDestroyedAnyActors && bBroadcastChangeDelegate && ensure(OwnerComponent)) + { + OwnerComponent->BroadcastChanged(); + } +} + +FGameplayTagContainer FLyraCharacterPartList::CollectCombinedTags() const +{ + FGameplayTagContainer Result; + + for (const FLyraAppliedCharacterPartEntry& Entry : Entries) + { + if (Entry.SpawnedComponent != nullptr) + { + if (IGameplayTagAssetInterface* TagInterface = Cast(Entry.SpawnedComponent->GetChildActor())) + { + TagInterface->GetOwnedGameplayTags(/*inout*/ Result); + } + } + } + + return Result; +} + +bool FLyraCharacterPartList::SpawnActorForEntry(FLyraAppliedCharacterPartEntry& Entry) +{ + bool bCreatedAnyActors = false; + + if (ensure(OwnerComponent) && !OwnerComponent->IsNetMode(NM_DedicatedServer)) + { + if (Entry.Part.PartClass != nullptr) + { + UWorld* World = OwnerComponent->GetWorld(); + + if (USceneComponent* ComponentToAttachTo = OwnerComponent->GetSceneComponentToAttachTo()) + { + const FTransform SpawnTransform = ComponentToAttachTo->GetSocketTransform(Entry.Part.SocketName); + + UChildActorComponent* PartComponent = NewObject(OwnerComponent->GetOwner()); + + PartComponent->SetupAttachment(ComponentToAttachTo, Entry.Part.SocketName); + PartComponent->SetChildActorClass(Entry.Part.PartClass); + PartComponent->RegisterComponent(); + + if (AActor* SpawnedActor = PartComponent->GetChildActor()) + { + switch (Entry.Part.CollisionMode) + { + case ECharacterCustomizationCollisionMode::UseCollisionFromCharacterPart: + // Do nothing + break; + + case ECharacterCustomizationCollisionMode::NoCollision: + SpawnedActor->SetActorEnableCollision(false); + break; + } + + // Set up a direct tick dependency to work around the child actor component not providing one + if (USceneComponent* SpawnedRootComponent = SpawnedActor->GetRootComponent()) + { + SpawnedRootComponent->AddTickPrerequisiteComponent(ComponentToAttachTo); + } + } + + Entry.SpawnedComponent = PartComponent; + bCreatedAnyActors = true; + } + } + } + + return bCreatedAnyActors; +} + +bool FLyraCharacterPartList::DestroyActorForEntry(FLyraAppliedCharacterPartEntry& Entry) +{ + bool bDestroyedAnyActors = false; + + if (Entry.SpawnedComponent != nullptr) + { + Entry.SpawnedComponent->DestroyComponent(); + Entry.SpawnedComponent = nullptr; + bDestroyedAnyActors = true; + } + + return bDestroyedAnyActors; +} + +////////////////////////////////////////////////////////////////////// + +ULyraPawnComponent_CharacterParts::ULyraPawnComponent_CharacterParts(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + SetIsReplicatedByDefault(true); +} + +void ULyraPawnComponent_CharacterParts::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const +{ + Super::GetLifetimeReplicatedProps(OutLifetimeProps); + + DOREPLIFETIME(ThisClass, CharacterPartList); +} + +FLyraCharacterPartHandle ULyraPawnComponent_CharacterParts::AddCharacterPart(const FLyraCharacterPart& NewPart) +{ + return CharacterPartList.AddEntry(NewPart); +} + +void ULyraPawnComponent_CharacterParts::RemoveCharacterPart(FLyraCharacterPartHandle Handle) +{ + CharacterPartList.RemoveEntry(Handle); +} + +void ULyraPawnComponent_CharacterParts::RemoveAllCharacterParts() +{ + CharacterPartList.ClearAllEntries(/*bBroadcastChangeDelegate=*/ true); +} + +void ULyraPawnComponent_CharacterParts::BeginPlay() +{ + Super::BeginPlay(); +} + +void ULyraPawnComponent_CharacterParts::EndPlay(const EEndPlayReason::Type EndPlayReason) +{ + CharacterPartList.ClearAllEntries(/*bBroadcastChangeDelegate=*/ false); + + Super::EndPlay(EndPlayReason); +} + +void ULyraPawnComponent_CharacterParts::OnRegister() +{ + Super::OnRegister(); + + if (!IsTemplate()) + { + CharacterPartList.SetOwnerComponent(this); + } +} + +TArray ULyraPawnComponent_CharacterParts::GetCharacterPartActors() const +{ + TArray Result; + Result.Reserve(CharacterPartList.Entries.Num()); + + for (const FLyraAppliedCharacterPartEntry& Entry : CharacterPartList.Entries) + { + if (UChildActorComponent* PartComponent = Entry.SpawnedComponent) + { + if (AActor* SpawnedActor = PartComponent->GetChildActor()) + { + Result.Add(SpawnedActor); + } + } + } + + return Result; +} + +USkeletalMeshComponent* ULyraPawnComponent_CharacterParts::GetParentMeshComponent() const +{ + if (AActor* OwnerActor = GetOwner()) + { + if (ACharacter* OwningCharacter = Cast(OwnerActor)) + { + if (USkeletalMeshComponent* MeshComponent = OwningCharacter->GetMesh()) + { + return MeshComponent; + } + } + } + + return nullptr; +} + +USceneComponent* ULyraPawnComponent_CharacterParts::GetSceneComponentToAttachTo() const +{ + if (USkeletalMeshComponent* MeshComponent = GetParentMeshComponent()) + { + return MeshComponent; + } + else if (AActor* OwnerActor = GetOwner()) + { + return OwnerActor->GetRootComponent(); + } + else + { + return nullptr; + } +} + +FGameplayTagContainer ULyraPawnComponent_CharacterParts::GetCombinedTags(FGameplayTag RequiredPrefix) const +{ + FGameplayTagContainer Result = CharacterPartList.CollectCombinedTags(); + if (RequiredPrefix.IsValid()) + { + return Result.Filter(FGameplayTagContainer(RequiredPrefix)); + } + else + { + return Result; + } +} + +void ULyraPawnComponent_CharacterParts::BroadcastChanged() +{ + const bool bReinitPose = true; + + // Check to see if the body type has changed + if (USkeletalMeshComponent* MeshComponent = GetParentMeshComponent()) + { + // Determine the mesh to use based on cosmetic part tags + const FGameplayTagContainer MergedTags = GetCombinedTags(FGameplayTag()); + USkeletalMesh* DesiredMesh = BodyMeshes.SelectBestBodyStyle(MergedTags); + + // Apply the desired mesh (this call is a no-op if the mesh hasn't changed) + MeshComponent->SetSkeletalMesh(DesiredMesh, /*bReinitPose=*/ bReinitPose); + + // Apply the desired physics asset if there's a forced override independent of the one from the mesh + if (UPhysicsAsset* PhysicsAsset = BodyMeshes.ForcedPhysicsAsset) + { + MeshComponent->SetPhysicsAsset(PhysicsAsset, /*bForceReInit=*/ bReinitPose); + } + } + + // Let observers know, e.g., if they need to apply team coloring or similar + OnCharacterPartsChanged.Broadcast(this); +} + + diff --git a/LyraStarterGame/Source/LyraGame/Cosmetics/LyraPawnComponent_CharacterParts.h b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraPawnComponent_CharacterParts.h new file mode 100644 index 0000000000000000000000000000000000000000..113bdc5eee908153a3a03746ed9c4f0fe3a52452 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Cosmetics/LyraPawnComponent_CharacterParts.h @@ -0,0 +1,178 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Components/PawnComponent.h" +#include "Cosmetics/LyraCosmeticAnimationTypes.h" +#include "LyraCharacterPartTypes.h" +#include "Net/Serialization/FastArraySerializer.h" + +#include "LyraPawnComponent_CharacterParts.generated.h" + +class ULyraPawnComponent_CharacterParts; +namespace EEndPlayReason { enum Type : int; } +struct FGameplayTag; +struct FLyraCharacterPartList; + +class AActor; +class UChildActorComponent; +class UObject; +class USceneComponent; +class USkeletalMeshComponent; +struct FFrame; +struct FNetDeltaSerializeInfo; + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FLyraSpawnedCharacterPartsChanged, ULyraPawnComponent_CharacterParts*, ComponentWithChangedParts); + +////////////////////////////////////////////////////////////////////// + +// A single applied character part +USTRUCT() +struct FLyraAppliedCharacterPartEntry : public FFastArraySerializerItem +{ + GENERATED_BODY() + + FLyraAppliedCharacterPartEntry() + {} + + FString GetDebugString() const; + +private: + friend FLyraCharacterPartList; + friend ULyraPawnComponent_CharacterParts; + +private: + // The character part being represented + UPROPERTY() + FLyraCharacterPart Part; + + // Handle index we returned to the user (server only) + UPROPERTY(NotReplicated) + int32 PartHandle = INDEX_NONE; + + // The spawned actor instance (client only) + UPROPERTY(NotReplicated) + TObjectPtr SpawnedComponent = nullptr; +}; + +////////////////////////////////////////////////////////////////////// + +// Replicated list of applied character parts +USTRUCT(BlueprintType) +struct FLyraCharacterPartList : public FFastArraySerializer +{ + GENERATED_BODY() + + FLyraCharacterPartList() + : OwnerComponent(nullptr) + { + } + +public: + //~FFastArraySerializer contract + void PreReplicatedRemove(const TArrayView RemovedIndices, int32 FinalSize); + void PostReplicatedAdd(const TArrayView AddedIndices, int32 FinalSize); + void PostReplicatedChange(const TArrayView ChangedIndices, int32 FinalSize); + //~End of FFastArraySerializer contract + + bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms) + { + return FFastArraySerializer::FastArrayDeltaSerialize(Entries, DeltaParms, *this); + } + + FLyraCharacterPartHandle AddEntry(FLyraCharacterPart NewPart); + void RemoveEntry(FLyraCharacterPartHandle Handle); + void ClearAllEntries(bool bBroadcastChangeDelegate); + + FGameplayTagContainer CollectCombinedTags() const; + + void SetOwnerComponent(ULyraPawnComponent_CharacterParts* InOwnerComponent) + { + OwnerComponent = InOwnerComponent; + } + +private: + friend ULyraPawnComponent_CharacterParts; + + bool SpawnActorForEntry(FLyraAppliedCharacterPartEntry& Entry); + bool DestroyActorForEntry(FLyraAppliedCharacterPartEntry& Entry); + +private: + // Replicated list of equipment entries + UPROPERTY() + TArray Entries; + + // The component that contains this list + UPROPERTY(NotReplicated) + TObjectPtr OwnerComponent; + + // Upcounter for handles + int32 PartHandleCounter = 0; +}; + +template<> +struct TStructOpsTypeTraits : public TStructOpsTypeTraitsBase2 +{ + enum { WithNetDeltaSerializer = true }; +}; + +////////////////////////////////////////////////////////////////////// + +// A component that handles spawning cosmetic actors attached to the owner pawn on all clients +UCLASS(meta=(BlueprintSpawnableComponent)) +class ULyraPawnComponent_CharacterParts : public UPawnComponent +{ + GENERATED_BODY() + +public: + ULyraPawnComponent_CharacterParts(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + //~UActorComponent interface + virtual void BeginPlay() override; + virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; + virtual void OnRegister() override; + //~End of UActorComponent interface + + // Adds a character part to the actor that owns this customization component, should be called on the authority only + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Cosmetics) + FLyraCharacterPartHandle AddCharacterPart(const FLyraCharacterPart& NewPart); + + // Removes a previously added character part from the actor that owns this customization component, should be called on the authority only + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Cosmetics) + void RemoveCharacterPart(FLyraCharacterPartHandle Handle); + + // Removes all added character parts, should be called on the authority only + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Cosmetics) + void RemoveAllCharacterParts(); + + // Gets the list of all spawned character parts from this component + UFUNCTION(BlueprintCallable, BlueprintPure=false, BlueprintCosmetic, Category=Cosmetics) + TArray GetCharacterPartActors() const; + + // If the parent actor is derived from ACharacter, returns the Mesh component, otherwise nullptr + USkeletalMeshComponent* GetParentMeshComponent() const; + + // Returns the scene component to attach the spawned actors to + // If the parent actor is derived from ACharacter, we'll use the Mesh component, otherwise the root component + USceneComponent* GetSceneComponentToAttachTo() const; + + // Returns the set of combined gameplay tags from attached character parts, optionally filtered to only tags that start with the specified root + UFUNCTION(BlueprintCallable, BlueprintPure=false, BlueprintCosmetic, Category=Cosmetics) + FGameplayTagContainer GetCombinedTags(FGameplayTag RequiredPrefix) const; + + void BroadcastChanged(); + +public: + // Delegate that will be called when the list of spawned character parts has changed + UPROPERTY(BlueprintAssignable, Category=Cosmetics, BlueprintCallable) + FLyraSpawnedCharacterPartsChanged OnCharacterPartsChanged; + +private: + // List of character parts + UPROPERTY(Replicated, Transient) + FLyraCharacterPartList CharacterPartList; + + // Rules for how to pick a body style mesh for animation to play on, based on character part cosmetics tags + UPROPERTY(EditAnywhere, Category=Cosmetics) + FLyraAnimBodyStyleSelectionSet BodyMeshes; +}; diff --git a/LyraStarterGame/Source/LyraGame/Development/LyraBotCheats.cpp b/LyraStarterGame/Source/LyraGame/Development/LyraBotCheats.cpp new file mode 100644 index 0000000000000000000000000000000000000000..00423184eec378731921869b2fe0dbc3f87fc1dc --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Development/LyraBotCheats.cpp @@ -0,0 +1,59 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraBotCheats.h" +#include "Engine/World.h" +#include "GameFramework/CheatManagerDefines.h" +#include "GameModes/LyraBotCreationComponent.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraBotCheats) + +////////////////////////////////////////////////////////////////////// +// ULyraBotCheats + +ULyraBotCheats::ULyraBotCheats() +{ +#if WITH_SERVER_CODE && UE_WITH_CHEAT_MANAGER + if (HasAnyFlags(RF_ClassDefaultObject)) + { + UCheatManager::RegisterForOnCheatManagerCreated(FOnCheatManagerCreated::FDelegate::CreateLambda( + [](UCheatManager* CheatManager) + { + CheatManager->AddCheatManagerExtension(NewObject(CheatManager)); + })); + } +#endif +} + +void ULyraBotCheats::AddPlayerBot() +{ +#if WITH_SERVER_CODE && UE_WITH_CHEAT_MANAGER + if (ULyraBotCreationComponent* BotComponent = GetBotComponent()) + { + BotComponent->Cheat_AddBot(); + } +#endif +} + +void ULyraBotCheats::RemovePlayerBot() +{ +#if WITH_SERVER_CODE && UE_WITH_CHEAT_MANAGER + if (ULyraBotCreationComponent* BotComponent = GetBotComponent()) + { + BotComponent->Cheat_RemoveBot(); + } +#endif +} + +ULyraBotCreationComponent* ULyraBotCheats::GetBotComponent() const +{ + if (UWorld* World = GetWorld()) + { + if (AGameStateBase* GameState = World->GetGameState()) + { + return GameState->FindComponentByClass(); + } + } + + return nullptr; +} + diff --git a/LyraStarterGame/Source/LyraGame/Development/LyraBotCheats.h b/LyraStarterGame/Source/LyraGame/Development/LyraBotCheats.h new file mode 100644 index 0000000000000000000000000000000000000000..fb68a037d8497e2749d881c302c6a79a3cd25b64 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Development/LyraBotCheats.h @@ -0,0 +1,32 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "GameFramework/CheatManager.h" + +#include "LyraBotCheats.generated.h" + +class ULyraBotCreationComponent; +class UObject; +struct FFrame; + +/** Cheats related to bots */ +UCLASS(NotBlueprintable) +class ULyraBotCheats final : public UCheatManagerExtension +{ + GENERATED_BODY() + +public: + ULyraBotCheats(); + + // Adds a bot player + UFUNCTION(Exec, BlueprintAuthorityOnly) + void AddPlayerBot(); + + // Removes a random bot player + UFUNCTION(Exec, BlueprintAuthorityOnly) + void RemovePlayerBot(); + +private: + ULyraBotCreationComponent* GetBotComponent() const; +}; diff --git a/LyraStarterGame/Source/LyraGame/Development/LyraDeveloperSettings.cpp b/LyraStarterGame/Source/LyraGame/Development/LyraDeveloperSettings.cpp new file mode 100644 index 0000000000000000000000000000000000000000..df1c5b0c5f21fd3b86caeb6f6a19aab52283cc86 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Development/LyraDeveloperSettings.cpp @@ -0,0 +1,63 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraDeveloperSettings.h" +#include "Misc/App.h" +#include "Widgets/Notifications/SNotificationList.h" +#include "Framework/Notifications/NotificationManager.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraDeveloperSettings) + +#define LOCTEXT_NAMESPACE "LyraCheats" + +ULyraDeveloperSettings::ULyraDeveloperSettings() +{ +} + +FName ULyraDeveloperSettings::GetCategoryName() const +{ + return FApp::GetProjectName(); +} + +#if WITH_EDITOR +void ULyraDeveloperSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) +{ + Super::PostEditChangeProperty(PropertyChangedEvent); + + ApplySettings(); +} + +void ULyraDeveloperSettings::PostReloadConfig(FProperty* PropertyThatWasLoaded) +{ + Super::PostReloadConfig(PropertyThatWasLoaded); + + ApplySettings(); +} + +void ULyraDeveloperSettings::PostInitProperties() +{ + Super::PostInitProperties(); + + ApplySettings(); +} + +void ULyraDeveloperSettings::ApplySettings() +{ +} + +void ULyraDeveloperSettings::OnPlayInEditorStarted() const +{ + // Show a notification toast to remind the user that there's an experience override set + if (ExperienceOverride.IsValid()) + { + FNotificationInfo Info(FText::Format( + LOCTEXT("ExperienceOverrideActive", "Developer Settings Override\nExperience {0}"), + FText::FromName(ExperienceOverride.PrimaryAssetName) + )); + Info.ExpireDuration = 2.0f; + FSlateNotificationManager::Get().AddNotification(Info); + } +} +#endif + +#undef LOCTEXT_NAMESPACE + diff --git a/LyraStarterGame/Source/LyraGame/Development/LyraDeveloperSettings.h b/LyraStarterGame/Source/LyraGame/Development/LyraDeveloperSettings.h new file mode 100644 index 0000000000000000000000000000000000000000..c542afc2c14ea65317c82bffda8931e2253ab449 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Development/LyraDeveloperSettings.h @@ -0,0 +1,111 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Engine/DeveloperSettingsBackedByCVars.h" +#include "UObject/PrimaryAssetId.h" +#include "UObject/SoftObjectPath.h" +#include "LyraDeveloperSettings.generated.h" + +struct FPropertyChangedEvent; + +class ULyraExperienceDefinition; + +UENUM() +enum class ECheatExecutionTime +{ + // When the cheat manager is created + OnCheatManagerCreated, + + // When a pawn is possessed by a player + OnPlayerPawnPossession +}; + +USTRUCT() +struct FLyraCheatToRun +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere) + ECheatExecutionTime Phase = ECheatExecutionTime::OnPlayerPawnPossession; + + UPROPERTY(EditAnywhere) + FString Cheat; +}; + +/** + * Developer settings / editor cheats + */ +UCLASS(config=EditorPerProjectUserSettings, MinimalAPI) +class ULyraDeveloperSettings : public UDeveloperSettingsBackedByCVars +{ + GENERATED_BODY() + +public: + ULyraDeveloperSettings(); + + //~UDeveloperSettings interface + virtual FName GetCategoryName() const override; + //~End of UDeveloperSettings interface + +public: + // The experience override to use for Play in Editor (if not set, the default for the world settings of the open map will be used) + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, config, Category=Lyra, meta=(AllowedTypes="LyraExperienceDefinition")) + FPrimaryAssetId ExperienceOverride; + + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, config, Category=LyraBots, meta=(InlineEditConditionToggle)) + bool bOverrideBotCount = false; + + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, config, Category=LyraBots, meta=(EditCondition=bOverrideBotCount)) + int32 OverrideNumPlayerBotsToSpawn = 0; + + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, config, Category=LyraBots) + bool bAllowPlayerBotsToAttack = true; + + // Do the full game flow when playing in the editor, or skip 'waiting for player' / etc... game phases? + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, config, Category=Lyra) + bool bTestFullGameFlowInPIE = false; + + /** + * Should force feedback effects be played, even if the last input device was not a gamepad? + * The default behavior in Lyra is to only play force feedback if the most recent input device was a gamepad. + */ + UPROPERTY(config, EditAnywhere, Category = Lyra, meta = (ConsoleVariable = "LyraPC.ShouldAlwaysPlayForceFeedback")) + bool bShouldAlwaysPlayForceFeedback = false; + + // Should game logic load cosmetic backgrounds in the editor or skip them for iteration speed? + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, config, Category=Lyra) + bool bSkipLoadingCosmeticBackgroundsInPIE = false; + + // List of cheats to auto-run during 'play in editor' + UPROPERTY(config, EditAnywhere, Category=Lyra) + TArray CheatsToRun; + + // Should messages broadcast through the gameplay message subsystem be logged? + UPROPERTY(config, EditAnywhere, Category=GameplayMessages, meta=(ConsoleVariable="GameplayMessageSubsystem.LogMessages")) + bool LogGameplayMessages = false; + +#if WITH_EDITORONLY_DATA + /** A list of common maps that will be accessible via the editor detoolbar */ + UPROPERTY(config, EditAnywhere, BlueprintReadOnly, Category=Maps, meta=(AllowedClasses="/Script/Engine.World")) + TArray CommonEditorMaps; +#endif + +#if WITH_EDITOR +public: + // Called by the editor engine to let us pop reminder notifications when cheats are active + LYRAGAME_API void OnPlayInEditorStarted() const; + +private: + void ApplySettings(); +#endif + +public: + //~UObject interface +#if WITH_EDITOR + virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; + virtual void PostReloadConfig(FProperty* PropertyThatWasLoaded) override; + virtual void PostInitProperties() override; +#endif + //~End of UObject interface +}; diff --git a/LyraStarterGame/Source/LyraGame/Development/LyraPlatformEmulationSettings.cpp b/LyraStarterGame/Source/LyraGame/Development/LyraPlatformEmulationSettings.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8c06120e695290134d56a995ef419ac0c6252d94 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Development/LyraPlatformEmulationSettings.cpp @@ -0,0 +1,196 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraPlatformEmulationSettings.h" +#include "CommonUIVisibilitySubsystem.h" +#include "Engine/PlatformSettingsManager.h" +#include "Misc/App.h" +#include "Widgets/Notifications/SNotificationList.h" +#include "Framework/Notifications/NotificationManager.h" +#include "DeviceProfiles/DeviceProfileManager.h" +#include "DeviceProfiles/DeviceProfile.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraPlatformEmulationSettings) + +#define LOCTEXT_NAMESPACE "LyraCheats" + +ULyraPlatformEmulationSettings::ULyraPlatformEmulationSettings() +{ +} + +FName ULyraPlatformEmulationSettings::GetCategoryName() const +{ + return FApp::GetProjectName(); +} + +FName ULyraPlatformEmulationSettings::GetPretendBaseDeviceProfile() const +{ + return PretendBaseDeviceProfile; +} + +FName ULyraPlatformEmulationSettings::GetPretendPlatformName() const +{ + return PretendPlatform; +} + +#if WITH_EDITOR +void ULyraPlatformEmulationSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) +{ + Super::PostEditChangeProperty(PropertyChangedEvent); + + ApplySettings(); +} + +void ULyraPlatformEmulationSettings::PostReloadConfig(FProperty* PropertyThatWasLoaded) +{ + Super::PostReloadConfig(PropertyThatWasLoaded); + + ApplySettings(); +} + +void ULyraPlatformEmulationSettings::PostInitProperties() +{ + Super::PostInitProperties(); + + ApplySettings(); +} + +void ULyraPlatformEmulationSettings::OnPlayInEditorStarted() const +{ + // Show a notification toast to remind the user that there's a tag enable override set + if (!AdditionalPlatformTraitsToEnable.IsEmpty()) + { + FNotificationInfo Info(FText::Format( + LOCTEXT("PlatformTraitEnableActive", "Platform Trait Override\nEnabling {0}"), + FText::AsCultureInvariant(AdditionalPlatformTraitsToEnable.ToStringSimple()) + )); + Info.ExpireDuration = 3.0f; + FSlateNotificationManager::Get().AddNotification(Info); + } + + // Show a notification toast to remind the user that there's a tag suppression override set + if (!AdditionalPlatformTraitsToSuppress.IsEmpty()) + { + FNotificationInfo Info(FText::Format( + LOCTEXT("PlatformTraitSuppressionActive", "Platform Trait Override\nSuppressing {0}"), + FText::AsCultureInvariant(AdditionalPlatformTraitsToSuppress.ToStringSimple()) + )); + Info.ExpireDuration = 3.0f; + FSlateNotificationManager::Get().AddNotification(Info); + } + + // Show a notification toast to remind the user that there's a platform override set + if (PretendPlatform != NAME_None) + { + FNotificationInfo Info(FText::Format( + LOCTEXT("PlatformOverrideActive", "Platform Override Active\nPretending to be {0}"), + FText::FromName(PretendPlatform) + )); + Info.ExpireDuration = 3.0f; + FSlateNotificationManager::Get().AddNotification(Info); + } +} + +void ULyraPlatformEmulationSettings::ApplySettings() +{ + UCommonUIVisibilitySubsystem::SetDebugVisibilityConditions(AdditionalPlatformTraitsToEnable, AdditionalPlatformTraitsToSuppress); + + if (GIsEditor && PretendPlatform != LastAppliedPretendPlatform) + { + ChangeActivePretendPlatform(PretendPlatform); + } + + PickReasonableBaseDeviceProfile(); +} + +void ULyraPlatformEmulationSettings::ChangeActivePretendPlatform(FName NewPlatformName) +{ + LastAppliedPretendPlatform = NewPlatformName; + PretendPlatform = NewPlatformName; + + UPlatformSettingsManager::SetEditorSimulatedPlatform(PretendPlatform); +} + +#endif + +TArray ULyraPlatformEmulationSettings::GetKnownPlatformIds() const +{ + TArray Results; + +#if WITH_EDITOR + Results.Add(NAME_None); + Results.Append(UPlatformSettingsManager::GetKnownAndEnablePlatformIniNames()); +#endif + + return Results; +} + +TArray ULyraPlatformEmulationSettings::GetKnownDeviceProfiles() const +{ + TArray Results; + +#if WITH_EDITOR + const UDeviceProfileManager& Manager = UDeviceProfileManager::Get(); + Results.Reserve(Manager.Profiles.Num() + 1); + + if (PretendPlatform == NAME_None) + { + Results.Add(NAME_None); + } + + for (const TObjectPtr& Profile : Manager.Profiles) + { + bool bIncludeEntry = true; + if (PretendPlatform != NAME_None) + { + if (Profile->DeviceType != PretendPlatform.ToString()) + { + bIncludeEntry = false; + } + } + + if (bIncludeEntry) + { + Results.Add(Profile->GetFName()); + } + } +#endif + + return Results; +} + +void ULyraPlatformEmulationSettings::PickReasonableBaseDeviceProfile() +{ + // First see if our pretend device profile is already compatible, if so we don't need to do anything + UDeviceProfileManager& Manager = UDeviceProfileManager::Get(); + if (UDeviceProfile* ProfilePtr = Manager.FindProfile(PretendBaseDeviceProfile.ToString(), /*bCreateOnFail=*/ false)) + { + const bool bIsCompatible = (PretendPlatform == NAME_None) || (ProfilePtr->DeviceType == PretendPlatform.ToString()); + if (!bIsCompatible) + { + PretendBaseDeviceProfile = NAME_None; + } + } + + if ((PretendPlatform != NAME_None) && (PretendBaseDeviceProfile == NAME_None)) + { + // If we're pretending we're a platform and don't have a pretend base profile, pick a reasonable one, + // preferring the one with the shortest name as a simple heuristic + FName ShortestMatchingProfileName; + const FString PretendPlatformStr = PretendPlatform.ToString(); + for (const TObjectPtr& Profile : Manager.Profiles) + { + if (Profile->DeviceType == PretendPlatformStr) + { + const FName TestName = Profile->GetFName(); + if ((ShortestMatchingProfileName == NAME_None) || (TestName.GetStringLength() < ShortestMatchingProfileName.GetStringLength())) + { + ShortestMatchingProfileName = TestName; + } + } + } + PretendBaseDeviceProfile = ShortestMatchingProfileName; + } +} + +#undef LOCTEXT_NAMESPACE + diff --git a/LyraStarterGame/Source/LyraGame/Development/LyraPlatformEmulationSettings.h b/LyraStarterGame/Source/LyraGame/Development/LyraPlatformEmulationSettings.h new file mode 100644 index 0000000000000000000000000000000000000000..5e409fab0ed1a65715396aa632c42a985482e0e3 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Development/LyraPlatformEmulationSettings.h @@ -0,0 +1,90 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Engine/DeveloperSettingsBackedByCVars.h" +#include "GameplayTagContainer.h" +#include "LyraPlatformEmulationSettings.generated.h" + +struct FPropertyChangedEvent; + +/** + * Platform emulation settings + */ +UCLASS(config=EditorPerProjectUserSettings, MinimalAPI) +class ULyraPlatformEmulationSettings : public UDeveloperSettingsBackedByCVars +{ + GENERATED_BODY() + +public: + ULyraPlatformEmulationSettings(); + + //~UDeveloperSettings interface + virtual FName GetCategoryName() const override; + //~End of UDeveloperSettings interface + + FName GetPretendBaseDeviceProfile() const; + FName GetPretendPlatformName() const; + +private: + UPROPERTY(EditAnywhere, config, Category=PlatformEmulation, meta=(Categories="Input,Platform.Trait")) + FGameplayTagContainer AdditionalPlatformTraitsToEnable; + + UPROPERTY(EditAnywhere, config, Category=PlatformEmulation, meta=(Categories="Input,Platform.Trait")) + FGameplayTagContainer AdditionalPlatformTraitsToSuppress; + + UPROPERTY(EditAnywhere, config, Category=PlatformEmulation, meta=(GetOptions=GetKnownPlatformIds)) + FName PretendPlatform; + + // The base device profile to pretend we are using when emulating device-specific device profiles applied from ULyraSettingsLocal + UPROPERTY(EditAnywhere, config, Category=PlatformEmulation, meta=(GetOptions=GetKnownDeviceProfiles, EditCondition=bApplyDeviceProfilesInPIE)) + FName PretendBaseDeviceProfile; + + // Do we apply desktop-style frame rate settings in PIE? + // (frame rate limits are an engine-wide setting so it's not always desirable to have enabled in the editor) + // You may also want to disable the editor preference "Use Less CPU when in Background" if testing background frame rate limits + UPROPERTY(EditAnywhere, config, Category=PlatformEmulation, meta=(ConsoleVariable="Lyra.Settings.ApplyFrameRateSettingsInPIE")) + bool bApplyFrameRateSettingsInPIE = false; + + // Do we apply front-end specific performance options in PIE? + // Most engine performance/scalability settings they drive are global, so if one PIE window + // is in the front-end and the other is in-game one will win and the other gets stuck with those settings + UPROPERTY(EditAnywhere, config, Category=PlatformEmulation, meta=(ConsoleVariable="Lyra.Settings.ApplyFrontEndPerformanceOptionsInPIE")) + bool bApplyFrontEndPerformanceOptionsInPIE = false; + + // Should we apply experience/platform emulated device profiles in PIE? + UPROPERTY(EditAnywhere, config, Category=PlatformEmulation, meta=(InlineEditConditionToggle, ConsoleVariable="Lyra.Settings.ApplyDeviceProfilesInPIE")) + bool bApplyDeviceProfilesInPIE = false; + +#if WITH_EDITOR +public: + // Called by the editor engine to let us pop reminder notifications when cheats are active + LYRAGAME_API void OnPlayInEditorStarted() const; + +private: + // The last pretend platform we applied + FName LastAppliedPretendPlatform; + +private: + void ApplySettings(); + void ChangeActivePretendPlatform(FName NewPlatformName); +#endif + +public: + //~UObject interface +#if WITH_EDITOR + virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; + virtual void PostReloadConfig(FProperty* PropertyThatWasLoaded) override; + virtual void PostInitProperties() override; +#endif + //~End of UObject interface + +private: + UFUNCTION() + TArray GetKnownPlatformIds() const; + + UFUNCTION() + TArray GetKnownDeviceProfiles() const; + + void PickReasonableBaseDeviceProfile(); +}; diff --git a/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentDefinition.cpp b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentDefinition.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9e35ee210d8dd828bf532abe82bf487c0411db82 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentDefinition.cpp @@ -0,0 +1,13 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraEquipmentDefinition.h" +#include "LyraEquipmentInstance.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraEquipmentDefinition) + +ULyraEquipmentDefinition::ULyraEquipmentDefinition(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + InstanceType = ULyraEquipmentInstance::StaticClass(); +} + diff --git a/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentDefinition.h b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentDefinition.h new file mode 100644 index 0000000000000000000000000000000000000000..6bcd344cab18df5c01e1f9e5cc13b703a5a01993 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentDefinition.h @@ -0,0 +1,56 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Templates/SubclassOf.h" + +#include "LyraEquipmentDefinition.generated.h" + +class AActor; +class ULyraAbilitySet; +class ULyraEquipmentInstance; + +USTRUCT() +struct FLyraEquipmentActorToSpawn +{ + GENERATED_BODY() + + FLyraEquipmentActorToSpawn() + {} + + UPROPERTY(EditAnywhere, Category=Equipment) + TSubclassOf ActorToSpawn; + + UPROPERTY(EditAnywhere, Category=Equipment) + FName AttachSocket; + + UPROPERTY(EditAnywhere, Category=Equipment) + FTransform AttachTransform; +}; + + +/** + * ULyraEquipmentDefinition + * + * Definition of a piece of equipment that can be applied to a pawn + */ +UCLASS(Blueprintable, Const, Abstract, BlueprintType) +class ULyraEquipmentDefinition : public UObject +{ + GENERATED_BODY() + +public: + ULyraEquipmentDefinition(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + // Class to spawn + UPROPERTY(EditDefaultsOnly, Category=Equipment) + TSubclassOf InstanceType; + + // Gameplay ability sets to grant when this is equipped + UPROPERTY(EditDefaultsOnly, Category=Equipment) + TArray> AbilitySetsToGrant; + + // Actors to spawn on the pawn when this is equipped + UPROPERTY(EditDefaultsOnly, Category=Equipment) + TArray ActorsToSpawn; +}; diff --git a/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentInstance.cpp b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentInstance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..79ee342c7b6c87932047ebc45efc22ea2f347905 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentInstance.cpp @@ -0,0 +1,119 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraEquipmentInstance.h" + +#include "Components/SkeletalMeshComponent.h" +#include "GameFramework/Character.h" +#include "LyraEquipmentDefinition.h" +#include "Net/UnrealNetwork.h" + +#if UE_WITH_IRIS +#include "Iris/ReplicationSystem/ReplicationFragmentUtil.h" +#endif // UE_WITH_IRIS + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraEquipmentInstance) + +class FLifetimeProperty; +class UClass; +class USceneComponent; + +ULyraEquipmentInstance::ULyraEquipmentInstance(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +UWorld* ULyraEquipmentInstance::GetWorld() const +{ + if (APawn* OwningPawn = GetPawn()) + { + return OwningPawn->GetWorld(); + } + else + { + return nullptr; + } +} + +void ULyraEquipmentInstance::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const +{ + Super::GetLifetimeReplicatedProps(OutLifetimeProps); + + DOREPLIFETIME(ThisClass, Instigator); + DOREPLIFETIME(ThisClass, SpawnedActors); +} + +#if UE_WITH_IRIS +void ULyraEquipmentInstance::RegisterReplicationFragments(UE::Net::FFragmentRegistrationContext& Context, UE::Net::EFragmentRegistrationFlags RegistrationFlags) +{ + using namespace UE::Net; + + // Build descriptors and allocate PropertyReplicationFragments for this object + FReplicationFragmentUtil::CreateAndRegisterFragmentsForObject(this, Context, RegistrationFlags); +} +#endif // UE_WITH_IRIS + +APawn* ULyraEquipmentInstance::GetPawn() const +{ + return Cast(GetOuter()); +} + +APawn* ULyraEquipmentInstance::GetTypedPawn(TSubclassOf PawnType) const +{ + APawn* Result = nullptr; + if (UClass* ActualPawnType = PawnType) + { + if (GetOuter()->IsA(ActualPawnType)) + { + Result = Cast(GetOuter()); + } + } + return Result; +} + +void ULyraEquipmentInstance::SpawnEquipmentActors(const TArray& ActorsToSpawn) +{ + if (APawn* OwningPawn = GetPawn()) + { + USceneComponent* AttachTarget = OwningPawn->GetRootComponent(); + if (ACharacter* Char = Cast(OwningPawn)) + { + AttachTarget = Char->GetMesh(); + } + + for (const FLyraEquipmentActorToSpawn& SpawnInfo : ActorsToSpawn) + { + AActor* NewActor = GetWorld()->SpawnActorDeferred(SpawnInfo.ActorToSpawn, FTransform::Identity, OwningPawn); + NewActor->FinishSpawning(FTransform::Identity, /*bIsDefaultTransform=*/ true); + NewActor->SetActorRelativeTransform(SpawnInfo.AttachTransform); + NewActor->AttachToComponent(AttachTarget, FAttachmentTransformRules::KeepRelativeTransform, SpawnInfo.AttachSocket); + + SpawnedActors.Add(NewActor); + } + } +} + +void ULyraEquipmentInstance::DestroyEquipmentActors() +{ + for (AActor* Actor : SpawnedActors) + { + if (Actor) + { + Actor->Destroy(); + } + } +} + +void ULyraEquipmentInstance::OnEquipped() +{ + K2_OnEquipped(); +} + +void ULyraEquipmentInstance::OnUnequipped() +{ + K2_OnUnequipped(); +} + +void ULyraEquipmentInstance::OnRep_Instigator() +{ +} + diff --git a/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentInstance.h b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentInstance.h new file mode 100644 index 0000000000000000000000000000000000000000..d7256ab58377595d904dce3c4e6269e4ef0c39cf --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentInstance.h @@ -0,0 +1,74 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Engine/World.h" + +#include "LyraEquipmentInstance.generated.h" + +class AActor; +class APawn; +struct FFrame; +struct FLyraEquipmentActorToSpawn; + +/** + * ULyraEquipmentInstance + * + * A piece of equipment spawned and applied to a pawn + */ +UCLASS(BlueprintType, Blueprintable) +class ULyraEquipmentInstance : public UObject +{ + GENERATED_BODY() + +public: + ULyraEquipmentInstance(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + //~UObject interface + virtual bool IsSupportedForNetworking() const override { return true; } + virtual UWorld* GetWorld() const override final; + //~End of UObject interface + + UFUNCTION(BlueprintPure, Category=Equipment) + UObject* GetInstigator() const { return Instigator; } + + void SetInstigator(UObject* InInstigator) { Instigator = InInstigator; } + + UFUNCTION(BlueprintPure, Category=Equipment) + APawn* GetPawn() const; + + UFUNCTION(BlueprintPure, Category=Equipment, meta=(DeterminesOutputType=PawnType)) + APawn* GetTypedPawn(TSubclassOf PawnType) const; + + UFUNCTION(BlueprintPure, Category=Equipment) + TArray GetSpawnedActors() const { return SpawnedActors; } + + virtual void SpawnEquipmentActors(const TArray& ActorsToSpawn); + virtual void DestroyEquipmentActors(); + + virtual void OnEquipped(); + virtual void OnUnequipped(); + +protected: +#if UE_WITH_IRIS + /** Register all replication fragments */ + virtual void RegisterReplicationFragments(UE::Net::FFragmentRegistrationContext& Context, UE::Net::EFragmentRegistrationFlags RegistrationFlags) override; +#endif // UE_WITH_IRIS + + UFUNCTION(BlueprintImplementableEvent, Category=Equipment, meta=(DisplayName="OnEquipped")) + void K2_OnEquipped(); + + UFUNCTION(BlueprintImplementableEvent, Category=Equipment, meta=(DisplayName="OnUnequipped")) + void K2_OnUnequipped(); + +private: + UFUNCTION() + void OnRep_Instigator(); + +private: + UPROPERTY(ReplicatedUsing=OnRep_Instigator) + TObjectPtr Instigator; + + UPROPERTY(Replicated) + TArray> SpawnedActors; +}; diff --git a/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentManagerComponent.cpp b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentManagerComponent.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c9aa151e4fa13f7dd13e9ffe461117e14520a1ae --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentManagerComponent.cpp @@ -0,0 +1,272 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraEquipmentManagerComponent.h" + +#include "AbilitySystem/LyraAbilitySystemComponent.h" +#include "AbilitySystemGlobals.h" +#include "Engine/ActorChannel.h" +#include "LyraEquipmentDefinition.h" +#include "LyraEquipmentInstance.h" +#include "Net/UnrealNetwork.h" + +#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraEquipmentManagerComponent) + +class FLifetimeProperty; +struct FReplicationFlags; + +////////////////////////////////////////////////////////////////////// +// FLyraAppliedEquipmentEntry + +FString FLyraAppliedEquipmentEntry::GetDebugString() const +{ + return FString::Printf(TEXT("%s of %s"), *GetNameSafe(Instance), *GetNameSafe(EquipmentDefinition.Get())); +} + +////////////////////////////////////////////////////////////////////// +// FLyraEquipmentList + +void FLyraEquipmentList::PreReplicatedRemove(const TArrayView RemovedIndices, int32 FinalSize) +{ + for (int32 Index : RemovedIndices) + { + const FLyraAppliedEquipmentEntry& Entry = Entries[Index]; + if (Entry.Instance != nullptr) + { + Entry.Instance->OnUnequipped(); + } + } +} + +void FLyraEquipmentList::PostReplicatedAdd(const TArrayView AddedIndices, int32 FinalSize) +{ + for (int32 Index : AddedIndices) + { + const FLyraAppliedEquipmentEntry& Entry = Entries[Index]; + if (Entry.Instance != nullptr) + { + Entry.Instance->OnEquipped(); + } + } +} + +void FLyraEquipmentList::PostReplicatedChange(const TArrayView ChangedIndices, int32 FinalSize) +{ +// for (int32 Index : ChangedIndices) +// { +// const FGameplayTagStack& Stack = Stacks[Index]; +// TagToCountMap[Stack.Tag] = Stack.StackCount; +// } +} + +ULyraAbilitySystemComponent* FLyraEquipmentList::GetAbilitySystemComponent() const +{ + check(OwnerComponent); + AActor* OwningActor = OwnerComponent->GetOwner(); + return Cast(UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(OwningActor)); +} + +ULyraEquipmentInstance* FLyraEquipmentList::AddEntry(TSubclassOf EquipmentDefinition) +{ + ULyraEquipmentInstance* Result = nullptr; + + check(EquipmentDefinition != nullptr); + check(OwnerComponent); + check(OwnerComponent->GetOwner()->HasAuthority()); + + const ULyraEquipmentDefinition* EquipmentCDO = GetDefault(EquipmentDefinition); + + TSubclassOf InstanceType = EquipmentCDO->InstanceType; + if (InstanceType == nullptr) + { + InstanceType = ULyraEquipmentInstance::StaticClass(); + } + + FLyraAppliedEquipmentEntry& NewEntry = Entries.AddDefaulted_GetRef(); + NewEntry.EquipmentDefinition = EquipmentDefinition; + NewEntry.Instance = NewObject(OwnerComponent->GetOwner(), InstanceType); //@TODO: Using the actor instead of component as the outer due to UE-127172 + Result = NewEntry.Instance; + + if (ULyraAbilitySystemComponent* ASC = GetAbilitySystemComponent()) + { + for (const TObjectPtr& AbilitySet : EquipmentCDO->AbilitySetsToGrant) + { + AbilitySet->GiveToAbilitySystem(ASC, /*inout*/ &NewEntry.GrantedHandles, Result); + } + } + else + { + //@TODO: Warning logging? + } + + Result->SpawnEquipmentActors(EquipmentCDO->ActorsToSpawn); + + + MarkItemDirty(NewEntry); + + return Result; +} + +void FLyraEquipmentList::RemoveEntry(ULyraEquipmentInstance* Instance) +{ + for (auto EntryIt = Entries.CreateIterator(); EntryIt; ++EntryIt) + { + FLyraAppliedEquipmentEntry& Entry = *EntryIt; + if (Entry.Instance == Instance) + { + if (ULyraAbilitySystemComponent* ASC = GetAbilitySystemComponent()) + { + Entry.GrantedHandles.TakeFromAbilitySystem(ASC); + } + + Instance->DestroyEquipmentActors(); + + + EntryIt.RemoveCurrent(); + MarkArrayDirty(); + } + } +} + +////////////////////////////////////////////////////////////////////// +// ULyraEquipmentManagerComponent + +ULyraEquipmentManagerComponent::ULyraEquipmentManagerComponent(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) + , EquipmentList(this) +{ + SetIsReplicatedByDefault(true); + bWantsInitializeComponent = true; +} + +void ULyraEquipmentManagerComponent::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const +{ + Super::GetLifetimeReplicatedProps(OutLifetimeProps); + + DOREPLIFETIME(ThisClass, EquipmentList); +} + +ULyraEquipmentInstance* ULyraEquipmentManagerComponent::EquipItem(TSubclassOf EquipmentClass) +{ + ULyraEquipmentInstance* Result = nullptr; + if (EquipmentClass != nullptr) + { + Result = EquipmentList.AddEntry(EquipmentClass); + if (Result != nullptr) + { + Result->OnEquipped(); + + if (IsUsingRegisteredSubObjectList() && IsReadyForReplication()) + { + AddReplicatedSubObject(Result); + } + } + } + return Result; +} + +void ULyraEquipmentManagerComponent::UnequipItem(ULyraEquipmentInstance* ItemInstance) +{ + if (ItemInstance != nullptr) + { + if (IsUsingRegisteredSubObjectList()) + { + RemoveReplicatedSubObject(ItemInstance); + } + + ItemInstance->OnUnequipped(); + EquipmentList.RemoveEntry(ItemInstance); + } +} + +bool ULyraEquipmentManagerComponent::ReplicateSubobjects(UActorChannel* Channel, class FOutBunch* Bunch, FReplicationFlags* RepFlags) +{ + bool WroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags); + + for (FLyraAppliedEquipmentEntry& Entry : EquipmentList.Entries) + { + ULyraEquipmentInstance* Instance = Entry.Instance; + + if (IsValid(Instance)) + { + WroteSomething |= Channel->ReplicateSubobject(Instance, *Bunch, *RepFlags); + } + } + + return WroteSomething; +} + +void ULyraEquipmentManagerComponent::InitializeComponent() +{ + Super::InitializeComponent(); +} + +void ULyraEquipmentManagerComponent::UninitializeComponent() +{ + TArray AllEquipmentInstances; + + // gathering all instances before removal to avoid side effects affecting the equipment list iterator + for (const FLyraAppliedEquipmentEntry& Entry : EquipmentList.Entries) + { + AllEquipmentInstances.Add(Entry.Instance); + } + + for (ULyraEquipmentInstance* EquipInstance : AllEquipmentInstances) + { + UnequipItem(EquipInstance); + } + + Super::UninitializeComponent(); +} + +void ULyraEquipmentManagerComponent::ReadyForReplication() +{ + Super::ReadyForReplication(); + + // Register existing LyraEquipmentInstances + if (IsUsingRegisteredSubObjectList()) + { + for (const FLyraAppliedEquipmentEntry& Entry : EquipmentList.Entries) + { + ULyraEquipmentInstance* Instance = Entry.Instance; + + if (IsValid(Instance)) + { + AddReplicatedSubObject(Instance); + } + } + } +} + +ULyraEquipmentInstance* ULyraEquipmentManagerComponent::GetFirstInstanceOfType(TSubclassOf InstanceType) +{ + for (FLyraAppliedEquipmentEntry& Entry : EquipmentList.Entries) + { + if (ULyraEquipmentInstance* Instance = Entry.Instance) + { + if (Instance->IsA(InstanceType)) + { + return Instance; + } + } + } + + return nullptr; +} + +TArray ULyraEquipmentManagerComponent::GetEquipmentInstancesOfType(TSubclassOf InstanceType) const +{ + TArray Results; + for (const FLyraAppliedEquipmentEntry& Entry : EquipmentList.Entries) + { + if (ULyraEquipmentInstance* Instance = Entry.Instance) + { + if (Instance->IsA(InstanceType)) + { + Results.Add(Instance); + } + } + } + return Results; +} + + diff --git a/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentManagerComponent.h b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentManagerComponent.h new file mode 100644 index 0000000000000000000000000000000000000000..45dd3828ecffcc72fbbd2fa8341d69e27b29d2f9 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/Equipment/LyraEquipmentManagerComponent.h @@ -0,0 +1,158 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "AbilitySystem/LyraAbilitySet.h" +#include "Components/PawnComponent.h" +#include "Net/Serialization/FastArraySerializer.h" + +#include "LyraEquipmentManagerComponent.generated.h" + +#define UE_API LYRAGAME_API + +class UActorComponent; +class ULyraAbilitySystemComponent; +class ULyraEquipmentDefinition; +class ULyraEquipmentInstance; +class ULyraEquipmentManagerComponent; +class UObject; +struct FFrame; +struct FLyraEquipmentList; +struct FNetDeltaSerializeInfo; +struct FReplicationFlags; + +/** A single piece of applied equipment */ +USTRUCT(BlueprintType) +struct FLyraAppliedEquipmentEntry : public FFastArraySerializerItem +{ + GENERATED_BODY() + + FLyraAppliedEquipmentEntry() + {} + + FString GetDebugString() const; + +private: + friend FLyraEquipmentList; + friend ULyraEquipmentManagerComponent; + + // The equipment class that got equipped + UPROPERTY() + TSubclassOf EquipmentDefinition; + + UPROPERTY() + TObjectPtr Instance = nullptr; + + // Authority-only list of granted handles + UPROPERTY(NotReplicated) + FLyraAbilitySet_GrantedHandles GrantedHandles; +}; + +/** List of applied equipment */ +USTRUCT(BlueprintType) +struct FLyraEquipmentList : public FFastArraySerializer +{ + GENERATED_BODY() + + FLyraEquipmentList() + : OwnerComponent(nullptr) + { + } + + FLyraEquipmentList(UActorComponent* InOwnerComponent) + : OwnerComponent(InOwnerComponent) + { + } + +public: + //~FFastArraySerializer contract + void PreReplicatedRemove(const TArrayView RemovedIndices, int32 FinalSize); + void PostReplicatedAdd(const TArrayView AddedIndices, int32 FinalSize); + void PostReplicatedChange(const TArrayView ChangedIndices, int32 FinalSize); + //~End of FFastArraySerializer contract + + bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms) + { + return FFastArraySerializer::FastArrayDeltaSerialize(Entries, DeltaParms, *this); + } + + ULyraEquipmentInstance* AddEntry(TSubclassOf EquipmentDefinition); + void RemoveEntry(ULyraEquipmentInstance* Instance); + +private: + ULyraAbilitySystemComponent* GetAbilitySystemComponent() const; + + friend ULyraEquipmentManagerComponent; + +private: + // Replicated list of equipment entries + UPROPERTY() + TArray Entries; + + UPROPERTY(NotReplicated) + TObjectPtr OwnerComponent; +}; + +template<> +struct TStructOpsTypeTraits : public TStructOpsTypeTraitsBase2 +{ + enum { WithNetDeltaSerializer = true }; +}; + + + + + + + + + + +/** + * Manages equipment applied to a pawn + */ +UCLASS(MinimalAPI, BlueprintType, Const) +class ULyraEquipmentManagerComponent : public UPawnComponent +{ + GENERATED_BODY() + +public: + UE_API ULyraEquipmentManagerComponent(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly) + UE_API ULyraEquipmentInstance* EquipItem(TSubclassOf EquipmentDefinition); + + UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly) + UE_API void UnequipItem(ULyraEquipmentInstance* ItemInstance); + + //~UObject interface + UE_API virtual bool ReplicateSubobjects(class UActorChannel* Channel, class FOutBunch* Bunch, FReplicationFlags* RepFlags) override; + //~End of UObject interface + + //~UActorComponent interface + //virtual void EndPlay() override; + UE_API virtual void InitializeComponent() override; + UE_API virtual void UninitializeComponent() override; + UE_API virtual void ReadyForReplication() override; + //~End of UActorComponent interface + + /** Returns the first equipped instance of a given type, or nullptr if none are found */ + UFUNCTION(BlueprintCallable, BlueprintPure) + UE_API ULyraEquipmentInstance* GetFirstInstanceOfType(TSubclassOf InstanceType); + + /** Returns all equipped instances of a given type, or an empty array if none are found */ + UFUNCTION(BlueprintCallable, BlueprintPure) + UE_API TArray GetEquipmentInstancesOfType(TSubclassOf InstanceType) const; + + template + T* GetFirstInstanceOfType() + { + return (T*)GetFirstInstanceOfType(T::StaticClass()); + } + +private: + UPROPERTY(Replicated) + FLyraEquipmentList EquipmentList; +}; + +#undef UE_API diff --git a/LyraStarterGame/Source/LyraGame/LyraLogChannels.cpp b/LyraStarterGame/Source/LyraGame/LyraLogChannels.cpp new file mode 100644 index 0000000000000000000000000000000000000000..14051026447ca48026a9c59372595df124d643fd --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/LyraLogChannels.cpp @@ -0,0 +1,40 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "LyraLogChannels.h" +#include "GameFramework/Actor.h" + +DEFINE_LOG_CATEGORY(LogLyra); +DEFINE_LOG_CATEGORY(LogLyraExperience); +DEFINE_LOG_CATEGORY(LogLyraAbilitySystem); +DEFINE_LOG_CATEGORY(LogLyraTeams); + +FString GetClientServerContextString(UObject* ContextObject) +{ + ENetRole Role = ROLE_None; + + if (AActor* Actor = Cast(ContextObject)) + { + Role = Actor->GetLocalRole(); + } + else if (UActorComponent* Component = Cast(ContextObject)) + { + Role = Component->GetOwnerRole(); + } + + if (Role != ROLE_None) + { + return (Role == ROLE_Authority) ? TEXT("Server") : TEXT("Client"); + } + else + { +#if WITH_EDITOR + if (GIsEditor) + { + extern ENGINE_API FString GPlayInEditorContextString; + return GPlayInEditorContextString; + } +#endif + } + + return TEXT("[]"); +} diff --git a/LyraStarterGame/Source/LyraGame/LyraLogChannels.h b/LyraStarterGame/Source/LyraGame/LyraLogChannels.h new file mode 100644 index 0000000000000000000000000000000000000000..ee46fcd8068a90c7faf5563edf3520c061558075 --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/LyraLogChannels.h @@ -0,0 +1,14 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Logging/LogMacros.h" + +class UObject; + +LYRAGAME_API DECLARE_LOG_CATEGORY_EXTERN(LogLyra, Log, All); +LYRAGAME_API DECLARE_LOG_CATEGORY_EXTERN(LogLyraExperience, Log, All); +LYRAGAME_API DECLARE_LOG_CATEGORY_EXTERN(LogLyraAbilitySystem, Log, All); +LYRAGAME_API DECLARE_LOG_CATEGORY_EXTERN(LogLyraTeams, Log, All); + +LYRAGAME_API FString GetClientServerContextString(UObject* ContextObject = nullptr); diff --git a/LyraStarterGame/Source/LyraGame/README.md b/LyraStarterGame/Source/LyraGame/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ad08b43bd6582e879e3cf7f06208c7d716929c5c --- /dev/null +++ b/LyraStarterGame/Source/LyraGame/README.md @@ -0,0 +1,3 @@ +# Lyra + +The Lyra project is to provide a bootstrapping game for Unreal Engine. Lyra is intended to be a living sample that shows how we build scalable games around the engines core technology. \ No newline at end of file diff --git a/StackOBot/Content/StackOBot/AI/BPI_Baddy.uasset b/StackOBot/Content/StackOBot/AI/BPI_Baddy.uasset new file mode 100644 index 0000000000000000000000000000000000000000..7ae03873333c06c83b9cacfadb0bbdd40dfc57f7 Binary files /dev/null and b/StackOBot/Content/StackOBot/AI/BPI_Baddy.uasset differ diff --git a/StackOBot/Content/StackOBot/AI/BP_AIController.uasset b/StackOBot/Content/StackOBot/AI/BP_AIController.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ba85610d73e81c7ad129a193c05d4563389f48da Binary files /dev/null and b/StackOBot/Content/StackOBot/AI/BP_AIController.uasset differ diff --git a/StackOBot/Content/StackOBot/AI/EQS_RandomNearbyPoint.uasset b/StackOBot/Content/StackOBot/AI/EQS_RandomNearbyPoint.uasset new file mode 100644 index 0000000000000000000000000000000000000000..5377d974782fc52c28c84dcdc844f65739c578fd Binary files /dev/null and b/StackOBot/Content/StackOBot/AI/EQS_RandomNearbyPoint.uasset differ diff --git a/StackOBot/Content/StackOBot/Audio/MS_Coin.uasset b/StackOBot/Content/StackOBot/Audio/MS_Coin.uasset new file mode 100644 index 0000000000000000000000000000000000000000..a85ef22c6e2284fa0b8b302c74d5391895f6fe71 Binary files /dev/null and b/StackOBot/Content/StackOBot/Audio/MS_Coin.uasset differ diff --git a/StackOBot/Content/StackOBot/Audio/MS_DevCom.uasset b/StackOBot/Content/StackOBot/Audio/MS_DevCom.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2587cbebca18a6412f22b1c6c70ff0e5c2ed5329 Binary files /dev/null and b/StackOBot/Content/StackOBot/Audio/MS_DevCom.uasset differ diff --git a/StackOBot/Content/StackOBot/Audio/MS_character_footsteps.uasset b/StackOBot/Content/StackOBot/Audio/MS_character_footsteps.uasset new file mode 100644 index 0000000000000000000000000000000000000000..73a78614078041acdd3819ad5da4b0863bb7ef29 Binary files /dev/null and b/StackOBot/Content/StackOBot/Audio/MS_character_footsteps.uasset differ diff --git a/StackOBot/Content/StackOBot/Audio/MS_crateimpact.uasset b/StackOBot/Content/StackOBot/Audio/MS_crateimpact.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8e95065d1c977d3a6cdeeb5ddfebb2a4a5292940 Binary files /dev/null and b/StackOBot/Content/StackOBot/Audio/MS_crateimpact.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Blobling/PA_Baddy.uasset b/StackOBot/Content/StackOBot/Characters/Blobling/PA_Baddy.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c431ecd1b8aeab926ea12a925e3c52d1e72df0f8 Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Blobling/PA_Baddy.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Blobling/SK_Baddy.uasset b/StackOBot/Content/StackOBot/Characters/Blobling/SK_Baddy.uasset new file mode 100644 index 0000000000000000000000000000000000000000..186b93e6ed6a1e011a8c179cef15b15483f37dc0 Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Blobling/SK_Baddy.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Hover_End.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Hover_End.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c159481ca93ede87cee313d71539391b51a8d744 Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Hover_End.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Hover_Start.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Hover_Start.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e2a11460af95ba0ac80fa9b33fe905edd7bcd4a8 Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Hover_Start.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Run.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Run.uasset new file mode 100644 index 0000000000000000000000000000000000000000..5bc45a101d37f363f377c362d87474864c7fc294 Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Run.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Run_LeanLeft.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Run_LeanLeft.uasset new file mode 100644 index 0000000000000000000000000000000000000000..a63b1a95f16d44cd40d3207cf83f9676c6d102fe Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Run_LeanLeft.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Run_LeanRight.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Run_LeanRight.uasset new file mode 100644 index 0000000000000000000000000000000000000000..f72cd1616653264367dcf2f1f8eed7e04d767b42 Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Animations/A_Bot_Run_LeanRight.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Animations/BS_Bot_RunIdleJump.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Animations/BS_Bot_RunIdleJump.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c1dd0b5138d043bd98e31cbd05dd2e9939298b4a Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Animations/BS_Bot_RunIdleJump.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Animations/BS_Bot_WalkRunLean.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Animations/BS_Bot_WalkRunLean.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0b325cbc1caa207871f24231f6c42837693e8ebd Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Animations/BS_Bot_WalkRunLean.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Materials/MD_DropShadow.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Materials/MD_DropShadow.uasset new file mode 100644 index 0000000000000000000000000000000000000000..cc257d903e1ba06feb9fda2cb74849947bd1a6c6 Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Materials/MD_DropShadow.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Materials/MI_BotFace.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Materials/MI_BotFace.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b3958f8c6e477475f274e03e42b09ff70c6f19a8 Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Materials/MI_BotFace.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Materials/M_BotBase.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Materials/M_BotBase.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9d1c859134fe5bfb8b634cd0f1faa55ba58a7d62 Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Materials/M_BotBase.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Materials/M_BotFace.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Materials/M_BotFace.uasset new file mode 100644 index 0000000000000000000000000000000000000000..f03f07deaf029df2c4cd9e4934b1dfb8eedeb074 Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Materials/M_BotFace.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Materials/M_Hologram.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Materials/M_Hologram.uasset new file mode 100644 index 0000000000000000000000000000000000000000..6e4917d511e083239b5d790ddfdfcb894f46eb4e Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Materials/M_Hologram.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Mesh/SK_Bot.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Mesh/SK_Bot.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c7021ed7d30b41d249b79b40cd2810872575903d Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Mesh/SK_Bot.uasset differ diff --git a/StackOBot/Content/StackOBot/Characters/Bot/Rig/PhA_Bot.uasset b/StackOBot/Content/StackOBot/Characters/Bot/Rig/PhA_Bot.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1d55caf1c1b09544242a15e45d243c7d4045d48b Binary files /dev/null and b/StackOBot/Content/StackOBot/Characters/Bot/Rig/PhA_Bot.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Background/Materials/MF_CloudWPO.uasset b/StackOBot/Content/StackOBot/Environment/Background/Materials/MF_CloudWPO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..3e6b3cef1de9797899dc7be14706c0b4db3135bd Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Background/Materials/MF_CloudWPO.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Materials/MF_RotateAwayPoint.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/MF_RotateAwayPoint.uasset new file mode 100644 index 0000000000000000000000000000000000000000..701209285164ed49a3d52357382e5ecd48ec451c Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/MF_RotateAwayPoint.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Materials/MF_TreeWind.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/MF_TreeWind.uasset new file mode 100644 index 0000000000000000000000000000000000000000..39ffd3335a120d844e94955bd8d86b6942902360 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/MF_TreeWind.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberFern.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberFern.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d6e0ee44dcf77c3c3c444ed9fdc144429a6bb032 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberFern.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberFrond.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberFrond.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2061f1d9b54bd4d985503a0796a40f2d1734c7f8 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberFrond.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberFrond_NoWPO.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberFrond_NoWPO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..bebafa588d7b579f73f18d91e751e14824a3c3a4 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberFrond_NoWPO.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberTrunk.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberTrunk.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e63b12d5b8f8aeceb4314e49e75ad12800745a82 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberTrunk.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberTrunk_NoWPO.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberTrunk_NoWPO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..cb161f7d489e40811d084757a9780c1fc0762955 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_CyberTrunk_NoWPO.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_Grass.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_Grass.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1ce3c34e5d9527094479b9bdcc709db3ec4119d2 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_Grass.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_TreeBase.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_TreeBase.uasset new file mode 100644 index 0000000000000000000000000000000000000000..cf45d0f2f6a0b39a6c05b912a8b0e03c957db7dc Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_TreeBase.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_TreeBaseNOWPO.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_TreeBaseNOWPO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..6145e86d1a3566ab16ab4f8289445118c732a740 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Materials/M_TreeBaseNOWPO.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Meshes/SM_GrassClump.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Meshes/SM_GrassClump.uasset new file mode 100644 index 0000000000000000000000000000000000000000..24af66e6b70354ae14a1a7084ae7a3a0e66d5fa7 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Meshes/SM_GrassClump.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Meshes/SM_GrassClump_01.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Meshes/SM_GrassClump_01.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1e365e9afc7bf7c7a44fb8c6b01234d6563fa9e3 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Meshes/SM_GrassClump_01.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Meshes/SM_GrassClump_02.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Meshes/SM_GrassClump_02.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d5719de80d83faee057979f082bca296d751cca4 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Meshes/SM_GrassClump_02.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Foilage/Textures/T_Grass.uasset b/StackOBot/Content/StackOBot/Environment/Foilage/Textures/T_Grass.uasset new file mode 100644 index 0000000000000000000000000000000000000000..17cacbf1998f40dff3258963f985626bfb4ac2c9 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Foilage/Textures/T_Grass.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/Clouds/m_SimpleVolumetricCloud_Inst.uasset b/StackOBot/Content/StackOBot/Environment/Materials/Clouds/m_SimpleVolumetricCloud_Inst.uasset new file mode 100644 index 0000000000000000000000000000000000000000..05f6d7b31a360f00ae91af7b3db86e51f6939c95 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/Clouds/m_SimpleVolumetricCloud_Inst.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/Decals/MD_Rock.uasset b/StackOBot/Content/StackOBot/Environment/Materials/Decals/MD_Rock.uasset new file mode 100644 index 0000000000000000000000000000000000000000..55dde3ad0010093c09db05c81ffe370066dcf696 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/Decals/MD_Rock.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_AngleTint.uasset b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_AngleTint.uasset new file mode 100644 index 0000000000000000000000000000000000000000..7a03d9142658b0241589d16b533bd4aaaee7e5e7 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_AngleTint.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_DetailNormal.uasset b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_DetailNormal.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d22a3c0da6125e88d934a40544f900c7782e54bd Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_DetailNormal.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_EdgeWear.uasset b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_EdgeWear.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b05f5a7d85fd2ecb1cec1b829cac641c5822d4f9 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_EdgeWear.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_Grunge.uasset b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_Grunge.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c625fae38aba02a8c74e01b257decdffad872527 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_Grunge.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_NoiseMask.uasset b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_NoiseMask.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d1733971fb87a1e53dba8c4800d4d7d18b0d7612 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_NoiseMask.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_Rainwear.uasset b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_Rainwear.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e4a5b8d147e0748d66e2eac887764c69294d64b4 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_Rainwear.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_SmartMat.uasset b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_SmartMat.uasset new file mode 100644 index 0000000000000000000000000000000000000000..a34a3f51b19c8343a266ef050d273d74a0af8216 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/MFunc/MF_SmartMat.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/MeshSpline/MI_Smart_Metal_Spline.uasset b/StackOBot/Content/StackOBot/Environment/Materials/MeshSpline/MI_Smart_Metal_Spline.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d16b72ccc7956b7926f0d8d8f7a70af4a802b395 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/MeshSpline/MI_Smart_Metal_Spline.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/MeshSpline/MI_Smart_Paint_Spline.uasset b/StackOBot/Content/StackOBot/Environment/Materials/MeshSpline/MI_Smart_Paint_Spline.uasset new file mode 100644 index 0000000000000000000000000000000000000000..3a5a0e2a2019d45359cdb87321ca59408fff659e Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/MeshSpline/MI_Smart_Paint_Spline.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/MeshSpline/M_SmartMat_Spline.uasset b/StackOBot/Content/StackOBot/Environment/Materials/MeshSpline/M_SmartMat_Spline.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b0ad4a68973d28ac90a67ec745e069302578a037 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/MeshSpline/M_SmartMat_Spline.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/Textures/BaseFlattenNormalMap_VT.uasset b/StackOBot/Content/StackOBot/Environment/Materials/Textures/BaseFlattenNormalMap_VT.uasset new file mode 100644 index 0000000000000000000000000000000000000000..7d4de4915bd2b3bc7f5b7309ae23dbc365cfe31d Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/Textures/BaseFlattenNormalMap_VT.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/Textures/DefaultTexture_VT.uasset b/StackOBot/Content/StackOBot/Environment/Materials/Textures/DefaultTexture_VT.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4bf70265309848d7b0602ce56afd4db526507e48 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/Textures/DefaultTexture_VT.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_FDepth_H.uasset b/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_FDepth_H.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b9fe03bcb98f85106b7830a36f218c6955ca9e0e Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_FDepth_H.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_Grey_RGB.uasset b/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_Grey_RGB.uasset new file mode 100644 index 0000000000000000000000000000000000000000..31d5514bb785efaa0456c3a16f854d8bb693ec73 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_Grey_RGB.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_Grey_SRGB.uasset b/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_Grey_SRGB.uasset new file mode 100644 index 0000000000000000000000000000000000000000..7e28891ba572f910723a0e92ed70fe6515010aea Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_Grey_SRGB.uasset differ diff --git a/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_Lamppost_Mask.uasset b/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_Lamppost_Mask.uasset new file mode 100644 index 0000000000000000000000000000000000000000..6cede3b429b75fa863c66695362933e44ea27de9 Binary files /dev/null and b/StackOBot/Content/StackOBot/Environment/Materials/Textures/T_Lamppost_Mask.uasset differ diff --git a/StackOBot/Content/StackOBot/Input/IA_CameraToggle.uasset b/StackOBot/Content/StackOBot/Input/IA_CameraToggle.uasset new file mode 100644 index 0000000000000000000000000000000000000000..7a5491659e6320368b0775bcb0afb6a1b4188379 Binary files /dev/null and b/StackOBot/Content/StackOBot/Input/IA_CameraToggle.uasset differ diff --git a/StackOBot/Content/StackOBot/Input/IA_DroneSwitch.uasset b/StackOBot/Content/StackOBot/Input/IA_DroneSwitch.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2bb3b54104339c9ccac7e7639c9ff02ad68ba49d Binary files /dev/null and b/StackOBot/Content/StackOBot/Input/IA_DroneSwitch.uasset differ diff --git a/StackOBot/Content/StackOBot/Input/IA_Grab.uasset b/StackOBot/Content/StackOBot/Input/IA_Grab.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ad33797f65502284b53029610f5a9620c16465f2 Binary files /dev/null and b/StackOBot/Content/StackOBot/Input/IA_Grab.uasset differ diff --git a/StackOBot/Content/StackOBot/Input/IA_Interact.uasset b/StackOBot/Content/StackOBot/Input/IA_Interact.uasset new file mode 100644 index 0000000000000000000000000000000000000000..3396b877e54794015f78788624a24344767c0ca0 Binary files /dev/null and b/StackOBot/Content/StackOBot/Input/IA_Interact.uasset differ diff --git a/StackOBot/Content/StackOBot/Input/IA_Jump.uasset b/StackOBot/Content/StackOBot/Input/IA_Jump.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e6445d98d87a01bd7676088c0fd6c745a6660d91 Binary files /dev/null and b/StackOBot/Content/StackOBot/Input/IA_Jump.uasset differ diff --git a/StackOBot/Content/StackOBot/Input/IA_Look.uasset b/StackOBot/Content/StackOBot/Input/IA_Look.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4552b0e842039802599d3ffd55a3b436d24637ee Binary files /dev/null and b/StackOBot/Content/StackOBot/Input/IA_Look.uasset differ diff --git a/StackOBot/Content/StackOBot/Input/IA_Move.uasset b/StackOBot/Content/StackOBot/Input/IA_Move.uasset new file mode 100644 index 0000000000000000000000000000000000000000..85f85615448c1ab7443152e84cd59acced4bc340 Binary files /dev/null and b/StackOBot/Content/StackOBot/Input/IA_Move.uasset differ diff --git a/StackOBot/Content/StackOBot/Input/IA_MoveSideScrolling.uasset b/StackOBot/Content/StackOBot/Input/IA_MoveSideScrolling.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4b96955ae0568d238cfcb6ae06eece7082e509c8 Binary files /dev/null and b/StackOBot/Content/StackOBot/Input/IA_MoveSideScrolling.uasset differ diff --git a/StackOBot/Content/StackOBot/Input/IA_Pause.uasset b/StackOBot/Content/StackOBot/Input/IA_Pause.uasset new file mode 100644 index 0000000000000000000000000000000000000000..05ef3168205ddd57915552d4f745b392a6a3b537 Binary files /dev/null and b/StackOBot/Content/StackOBot/Input/IA_Pause.uasset differ diff --git a/StackOBot/Content/StackOBot/Input/IMC_SideScrollingControls.uasset b/StackOBot/Content/StackOBot/Input/IMC_SideScrollingControls.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e630970c346e92eb4f14d9423587098e702b7dea Binary files /dev/null and b/StackOBot/Content/StackOBot/Input/IMC_SideScrollingControls.uasset differ diff --git a/StackOBot/Content/StackOBot/Input/IMC_ThirdPersonControls.uasset b/StackOBot/Content/StackOBot/Input/IMC_ThirdPersonControls.uasset new file mode 100644 index 0000000000000000000000000000000000000000..37bb99c51dddfdb03e27d59ab04aa6ee9a6e4eb4 Binary files /dev/null and b/StackOBot/Content/StackOBot/Input/IMC_ThirdPersonControls.uasset differ diff --git a/StackOBot/Content/StackOBot/Maps/LVL_MainMenu.umap b/StackOBot/Content/StackOBot/Maps/LVL_MainMenu.umap new file mode 100644 index 0000000000000000000000000000000000000000..8137dbe56522d57c75702c701eeb88432a7588b2 Binary files /dev/null and b/StackOBot/Content/StackOBot/Maps/LVL_MainMenu.umap differ diff --git a/StackOBot/Content/StackOBot/Maps/LVL_StackOBot.umap b/StackOBot/Content/StackOBot/Maps/LVL_StackOBot.umap new file mode 100644 index 0000000000000000000000000000000000000000..5ac4e9bfb377a3aeb0d91d67c7fb05d4603fce23 Binary files /dev/null and b/StackOBot/Content/StackOBot/Maps/LVL_StackOBot.umap differ diff --git a/StackOBot/Content/StackOBot/Maps/LVL_StackOBot_HLODLayer_Merged.uasset b/StackOBot/Content/StackOBot/Maps/LVL_StackOBot_HLODLayer_Merged.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e84a9189f3db99846e101c7207a0526ee4463d6e Binary files /dev/null and b/StackOBot/Content/StackOBot/Maps/LVL_StackOBot_HLODLayer_Merged.uasset differ diff --git a/StackOBot/Content/StackOBot/Maps/Lvl_Empty.umap b/StackOBot/Content/StackOBot/Maps/Lvl_Empty.umap new file mode 100644 index 0000000000000000000000000000000000000000..5b2479f09b3ef18437067422eb0b79fea56a89fd Binary files /dev/null and b/StackOBot/Content/StackOBot/Maps/Lvl_Empty.umap differ diff --git a/StackOBot/Content/StackOBot/UI/BPI_HUD.uasset b/StackOBot/Content/StackOBot/UI/BPI_HUD.uasset new file mode 100644 index 0000000000000000000000000000000000000000..564aab1aa9a2e3259efac44cfc51ef471099ee17 Binary files /dev/null and b/StackOBot/Content/StackOBot/UI/BPI_HUD.uasset differ diff --git a/StackOBot/Content/StackOBot/_Ignore/BP_GM_Sandbox.uasset b/StackOBot/Content/StackOBot/_Ignore/BP_GM_Sandbox.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d25b43af232c2ee63b0635108c071089bf551a3d Binary files /dev/null and b/StackOBot/Content/StackOBot/_Ignore/BP_GM_Sandbox.uasset differ diff --git a/StackOBot/Content/StackOBot/_Ignore/BugAnim.umap b/StackOBot/Content/StackOBot/_Ignore/BugAnim.umap new file mode 100644 index 0000000000000000000000000000000000000000..deb12e974526b0bc7a1d952cc268759ab3be1ca3 Binary files /dev/null and b/StackOBot/Content/StackOBot/_Ignore/BugAnim.umap differ diff --git a/StackOBot/Content/StackOBot/_Ignore/RainbowCapture.umap b/StackOBot/Content/StackOBot/_Ignore/RainbowCapture.umap new file mode 100644 index 0000000000000000000000000000000000000000..0f8c3e12f2d56e9bc8e414acba724ed6c3e71166 Binary files /dev/null and b/StackOBot/Content/StackOBot/_Ignore/RainbowCapture.umap differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Large_01/3/8C/93F3RP5NRCJDOPLZV8MJLO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Large_01/3/8C/93F3RP5NRCJDOPLZV8MJLO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..7897c60a0b61a3f82658c63e18207eda645cd599 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Large_01/3/8C/93F3RP5NRCJDOPLZV8MJLO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Large_01/3/MV/HDVDBH1F0BZV9TSI83R8SR.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Large_01/3/MV/HDVDBH1F0BZV9TSI83R8SR.uasset new file mode 100644 index 0000000000000000000000000000000000000000..a564d35b5a0286ae395c0008c7bda1e5d5568851 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Large_01/3/MV/HDVDBH1F0BZV9TSI83R8SR.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Large_01/8/LA/J8LJIA3SERZB2ACVPZZXFG.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Large_01/8/LA/J8LJIA3SERZB2ACVPZZXFG.uasset new file mode 100644 index 0000000000000000000000000000000000000000..432e4546deb5466dcee9f2be3d6bf77c32d9cc13 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Large_01/8/LA/J8LJIA3SERZB2ACVPZZXFG.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_01/7/L6/AYNAED49JXLZ7YYM7LQD2S.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_01/7/L6/AYNAED49JXLZ7YYM7LQD2S.uasset new file mode 100644 index 0000000000000000000000000000000000000000..756eee9b79a9c16995c4ac74956962b3dd2c4291 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_01/7/L6/AYNAED49JXLZ7YYM7LQD2S.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_01/9/A4/I52LZXEO3EZ99T47JR36I8.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_01/9/A4/I52LZXEO3EZ99T47JR36I8.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d1195344f9beb9641123c849b42814bd3c30b574 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_01/9/A4/I52LZXEO3EZ99T47JR36I8.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_01/A/LD/A8Y5D5ZMD9U74VIHROKMWQ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_01/A/LD/A8Y5D5ZMD9U74VIHROKMWQ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1561f2a6565e609cfe230f9baeb1cf9eeece8318 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_01/A/LD/A8Y5D5ZMD9U74VIHROKMWQ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_02/2/NZ/A6A0QB6O9ITMSPVQMJANCZ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_02/2/NZ/A6A0QB6O9ITMSPVQMJANCZ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..25f7d4d189c981a03e1158b4ddda04d0616b6284 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_02/2/NZ/A6A0QB6O9ITMSPVQMJANCZ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_02/3/52/UC5V83BOZUNV3UA9UBXOBN.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_02/3/52/UC5V83BOZUNV3UA9UBXOBN.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2c796176fcf1a24f5b0587443226d10f536d7a71 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_02/3/52/UC5V83BOZUNV3UA9UBXOBN.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_02/A/BL/ASFY220N5B5JWT2YDA61RN.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_02/A/BL/ASFY220N5B5JWT2YDA61RN.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9a11aa78071fabd37ccd7eea637ca208db2789ec Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Medium_02/A/BL/ASFY220N5B5JWT2YDA61RN.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/0/LL/WH89G0XB5LPUFLRDDPF6CS.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/0/LL/WH89G0XB5LPUFLRDDPF6CS.uasset new file mode 100644 index 0000000000000000000000000000000000000000..431034ecfdda9607a9839403a05722ac9c759f0a Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/0/LL/WH89G0XB5LPUFLRDDPF6CS.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/1/G5/MEW177IBFC39L9N7E5AG9I.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/1/G5/MEW177IBFC39L9N7E5AG9I.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1ec22a11f602e57d9947fdb9bd613f8e995af075 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/1/G5/MEW177IBFC39L9N7E5AG9I.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/5/DY/8BK8YOTB4YIMUADAAZVTUW.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/5/DY/8BK8YOTB4YIMUADAAZVTUW.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1bc7e2e9c01af3e718b7051c82dda07aa4d763b2 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/5/DY/8BK8YOTB4YIMUADAAZVTUW.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/5/VN/ELHDMPM79FRA08YAZC444C.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/5/VN/ELHDMPM79FRA08YAZC444C.uasset new file mode 100644 index 0000000000000000000000000000000000000000..de1f360e028f3ef10b7e77a7a32b63e72f383974 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/5/VN/ELHDMPM79FRA08YAZC444C.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/9/7P/GR1W2372J7NBK06IWUVPEL.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/9/7P/GR1W2372J7NBK06IWUVPEL.uasset new file mode 100644 index 0000000000000000000000000000000000000000..42b43a0fa809fff7799e27ff44b2d6ec3213b6ee Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/9/7P/GR1W2372J7NBK06IWUVPEL.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/B/6B/YCO6VL8WZQQPSIOPTPE9EE.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/B/6B/YCO6VL8WZQQPSIOPTPE9EE.uasset new file mode 100644 index 0000000000000000000000000000000000000000..dec988caca6173779dbb43ea6c11033a09aebd94 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/B/6B/YCO6VL8WZQQPSIOPTPE9EE.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/C/GC/00DMZTDOYUJ8NLJOQR8MBP.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/C/GC/00DMZTDOYUJ8NLJOQR8MBP.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b55ef110373f5463ae85daffab2e8f7abc9bca30 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/C/GC/00DMZTDOYUJ8NLJOQR8MBP.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/D/A0/BFGOTAF28IBYS81L7RU8CW.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/D/A0/BFGOTAF28IBYS81L7RU8CW.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d48ddd70e9066889f94fe6e3c0d9fc8502051e61 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/D/A0/BFGOTAF28IBYS81L7RU8CW.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/F/0S/WK2RU5F0YO00WI17GFGMPE.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/F/0S/WK2RU5F0YO00WI17GFGMPE.uasset new file mode 100644 index 0000000000000000000000000000000000000000..025171a5f49ae4e792eaf8465a662e5e009d3866 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Large_01/F/0S/WK2RU5F0YO00WI17GFGMPE.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/4/4Q/ZVNTBMKQ7PH3O57F8D40TI.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/4/4Q/ZVNTBMKQ7PH3O57F8D40TI.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2366660fa05aada3d85e90ab7c6a60ff6d073201 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/4/4Q/ZVNTBMKQ7PH3O57F8D40TI.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/4/DO/5E1W64AA6SU7Q9I6SDM6DO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/4/DO/5E1W64AA6SU7Q9I6SDM6DO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..3ad9d7c152aa8b27e3d498397ed3658bfcb21a38 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/4/DO/5E1W64AA6SU7Q9I6SDM6DO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/4/SA/H6OA7LQK143QP7KQRLIGR2.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/4/SA/H6OA7LQK143QP7KQRLIGR2.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ae10149984ff519e77b1b7814a5d7e11e878e1c5 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/4/SA/H6OA7LQK143QP7KQRLIGR2.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/5/BR/8L50KKVDJWBL92X0H2NIC2.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/5/BR/8L50KKVDJWBL92X0H2NIC2.uasset new file mode 100644 index 0000000000000000000000000000000000000000..fe88a6e1c724869b68a50f6c65dde89939fcdf5f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/5/BR/8L50KKVDJWBL92X0H2NIC2.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/6/8G/ESLXDN4AWFGZTI58SQANKM.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/6/8G/ESLXDN4AWFGZTI58SQANKM.uasset new file mode 100644 index 0000000000000000000000000000000000000000..bb56e9f868a84dd56556282cc36889a4905fa2b9 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/6/8G/ESLXDN4AWFGZTI58SQANKM.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/6/YR/EQPERIP9OQ2P0EI8I8FQE8.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/6/YR/EQPERIP9OQ2P0EI8I8FQE8.uasset new file mode 100644 index 0000000000000000000000000000000000000000..fb7cce8758ec21f5ae1ee820f136536673a8a4d9 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/6/YR/EQPERIP9OQ2P0EI8I8FQE8.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/8/1M/O7KNMF140VQOV6MAUR8R3H.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/8/1M/O7KNMF140VQOV6MAUR8R3H.uasset new file mode 100644 index 0000000000000000000000000000000000000000..64044c68d46f202fa468aab5aeb72015a8372f27 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/8/1M/O7KNMF140VQOV6MAUR8R3H.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/A/EL/IV8R3ZXC3FWK689XH7U0JO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/A/EL/IV8R3ZXC3FWK689XH7U0JO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..aaa70103806ba9b8dc691d3f3aefc9ea979b190d Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/A/EL/IV8R3ZXC3FWK689XH7U0JO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/A/OW/2ZDS8DXGEZJOKEA02UAGYM.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/A/OW/2ZDS8DXGEZJOKEA02UAGYM.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2dbc5760eeaa39eae4ab844416d81ce30a35c203 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/A/OW/2ZDS8DXGEZJOKEA02UAGYM.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/B/W2/F6LF2OM16F9795MXL3GN4K.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/B/W2/F6LF2OM16F9795MXL3GN4K.uasset new file mode 100644 index 0000000000000000000000000000000000000000..6952146868d018ec3216b7a4145c8d8ecbc2e4bc Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/B/W2/F6LF2OM16F9795MXL3GN4K.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/D/GO/9R9EU10XF9BJQL1F8GQMZ5.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/D/GO/9R9EU10XF9BJQL1F8GQMZ5.uasset new file mode 100644 index 0000000000000000000000000000000000000000..5f57dbf598621b62a1d598e883980df4cdf4eec1 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/D/GO/9R9EU10XF9BJQL1F8GQMZ5.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/D/O6/6K77UE1E1ZW5GPSS9IHO06.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/D/O6/6K77UE1E1ZW5GPSS9IHO06.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b63ce69157244bb6230f836931c7eac7a313192f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/D/O6/6K77UE1E1ZW5GPSS9IHO06.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/E/Z6/RHW0IY9DYFLSR5W4RNABMD.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/E/Z6/RHW0IY9DYFLSR5W4RNABMD.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d59dbc58801db881a54dda0ea695170cbd79cba4 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Pillar_Medium_01/E/Z6/RHW0IY9DYFLSR5W4RNABMD.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_01/1/6Y/6A62P2N1T50YQBB09TIU86.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_01/1/6Y/6A62P2N1T50YQBB09TIU86.uasset new file mode 100644 index 0000000000000000000000000000000000000000..7c5571b526056d1fe99b5e3a589a18db16f23e8a Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_01/1/6Y/6A62P2N1T50YQBB09TIU86.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_01/1/PN/Y5B12V0GOIL7BGR29Z71XB.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_01/1/PN/Y5B12V0GOIL7BGR29Z71XB.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4fedea9816200a5551005a2192e6f54ea7f9269e Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_01/1/PN/Y5B12V0GOIL7BGR29Z71XB.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_01/6/TW/I2U85XUEKJU8KXUEAORR33.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_01/6/TW/I2U85XUEKJU8KXUEAORR33.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ac61d58ba1e0da722cbf7fee3965c8311b559e3f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_01/6/TW/I2U85XUEKJU8KXUEAORR33.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_02/1/W0/B8XREYD8HE06OFEUV52C7K.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_02/1/W0/B8XREYD8HE06OFEUV52C7K.uasset new file mode 100644 index 0000000000000000000000000000000000000000..80331e29eb0791446083d7648df5acfa351d6ae0 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_02/1/W0/B8XREYD8HE06OFEUV52C7K.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_02/3/Y2/QO8Z5M9MOGDUQOEWZKEJAD.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_02/3/Y2/QO8Z5M9MOGDUQOEWZKEJAD.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b748ade3bcd80464ba6569bce9224d5e8c9eea4e Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_02/3/Y2/QO8Z5M9MOGDUQOEWZKEJAD.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_02/6/SS/5L595IHZCKLDLB55XL3XZJ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_02/6/SS/5L595IHZCKLDLB55XL3XZJ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d06f23b945937097a4621e4bd1dc1b02ef5e2fcf Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_02/6/SS/5L595IHZCKLDLB55XL3XZJ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_03/2/0E/8M00GUYHOSLBSBP9SGAN5C.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_03/2/0E/8M00GUYHOSLBSBP9SGAN5C.uasset new file mode 100644 index 0000000000000000000000000000000000000000..5a948803f7b5791fac229b04bf8b6679e89b59b1 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_03/2/0E/8M00GUYHOSLBSBP9SGAN5C.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_03/9/FI/0JQW7GRRP09G5AORYTQILW.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_03/9/FI/0JQW7GRRP09G5AORYTQILW.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1e066ef92be7ab8bb5787fcc441ec7bb89eb22ad Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_03/9/FI/0JQW7GRRP09G5AORYTQILW.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_03/E/VK/XU3JKPWV94OIURRNQ3WRP6.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_03/E/VK/XU3JKPWV94OIURRNQ3WRP6.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e7aafe8ef38ec19a5caa0d31ac78449913d9801f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Environment/PackedLevelActors/PLA_Platform_Small_03/E/VK/XU3JKPWV94OIURRNQ3WRP6.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/02/0X3GQ7Y0CRIL33WOHCO7DB.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/02/0X3GQ7Y0CRIL33WOHCO7DB.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9259d8cdee83f97612d922fda4882cb5740051bd Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/02/0X3GQ7Y0CRIL33WOHCO7DB.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/2W/L4CJV4MV80Z8A6FIBPAIPV.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/2W/L4CJV4MV80Z8A6FIBPAIPV.uasset new file mode 100644 index 0000000000000000000000000000000000000000..6b2acaaee1f6ee31d94ab8f1cdde1e8d52f1b29a Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/2W/L4CJV4MV80Z8A6FIBPAIPV.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/46/83SVVAT347TPWLEGC0JAZ6.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/46/83SVVAT347TPWLEGC0JAZ6.uasset new file mode 100644 index 0000000000000000000000000000000000000000..3dcbcb641bf3b95d8b7ad7dcbead32ad08de3d4f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/46/83SVVAT347TPWLEGC0JAZ6.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/62/IBAXLLV147GT43IPREYJZT.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/62/IBAXLLV147GT43IPREYJZT.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8b5793d967ef82c3e33b06cd26361ab95c157c5f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/62/IBAXLLV147GT43IPREYJZT.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/9O/DVPFZME7VIXM9WIDR5S135.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/9O/DVPFZME7VIXM9WIDR5S135.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d702872b6abf3b1bbc915a12269585b5c47ea4da Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/9O/DVPFZME7VIXM9WIDR5S135.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/G5/FBJNNRX0IL002LPQCI6PUF.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/G5/FBJNNRX0IL002LPQCI6PUF.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9532d03d07a988118397c7172c810455bd5d3bb9 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/G5/FBJNNRX0IL002LPQCI6PUF.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/GD/XAIPVZWZZSEJAFAW1DHP33.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/GD/XAIPVZWZZSEJAFAW1DHP33.uasset new file mode 100644 index 0000000000000000000000000000000000000000..283b1ef5a053dea89b14926f076e95ada3001a7c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/GD/XAIPVZWZZSEJAFAW1DHP33.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/MV/VYG117DOTK98LSTV6PLG5N.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/MV/VYG117DOTK98LSTV6PLG5N.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ffe6e3dcbde01b8db74d8221f5cdcccaac29771a Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/MV/VYG117DOTK98LSTV6PLG5N.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/NG/CCYDMMDRDQJNSBP9UWFEO7.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/NG/CCYDMMDRDQJNSBP9UWFEO7.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4ab8b4218e5178579a19762eb7580654c4ac66b9 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/0/NG/CCYDMMDRDQJNSBP9UWFEO7.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/33/UXSSK6SRLPKDYC361LTF8A.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/33/UXSSK6SRLPKDYC361LTF8A.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c5f5c8983179b6a39651edcbf940547c98c5c0cb Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/33/UXSSK6SRLPKDYC361LTF8A.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/48/OYR7ZG697J8ESK2BA2GUVK.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/48/OYR7ZG697J8ESK2BA2GUVK.uasset new file mode 100644 index 0000000000000000000000000000000000000000..7f741d07d36a9b97733f78d338292ec8fb6eb09c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/48/OYR7ZG697J8ESK2BA2GUVK.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/64/BVJS58KD1L7V52XG6TZNBG.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/64/BVJS58KD1L7V52XG6TZNBG.uasset new file mode 100644 index 0000000000000000000000000000000000000000..bb2943292d099d86d9d370f6079619ff5e994b6d Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/64/BVJS58KD1L7V52XG6TZNBG.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/69/QBOMYMAT0U7T1EXIXWLLFY.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/69/QBOMYMAT0U7T1EXIXWLLFY.uasset new file mode 100644 index 0000000000000000000000000000000000000000..182bf045973e9046ca08a784806138b1e6d397ba Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/69/QBOMYMAT0U7T1EXIXWLLFY.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/C4/H7XA6A89ALT1AAHGYDOJB7.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/C4/H7XA6A89ALT1AAHGYDOJB7.uasset new file mode 100644 index 0000000000000000000000000000000000000000..32c761422e05964363394fb62a2773bb8316266a Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/C4/H7XA6A89ALT1AAHGYDOJB7.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/C6/8SD45TG1V0KZKSL58XXME8.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/C6/8SD45TG1V0KZKSL58XXME8.uasset new file mode 100644 index 0000000000000000000000000000000000000000..16ef82d4b51bcf88e177848bb6ad4b9962850d12 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/C6/8SD45TG1V0KZKSL58XXME8.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/HI/5AV1CS1R32L01XJEVKN8TM.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/HI/5AV1CS1R32L01XJEVKN8TM.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0adf6dd255f39e4fedcb7fe72e85623b62607a23 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/HI/5AV1CS1R32L01XJEVKN8TM.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/I6/7N4DHGGYFACL72N066RIL6.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/I6/7N4DHGGYFACL72N066RIL6.uasset new file mode 100644 index 0000000000000000000000000000000000000000..f11e961105100398745c9148f4221fe0003b4538 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/I6/7N4DHGGYFACL72N066RIL6.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/JJ/OAWQU4T1ZRTQVLWM21H1EG.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/JJ/OAWQU4T1ZRTQVLWM21H1EG.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8364b582a4301a0a673edefb6e323b7980c01496 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/JJ/OAWQU4T1ZRTQVLWM21H1EG.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/K9/C7SW1LD5RK5UR8KPUF8F91.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/K9/C7SW1LD5RK5UR8KPUF8F91.uasset new file mode 100644 index 0000000000000000000000000000000000000000..290371a7b08bda7b2a1750644e44ef5d00784781 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/K9/C7SW1LD5RK5UR8KPUF8F91.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/MA/HMEPT6VBYU78D6IGARWS9U.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/MA/HMEPT6VBYU78D6IGARWS9U.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9732099698d3d72f6566f2d603dbec2610e148c3 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/MA/HMEPT6VBYU78D6IGARWS9U.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/NA/DRUSPLIC1B57Q48ASXMIG5.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/NA/DRUSPLIC1B57Q48ASXMIG5.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9e7338b36fd87646608bb01c6e7ccabfe4deca6f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/NA/DRUSPLIC1B57Q48ASXMIG5.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/O7/F41C1Z7X3MKPLBQC2GNIFD.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/O7/F41C1Z7X3MKPLBQC2GNIFD.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ffeda0e7c0f47d1cc4401631d5f109d02458b898 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/O7/F41C1Z7X3MKPLBQC2GNIFD.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/OC/6K6QCSPLC4VRJRPFCAOXIF.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/OC/6K6QCSPLC4VRJRPFCAOXIF.uasset new file mode 100644 index 0000000000000000000000000000000000000000..cb507c597bfce4039c668944c14f21335098a6a8 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/OC/6K6QCSPLC4VRJRPFCAOXIF.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/R0/5J8XLKZNNGJLMBMDXPN3AB.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/R0/5J8XLKZNNGJLMBMDXPN3AB.uasset new file mode 100644 index 0000000000000000000000000000000000000000..440847075d91cb21ad76ca431bbebc87d79fbffe Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/R0/5J8XLKZNNGJLMBMDXPN3AB.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/SX/RTRPZJHBNRO8I6IH2A0L20.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/SX/RTRPZJHBNRO8I6IH2A0L20.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4ec9f057c9dd79a79725da61a43f7f1550d0504e Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/SX/RTRPZJHBNRO8I6IH2A0L20.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/U4/J4JV2HFGF0U7LS8QOTOAXF.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/U4/J4JV2HFGF0U7LS8QOTOAXF.uasset new file mode 100644 index 0000000000000000000000000000000000000000..5f2cf407eded9367b83bcdef6d7c2ecf90e94b03 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/U4/J4JV2HFGF0U7LS8QOTOAXF.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/XI/5LZL0D6ALK7DH9Q3ID3EA5.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/XI/5LZL0D6ALK7DH9Q3ID3EA5.uasset new file mode 100644 index 0000000000000000000000000000000000000000..81fb114ec49088fbb7f35bdbbd732e77f16bde0f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/1/XI/5LZL0D6ALK7DH9Q3ID3EA5.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/2M/JQBLVGDJ2CVQUT5XEYOEVQ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/2M/JQBLVGDJ2CVQUT5XEYOEVQ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0e8c4cad4e6c74a99a458ddfbbe882bc6d0eb797 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/2M/JQBLVGDJ2CVQUT5XEYOEVQ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/4J/P4HFAUMB34X6RGNLBGWP42.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/4J/P4HFAUMB34X6RGNLBGWP42.uasset new file mode 100644 index 0000000000000000000000000000000000000000..56880afedc179ed15b65076d259f4c47ee7b647b Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/4J/P4HFAUMB34X6RGNLBGWP42.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/4N/53QXJG8IJ84XACKVSEI34X.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/4N/53QXJG8IJ84XACKVSEI34X.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9d65b145e44dea95ab6de3a527edbe04c6306885 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/4N/53QXJG8IJ84XACKVSEI34X.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/8G/GRSO888KLSFZBHX2D2BG0E.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/8G/GRSO888KLSFZBHX2D2BG0E.uasset new file mode 100644 index 0000000000000000000000000000000000000000..98b2547906d49a8ab71795fbbee191d88960955c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/8G/GRSO888KLSFZBHX2D2BG0E.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/9P/N0OJYD6313FS3IGV2BEXHY.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/9P/N0OJYD6313FS3IGV2BEXHY.uasset new file mode 100644 index 0000000000000000000000000000000000000000..aaf628efdcb271370ef7bb7282c15648c6616d51 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/9P/N0OJYD6313FS3IGV2BEXHY.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/A3/XAIJ0O6EFEIH0NRBCRWQOG.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/A3/XAIJ0O6EFEIH0NRBCRWQOG.uasset new file mode 100644 index 0000000000000000000000000000000000000000..a9fb9e0bbc7d9ed94689c92c36fe3be0c6391e7a Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/A3/XAIJ0O6EFEIH0NRBCRWQOG.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/CM/9L9T8B4DTTQ24ZIW7WR26M.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/CM/9L9T8B4DTTQ24ZIW7WR26M.uasset new file mode 100644 index 0000000000000000000000000000000000000000..340794ba4553a41e6e7819e1df3ee129d54c0fe1 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/CM/9L9T8B4DTTQ24ZIW7WR26M.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/DN/8R60K9FGLN9HP68L1CI84S.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/DN/8R60K9FGLN9HP68L1CI84S.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ce632b172af51eb3404401ba51accdaec6c3546c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/DN/8R60K9FGLN9HP68L1CI84S.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/DT/7L15I041CXLFAJS9RGDGBM.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/DT/7L15I041CXLFAJS9RGDGBM.uasset new file mode 100644 index 0000000000000000000000000000000000000000..a3466b597a0004798bee5b27423bbbd36740ef2e Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/DT/7L15I041CXLFAJS9RGDGBM.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/E0/AQMTKPRHY7Z44QT410BUGY.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/E0/AQMTKPRHY7Z44QT410BUGY.uasset new file mode 100644 index 0000000000000000000000000000000000000000..98084ef944143113e07e4a09150ba864e5e46c0e Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/E0/AQMTKPRHY7Z44QT410BUGY.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/E8/MWJL37O36QUC01AZ8H5D8N.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/E8/MWJL37O36QUC01AZ8H5D8N.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b2426627a831521b155979ca0c16f98f4bc43fc9 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/E8/MWJL37O36QUC01AZ8H5D8N.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/FV/BIPHEBBC4OGT26O6J2AAK3.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/FV/BIPHEBBC4OGT26O6J2AAK3.uasset new file mode 100644 index 0000000000000000000000000000000000000000..af93db15dd5091b38f7d1880a71ecc1e57f02f88 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/FV/BIPHEBBC4OGT26O6J2AAK3.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/HL/F4T9M6RH8PAWXAI0AQ16TR.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/HL/F4T9M6RH8PAWXAI0AQ16TR.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0be3394bfd2104fcedb15942b8eebf102dc9d667 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/HL/F4T9M6RH8PAWXAI0AQ16TR.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/JG/N8O0O101Q2E4QG8S42B69V.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/JG/N8O0O101Q2E4QG8S42B69V.uasset new file mode 100644 index 0000000000000000000000000000000000000000..820f2ef9b2d96344ae0e3753bf99a03ea718c605 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/JG/N8O0O101Q2E4QG8S42B69V.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/KZ/ETYUI4Q5YH98EYSXD29XEW.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/KZ/ETYUI4Q5YH98EYSXD29XEW.uasset new file mode 100644 index 0000000000000000000000000000000000000000..666a0e577a2582a2b963999a345e476f2cff4977 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/KZ/ETYUI4Q5YH98EYSXD29XEW.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/LN/5GWTBGEKY8F1HDDTEEPBEX.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/LN/5GWTBGEKY8F1HDDTEEPBEX.uasset new file mode 100644 index 0000000000000000000000000000000000000000..cdae6eef65748feb54f74a0a159dc22c55926b89 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/LN/5GWTBGEKY8F1HDDTEEPBEX.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/O9/LNNADCMH6UKDAR2KTRGLPC.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/O9/LNNADCMH6UKDAR2KTRGLPC.uasset new file mode 100644 index 0000000000000000000000000000000000000000..99528306c91f362210650f136744b99950ed3489 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/O9/LNNADCMH6UKDAR2KTRGLPC.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/OB/QUVIO5ALYUPL2S5MPIXKTO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/OB/QUVIO5ALYUPL2S5MPIXKTO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c1269e3572852a9f57c6f19e1c31494160b798bd Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/OB/QUVIO5ALYUPL2S5MPIXKTO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/PC/VX1ZOTTHXQ48EOF4TPLFQH.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/PC/VX1ZOTTHXQ48EOF4TPLFQH.uasset new file mode 100644 index 0000000000000000000000000000000000000000..dd7e815c110793c5ae5094d8e8a5de044d1d15aa Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/PC/VX1ZOTTHXQ48EOF4TPLFQH.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/TV/HQO3TJF974I0OISAMURN8B.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/TV/HQO3TJF974I0OISAMURN8B.uasset new file mode 100644 index 0000000000000000000000000000000000000000..f5ef6e543e76ad79f968f043c95d3bb31068dea9 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/TV/HQO3TJF974I0OISAMURN8B.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/UE/IM70VD18LOCTC0B90ECRX0.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/UE/IM70VD18LOCTC0B90ECRX0.uasset new file mode 100644 index 0000000000000000000000000000000000000000..168ab083265a1430920ff83e8590a9a6b07d66ed Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/UE/IM70VD18LOCTC0B90ECRX0.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/VJ/ZQOAOR2IO91TPZCVX3ZG15.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/VJ/ZQOAOR2IO91TPZCVX3ZG15.uasset new file mode 100644 index 0000000000000000000000000000000000000000..28f7df7774bf5cce310968df306b850cfe7e07a2 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/VJ/ZQOAOR2IO91TPZCVX3ZG15.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/WH/N4WTQ05LV9WYBREBIZQRPO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/WH/N4WTQ05LV9WYBREBIZQRPO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ff11c87dd12b5cb90727b9b547008321f06bd25b Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/WH/N4WTQ05LV9WYBREBIZQRPO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/X4/009ZYXJD4VIJ6X9FYC8QCT.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/X4/009ZYXJD4VIJ6X9FYC8QCT.uasset new file mode 100644 index 0000000000000000000000000000000000000000..896480cf1e42cb10957326b19cbf3adaecfab066 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/2/X4/009ZYXJD4VIJ6X9FYC8QCT.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/0D/G98I3V48ZRX0DFER8S3BNP.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/0D/G98I3V48ZRX0DFER8S3BNP.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c723d6fdfb2269e794a25edae20131f73fe9076d Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/0D/G98I3V48ZRX0DFER8S3BNP.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/4H/X30D1OVDEQ6IO8NYZ4ZDN6.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/4H/X30D1OVDEQ6IO8NYZ4ZDN6.uasset new file mode 100644 index 0000000000000000000000000000000000000000..285e2495180d22b24bd351fda7681be5261e232c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/4H/X30D1OVDEQ6IO8NYZ4ZDN6.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/4Z/BFNIVT69DB6WFYKJ5M0IWI.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/4Z/BFNIVT69DB6WFYKJ5M0IWI.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4adbef77b9d5656c5afd815d0f5c3dd729ea43a1 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/4Z/BFNIVT69DB6WFYKJ5M0IWI.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/5P/36VGF1Y6ODOHUWXEEVII7Q.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/5P/36VGF1Y6ODOHUWXEEVII7Q.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ef1d106e24455ff8dc60148efa094d6d0acc3404 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/5P/36VGF1Y6ODOHUWXEEVII7Q.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/6T/HR95QJ1IBSC7CMSLGYVJMB.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/6T/HR95QJ1IBSC7CMSLGYVJMB.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c53953c5e9019e8e07ece45e5f613fbb86da4be2 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/6T/HR95QJ1IBSC7CMSLGYVJMB.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/9A/D82TD0O9MPV2RFHJC9IHH8.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/9A/D82TD0O9MPV2RFHJC9IHH8.uasset new file mode 100644 index 0000000000000000000000000000000000000000..5cc31388e1b2e6d2399c64182fe01b03b157667c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/9A/D82TD0O9MPV2RFHJC9IHH8.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/9O/C6PXESQ75XKQ00DD4MTKE3.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/9O/C6PXESQ75XKQ00DD4MTKE3.uasset new file mode 100644 index 0000000000000000000000000000000000000000..604bd71e6c0f279ade23deed0c852aa5f19cb35e Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/9O/C6PXESQ75XKQ00DD4MTKE3.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/A4/TZ468H65L8Z3OI9Z0XC3UD.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/A4/TZ468H65L8Z3OI9Z0XC3UD.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ac57bf9f60fc4fb22d55029ea87e842dc869b3a3 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/A4/TZ468H65L8Z3OI9Z0XC3UD.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/EC/MA6VZHTJ9MSR9NB1C0CL9C.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/EC/MA6VZHTJ9MSR9NB1C0CL9C.uasset new file mode 100644 index 0000000000000000000000000000000000000000..aefc809c7463c328c05201f8f0216108e4807d01 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/EC/MA6VZHTJ9MSR9NB1C0CL9C.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/H5/K7TMELYBM11EMF74HTNVHO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/H5/K7TMELYBM11EMF74HTNVHO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e23aadbb8e696a6e27246583a02319e8a6971c66 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/H5/K7TMELYBM11EMF74HTNVHO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/HG/6QMDIUEHEEHOO0Z4OV2XH0.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/HG/6QMDIUEHEEHOO0Z4OV2XH0.uasset new file mode 100644 index 0000000000000000000000000000000000000000..5ab6ac6c896811b590f63922b20adfa78dc9690f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/HG/6QMDIUEHEEHOO0Z4OV2XH0.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/I0/2G1FJOXSV0CP4HH6L2IUMZ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/I0/2G1FJOXSV0CP4HH6L2IUMZ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0445984faf89634295390a0926aaec33c6137a84 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/I0/2G1FJOXSV0CP4HH6L2IUMZ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/J4/DO0A9NNX4TDRJBPV7KEG91.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/J4/DO0A9NNX4TDRJBPV7KEG91.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9d634ac743a5ad5835b51b5849f5c1c5713fa8b3 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/J4/DO0A9NNX4TDRJBPV7KEG91.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/LC/X2W0JVIL99AT86QY0UHFKP.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/LC/X2W0JVIL99AT86QY0UHFKP.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2b927d4ebfa3e84ec62d969d277fa506c4e77fce Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/LC/X2W0JVIL99AT86QY0UHFKP.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/LM/S4N06CGXDZ8RTJCDMH3LLH.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/LM/S4N06CGXDZ8RTJCDMH3LLH.uasset new file mode 100644 index 0000000000000000000000000000000000000000..35b945669a74e78ff021eefaa5303977cae64bf7 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/LM/S4N06CGXDZ8RTJCDMH3LLH.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/OL/Z7I1N2C8TX9O5HD0W7KBZI.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/OL/Z7I1N2C8TX9O5HD0W7KBZI.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e19ac8899699e48b4884d55e6fe1ea65df315f20 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/OL/Z7I1N2C8TX9O5HD0W7KBZI.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/V7/FHBC2MIBDHEGRMISYT2BAP.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/V7/FHBC2MIBDHEGRMISYT2BAP.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ac72672b7959e347128e0ec8e31532cfb07f60e4 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/V7/FHBC2MIBDHEGRMISYT2BAP.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/ZH/RM9YHBFNJMWXHHC88SLGK5.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/ZH/RM9YHBFNJMWXHHC88SLGK5.uasset new file mode 100644 index 0000000000000000000000000000000000000000..90c4b300adbb01506772c6493a0da1766c4c64a4 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/3/ZH/RM9YHBFNJMWXHHC88SLGK5.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/18/BWPGE0IDVTNN30S5UYRNAX.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/18/BWPGE0IDVTNN30S5UYRNAX.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2ac37f707f0187fec01dc96f89a3f9cb08a5de7a Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/18/BWPGE0IDVTNN30S5UYRNAX.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/39/LGRJEYH847GT6AHCDC0NKG.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/39/LGRJEYH847GT6AHCDC0NKG.uasset new file mode 100644 index 0000000000000000000000000000000000000000..405d7075f77af7b1ca55f93a7e29dbfe143555cd Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/39/LGRJEYH847GT6AHCDC0NKG.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/3O/IYLEAVXLEJD758WAUNNMLF.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/3O/IYLEAVXLEJD758WAUNNMLF.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4fbd4c42915d035c11328ae0536dfb3bcae0e95e Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/3O/IYLEAVXLEJD758WAUNNMLF.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/B2/ZABDMV7RUMVMBXKVRW1HYD.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/B2/ZABDMV7RUMVMBXKVRW1HYD.uasset new file mode 100644 index 0000000000000000000000000000000000000000..bcbf4dde048284ecf5300cf0c947013dc102b64d Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/B2/ZABDMV7RUMVMBXKVRW1HYD.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/F9/9SU8VCMJRLEQ9O4U9DTC37.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/F9/9SU8VCMJRLEQ9O4U9DTC37.uasset new file mode 100644 index 0000000000000000000000000000000000000000..98fb394db7147fe017a41142ae425df79d28e0d4 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/F9/9SU8VCMJRLEQ9O4U9DTC37.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/FS/IB27O247O51QZZVDF33K3S.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/FS/IB27O247O51QZZVDF33K3S.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4b5ad2701f9e326caa76469df5a0177215e2057c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/FS/IB27O247O51QZZVDF33K3S.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/JH/N0QGH92WINPYTYLH4C3HGJ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/JH/N0QGH92WINPYTYLH4C3HGJ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1dd109190c011e168ba4c6da25c712de2db620b0 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/JH/N0QGH92WINPYTYLH4C3HGJ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/L3/FROVBCSWUKIKFFIAHTMB4L.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/L3/FROVBCSWUKIKFFIAHTMB4L.uasset new file mode 100644 index 0000000000000000000000000000000000000000..726f12abcfbf14e251c37274cfe547714547cdb4 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/L3/FROVBCSWUKIKFFIAHTMB4L.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/N0/VUM320GT2NQ9P8TQ5EQMDY.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/N0/VUM320GT2NQ9P8TQ5EQMDY.uasset new file mode 100644 index 0000000000000000000000000000000000000000..6076147e7c0b947efa68dd6ae2e55ae098311d6b Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/N0/VUM320GT2NQ9P8TQ5EQMDY.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/NM/4C86EX6ZNF4E2ESLFH7J7H.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/NM/4C86EX6ZNF4E2ESLFH7J7H.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e2b47b9669f5b39034a7f894a1796d9b6d648a48 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/NM/4C86EX6ZNF4E2ESLFH7J7H.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/OM/RFGTQRTTG9V0IJLVLNJUET.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/OM/RFGTQRTTG9V0IJLVLNJUET.uasset new file mode 100644 index 0000000000000000000000000000000000000000..776b13939e202830550456f87c83487bf3da7205 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/OM/RFGTQRTTG9V0IJLVLNJUET.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/RH/2AZ8XMNLVHYUTP27W7KI0M.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/RH/2AZ8XMNLVHYUTP27W7KI0M.uasset new file mode 100644 index 0000000000000000000000000000000000000000..31ae17a75403e636f032325f8e9034aecddc50dc Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/RH/2AZ8XMNLVHYUTP27W7KI0M.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/VJ/S3HW0OOVSD05JXQIZZEG9D.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/VJ/S3HW0OOVSD05JXQIZZEG9D.uasset new file mode 100644 index 0000000000000000000000000000000000000000..526062abad136125ed5cde5ca0254bbe8511ca2d Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/VJ/S3HW0OOVSD05JXQIZZEG9D.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/VT/6P5B5YZTBVX0Y5KRFQ4SXX.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/VT/6P5B5YZTBVX0Y5KRFQ4SXX.uasset new file mode 100644 index 0000000000000000000000000000000000000000..04e38c13e2ab4251992c966184fcd3b5325ea437 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/VT/6P5B5YZTBVX0Y5KRFQ4SXX.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/W7/UMAVHZS2BIAND74ZJNEIYR.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/W7/UMAVHZS2BIAND74ZJNEIYR.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b15db3cbabf60b7a486bad1ea93102cdbaf8f03c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/W7/UMAVHZS2BIAND74ZJNEIYR.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/WH/1KX2L3O5L4F4N86FA0PHU9.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/WH/1KX2L3O5L4F4N86FA0PHU9.uasset new file mode 100644 index 0000000000000000000000000000000000000000..049c9c3bb1cae0ac6c4f983c46a584b24a7b8c3b Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/WH/1KX2L3O5L4F4N86FA0PHU9.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/XY/DSFMN1UQD3U186PZA5WXW8.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/XY/DSFMN1UQD3U186PZA5WXW8.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c1251abe878ac4658f30b46f8427ca60a5146229 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/4/XY/DSFMN1UQD3U186PZA5WXW8.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/5/TS/M9ZNCCH8808AE1QYMQG38Z.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/5/TS/M9ZNCCH8808AE1QYMQG38Z.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d3340df717b3b7c2ca1421b49eadc12f8cfa4e5a Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/5/TS/M9ZNCCH8808AE1QYMQG38Z.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/5/VX/TM8CU6Y7GORFZQSI6X399I.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/5/VX/TM8CU6Y7GORFZQSI6X399I.uasset new file mode 100644 index 0000000000000000000000000000000000000000..673cd56975691bfb622c615ec679e66f9ac4f7b3 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LVL_StackOBot/5/VX/TM8CU6Y7GORFZQSI6X399I.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/3L/UU895L3J24MTRB5K8BCPM2.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/3L/UU895L3J24MTRB5K8BCPM2.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c1b13081264606d688069153314426a3ca02261f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/3L/UU895L3J24MTRB5K8BCPM2.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/9S/W8DQ65Z49FT5E817KEBOTU.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/9S/W8DQ65Z49FT5E817KEBOTU.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1b44e3a45230dc0bb544685a0dbce6136a8dc11e Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/9S/W8DQ65Z49FT5E817KEBOTU.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/DK/HOBAMWRMYPYGZNKDZ7AHID.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/DK/HOBAMWRMYPYGZNKDZ7AHID.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2d5fa4e0f01ae138cd913edb61026a209c9d1fda Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/DK/HOBAMWRMYPYGZNKDZ7AHID.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/N3/LX6A1LNEPLW79T06B2ISXR.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/N3/LX6A1LNEPLW79T06B2ISXR.uasset new file mode 100644 index 0000000000000000000000000000000000000000..3a0bf680cec9a3fd0960b9d78be1f9e5ecb9f860 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/0/N3/LX6A1LNEPLW79T06B2ISXR.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/1/0Y/HSBGFWZDH08NOGP0FD6MBO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/1/0Y/HSBGFWZDH08NOGP0FD6MBO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..fc81d3ecb6937683ad9f14ec198e7c85fc31a51f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/1/0Y/HSBGFWZDH08NOGP0FD6MBO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/1/2F/TBSKJS9E7UWBPOELOQFGTD.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/1/2F/TBSKJS9E7UWBPOELOQFGTD.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b91ecfe839ac40d82bc33536e0b91ae4345c2a9d Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/1/2F/TBSKJS9E7UWBPOELOQFGTD.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/1/I2/KRW51T2CJGUJ8NMCNURMPO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/1/I2/KRW51T2CJGUJ8NMCNURMPO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1a7c303e4615b4b36ba755511dee92ee6221f780 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/1/I2/KRW51T2CJGUJ8NMCNURMPO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/9N/AVH26FC63QK7WLDPZ5BK61.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/9N/AVH26FC63QK7WLDPZ5BK61.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1a3d8e819591984bace3a639f9b970b1166e5217 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/9N/AVH26FC63QK7WLDPZ5BK61.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/NX/5H75RMN9451FF66EFA5NBE.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/NX/5H75RMN9451FF66EFA5NBE.uasset new file mode 100644 index 0000000000000000000000000000000000000000..cdae96ca4bad43ebc8fbd0dd9cba56831e91da18 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/NX/5H75RMN9451FF66EFA5NBE.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/PU/KCNSY82VIIH6D76XOXKJCF.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/PU/KCNSY82VIIH6D76XOXKJCF.uasset new file mode 100644 index 0000000000000000000000000000000000000000..cfcd254939a7838a66b2158913f51e06d1670699 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/PU/KCNSY82VIIH6D76XOXKJCF.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/SO/3F9E5ENHW2G3CNDMNGA2IA.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/SO/3F9E5ENHW2G3CNDMNGA2IA.uasset new file mode 100644 index 0000000000000000000000000000000000000000..7cfb269cbd8071e9d587ebf6eec447d5ab20b152 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/SO/3F9E5ENHW2G3CNDMNGA2IA.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/TN/1Y8UFLI3DUOREKVSSPSQ61.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/TN/1Y8UFLI3DUOREKVSSPSQ61.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4754d133312c92a4bd65af8e506f6033a4bc6378 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/2/TN/1Y8UFLI3DUOREKVSSPSQ61.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/57/V1KF9GFUR020SD2MESN2BA.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/57/V1KF9GFUR020SD2MESN2BA.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0a80ecd746200606d839e0524f569532cc623a80 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/57/V1KF9GFUR020SD2MESN2BA.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/HK/T2DSCG1960VMXOBAHHYCA0.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/HK/T2DSCG1960VMXOBAHHYCA0.uasset new file mode 100644 index 0000000000000000000000000000000000000000..59677feb962b7e05a8f5988fa06b46ecf27fcbff Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/HK/T2DSCG1960VMXOBAHHYCA0.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/RZ/2E09PPD6T04V5QLK5B06G0.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/RZ/2E09PPD6T04V5QLK5B06G0.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4001820454260b2d5311c32791358843ad41d8d8 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/RZ/2E09PPD6T04V5QLK5B06G0.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/T8/EQYBB1UN49BF2K4IU4H6H7.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/T8/EQYBB1UN49BF2K4IU4H6H7.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ba90d22487a708265943e5fd367fa24436172b73 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/T8/EQYBB1UN49BF2K4IU4H6H7.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/W0/VV0VCOYE7VJYBA46CXB0XO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/W0/VV0VCOYE7VJYBA46CXB0XO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..5b8f49c66d508a102019d1a73f97c8f61f820a8c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/W0/VV0VCOYE7VJYBA46CXB0XO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/WH/MOY2XLFKY1DGKHUI6KKG6T.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/WH/MOY2XLFKY1DGKHUI6KKG6T.uasset new file mode 100644 index 0000000000000000000000000000000000000000..71ec6023fce5bfb1dc006c1cc8825d9e76525b31 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/3/WH/MOY2XLFKY1DGKHUI6KKG6T.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/9K/WW8WX31OHK49F74XW6JW66.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/9K/WW8WX31OHK49F74XW6JW66.uasset new file mode 100644 index 0000000000000000000000000000000000000000..cc9c83a679b8b74687d2c1981eacf6450539f0bc Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/9K/WW8WX31OHK49F74XW6JW66.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/GE/L8CGQAFXNQK3BY78YWGN8X.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/GE/L8CGQAFXNQK3BY78YWGN8X.uasset new file mode 100644 index 0000000000000000000000000000000000000000..103fda4084a6665c9530f00c23bfbd14391c969a Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/GE/L8CGQAFXNQK3BY78YWGN8X.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/KT/68NSFQK6YMOYFD9B0AAW3Y.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/KT/68NSFQK6YMOYFD9B0AAW3Y.uasset new file mode 100644 index 0000000000000000000000000000000000000000..177e5d07661340644cd227feb0d1662179da8839 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/KT/68NSFQK6YMOYFD9B0AAW3Y.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/N8/86CKXUJF1TWCPEM5SEOS1R.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/N8/86CKXUJF1TWCPEM5SEOS1R.uasset new file mode 100644 index 0000000000000000000000000000000000000000..a2a79caf66cde222714dae6851190ca2e15d6530 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/N8/86CKXUJF1TWCPEM5SEOS1R.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/OP/FQDGF8NNSPF15LOMU1INHE.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/OP/FQDGF8NNSPF15LOMU1INHE.uasset new file mode 100644 index 0000000000000000000000000000000000000000..319350bd9f2afd5aaa057fef2eb86d9db147e37a Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/4/OP/FQDGF8NNSPF15LOMU1INHE.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/5/ET/SDWQLKSUIJME0WUPZ08635.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/5/ET/SDWQLKSUIJME0WUPZ08635.uasset new file mode 100644 index 0000000000000000000000000000000000000000..36e8681a1c999c65f24b877722387e15aecc418d Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/5/ET/SDWQLKSUIJME0WUPZ08635.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/5/LA/K29OQZIBYRPY0FMQ5PFUYG.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/5/LA/K29OQZIBYRPY0FMQ5PFUYG.uasset new file mode 100644 index 0000000000000000000000000000000000000000..63fdc356ee4cd04aaf7ff9aa5098299df1a6d1b0 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/5/LA/K29OQZIBYRPY0FMQ5PFUYG.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/5/P4/JRC1QZCGPB18RVKSZRCLG5.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/5/P4/JRC1QZCGPB18RVKSZRCLG5.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d009ec4a0b40b27f1a8e1c1484c0b7663252f4a4 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_00_Hub/5/P4/JRC1QZCGPB18RVKSZRCLG5.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_06_SubLevelC/E/00/HQJMDLMLM7NW8N8URFSWA0.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_06_SubLevelC/E/00/HQJMDLMLM7NW8N8URFSWA0.uasset new file mode 100644 index 0000000000000000000000000000000000000000..35bf6b18d87805254c0d5589ed1fec538cdb6a53 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_06_SubLevelC/E/00/HQJMDLMLM7NW8N8URFSWA0.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_06_SubLevelC/E/9S/3BPY3YMOLRY65O2OKX495Z.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_06_SubLevelC/E/9S/3BPY3YMOLRY65O2OKX495Z.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e1f5f487fd0af7bf8f58f64ca282ea62864e7bba Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_06_SubLevelC/E/9S/3BPY3YMOLRY65O2OKX495Z.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/0/LN/TFXHV33OQQSOZFW4UHFHV5.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/0/LN/TFXHV33OQQSOZFW4UHFHV5.uasset new file mode 100644 index 0000000000000000000000000000000000000000..7f15fdc1b5e21779bef8fbb88a0547cc49f4160e Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/0/LN/TFXHV33OQQSOZFW4UHFHV5.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/1/J1/YO7B50K2HR4BG3T1HP8C3C.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/1/J1/YO7B50K2HR4BG3T1HP8C3C.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2c3441e764d5d7031756f77b6dc68959323adfdc Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/1/J1/YO7B50K2HR4BG3T1HP8C3C.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/2/68/RX11CWIW0YTSLPD04EX1N0.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/2/68/RX11CWIW0YTSLPD04EX1N0.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e1211091ecc4210e554dae262513d4779147d3a8 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/2/68/RX11CWIW0YTSLPD04EX1N0.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/86/B1IQX11MFKG9XW15ETOP9M.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/86/B1IQX11MFKG9XW15ETOP9M.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c48b5017d61d090e98fc07f8897aa09c9a962d54 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/86/B1IQX11MFKG9XW15ETOP9M.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/MO/Y8QV1QFJTZ00U2998WLKXO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/MO/Y8QV1QFJTZ00U2998WLKXO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..6d12853e53967679d8f143e3f14fd8c9c8470095 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/MO/Y8QV1QFJTZ00U2998WLKXO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/UF/OD3UKJHHFOVDCIXYFPHPYH.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/UF/OD3UKJHHFOVDCIXYFPHPYH.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b515288e7d835e7ce9b6cc3ac3defc365aeb955a Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/UF/OD3UKJHHFOVDCIXYFPHPYH.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/W4/CMKIH64RQJFAK10GWU99XY.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/W4/CMKIH64RQJFAK10GWU99XY.uasset new file mode 100644 index 0000000000000000000000000000000000000000..aade59285b7747522e6a739590eb49902d8b14ea Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/3/W4/CMKIH64RQJFAK10GWU99XY.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/7/91/RY0336S1Y7RLUTSTM0RKZ0.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/7/91/RY0336S1Y7RLUTSTM0RKZ0.uasset new file mode 100644 index 0000000000000000000000000000000000000000..fb62e09bb6ffef847ffef793fc96e1002a5c06f9 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/7/91/RY0336S1Y7RLUTSTM0RKZ0.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/7/B6/8R0ZBXMY3RLI5D7REKITKP.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/7/B6/8R0ZBXMY3RLI5D7REKITKP.uasset new file mode 100644 index 0000000000000000000000000000000000000000..52cd54e3f45314390291b95835040ff0ec05561b Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/7/B6/8R0ZBXMY3RLI5D7REKITKP.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/8/7S/K68DCSNQNJUO64IERE4KML.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/8/7S/K68DCSNQNJUO64IERE4KML.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c00070ab32292175c4acf077cb1404b5ddfe5717 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/8/7S/K68DCSNQNJUO64IERE4KML.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/9/U3/QJ546EAV5I2ZZ3D63R04S5.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/9/U3/QJ546EAV5I2ZZ3D63R04S5.uasset new file mode 100644 index 0000000000000000000000000000000000000000..24dd651f5a05cf48e7249a3eec4fd6d5fa84b570 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/9/U3/QJ546EAV5I2ZZ3D63R04S5.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/9/ZH/SP24H75KND1RMO2R4V2OXO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/9/ZH/SP24H75KND1RMO2R4V2OXO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..300b7ac0435b413b20d3e6da89c01fb768cd5019 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/9/ZH/SP24H75KND1RMO2R4V2OXO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/A/BG/VVUX2ER4639K45TH2TTZW7.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/A/BG/VVUX2ER4639K45TH2TTZW7.uasset new file mode 100644 index 0000000000000000000000000000000000000000..bb79d8622c7795dd7b7c23e9961120c9f77e236d Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/A/BG/VVUX2ER4639K45TH2TTZW7.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/B/O4/R2U3DW1OK2DVQSTUU7QCUA.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/B/O4/R2U3DW1OK2DVQSTUU7QCUA.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9cb59f04c5e993a929c27193beb3c4354ffc56f4 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/B/O4/R2U3DW1OK2DVQSTUU7QCUA.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/B/O7/UEATAY8PHPXP1W1CR74UUQ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/B/O7/UEATAY8PHPXP1W1CR74UUQ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1cf6b4e43ce04d4764d2ee77be6f816aa98ffbc6 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/B/O7/UEATAY8PHPXP1W1CR74UUQ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/D/9W/GOVESDY5EHDFPQ92C6FC96.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/D/9W/GOVESDY5EHDFPQ92C6FC96.uasset new file mode 100644 index 0000000000000000000000000000000000000000..6b25b12bc6ce83fef1e4a7b3662b21b2bab54d8d Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/D/9W/GOVESDY5EHDFPQ92C6FC96.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/D/UD/LY3A939Q6HSP53XLREFMKF.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/D/UD/LY3A939Q6HSP53XLREFMKF.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4ef3743e38d110ebe5a00982071d3178bdf0ddef Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/D/UD/LY3A939Q6HSP53XLREFMKF.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/E/37/ROQ1VO1K04IQLGDEOF6TMR.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/E/37/ROQ1VO1K04IQLGDEOF6TMR.uasset new file mode 100644 index 0000000000000000000000000000000000000000..dde47853741d1de6b69f76271e0fc2bca5ea211b Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_001/E/37/ROQ1VO1K04IQLGDEOF6TMR.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/0/2V/XZTLWSKPLMONXNX6VHOVVH.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/0/2V/XZTLWSKPLMONXNX6VHOVVH.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8ef3029e543052e190f7249bf7ddc5148eac52e8 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/0/2V/XZTLWSKPLMONXNX6VHOVVH.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/0/BD/HV1JEN7YLAPCTBYLVFZCML.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/0/BD/HV1JEN7YLAPCTBYLVFZCML.uasset new file mode 100644 index 0000000000000000000000000000000000000000..85f8a877ee64b11cc5a878e3f940ee7243634553 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/0/BD/HV1JEN7YLAPCTBYLVFZCML.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/0/O8/USO96ZZQ8ZT96QIKWEBMZ3.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/0/O8/USO96ZZQ8ZT96QIKWEBMZ3.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1ef5d85d7053324421e4821048a456ac98347ee7 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/0/O8/USO96ZZQ8ZT96QIKWEBMZ3.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/1/1A/CFYEOOCCFV0DLG5V8DGHA1.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/1/1A/CFYEOOCCFV0DLG5V8DGHA1.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ff708cc6a586f43668165bb1a7f474249331a303 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/1/1A/CFYEOOCCFV0DLG5V8DGHA1.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/1/I4/RSZY1E29S6LYYD9FQVY83Y.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/1/I4/RSZY1E29S6LYYD9FQVY83Y.uasset new file mode 100644 index 0000000000000000000000000000000000000000..696a8a8aef5de7db2a5102edd871dc8e4d5d33bd Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/1/I4/RSZY1E29S6LYYD9FQVY83Y.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/2/G2/W1U4YFLBT1N132852M5GRZ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/2/G2/W1U4YFLBT1N132852M5GRZ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..74a47336e5672b3cd4d3e4e366369be0fda7459e Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/2/G2/W1U4YFLBT1N132852M5GRZ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/2/NF/C0SIR4C8J2HRSCO06HXUPM.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/2/NF/C0SIR4C8J2HRSCO06HXUPM.uasset new file mode 100644 index 0000000000000000000000000000000000000000..250f22ba906d6836dc3a79e11fa25b42670bff3c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/2/NF/C0SIR4C8J2HRSCO06HXUPM.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/2/UT/T9HK92U04D34C30PR7Z0K0.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/2/UT/T9HK92U04D34C30PR7Z0K0.uasset new file mode 100644 index 0000000000000000000000000000000000000000..a0fc1191ba3b80739d4bacfa4af6cd549979ef93 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/2/UT/T9HK92U04D34C30PR7Z0K0.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/3/BY/13Q1M1HIWQMM7CI5RIQM6I.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/3/BY/13Q1M1HIWQMM7CI5RIQM6I.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c5fd68fd7a01f6d33c5815052085c6d8a428f17f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/3/BY/13Q1M1HIWQMM7CI5RIQM6I.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/3/M4/1UZFY3W7AYO8H4XE6RPV4C.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/3/M4/1UZFY3W7AYO8H4XE6RPV4C.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8fce4e63ef0bcfb93d8b8e7ed7f662a8492ca9c1 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/3/M4/1UZFY3W7AYO8H4XE6RPV4C.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/3/V4/SV3H2ZOTA00TVLN5005NZU.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/3/V4/SV3H2ZOTA00TVLN5005NZU.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8d3153073906e8a2dc6e155139bff7e4d8d92542 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/3/V4/SV3H2ZOTA00TVLN5005NZU.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/4/Y7/ZEPMCOXRUU2G7SXJ6BTKMH.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/4/Y7/ZEPMCOXRUU2G7SXJ6BTKMH.uasset new file mode 100644 index 0000000000000000000000000000000000000000..f96db45d8ea9f720a9bf347f2bf85f3e837e1592 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/4/Y7/ZEPMCOXRUU2G7SXJ6BTKMH.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/5/L5/NU5WE4U1VA60X5H7O8SNWO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/5/L5/NU5WE4U1VA60X5H7O8SNWO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..075dca005d59b9e5ed9db6171314482c16f27a3b Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/5/L5/NU5WE4U1VA60X5H7O8SNWO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/5/RV/A21L0Q1O1KJG3U4IHDB5NQ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/5/RV/A21L0Q1O1KJG3U4IHDB5NQ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..f6c031169d7efb77c956d5d93bc3c8c0a56b3086 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/5/RV/A21L0Q1O1KJG3U4IHDB5NQ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/5/ZH/4CYKMQQZ8NA9EI69X903L8.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/5/ZH/4CYKMQQZ8NA9EI69X903L8.uasset new file mode 100644 index 0000000000000000000000000000000000000000..dcb4463e4b51dbb7e426b20c46e0ad0a9c0d9ad6 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/5/ZH/4CYKMQQZ8NA9EI69X903L8.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/6/9I/YFZ5G8GWPIH5Q23GRFEP1R.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/6/9I/YFZ5G8GWPIH5Q23GRFEP1R.uasset new file mode 100644 index 0000000000000000000000000000000000000000..eb705f031966e225278f0c29f57b3edd0c799302 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/6/9I/YFZ5G8GWPIH5Q23GRFEP1R.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/6/BX/WZPWV8J9XKNSN9BOLD94UJ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/6/BX/WZPWV8J9XKNSN9BOLD94UJ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..6a3be219ea6befc45bed187c5a2667072ca82a81 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/6/BX/WZPWV8J9XKNSN9BOLD94UJ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/6/GU/SNAT1OHQSIG3IOMU245FI0.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/6/GU/SNAT1OHQSIG3IOMU245FI0.uasset new file mode 100644 index 0000000000000000000000000000000000000000..834b464dd7ce18a84741e66fb8d6dd445758c6c8 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/6/GU/SNAT1OHQSIG3IOMU245FI0.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/7/6A/JY4GNPU8SG3GEVO1Z6YQUJ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/7/6A/JY4GNPU8SG3GEVO1Z6YQUJ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9fb22571b45b8e5e53671570d2432d5b65c2f554 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/7/6A/JY4GNPU8SG3GEVO1Z6YQUJ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/7/JQ/M27CR7LGIALU5DWF3CF5T0.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/7/JQ/M27CR7LGIALU5DWF3CF5T0.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8f94e8ccde0faeb5cf0938882281ff908439c9df Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/7/JQ/M27CR7LGIALU5DWF3CF5T0.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/7/LB/FFE21MS2MGSUI6D9E5R76K.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/7/LB/FFE21MS2MGSUI6D9E5R76K.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0c0a77560438019ae5018200b21103f40e0629c4 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/7/LB/FFE21MS2MGSUI6D9E5R76K.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/8/GI/UILKJ2G5S2WRFBKXM0JNPK.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/8/GI/UILKJ2G5S2WRFBKXM0JNPK.uasset new file mode 100644 index 0000000000000000000000000000000000000000..3aef7083c2e0a496556ddf933742907bc21ddcd8 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/8/GI/UILKJ2G5S2WRFBKXM0JNPK.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/8/PQ/WIAE9FC36OKLXIJX18P556.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/8/PQ/WIAE9FC36OKLXIJX18P556.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8dce1958f0a0ad204a8dbf974922ba0deef42a14 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/8/PQ/WIAE9FC36OKLXIJX18P556.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/8/XD/86JWT5RCD8C5WM6646A1N9.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/8/XD/86JWT5RCD8C5WM6646A1N9.uasset new file mode 100644 index 0000000000000000000000000000000000000000..fd77e06f0e3a74285f8c7415e03f8b635449a99c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/8/XD/86JWT5RCD8C5WM6646A1N9.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/9/4P/2XI6L9VK4L6DWY2HJQZDCZ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/9/4P/2XI6L9VK4L6DWY2HJQZDCZ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..66ad30efd9266893e02e5de1a9c12f99c65152c4 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/9/4P/2XI6L9VK4L6DWY2HJQZDCZ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/9/EK/6ISFH0E45KIGCNGWKO2SG6.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/9/EK/6ISFH0E45KIGCNGWKO2SG6.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0d700ff54b7817edc9256313ec959aa07a7b55dd Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/9/EK/6ISFH0E45KIGCNGWKO2SG6.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/9/HC/L460ZZYL4A7KZI0P6YZ3X5.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/9/HC/L460ZZYL4A7KZI0P6YZ3X5.uasset new file mode 100644 index 0000000000000000000000000000000000000000..80c1350e8590765e741eec64f19fd28837f916c3 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/9/HC/L460ZZYL4A7KZI0P6YZ3X5.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/A/4G/MMOMK7N8OCXZQ6HACXFKWW.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/A/4G/MMOMK7N8OCXZQ6HACXFKWW.uasset new file mode 100644 index 0000000000000000000000000000000000000000..278f3417cc7acde273fd6cf88f1d22f4df76dd04 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/A/4G/MMOMK7N8OCXZQ6HACXFKWW.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/A/5N/AU6XON79MU23PFB3OV8ETB.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/A/5N/AU6XON79MU23PFB3OV8ETB.uasset new file mode 100644 index 0000000000000000000000000000000000000000..020321c491dcfa35ce23b6d56613d9301cb210a9 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/A/5N/AU6XON79MU23PFB3OV8ETB.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/A/RD/UIGHD0C5P9MD7LQS9YJHWG.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/A/RD/UIGHD0C5P9MD7LQS9YJHWG.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0001b3b10302b5339ea52d8d043e2d542d081a44 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/A/RD/UIGHD0C5P9MD7LQS9YJHWG.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/AO/KHEA33MOZUP9V8QKF9UD3Z.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/AO/KHEA33MOZUP9V8QKF9UD3Z.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b7df24fc2a66aaeb33246f6405f9f47d6514354d Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/AO/KHEA33MOZUP9V8QKF9UD3Z.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/HZ/PB1BFW5H932JXMFMB0S4MJ.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/HZ/PB1BFW5H932JXMFMB0S4MJ.uasset new file mode 100644 index 0000000000000000000000000000000000000000..02548fa9086f0b5cb179c21f5df91bb7cd1a2b87 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/HZ/PB1BFW5H932JXMFMB0S4MJ.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/K0/0C0KJXJR5RU4VKVGOV4OHG.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/K0/0C0KJXJR5RU4VKVGOV4OHG.uasset new file mode 100644 index 0000000000000000000000000000000000000000..6d0407a4eb18a29e75c2f31ebe5f125540e5d414 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/K0/0C0KJXJR5RU4VKVGOV4OHG.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/KI/HEFPDZZZZ1OAWS0L7XH8D0.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/KI/HEFPDZZZZ1OAWS0L7XH8D0.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0315f931ca52ef64d70244967de1a99e57b851b5 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/KI/HEFPDZZZZ1OAWS0L7XH8D0.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/ME/5LYTLWF651O9P6ETHHM1U3.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/ME/5LYTLWF651O9P6ETHHM1U3.uasset new file mode 100644 index 0000000000000000000000000000000000000000..1e918762a4971b87d0f950b3fc3b4ec174f97138 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/ME/5LYTLWF651O9P6ETHHM1U3.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/PF/P37CWT4QYJ9JTQCF5IHKF1.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/PF/P37CWT4QYJ9JTQCF5IHKF1.uasset new file mode 100644 index 0000000000000000000000000000000000000000..19c296c1b209b821c353c39bcee6bd07f84c96f4 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/B/PF/P37CWT4QYJ9JTQCF5IHKF1.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/D/2W/AUIZ9BXOQUFW42MQU89A6O.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/D/2W/AUIZ9BXOQUFW42MQU89A6O.uasset new file mode 100644 index 0000000000000000000000000000000000000000..634ee7408d5466293bb4437526311468fc3799ac Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/D/2W/AUIZ9BXOQUFW42MQU89A6O.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/D/CH/PF02ZHORGUXYIHQ9UL7UOB.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/D/CH/PF02ZHORGUXYIHQ9UL7UOB.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8c4bcc4fd673a77cb2e0adc3fc451ea4a2a20eed Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/D/CH/PF02ZHORGUXYIHQ9UL7UOB.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/D/F4/I76M8JO4F4NR7CPRE138FS.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/D/F4/I76M8JO4F4NR7CPRE138FS.uasset new file mode 100644 index 0000000000000000000000000000000000000000..6aadef555bd9b318194758e8973f73056e611233 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/D/F4/I76M8JO4F4NR7CPRE138FS.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/4E/5EX1KYT4KOG75QRAMU6G4U.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/4E/5EX1KYT4KOG75QRAMU6G4U.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b749274e953877341a08141eb6683666cc243fe7 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/4E/5EX1KYT4KOG75QRAMU6G4U.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/92/E0HWBM4N7YXV1TT1CSN7QS.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/92/E0HWBM4N7YXV1TT1CSN7QS.uasset new file mode 100644 index 0000000000000000000000000000000000000000..efb1bdc21acb74ed61b560f14ebe1e1a65f47ed3 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/92/E0HWBM4N7YXV1TT1CSN7QS.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/N9/78FG5KJOO5AUE4WXXZKQLM.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/N9/78FG5KJOO5AUE4WXXZKQLM.uasset new file mode 100644 index 0000000000000000000000000000000000000000..72778720b1c7a19fb7799a78d9011e7829d7c15e Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/N9/78FG5KJOO5AUE4WXXZKQLM.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/QX/0RDG6OHNMR62G2SZHVLDE7.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/QX/0RDG6OHNMR62G2SZHVLDE7.uasset new file mode 100644 index 0000000000000000000000000000000000000000..40f6f19f47fc74880826d6315ed37aa90487084c Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_L_002/E/QX/0RDG6OHNMR62G2SZHVLDE7.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/0/D4/X74BG7Z1ZDMS4TWVKL4K77.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/0/D4/X74BG7Z1ZDMS4TWVKL4K77.uasset new file mode 100644 index 0000000000000000000000000000000000000000..49521ae9e4986a99724b963621e6af74d5c434fb Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/0/D4/X74BG7Z1ZDMS4TWVKL4K77.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/0/MP/8HCQS4B9OH60QCTV9D2CXR.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/0/MP/8HCQS4B9OH60QCTV9D2CXR.uasset new file mode 100644 index 0000000000000000000000000000000000000000..5c58d87f5b7d25177e1315a19cc67728ce2ade65 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/0/MP/8HCQS4B9OH60QCTV9D2CXR.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/0/YN/UJIFJG7KE64G5EC8A1A0PO.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/0/YN/UJIFJG7KE64G5EC8A1A0PO.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4fdc2ea2696876381068f965145b2bbaca8eccae Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/0/YN/UJIFJG7KE64G5EC8A1A0PO.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/1Q/J73COWF4CYOZ1I4DE9LH7X.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/1Q/J73COWF4CYOZ1I4DE9LH7X.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c33bd105ab4e3a5816eb959e1d249eaca8db55d7 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/1Q/J73COWF4CYOZ1I4DE9LH7X.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/1S/IESIPYM9DR46RV2PHGDXNY.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/1S/IESIPYM9DR46RV2PHGDXNY.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2420a29cfc06005c82c03bceafb201222e17c1e0 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/1S/IESIPYM9DR46RV2PHGDXNY.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/6Q/AZ7EVGAE5GXAOZTMWZAI4J.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/6Q/AZ7EVGAE5GXAOZTMWZAI4J.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ca00caf2a944d9cd0d8075bc17fba61b96df0dbc Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/6Q/AZ7EVGAE5GXAOZTMWZAI4J.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/HG/ZEREBE5X2F5HU544KMTTIX.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/HG/ZEREBE5X2F5HU544KMTTIX.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8e309283bb865f3f55a613485a0b30e5e1a08b23 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/HG/ZEREBE5X2F5HU544KMTTIX.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/ZL/QC3PGS9YUVRD9ZJ3OQJNQ7.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/ZL/QC3PGS9YUVRD9ZJ3OQJNQ7.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2a742405c3e5c07142b806ccdd80cd60f4c64ca7 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/1/ZL/QC3PGS9YUVRD9ZJ3OQJNQ7.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/2/2F/WBOONVHZTKEXD6DOKCBHJ5.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/2/2F/WBOONVHZTKEXD6DOKCBHJ5.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8189a91b852eca185bbf13afb619131d01770476 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/2/2F/WBOONVHZTKEXD6DOKCBHJ5.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/2/OJ/WD7HSOT6AWCJET4UOZVIUA.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/2/OJ/WD7HSOT6AWCJET4UOZVIUA.uasset new file mode 100644 index 0000000000000000000000000000000000000000..591d07ebffb2b4dd82e6fcbb9eb4295fb4d0b4b7 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/2/OJ/WD7HSOT6AWCJET4UOZVIUA.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/2/VD/AOX8FWBD7A6WNPDHHP7321.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/2/VD/AOX8FWBD7A6WNPDHHP7321.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ed93f48ef4cf64ded080e06fe05df3e878f0c2c3 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/2/VD/AOX8FWBD7A6WNPDHHP7321.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/7M/XL54SGOF0RYAHTWGIYUAXE.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/7M/XL54SGOF0RYAHTWGIYUAXE.uasset new file mode 100644 index 0000000000000000000000000000000000000000..e6ec8bd174c86afca286f6105f1866f0b4d8fbb1 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/7M/XL54SGOF0RYAHTWGIYUAXE.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/8K/PNHYJIWSCR4OUNQ7WV15WW.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/8K/PNHYJIWSCR4OUNQ7WV15WW.uasset new file mode 100644 index 0000000000000000000000000000000000000000..d83042544b59e2541576daa7088becbdbddc35b8 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/8K/PNHYJIWSCR4OUNQ7WV15WW.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/I8/I259V28CU77H6KXPXMRYNI.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/I8/I259V28CU77H6KXPXMRYNI.uasset new file mode 100644 index 0000000000000000000000000000000000000000..8aa44809f1af3f86053de3bac14f2580da0489f1 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/I8/I259V28CU77H6KXPXMRYNI.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/UM/XPF2CUJSI9WLVEHVW2NFOT.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/UM/XPF2CUJSI9WLVEHVW2NFOT.uasset new file mode 100644 index 0000000000000000000000000000000000000000..09a1405570a6d6fcf08c37759ffea215708154d0 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/3/UM/XPF2CUJSI9WLVEHVW2NFOT.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/6A/LDL3Q953H5Z66B7T9EQ714.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/6A/LDL3Q953H5Z66B7T9EQ714.uasset new file mode 100644 index 0000000000000000000000000000000000000000..33e5c2baaca2f3fe874ecff583009cc522c25ba6 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/6A/LDL3Q953H5Z66B7T9EQ714.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/DC/W49SZ6ZMROQ3DPZOK85WIB.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/DC/W49SZ6ZMROQ3DPZOK85WIB.uasset new file mode 100644 index 0000000000000000000000000000000000000000..02fc9a3f17a6b289c348df2e25f832b88ca22408 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/DC/W49SZ6ZMROQ3DPZOK85WIB.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/HS/HLQLSI2DW176937QX4DMQF.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/HS/HLQLSI2DW176937QX4DMQF.uasset new file mode 100644 index 0000000000000000000000000000000000000000..f3ae7bba63fad4745d8d0fccc22c8c7b5d87387f Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/HS/HLQLSI2DW176937QX4DMQF.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/OS/YAOB4AXWXZ6T2HA7ZJURLT.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/OS/YAOB4AXWXZ6T2HA7ZJURLT.uasset new file mode 100644 index 0000000000000000000000000000000000000000..f228020a17292550610003ec64a6d942fc5dc018 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/4/OS/YAOB4AXWXZ6T2HA7ZJURLT.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/5/1E/9EM9E8FBUNIIABAXOSIOXE.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/5/1E/9EM9E8FBUNIIABAXOSIOXE.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4579bf8820ab44ea1a0b72a189d760dd593ffdaf Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/5/1E/9EM9E8FBUNIIABAXOSIOXE.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/5/F8/UMZ7ZQJPKVLWNRCDQAAIV9.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/5/F8/UMZ7ZQJPKVLWNRCDQAAIV9.uasset new file mode 100644 index 0000000000000000000000000000000000000000..2cfa37c6a20c56c117dfc104dab42ef921dd8702 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/5/F8/UMZ7ZQJPKVLWNRCDQAAIV9.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/6/JT/K8IUZM4LZRNAV0CDYZENS1.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/6/JT/K8IUZM4LZRNAV0CDYZENS1.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c094431dbd77ecb20db7b9af5a1413e8a38387a8 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/6/JT/K8IUZM4LZRNAV0CDYZENS1.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/6/W7/PKXRY973P40J9M7BMOIKUF.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/6/W7/PKXRY973P40J9M7BMOIKUF.uasset new file mode 100644 index 0000000000000000000000000000000000000000..04a08e67e983127763594286597498642f4f7ad0 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/6/W7/PKXRY973P40J9M7BMOIKUF.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/6W/NVYUTV5EOAC35JR72SZCBC.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/6W/NVYUTV5EOAC35JR72SZCBC.uasset new file mode 100644 index 0000000000000000000000000000000000000000..900a89562094485a586a1ae27b3572a199e5f5ea Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/6W/NVYUTV5EOAC35JR72SZCBC.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/CX/N2DKN39VRPL3NHHDJLNIQC.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/CX/N2DKN39VRPL3NHHDJLNIQC.uasset new file mode 100644 index 0000000000000000000000000000000000000000..7ba1343e5831faab81dc5a743bc6a85a4daa0c15 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/CX/N2DKN39VRPL3NHHDJLNIQC.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/HU/MURF8DNCAW6TLD8VVJWRWM.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/HU/MURF8DNCAW6TLD8VVJWRWM.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0828f5923f28182e1b34c06116d5e88fe0269520 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/HU/MURF8DNCAW6TLD8VVJWRWM.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/S7/EIX2K4V5FO7CLPAM678RIY.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/S7/EIX2K4V5FO7CLPAM678RIY.uasset new file mode 100644 index 0000000000000000000000000000000000000000..ad58eb0ecc5457e1f2120c0135162f36b7091e74 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/8/S7/EIX2K4V5FO7CLPAM678RIY.uasset differ diff --git a/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/9/OU/077GQD2MFLEZCMU5HL8TI4.uasset b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/9/OU/077GQD2MFLEZCMU5HL8TI4.uasset new file mode 100644 index 0000000000000000000000000000000000000000..0d67eeba07578fbf7cfaeee4cbbd039db3d9a877 Binary files /dev/null and b/StackOBot/Content/__ExternalActors__/StackOBot/Maps/LevelInstances/LI_Island_M_001/9/OU/077GQD2MFLEZCMU5HL8TI4.uasset differ