Table of Contents

Struct AIKiteBudget

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

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

bool

REFUND_RATE

Fraction of elapsed time refunded while not kiting.

public const float REFUND_RATE = 0.5

Field Value

float

RecoveryTimer

Seconds left in the recovery hold, once spent.

public float RecoveryTimer

Field Value

float

Remaining

Seconds of kiting left before the budget is spent.

public float Remaining

Field Value

float

Methods

Clear()

Clears everything, for pooling.

public void Clear()

Reset(float)

Primes the budget for a new fight.

public void Reset(float budgetSeconds)

Parameters

budgetSeconds float

Seconds 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)

Parameters

kiting bool

True if the NPC backed away during this update.

deltaTime float

Seconds elapsed since the previous combat update.

budgetSeconds float

Seconds of kiting allowed per window. 0 disables the budget.

recoverySeconds float

Seconds the NPC must hold its ground once spent.