From 9b50b548e4f5c2e017b7084618ad05a96af43cfd Mon Sep 17 00:00:00 2001 From: GageM Date: Thu, 29 Feb 2024 14:03:55 -0500 Subject: [PATCH 1/4] - Made some changes to the level for clarity based off Alexander's advice. (This should be overwriiten by anyone working on the level) - Made the exploding body character ragdoll on split --- .../GingerbreadMan/GBM_Body_PhysicsAsset.uasset | 4 ++-- .../GingerbreadMan/GingerbreadMan_PhysicsAsset.uasset | 4 ++-- Content/Unbread/Core/Character/BP_ExplodingBody.uasset | 4 ++-- Content/Unbread/Maps/CoreLevelTest.umap | 4 ++-- Source/unbread/Private/SCharacter.cpp | 8 ++++++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Content/Unbread/Art/Characters/GingerbreadMan/GBM_Body_PhysicsAsset.uasset b/Content/Unbread/Art/Characters/GingerbreadMan/GBM_Body_PhysicsAsset.uasset index eed0d9d6..fb948861 100644 --- a/Content/Unbread/Art/Characters/GingerbreadMan/GBM_Body_PhysicsAsset.uasset +++ b/Content/Unbread/Art/Characters/GingerbreadMan/GBM_Body_PhysicsAsset.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4cf6393ce923e4f57eee733a2a66c430a0cfa3a60d384d74d5cc90599ceb21af -size 11984 +oid sha256:68094b72180cdb2c386a78b80287e3794a91a962bb3479bfebb843943e8d8b16 +size 16593 diff --git a/Content/Unbread/Art/Characters/GingerbreadMan/GingerbreadMan_PhysicsAsset.uasset b/Content/Unbread/Art/Characters/GingerbreadMan/GingerbreadMan_PhysicsAsset.uasset index 9f883e08..0c68553b 100644 --- a/Content/Unbread/Art/Characters/GingerbreadMan/GingerbreadMan_PhysicsAsset.uasset +++ b/Content/Unbread/Art/Characters/GingerbreadMan/GingerbreadMan_PhysicsAsset.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4b8261929d4b714a8b95ba49a2f4d4c7d5322d49556b565d2cee8f90856747e5 -size 13839 +oid sha256:6df961baa0cc00edd3d0f2e616d6557f7e51d6d686bd44894eff23bcf0fc6a29 +size 14058 diff --git a/Content/Unbread/Core/Character/BP_ExplodingBody.uasset b/Content/Unbread/Core/Character/BP_ExplodingBody.uasset index 6e48efd6..a08ec559 100644 --- a/Content/Unbread/Core/Character/BP_ExplodingBody.uasset +++ b/Content/Unbread/Core/Character/BP_ExplodingBody.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5fabcd3914cee8e8946d0e348bbe15379859365e2838475b31705605c056a556 -size 35013 +oid sha256:67a5e0cc069108ad3159dbb4a37a4921aef47e1548529cbc98481b1baaedf820 +size 36646 diff --git a/Content/Unbread/Maps/CoreLevelTest.umap b/Content/Unbread/Maps/CoreLevelTest.umap index b01b2e14..399d50e3 100644 --- a/Content/Unbread/Maps/CoreLevelTest.umap +++ b/Content/Unbread/Maps/CoreLevelTest.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:12a3a3256f8c54812b3bb109e99c1f9c019077605c68eb1370ce286b3d0998cc -size 556682 +oid sha256:a5c4e83f5e4659f3ae878a23ef9c0291214990a39fe4cbcfdd7f8c4adfc3fd8c +size 561455 diff --git a/Source/unbread/Private/SCharacter.cpp b/Source/unbread/Private/SCharacter.cpp index 144c96c8..c5309677 100644 --- a/Source/unbread/Private/SCharacter.cpp +++ b/Source/unbread/Private/SCharacter.cpp @@ -217,7 +217,7 @@ void ASCharacter::LaunchHead() bIsHeadForm = true; // Store the current location and rotation of the character - const FVector BodySpawnLocation = GetMesh()->GetComponentLocation(); + const FVector BodySpawnLocation = GetMesh()->GetComponentLocation() + FVector(0.f, 0.f, 50.f); const FRotator BodySpawnRotation = GetMesh()->GetComponentRotation(); // Swap the mesh and launch the head @@ -234,7 +234,11 @@ void ASCharacter::LaunchHead() GetCharacterMovement()->Velocity = LaunchVelocity; // Spawn the body and add it to ActiveBodies - ActiveBodies.AddUnique(GetWorld()->SpawnActor(BodyClass, BodySpawnLocation, BodySpawnRotation)); + FActorSpawnParameters Parameters {}; + Parameters.bNoFail = true; + auto Spawned = GetWorld()->SpawnActor(BodyClass, BodySpawnLocation, BodySpawnRotation, Parameters); + Spawned->Mesh->AddImpulse(-GetMesh()->GetRightVector() * 10 * HeadLaunchVelocityMultiplier); + ActiveBodies.AddUnique(Spawned); } From 5db39f6838da8389ca5ca62db9ef6524011d7fb8 Mon Sep 17 00:00:00 2001 From: GageM Date: Thu, 29 Feb 2024 17:46:19 -0500 Subject: [PATCH 2/4] - Did some work on the core level - Adjusted the Exploding body explosion - Added a new control system that uses only the left stick/WASD - Crumbles now use the IInteract interface --- .../Art/Environment_Assets/Display_1.uasset | 3 ++ .../Art/Environment_Assets/SM_Sink.uasset | 4 +-- Content/Unbread/Art/Props/SM_Cake1.uasset | 4 +-- Content/Unbread/Art/Props/SM_Cake2.uasset | 4 +-- .../Art/Props/SM_Cake_Rectangle2.uasset | 4 +-- .../Core/Character/BP_ExplodingBody.uasset | 4 +-- Content/Unbread/Maps/CoreLevelTest.umap | 4 +-- Source/unbread/Private/AIManager.cpp | 2 +- Source/unbread/Private/SCharacter.cpp | 25 +++++++++++++++- Source/unbread/Private/SCrumbles.cpp | 5 +++- Source/unbread/Private/SExplodingBody.cpp | 29 ++++++++++--------- Source/unbread/Private/SRespawnGameMode.cpp | 2 +- Source/unbread/Public/SCharacter.h | 3 ++ Source/unbread/Public/SCrumbles.h | 3 ++ Source/unbread/Public/SExplodingBody.h | 4 +-- 15 files changed, 69 insertions(+), 31 deletions(-) create mode 100644 Content/Unbread/Art/Environment_Assets/Display_1.uasset diff --git a/Content/Unbread/Art/Environment_Assets/Display_1.uasset b/Content/Unbread/Art/Environment_Assets/Display_1.uasset new file mode 100644 index 00000000..232a48ef --- /dev/null +++ b/Content/Unbread/Art/Environment_Assets/Display_1.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45bcdae0494d763f273c8327e979ab5d6897db6d9b77053bd2394de246031b64 +size 39678 diff --git a/Content/Unbread/Art/Environment_Assets/SM_Sink.uasset b/Content/Unbread/Art/Environment_Assets/SM_Sink.uasset index 8a7b3d5b..5dccb456 100644 --- a/Content/Unbread/Art/Environment_Assets/SM_Sink.uasset +++ b/Content/Unbread/Art/Environment_Assets/SM_Sink.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f91739686a996c0935081c72fed1daf251f9874c96818c06df7fcb53fdc9e5d5 -size 85094 +oid sha256:bbbf7d89cfb5536b4f9c04984476a51ed111f368af6117b60549838877694604 +size 85502 diff --git a/Content/Unbread/Art/Props/SM_Cake1.uasset b/Content/Unbread/Art/Props/SM_Cake1.uasset index 73214523..856ef742 100644 --- a/Content/Unbread/Art/Props/SM_Cake1.uasset +++ b/Content/Unbread/Art/Props/SM_Cake1.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9b5c3b87fa4d67b2fdedfc337503519223c735e053fcb795b1fdd90f255ca894 -size 833155 +oid sha256:06f067f49cb696694db49b28b2b0eb5e7c50e532cce2c48327986b36df72f2a2 +size 833703 diff --git a/Content/Unbread/Art/Props/SM_Cake2.uasset b/Content/Unbread/Art/Props/SM_Cake2.uasset index 53c598cf..95a68739 100644 --- a/Content/Unbread/Art/Props/SM_Cake2.uasset +++ b/Content/Unbread/Art/Props/SM_Cake2.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:857058f4d7b6d59cb415d442ad085cfa544bf9efe2d3e946cec8b10dcb527a2c -size 840413 +oid sha256:7b7a4d2fc39246e93a8dea5f53a2c8457e2ac3e7c1c3fb36ae99d46db6760797 +size 840198 diff --git a/Content/Unbread/Art/Props/SM_Cake_Rectangle2.uasset b/Content/Unbread/Art/Props/SM_Cake_Rectangle2.uasset index e77a1018..9ff89656 100644 --- a/Content/Unbread/Art/Props/SM_Cake_Rectangle2.uasset +++ b/Content/Unbread/Art/Props/SM_Cake_Rectangle2.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c1cae39e39b382ad101d0d6ccce36a7283460d1564f2a4233cd5fba91f0f4d0a -size 293260 +oid sha256:5a8f503977b380b016aa6fb3134b3a3f30564f447b11deb4f9256f37ab6d8295 +size 291911 diff --git a/Content/Unbread/Core/Character/BP_ExplodingBody.uasset b/Content/Unbread/Core/Character/BP_ExplodingBody.uasset index a08ec559..7209112b 100644 --- a/Content/Unbread/Core/Character/BP_ExplodingBody.uasset +++ b/Content/Unbread/Core/Character/BP_ExplodingBody.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:67a5e0cc069108ad3159dbb4a37a4921aef47e1548529cbc98481b1baaedf820 -size 36646 +oid sha256:7da2e94aa8c8a8579342869a9a22b3466a713f657e5110900e05b9879f358d78 +size 35419 diff --git a/Content/Unbread/Maps/CoreLevelTest.umap b/Content/Unbread/Maps/CoreLevelTest.umap index 399d50e3..2076abe3 100644 --- a/Content/Unbread/Maps/CoreLevelTest.umap +++ b/Content/Unbread/Maps/CoreLevelTest.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a5c4e83f5e4659f3ae878a23ef9c0291214990a39fe4cbcfdd7f8c4adfc3fd8c -size 561455 +oid sha256:6a267524aa82477a2d5be448ea95fa48739f4d09dd1489fb37e6d01200e80c33 +size 429169 diff --git a/Source/unbread/Private/AIManager.cpp b/Source/unbread/Private/AIManager.cpp index af95ad28..b1560f64 100644 --- a/Source/unbread/Private/AIManager.cpp +++ b/Source/unbread/Private/AIManager.cpp @@ -94,7 +94,7 @@ void AAIManager::NotifyAIState(EAIState state) { for(auto & Cntrl: Agents) { - Cntrl->BBC->SetValueAsEnum("AIState", (uint8_t)state); + Cntrl->BBC->SetValueAsEnum("AIState", StaticCast(state)); if(state == EAIState::Attack) { GetWorldTimerManager().ClearTimer(Cntrl->DetectionTimer); diff --git a/Source/unbread/Private/SCharacter.cpp b/Source/unbread/Private/SCharacter.cpp index c5309677..92527903 100644 --- a/Source/unbread/Private/SCharacter.cpp +++ b/Source/unbread/Private/SCharacter.cpp @@ -127,10 +127,28 @@ void ASCharacter::Move(const FInputActionValue& Value) // TODO: Update forward and right vectors according to camera position and rotation // // + + if(!bUseNewRotation) return; + + const FVector2D RotVector = Value.Get(); + + const float Angle = FMath::Atan2(RotVector.Y, RotVector.X) * (180.0f / PI); + + // Rotate the character relative to the current camera + FRotator CameraWorldRotation = DynamicCamera->CurrentCameraActor->GetComponentByClass()->GetComponentRotation(); + CameraWorldRotation.Roll = 0.f; + CameraWorldRotation.Pitch = 0.f; + const FRotator TargetRotation = UKismetMathLibrary::ComposeRotators(FRotator(0.0f, -1* Angle, 0.0f), CameraWorldRotation); + + FRotator LerpedRotation = FMath::Lerp(GetMesh()->GetComponentRotation(), TargetRotation, LerpSpeed); + + GetMesh()->SetWorldRotation(LerpedRotation); } void ASCharacter::Rotate(const FInputActionValue& Value) { + if(bUseNewRotation) return; + const FVector2D RotVector = Value.Get(); const float Angle = FMath::Atan2(RotVector.Y, RotVector.X) * (180.0f / PI); @@ -267,7 +285,12 @@ void ASCharacter::ReformBody() return; } - NearestCrumbles->Destroy(); + //NearestCrumbles->Destroy(); + + if(NearestCrumbles->GetClass()->ImplementsInterface(UInteractInterface::StaticClass())) + { + IInteractInterface::Execute_CrumbleInteraction(NearestCrumbles, this); + } NearestCrumbles = nullptr; bIsHeadForm = false; diff --git a/Source/unbread/Private/SCrumbles.cpp b/Source/unbread/Private/SCrumbles.cpp index 21301943..cba1775b 100644 --- a/Source/unbread/Private/SCrumbles.cpp +++ b/Source/unbread/Private/SCrumbles.cpp @@ -60,6 +60,9 @@ void ASCrumbles::Tick(float DeltaTime) void ASCrumbles::CrumbleInteraction_Implementation(AActor* InstigatingActor) { IInteractInterface::CrumbleInteraction_Implementation(InstigatingActor); - Destroy(); + if(bDestroyOnUse) + { + Destroy(); + } } diff --git a/Source/unbread/Private/SExplodingBody.cpp b/Source/unbread/Private/SExplodingBody.cpp index d478de74..7ea9ecdd 100644 --- a/Source/unbread/Private/SExplodingBody.cpp +++ b/Source/unbread/Private/SExplodingBody.cpp @@ -16,23 +16,23 @@ ASExplodingBody::ASExplodingBody() Root = CreateDefaultSubobject("RootComponent"); SetRootComponent(Root); + //Capsule = CreateDefaultSubobject("CapsuleComponent"); + //Capsule->SetupAttachment(Root); + //Capsule->SetRelativeLocation(FVector(0.f, 0.f, 88.f)); + //Capsule->SetCapsuleHalfHeight(88.f); + //Capsule->SetCapsuleRadius(34.f); + + Mesh = CreateDefaultSubobject("SkeletalMesh"); + Mesh->SetupAttachment(Root); + Mesh->SetRelativeScale3D(FVector(0.465f, 0.465f, 0.465f)); + Mesh->SetRelativeLocation(FVector(0.f, 0.f, 0.f)); + RadialForce = CreateDefaultSubobject("RadialForceComponent"); - RadialForce->SetupAttachment(Root); + RadialForce->SetupAttachment(Mesh); RadialForce->Radius = 200.f; RadialForce->ImpulseStrength = 1000.f; RadialForce->bImpulseVelChange = true; - Capsule = CreateDefaultSubobject("CapsuleComponent"); - Capsule->SetupAttachment(Root); - Capsule->SetRelativeLocation(FVector(0.f, 0.f, 88.f)); - Capsule->SetCapsuleHalfHeight(88.f); - Capsule->SetCapsuleRadius(34.f); - - Mesh = CreateDefaultSubobject("SkeletalMesh"); - Mesh->SetupAttachment(Capsule); - Mesh->SetRelativeScale3D(FVector(0.465f, 0.465f, 0.465f)); - Mesh->SetRelativeLocation(FVector(0.f, 0.f, -90.f)); - } // Called when the game starts or when spawned @@ -59,7 +59,10 @@ void ASExplodingBody::Explode() { RadialForce->FireImpulse(); const FActorSpawnParameters SpawnParameters; - GetWorld()->SpawnActor(CrumblesActor, Mesh->GetComponentLocation(), Mesh->GetComponentRotation(), SpawnParameters); + FRotator SpawnRotation = Mesh->GetComponentRotation(); + SpawnRotation.Pitch = 0.f; + SpawnRotation.Roll = 0.f; + GetWorld()->SpawnActor(CrumblesActor, Mesh->GetComponentLocation(), SpawnRotation, SpawnParameters); Destroy(); } diff --git a/Source/unbread/Private/SRespawnGameMode.cpp b/Source/unbread/Private/SRespawnGameMode.cpp index 0c072861..bbee1220 100644 --- a/Source/unbread/Private/SRespawnGameMode.cpp +++ b/Source/unbread/Private/SRespawnGameMode.cpp @@ -55,7 +55,7 @@ void ASRespawnGameMode::SpawnPlayer() void ASRespawnGameMode::RespawnPlayer(AActor* Destroyed) { - CurLives--; + //CurLives--; if (CheckLoss()) return; diff --git a/Source/unbread/Public/SCharacter.h b/Source/unbread/Public/SCharacter.h index 16e13325..c5f8ffe9 100644 --- a/Source/unbread/Public/SCharacter.h +++ b/Source/unbread/Public/SCharacter.h @@ -130,6 +130,9 @@ class UNBREAD_API ASCharacter : public ACharacter, public IDynamicCameraInterfac UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement") float LerpSpeed = 0.6f; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement") + bool bUseNewRotation = true; + // Splitting Variables UPROPERTY(EditAnywhere, BlueprintReadWrite) diff --git a/Source/unbread/Public/SCrumbles.h b/Source/unbread/Public/SCrumbles.h index ca407a08..6c35d24c 100644 --- a/Source/unbread/Public/SCrumbles.h +++ b/Source/unbread/Public/SCrumbles.h @@ -26,6 +26,9 @@ class UNBREAD_API ASCrumbles : public AActor, public IInteractInterface UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components") UBoxComponent* TriggerVolume; + UPROPERTY(EditAnywhere, BlueprintReadWrite) + bool bDestroyOnUse = true; + protected: // Called when the game starts or when spawned virtual void BeginPlay() override; diff --git a/Source/unbread/Public/SExplodingBody.h b/Source/unbread/Public/SExplodingBody.h index 1428d30e..76a8c027 100644 --- a/Source/unbread/Public/SExplodingBody.h +++ b/Source/unbread/Public/SExplodingBody.h @@ -25,8 +25,8 @@ class UNBREAD_API ASExplodingBody : public APawn UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components") URadialForceComponent* RadialForce; - UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components") - UCapsuleComponent* Capsule; + //UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components") + //UCapsuleComponent* Capsule; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components") USkeletalMeshComponent* Mesh; From c3f0268a5bcb5c36aea4e4d138b0b5faa4c833b5 Mon Sep 17 00:00:00 2001 From: GageM Date: Thu, 29 Feb 2024 18:16:52 -0500 Subject: [PATCH 3/4] - Made some QOL changes to CoreLevel - Gave pawn collision to enemy AI --- Content/Unbread/Core/AI/Melee/BP_MeleeAICharacter.uasset | 4 ++-- Content/Unbread/Core/AI/Ranged/BP_RangedAICharacter.uasset | 4 ++-- Content/Unbread/Maps/CoreLevelTest.umap | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Content/Unbread/Core/AI/Melee/BP_MeleeAICharacter.uasset b/Content/Unbread/Core/AI/Melee/BP_MeleeAICharacter.uasset index d32e65f8..acb9f71d 100644 --- a/Content/Unbread/Core/AI/Melee/BP_MeleeAICharacter.uasset +++ b/Content/Unbread/Core/AI/Melee/BP_MeleeAICharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9a2f546bbad4794993473c1e35cc3e7a8f60767b08515c8c8b4afc82da4c858a -size 72783 +oid sha256:e6d00c762491114e1887b1555da35f1bb23a54ab0bfb2e1cb14fb2fbdd412a7e +size 73198 diff --git a/Content/Unbread/Core/AI/Ranged/BP_RangedAICharacter.uasset b/Content/Unbread/Core/AI/Ranged/BP_RangedAICharacter.uasset index c027beeb..93a71d90 100644 --- a/Content/Unbread/Core/AI/Ranged/BP_RangedAICharacter.uasset +++ b/Content/Unbread/Core/AI/Ranged/BP_RangedAICharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3b961b0b47758d8ff19ab4df3fd69e8f5e6a215ab4409d6b80ba00f36f8af225 -size 82086 +oid sha256:54f7d019b8f30e5d2849feee23d2c9b790593e53446565e79234cca4bc76920f +size 82403 diff --git a/Content/Unbread/Maps/CoreLevelTest.umap b/Content/Unbread/Maps/CoreLevelTest.umap index 2076abe3..b845837d 100644 --- a/Content/Unbread/Maps/CoreLevelTest.umap +++ b/Content/Unbread/Maps/CoreLevelTest.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6a267524aa82477a2d5be448ea95fa48739f4d09dd1489fb37e6d01200e80c33 -size 429169 +oid sha256:8609aeaa16380bde392f3c28a747d435049e0913314fd4a9533754a2e2df2ec6 +size 448645 From 9d47cc7a91a010024e1346b511b45941dcb475f9 Mon Sep 17 00:00:00 2001 From: GageM Date: Thu, 29 Feb 2024 19:06:32 -0500 Subject: [PATCH 4/4] - Added lights to cupcake stands --- Content/Unbread/Maps/CoreLevelTest.umap | 4 ++-- Source/unbread/Private/SRespawnGameMode.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Content/Unbread/Maps/CoreLevelTest.umap b/Content/Unbread/Maps/CoreLevelTest.umap index b845837d..6c5bd55b 100644 --- a/Content/Unbread/Maps/CoreLevelTest.umap +++ b/Content/Unbread/Maps/CoreLevelTest.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8609aeaa16380bde392f3c28a747d435049e0913314fd4a9533754a2e2df2ec6 -size 448645 +oid sha256:a214adb4bcd8a6e04bc4ab60ed0f2917705fb061d6dd1626f296b539dc4c2e78 +size 450773 diff --git a/Source/unbread/Private/SRespawnGameMode.cpp b/Source/unbread/Private/SRespawnGameMode.cpp index 0bdb1be7..6925aa9c 100644 --- a/Source/unbread/Private/SRespawnGameMode.cpp +++ b/Source/unbread/Private/SRespawnGameMode.cpp @@ -61,7 +61,7 @@ void ASRespawnGameMode::SpawnPlayer() void ASRespawnGameMode::RespawnPlayer(AActor* Destroyed) { - CurLives--; + //CurLives--; if (CheckLoss()) return;