Drift Stalling
Reference for `gameplay_drift_stallingSystem`, which penalizes repetitive drift behavior by reducing the score multiplier when the player repeats the same stunts without variety.
Reference for gameplay_drift_stallingSystem, which penalizes repetitive drift behavior by reducing the score multiplier when the player repeats the same stunts without variety.
Dependencies
gameplay_drift_general
Overview
Tracks a history of all player stunts (drifts and stunt zones). Calculates a stalling value (0.5–1.0) based on how varied the recent history is. Repeating the same stunt type reduces the multiplier; mixing different stunts keeps it high.
Stalling Options (gymkhana defaults)
| Option | Value |
|---|---|
minStallingValue | 0.5 |
maxStallingValue | 1.0 |
historyLength | 10 |
Drift: posStallingWeight | 0.35 |
Drift: negStallingWeight | 0.15 |
Drift: maxRepetitions | 5 |
StuntZone: posStallingWeight | 1.0 |
StuntZone: negStallingWeight | 0.6 |
StuntZone: maxRepetitions | 1 |
Exports
| Function | Signature | Description |
|---|---|---|
reset | () | Clears history and resets stalling value to 1 |
calculateScore | (score) | Returns score * stallingValue |
processStuntZone | (stuntZoneId) | Records a stunt zone completion in history and recalculates |
getDriftDebugInfo | () | Returns {default=true, canBeChanged=true} for debug toggle |
onDriftStatusChanged | (isDrifting) | When drifting starts, records a drift entry (stuntId=0) in history |
onUpdate | () | Runs imgui debug panel |
M.calculateScore | (score) | - |
M.dependencies | value | - |
M.getDriftDebugInfo | () | - |
M.onDriftStatusChanged | (isDrifting) | - |
M.onUpdate | () | - |
M.processStuntZone | (stuntZoneId) | - |
M.reset | () | - |
Key Behaviors
- Switching between different stunt types increases the score; repeating the same one penalizes
- The algorithm uses a sliding window of the last
historyLengthentries - Negative weight is applied when a stunt exceeds
maxRepetitionswithin a buffer - Score multiplier is clamped between
minStallingValueandmaxStallingValue
See Also
- drift/bounds - Drift Zone Boundary Detection - Related reference
- drift/destination - Race Path & Wrong-Way Detection - Related reference
- drift/display - Drift UI & HUD Management - Related reference
- Gameplay Systems Guide - Guide
Drift Audio
Reference for `gameplay_drift_sounds`, which manages all audio feedback for the drift system including continuous drift sounds, tier/combo sounds, and crash/spinout audio cues.
Drift Statistics
Reference for `gameplay_drift_statistics`, which records drift performance metrics into the persistent statistics system (`gameplay_statistic`).