RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Drift Zone BoundsDrift Race PathDrift UI DisplayDrift Detection EngineDrift SystemDrift Quick MessagesDrift Save/LoadDrift ScoreboardDrift Scoring SystemDrift AudioDrift StallingDrift StatisticsDrift Stunt Zones

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsgameplaydrift

Drift Scoring System

Reference for `gameplay_drift_scoring`, which calculates continuous drift scores, manages the combo system, tracks tier progression, handles stunt zone bonuses, and determines career rewards.

Reference for gameplay_drift_scoring, which calculates continuous drift scores, manages the combo system, tracks tier progression, handles stunt zone bonuses, and determines career rewards.


Overview

The scoring engine runs every frame during a drift, accumulating points based on angle, speed, and wall proximity. Points are cached until the drift chain completes, then multiplied by the combo and added to the permanent score. A tier system (Drift → Legendary Drift) adds bonus continuous points. The combo builds through sustained drifting, transitions, and stunt zones.


Exports

Score Management

| Function | Signature | Description | |--------- | M.getGC | () | any | getGC | | M.getDriftDebugInfo | () | any | getDriftDebugInfo |-| | M.onSerialize | onSerialize handler |-----------|-------------| | getScore | () → table | {score, combo, potentialScore, cachedScore, comboCreepup} | | getPotentialScore | () → number | cachedScore × combo | | getScoreAddedThisFrame | () → number | Points added this frame (with tier) | | addCachedScore | (value, useStallingSystem?) → number | Add to cached score | | reset | () | Reset all score state | | wrapUp | () → number\|false | Confirm cached score × combo to permanent | | wrapUpWithText | () → number\|false | Wrap up + fire display hook | | M.onDeserialized | onDeserialized handler |

Tiers

FunctionSignatureDescription
getDriftTiers() → tableAll tier definitions
getCurrentDriftTier() → tableActive tier

Performance

FunctionSignatureDescription
getDriftPerformanceFactor() → number0-1 raw performance
getSteppedDriftPerformanceFactor() → number0-4 smoothed stepped factor
getScoreOptions() → tableAll scoring constants
getStuntZoneBasePoints(type) → numberBase points for stunt type

Hooks

FunctionDescription
onUpdateMain scoring loop
onDriftCompletedScore confirmation on chain end
onDriftTransitionCombo creep on direction change
onAnyStuntZoneAccomplishedCombo creep from stunt zones
onDriftThroughAccomplishedScore tight drift zone
onHitPoleAccomplishedScore pole hit
onDonutDriftAccomplishedScore donut
onNearPoleAccomplishedScore near-pole drift
onDriftCrash / onDriftSpinoutReset cached score
onDriftChainStartedAnnounce first tier
onDriftPlVehResetFull reset

Score Formula

-- Per frame while drifting:
angleMulti = linearScale(angle, minAngle, maxAngle, 1, 10)
speedMulti = linearScale(airSpeed, 22, 200, 1, 4)  -- clamped to [1, 4]
wallMulti  = 1 + linearScale(wallDistFront, 3, 0, 0, 3) + linearScale(wallDistRear, 3, 0, 0, 3)

scoreBeforeTier = angleMulti × speedMulti × wallMulti × distSinceLastFrame × 0.6
scoreWithTier = scoreBeforeTier + driftTiers[currentTier].continuousScore × dtSim

-- Final score on chain completion:
permanentScore += floor(cachedScore × combo)

Tier System

TierMin ScoreContinuous Bonus/sec
Drift010
Great Drift25020
Awesome Drift75030
Superior Drift200040
Epic Drift500050
Apex Drift900060
Legendary Drift1500075

Combo System

-- Combo builds via comboCreepup (0-100 → +0.1 combo):
-- Sources:
--   oneSideDrift:    +10 creep per 0.1s (min 25° angle, max 100 increments)
--   driftTransition: +100-500 creep based on speed bracket (2s cooldown)
--   stuntZone:       +140 creep per zone
--   closeWall:       +50 creep (via quick messages)

