Struct AIKiteBudget
Limits how long an NPC may keep backing away from its target before it has to stand and fight.
public struct AIKiteBudget
- Inherited Members
Remarks
A kiting archetype backs away whenever the target is inside its comfort distance. Left
unbounded, and moving at the same run speed as the player, that is a fight nobody can
close: the caster retreats every tick the player advances and a melee character never
lands a hit. The budget drains while the NPC kites; once spent, the planner ignores the
comfort band for RecoverySeconds and the NPC holds its ground, then the budget
refills. Standing still refunds it slowly so a caster that is left alone gets its kite
back.
One per NPC (on AIController), never on the shared state asset.
Fields
Exhausted
True while the budget is spent and the NPC must hold its ground.
public bool Exhausted
Field Value
REFUND_RATE
Fraction of elapsed time refunded while not kiting.
public const float REFUND_RATE = 0.5
Field Value
RecoveryTimer
Seconds left in the recovery hold, once spent.
public float RecoveryTimer
Field Value
Remaining
Seconds of kiting left before the budget is spent.
public float Remaining
Field Value
Methods
Clear()
Clears everything, for pooling.
public void Clear()
Reset(float)
Primes the budget for a new fight.
public void Reset(float budgetSeconds)
Parameters
budgetSecondsfloatSeconds of kiting allowed before the hold.
Tick(bool, float, float, float)
Advances the budget by one combat update.
public void Tick(bool kiting, float deltaTime, float budgetSeconds, float recoverySeconds)