Setup NPC director

This commit is contained in:
2026-06-01 16:26:15 +03:00
parent f63c98d5d7
commit 192bd94bb7
17 changed files with 590 additions and 50 deletions
+36 -2
View File
@@ -4,9 +4,10 @@
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "NPCType.h"
#include "NPC.generated.h"
class ANPC;
class UNPCTypeDefinition;
UCLASS()
class NAKEDDESIRE_API ANPC : public ACharacter
@@ -15,4 +16,37 @@ class NAKEDDESIRE_API ANPC : public ACharacter
public:
ANPC();
};
// Behavioral template for this NPC (Walker / Stalker / …). Author one DA_* per type and assign
// here (or on the NPC blueprint). Null falls back to Walker-ish defaults (GDD §10.2, §17.4).
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "NPC")
TObjectPtr<UNPCTypeDefinition> NPCTypeDefinition;
UFUNCTION(BlueprintPure, Category = "NPC")
ENPCType GetNPCType() const;
// Multiplier on this NPC's embarrassment contribution; read by StatsManager via the AI controller.
UFUNCTION(BlueprintPure, Category = "NPC")
float GetObservationWeight() const;
// True for Stalker-like types; the behavior tree branches on this to stop and stare vs. walk past.
UFUNCTION(BlueprintPure, Category = "NPC")
bool ShouldStopToObserve() const;
// Seconds a stopping NPC lingers staring before resuming its path.
UFUNCTION(BlueprintPure, Category = "NPC")
float GetObserveDuration() const;
// Pooling lifecycle driven by UNPCDirectorSubsystem. The native side handles transform /
// visibility / collision / movement; the BlueprintImplementableEvents let the behavior-tree
// layer restart and pick a fresh destination (BT startup lives in BP, §17.5).
void ActivateFromPool(const FVector& Location, const FRotator& Rotation);
void DeactivateToPool();
protected:
UFUNCTION(BlueprintImplementableEvent, Category = "NPC")
void OnActivatedFromPool();
UFUNCTION(BlueprintImplementableEvent, Category = "NPC")
void OnDeactivatedToPool();
};