-- Limits:
--   comboSoftCap = 10  (above this, use lower creep values)
--   comboHardCap = 25  (absolute maximum)

Performance Factor

-- Compares current score to a simulated "good drift":
-- Good drift: wallDist=1.8m, angle=80°, speed=70kph
veryGoodScore = getContinuousScore(0.15, goodDriftData)
performanceFactor = scoreBeforeTier / veryGoodScore  -- 0 to 1+

-- Stepped: 1=poor, 2=okay, 3=good, 4=excellent
-- Level 4 has hysteresis (0.3s hold both ways) to prevent flickering
-- Smoothed via newTemporalSmoothing(8, 8)

Stunt Zone Scoring

TypeFormula
Drift ThroughlinearScale(angle, 0, 90, 0, zonePoints)
Hit PolelinearScale(angle + speed, 0, 250, 0, zonePoints)
Near Pole(angle × closeness / 90) × zonePoints
DonutzonePoints (flat)

All stunt scores pass through addCachedScore(score, useStallingSystem=true).


Key Behaviors

  • Score only accumulates when !frozen and !paused
  • Cached score resets on crash or spinout (losing the combo)
  • wrapUp() is called by drift chain completion or challenge finish
  • Career rewards: floor(score × 0.0017) beamXP if score ≥ 300 (currently commented out)
  • Performance factor smoothing prevents UI jitter during erratic drifts
  • Combo transition requires 2s cooldown and >25 kph to prevent rapid back-and-forth farming
FunctionSignatureReturnsDescription
M.onSerialize()nilonSerialize
M.onDeserialized(data)nilonDeserialized
M.getDriftDebugInfo()nilgetDriftDebugInfo
M.getGC()nilgetGC
M.addCachedScore(valueToAdd, useStallingSystem)-addCachedScore handler
M.getCurrentDriftTier()-Returns CurrentDriftTier
M.getDriftPerformanceFactor()-Returns DriftPerformanceFactor
M.getDriftTiers()-Returns DriftTiers
M.getPotentialScore()-Returns PotentialScore
M.getScore()-Returns Score
M.getScoreAddedThisFrame()-Returns ScoreAddedThisFrame
M.getScoreOptions()-Returns ScoreOptions
M.getSteppedDriftPerformanceFactor()-Returns SteppedDriftPerformanceFactor
M.getStuntZoneBasePoints(stuntZoneType)-Returns StuntZoneBasePoints
M.onAnyStuntZoneAccomplished()-Drift stunts --
M.onDonutDriftAccomplished(data)-Callback for DonutDriftAccomplished event
M.onDriftChainStarted()-Callback for DriftChainStarted event
M.onDriftCompleted()-finished a whole drift chain
M.onDriftCrash()-Callback for DriftCrash event
M.onDriftPlVehReset()-Callback for DriftPlVehReset event
M.onDriftSpinout()-Callback for DriftSpinout event
M.onDriftThroughAccomplished(data)-Callback for DriftThroughAccomplished event
M.onDriftTransition()-this is combo when doing drift transitions
M.onHitPoleAccomplished(data)-Callback for HitPoleAccomplished event
M.onNearPoleAccomplished(data)-Callback for NearPoleAccomplished event
M.onUpdate(dtReal, _dtSim)-Callback for Update event
M.reset()-Resets state
M.wrapUp()-preemptively "confirm" cached score
M.wrapUpWithText()-wrapUpWithText handler

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 Scoreboard

Reference for `gameplay_drift_scoreboard`, which accumulates detailed performance statistics during formal drift challenges for end-screen display.

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.

On this page

OverviewExportsScore ManagementTiersPerformanceHooksScore FormulaTier SystemCombo SystemPerformance FactorStunt Zone ScoringKey BehaviorsSee Also