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 Scoreboard

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

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


Overview

Tracks per-tier score breakdowns, quick message counts, and raw performance metrics (average speed, angle, distance, combo, etc.) during a challenge. Provides formatted data for the challenge results screen.


Exports

FunctionSignatureDescription
onUpdate()Debug display, first-frame init
reset()Clear all stats and repopulate tier/message names
onDriftCompletedScored(data)Attribute chain score to tier, confirm quick messages
onDriftActiveDataFinished(data)Accumulate single-drift raw stats
onDriftQuickMessageReached(data)Queue quick message for tier attribution
onDriftCrash / onDriftSpinout()Discard unconfirmed quick messages
getPerformanceStats() → tableFormatted performance statistics
getTiersStats() → tablePer-tier score and count
getDriftEventStats() → tableQuick message counts and totals
getDriftDebugInfo() → tableDebug toggle
M.getDriftDebugInfo()-
M.getDriftEventStats()-
M.getPerformanceStats()-
M.getTiersStats()-
M.onDriftActiveDataFinished(data)-
M.onDriftCompletedScored(data)-
M.onDriftCrash()-
M.onDriftQuickMessageReached(data)-
M.onDriftSpinout()-
M.onUpdate()-
M.reset()-

Performance Stats Output

local stats = gameplay_drift_scoreboard.getPerformanceStats()
-- Returns ordered table:
-- {
--   avrgDriftPerformanceFactor = {order=1, value="0.750", name="..."},
--   avrgDriftSpeed    = {order=2, value="85 km/h", name="..."},
--   avrgDriftAngle    = {order=3, value="42 °", name="..."},
--   maxDriftAngle     = {order=4, value="95 °", name="..."},
--   maxDriftCombo     = {order=5, value=12, name="..."},
--   totalDriftDist    = {order=6, value="450 m", name="..."},
--   totalIndividualDrifts = {order=7, value=8, name="..."},
--   totalDriftDuration = {order=8, value="1 minute 23 seconds", name="..."},
-- }

Tier Stats

local tiers = gameplay_drift_scoreboard.getTiersStats()
-- {
--   drift = {totalScore=200, count=5, name="Drift", order=1},
--   greatDrift = {totalScore=800, count=3, name="Great Drift", order=2},
--   ...
-- }

How It Works

-- When a drift chain completes and is scored:
-- 1. Quick messages queued during that chain are confirmed
-- 2. Quick message scores (× combo) are subtracted from tier attribution
-- 3. Remaining score attributed to current tier
-- 4. Max combo updated

-- When individual drift ends:
-- 1. Speed, angle, performance factor averages updated
-- 2. Total drift count, duration, distance accumulated

Quick Message Attribution

-- Quick messages are queued in quickMessagesToBeConfirmed during a drift chain
-- On onDriftCompletedScored, they're multiplied by the chain combo and
-- subtracted from the tier score to avoid double-counting
-- Then moved to the permanent quickMessages tracking table

Key Behaviors

  • Stats only accumulate when not paused and not frozen
  • Uses translateVelocity() and translateDistance() for unit-aware formatting
  • Time formatting handles hours, minutes, seconds with proper pluralisation
  • Tier names are translated via translateLanguage("missions.drift.tiers.<id>")
  • Stat names translated via translateLanguage("missions.drift.stats.<key>")
  • Quick messages discarded on crash/spinout (via driftFailed())

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 Save/Load

Reference for `gameplay_drift_saveLoad`, which loads drift spot definitions from level directories, manages per-spot score persistence, and handles career save integration.

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.

On this page

OverviewExportsPerformance Stats OutputTier StatsHow It WorksQuick Message AttributionKey BehaviorsSee Also