diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index 49f7658..a830ed9 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -91,3 +91,6 @@ ConnectionType=USBOnly bUseManualIPAddress=False ManualIPAddress= +[/Script/GameplayDebugger.GameplayDebuggerConfig] +CategorySlot5=Five + diff --git a/Content/AI/Minions/AIC_Minion_BP.uasset b/Content/AI/Minions/AIC_Minion_BP.uasset new file mode 100644 index 0000000..3ed57bd --- /dev/null +++ b/Content/AI/Minions/AIC_Minion_BP.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34bdfb6050bbcdf26195ecf4a39574e0ea3a8a9f1b2de2fa2a1d33d6cd762858 +size 20715 diff --git a/Content/AI/Minions/Minion_BP.uasset b/Content/AI/Minions/Minion_BP.uasset new file mode 100644 index 0000000..b72f7da --- /dev/null +++ b/Content/AI/Minions/Minion_BP.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67d488bc3f4ebbd04593b3e5f273bafb3be3315796122304517a61fc0ec41d00 +size 38353 diff --git a/Content/Maps/GameLevel.umap b/Content/Maps/GameLevel.umap index 2881c56..7032e57 100644 --- a/Content/Maps/GameLevel.umap +++ b/Content/Maps/GameLevel.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eb90937d6ed7be34b8830e08f4554ee8b97639c7a19fa0cdc8f3ab21fea9c9d7 -size 15354151 +oid sha256:02ccadf71b7c79c2b6749152d7e3e259b8d622bf327cdbb19e6727d8b719cd20 +size 15358735 diff --git a/Source/Crunch/Private/AI/CAIController.cpp b/Source/Crunch/Private/AI/CAIController.cpp new file mode 100644 index 0000000..0f72779 --- /dev/null +++ b/Source/Crunch/Private/AI/CAIController.cpp @@ -0,0 +1,48 @@ +// Multiplayer By Caleb + + +#include "AI/CAIController.h" + +#include "Character/CCharacter.h" +#include "Perception/AIPerceptionComponent.h" +#include "Perception/AISenseConfig_Sight.h" + + +ACAIController::ACAIController() +{ + PrimaryActorTick.bCanEverTick = true; + AIPerceptionComponent = CreateDefaultSubobject("AI Perception Component"); + SightConfig = CreateDefaultSubobject("Sight config"); + + SightConfig->DetectionByAffiliation.bDetectEnemies = true; + SightConfig->DetectionByAffiliation.bDetectFriendlies = false; + SightConfig->DetectionByAffiliation.bDetectNeutrals = false; + + SightConfig->SightRadius = 1000.f; + SightConfig->LoseSightRadius = 1200.f; + SightConfig->SetMaxAge(5.f); + SightConfig->PeripheralVisionAngleDegrees = 100.f; + + AIPerceptionComponent->ConfigureSense(*SightConfig); +} + +void ACAIController::OnPossess(APawn* InPawn) +{ + Super::OnPossess(InPawn); + SetGenericTeamId(FGenericTeamId(0)); + + if (const auto PawnTeamInterface{Cast(InPawn)}) + { + PawnTeamInterface->SetGenericTeamId(GetGenericTeamId()); + } +} + +void ACAIController::BeginPlay() +{ + Super::BeginPlay(); +} + +void ACAIController::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); +} diff --git a/Source/Crunch/Public/AI/CAIController.h b/Source/Crunch/Public/AI/CAIController.h new file mode 100644 index 0000000..199d0c0 --- /dev/null +++ b/Source/Crunch/Public/AI/CAIController.h @@ -0,0 +1,30 @@ +// Multiplayer By Caleb + +#pragma once + +#include "CoreMinimal.h" +#include "AIController.h" +#include "CAIController.generated.h" + +UCLASS() +class CRUNCH_API ACAIController : public AAIController +{ + GENERATED_BODY() + +public: + ACAIController(); + virtual void OnPossess(APawn* InPawn) override; + +protected: + virtual void BeginPlay() override; + +public: + virtual void Tick(float DeltaTime) override; + +private: + UPROPERTY(VisibleDefaultsOnly, Category="Perception") + UAIPerceptionComponent* AIPerceptionComponent; + + UPROPERTY(VisibleDefaultsOnly, Category="Perception") + class UAISenseConfig_Sight* SightConfig; +};