CornerTrapBuilder
Sub-builder for corner-trap detection. Opened via BehaviorBuilder:CornerTrap.
Call :Done() to return to the root BehaviorBuilder.
Corner-trap detection terminates bullets stuck bouncing infinitely between opposing surfaces. Four independent passes run on every bounce, any single pass firing is sufficient to declare a trap:
- Pass 1, Temporal: Two bounces within
CornerTimeThresholdseconds. - Pass 2, Velocity EMA: Velocity direction EMA falls below
CornerEMAThreshold. - Pass 3, Spatial: Successive bounce contact points within
CornerDisplacementThresholdstuds. - Pass 4, Minimum progress: Bullet fails to advance
CornerMinProgressPerBouncestuds from its first bounce contact.
Functions
TimeThreshold
Minimum seconds between successive bounces (Pass 1).
Default: 0.002
PositionHistorySize
Bounce contact point history size. Must be a positive integer.
Default: 4
DisplacementThreshold
Minimum stud distance between successive contact points (Pass 3).
Default: 0.5
EMAAlpha
EMA smoothing factor for velocity direction tracking (Pass 2). Must be in (0, 1).
CAUTION
EMAThreshold must be > |1 − 2 · EMAAlpha|. Changing this value requires
updating EMAThreshold. :Build() enforces the constraint.
Default: 0.4
EMAThreshold
EMA magnitude threshold below which oscillation is declared (Pass 2).
Must be > |1 − 2 · EMAAlpha|.
Default: 0.25
MinProgressPerBounce
Minimum studs of progress per bounce over the history window (Pass 4).
Set to 0 to disable Pass 4.
Default: 0.3
Done
Returns the root BehaviorBuilder.