AI Combat Manager

The AI Combat Manager (AC_AI_CombatManager) component is responsible for handling AI combat interactions, including damage processing, hit reactions, poise/stance breaks, unarmed combat, and death handling. It functions similarly to the Combat Manager used for the player but is specifically designed for AI, ensuring that AI enemies can react to incoming attacks, process damage correctly, and execute appropriate combat behaviors.

It is added to the Soulslike Enemy (B_Soulslike_Enemy) class by default.

How It Works

  • Event Bindings

    • Registers AI combat events, such as OnTakeDamage and OnStatUpdated, to ensure AI responds dynamically to combat situations.

  • Ability Selection

    • The TryGetAbility method (called from BTS_TryGetAbility) is used to retrieve a possible attack Ability while the AI is in Combat state.

  • Damage Handling

    • Listens for incoming damage events and adjusts HP accordingly. If HP falls to zero, it triggers the death logic.

  • Poise System

    • Listens for poise stat changes & manages poise mechanics, triggering a stagger/stun when poise is broken (if Poise falls to zero)

  • Stance Breaks & Hit Reactions

    • Upon taking damage, the HandleHitReaction method checks if Stance is broken, if so, determines the correct hit reaction animation and applies knockback forces based on damage impact.

  • Weapon & Projectile Damage Processing:

    • Handles incoming melee and projectile attacks, applying damage effects accordingly.

  • Unarmed Combat

    • Uses socket-based tracing for unarmed combat.

  • Notify Related Properties

  • World Healthbar Updates

    • Updates the world UI, displaying AI health changes in real-time, Souls style.

  • Death Handling

    • Initiates the AI death sequence, plays the ragdoll/directional death animation and stops AI controller logic.

Example Usage

Last updated

Was this helpful?