Struct AIRetreatContext
- Namespace
- FishMMO.Server.Implementation.World.SceneServer.AI
- Assembly
- FishMMO.Server.dll
Everything Decide(in AIRetreatContext) needs to reach an outcome.
public struct AIRetreatContext
- Inherited Members
Remarks
A plain struct of scalars, so a test can build one with named field initialisers and assert the outcome without a scene, a NavMesh or an NPC.
Fields
ConsecutiveRetreats
How many times this NPC has fled during the current fight, including this one.
public int ConsecutiveRetreats
Field Value
CumulativeCapSpent
True when the cumulative retreat budget for this fight is spent.
public bool CumulativeCapSpent
Field Value
MinRetreatSeconds
Seconds to retreat before turning back is even considered.
public float MinRetreatSeconds
Field Value
OutOfPatience
True when this retreat leg has run past its own time limit.
public bool OutOfPatience
Field Value
PathBlocked
True when the NPC cannot path away — backed into geometry.
public bool PathBlocked
Field Value
ReengageChance
Base chance per check of turning back, 0-1.
public float ReengageChance
Field Value
ReengageChanceRamp
Added to the chance once per retreat this fight, counting the one in progress.
public float ReengageChanceRamp
Field Value
Remarks
Counted from one rather than zero, so the first retreat of a fight rolls at
ReengageChance + ReengageChanceRamp and a ramp with no base chance still does
something on its own.
ReengageRoll
This check's roll in 0-1, drawn from the NPC's seeded RNG by the caller.
public float ReengageRoll
Field Value
SafeDistance
Distance at which the NPC considers itself clear.
public float SafeDistance
Field Value
SecondsRetreating
Seconds this retreat leg has been running.
public float SecondsRetreating
Field Value
SqrDistanceToTarget
Squared distance from the NPC to its target.
public float SqrDistanceToTarget
Field Value
TargetClosingSpeed
How fast the target is closing on the NPC, in units per second. Negative when it is moving away.
public float TargetClosingSpeed