From de3a5310f4d3839db69cc521e9201afe7332f34a Mon Sep 17 00:00:00 2001 From: "j.foucher" Date: Wed, 1 Apr 2026 07:04:59 +0200 Subject: [PATCH] Update tooltips and comments: fix outdated references, clarify personality modulation - BTTask_Attack.h: remove reference to non-existent GetBehaviorOptimalAttackRange, document PersonalityProfile ranges - AIController.h: update TeamId comment to reflect actual MakeTeamId encoding (nibble-based) - CoverShootCycle.h: clarify that Peek/Cover durations are base values modulated by personality traits - FindCover.h: clarify ManualPointBonus is additive score - CombatComponent.h: clarify AttackRange/AttackCooldown are for ExecuteAttack, not BTTask_Attack Co-Authored-By: Claude Opus 4.6 (1M context) --- .../Public/BT/PS_AI_Behavior_BTTask_Attack.h | 10 ++++++---- .../BT/PS_AI_Behavior_BTTask_CoverShootCycle.h | 10 +++++----- .../Public/BT/PS_AI_Behavior_BTTask_FindCover.h | 5 +++-- .../Public/PS_AI_Behavior_AIController.h | 16 ++++++++-------- .../Public/PS_AI_Behavior_CombatComponent.h | 4 ++-- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_Attack.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_Attack.h index cb819d7..406c87c 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_Attack.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_Attack.h @@ -13,9 +13,11 @@ class UEnvQuery; /** * BT Task: Move toward the threat actor and delegate combat to the Pawn. * - * Queries IPS_AI_Behavior_Interface for CombatType and OptimalAttackRange: - * - Melee: rush toward target, stop at optimal range. - * - Ranged: maintain optimal distance — back away if too close, advance if too far. + * Queries IPS_AI_Behavior_Interface for CombatType (Melee/Ranged). + * Attack ranges come from PersonalityProfile (MinAttackRange/MaxAttackRange), + * with fallback to AttackMoveRadius if no profile is available. + * - Melee: rush toward target, continuous pursuit within MinRange. + * - Ranged: maintain distance — back away if closer than MinRange, advance if farther than MaxRange. * * Calls IPS_AI_Behavior_Interface::BehaviorStartAttack() on enter and * BehaviorStopAttack() on abort. The Pawn handles the actual combat @@ -32,7 +34,7 @@ class PS_AI_BEHAVIOR_API UPS_AI_Behavior_BTTask_Attack : public UBTTaskNode public: UPS_AI_Behavior_BTTask_Attack(); - /** Fallback move radius if the Pawn doesn't implement GetBehaviorOptimalAttackRange(). */ + /** Fallback attack range (cm) used when PersonalityProfile is unavailable. */ UPROPERTY(EditAnywhere, Category = "Attack", meta = (ClampMin = "50.0")) float AttackMoveRadius = 300.0f; diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_CoverShootCycle.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_CoverShootCycle.h index 3b66f39..a52c82b 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_CoverShootCycle.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_CoverShootCycle.h @@ -43,19 +43,19 @@ public: // ─── Timing ───────────────────────────────────────────────────────── - /** Minimum time (seconds) spent peeking/shooting. */ + /** Base minimum time (seconds) spent peeking/shooting. Modulated at runtime: Aggressivity increases, Caution decreases. */ UPROPERTY(EditAnywhere, Category = "Cover Shoot|Timing", meta = (ClampMin = "0.5")) float PeekDurationMin = 2.0f; - /** Maximum time (seconds) spent peeking/shooting. */ + /** Base maximum time (seconds) spent peeking/shooting. Modulated at runtime: Aggressivity increases, Caution decreases. */ UPROPERTY(EditAnywhere, Category = "Cover Shoot|Timing", meta = (ClampMin = "0.5")) float PeekDurationMax = 5.0f; - /** Minimum time (seconds) spent ducked behind cover. */ + /** Base minimum time (seconds) spent ducked behind cover. Modulated at runtime: Caution increases, Aggressivity decreases. */ UPROPERTY(EditAnywhere, Category = "Cover Shoot|Timing", meta = (ClampMin = "0.5")) float CoverDurationMin = 1.0f; - /** Maximum time (seconds) spent ducked behind cover. */ + /** Base maximum time (seconds) spent ducked behind cover. Modulated at runtime: Caution increases, Aggressivity decreases. */ UPROPERTY(EditAnywhere, Category = "Cover Shoot|Timing", meta = (ClampMin = "0.5")) float CoverDurationMax = 3.0f; @@ -72,7 +72,7 @@ public: // ─── Advancement ──────────────────────────────────────────────────── - /** Number of peek/duck cycles before advancing to a closer cover. */ + /** Number of peek/duck cycles before attempting to advance to a closer cover point. Modulated by Aggressivity. */ UPROPERTY(EditAnywhere, Category = "Cover Shoot|Advancement", meta = (ClampMin = "1", ClampMax = "10")) int32 MaxCyclesBeforeAdvance = 3; diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_FindCover.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_FindCover.h index 5d4ea50..c933932 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_FindCover.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/BT/PS_AI_Behavior_BTTask_FindCover.h @@ -51,8 +51,9 @@ public: EPS_AI_Behavior_CoverPointType CoverPointType = EPS_AI_Behavior_CoverPointType::Cover; /** - * Bonus score added to manual CoverPoints over procedural candidates. - * Higher = manual points are strongly preferred. + * Score bonus added to manual CoverPoints (additive, 0-1 range). + * A manual point with score 0.5 + bonus 0.3 = 0.8 total. + * Higher = manual points strongly preferred over procedural candidates. */ UPROPERTY(EditAnywhere, Category = "Cover|Manual Points", meta = (ClampMin = "0.0", ClampMax = "1.0")) float ManualPointBonus = 0.3f; diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/PS_AI_Behavior_AIController.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/PS_AI_Behavior_AIController.h index 39aa4ce..d97f4cd 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/PS_AI_Behavior_AIController.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/PS_AI_Behavior_AIController.h @@ -33,15 +33,15 @@ public: /** * Team ID — determines perception affiliation (Enemy/Friendly/Neutral). - * Auto-assigned from NPCType at possession if left at 255 (NoTeam): - * - Civilian = Team 1 - * - Enemy = Team 2 - * - Neutral = 255 (NoTeam → perceived as Neutral by everyone) - * - * Two NPCs with the SAME Team ID → Friendly (ignored by perception). - * Two NPCs with DIFFERENT Team IDs → Enemy (detected by perception). - * A NPC with Team ID 255 → Neutral to everyone. + * Auto-assigned from NPCType + Faction at possession via MakeTeamId(): + * - Encoding: high nibble = NPCType, low nibble = Faction + * - Civilian F0 = 0x00, Enemy F0 = 0x10, Protector F0 = 0x20 + * - Same NPCType + same Faction → Friendly + * - Same NPCType + different Faction → Hostile (rival gangs) + * - Civilian ↔ Protector → always Friendly + * - Everything else → Hostile * + * Disguised enemies (hostile=false) use DisguisedTeamId (0x01). * You can override this in Blueprint or per-instance in the editor. */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Team") diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/PS_AI_Behavior_CombatComponent.h b/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/PS_AI_Behavior_CombatComponent.h index ed56c4c..05bb16a 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/PS_AI_Behavior_CombatComponent.h +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_Behavior/Source/PS_AI_Behavior/Public/PS_AI_Behavior_CombatComponent.h @@ -27,11 +27,11 @@ public: // ─── Configuration ────────────────────────────────────────────────── - /** Maximum distance at which the NPC can attack (cm). */ + /** Maximum distance at which ExecuteAttack() succeeds (cm). Independent from PersonalityProfile ranges used by BTTask_Attack. */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Combat", meta = (ClampMin = "50.0")) float AttackRange = 200.0f; - /** Cooldown between attacks (seconds). */ + /** Minimum time between consecutive ExecuteAttack() calls (seconds). */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Combat", meta = (ClampMin = "0.1")) float AttackCooldown = 1.5f;