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

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 Extensionsgameplay

Vehicle Performance

Reference for `gameplay_vehiclePerformance`, which calculates a Performance Index (PI) from drag test data and assigns vehicles to performance classes (D through X).

Reference for gameplay_vehiclePerformance, which calculates a Performance Index (PI) from drag test data and assigns vehicles to performance classes (D through X).


Module Exports (M)

FunctionSignatureDescription
getClassFromData(testData) → table|nilClassifies from raw drag test data
getClassFromVehId(vehId) → table|nilClassifies a spawned vehicle by ID
getClassFromConfig(model, configName) → table|nilClassifies from model/config without spawning
getAggregateScores(testData) → table|nilReturns detailed scoring breakdown

Vehicle Classes

ClassMin PIDescription
X101Modified
S86Super Sports
A66High Performance
B41Sports
C21Standard
D0Economy/Utility

Internals

Performance Index Calculation

The PI is a weighted sum of drag test metrics, each transformed through a linear formula:

weightedValue = max(0, bias + testValue × multiplier)
MetricBiasMultiplierDescription
time_6019.61-8.290–60 ft time
time_3309.68-0.970–330 ft time
time_100015.00-0.500–1000 ft time
time_1_822.41-2.041/8 mile time
time_1_429.14-1.621/4 mile time
time_0_6021.43-1.430–60 mph time
velAt_1_8-8.000.53Speed at 1/8 mile
velAt_1_4-6.000.40Speed at 1/4 mile
brakingG-3.577.14Braking G-force

Negative multipliers mean faster times → higher scores. Positive multipliers mean higher speeds/G → higher scores.

Aggregate Scores

getAggregateScores() returns percentage-based scores normalized to a reference vehicle (Scintilla drag configuration):

ScoreFormula
powerScore(power / basePower) × 100
powerToWeightScore(P/W ratio / base P/W) × 100
timeTo60Score(baseTime / testTime) × 100
quarterMileScore(baseTime / testTime) × 100
speedProgressionScore(deltaSpeed / baseDeltaSpeed) × 100
brakingGForceScore(testG / baseG) × 100
time0To60Score(baseTime / testTime) × 100
M.getAggregateScores(testData)
M.getClassFromConfig(model, configName)
M.getClassFromData(testData)
M.getClassFromVehId(vehId)

Base Reference Data (Scintilla)

{
  time_60 = 1.833, time_330 = 4.067, time_1_8 = 5.667,
  time_1_4 = 8.134, velAt_1_4 = 90.25, velAt_1_8 = 70.95,
  time_0_60 = 2.367, brakingG = 1.417,
  power = 1395241,  -- watts (~1870 hp)
  torque = 1740, weight = 1280
}

How It Works

  1. Extract drag test data from core_vehicles.getVehicleDetails() or raw data
  2. Apply linear weight to each metric using bias/multiplier pairs
  3. Sum all weighted values to get the Performance Index
  4. Match PI against class thresholds (descending) to find the class

Usage Example

-- Classify the player's current vehicle
local result = gameplay_vehiclePerformance.getClassFromVehId(be:getPlayerVehicleID(0))
if result then
  log("I", "", string.format("Class %s (PI: %0.1f) - %s",
    result.class.name, result.performanceIndex, result.class.description))
end

-- Classify without spawning
local result = gameplay_vehiclePerformance.getClassFromConfig("vivace", "Sport_S")
if result then
  log("I", "", "Class: " .. result.class.name)
end

-- Get detailed scores
local scores = gameplay_vehiclePerformance.getAggregateScores(testData)
log("I", "", "Power score: " .. scores.powerScore)

See Also

  • Gameplay Achievement - Related reference
  • Gameplay City - Related reference
  • discover - Discover / Experience System - Related reference
  • Gameplay Systems Guide - Guide

Traffic System

Reference for `gameplay_traffic`, the master traffic system that spawns, manages, respawns, and pools AI traffic vehicles. This is the central orchestrator for all traffic behavior.

Walking

Reference for `gameplay_walk`, which manages the walking mode (first-person on-foot via the "unicycle" vehicle). Handles toggling between walking and driving, entering/exiting vehicles, proximity dete

On this page

Module Exports (M)Vehicle ClassesInternalsPerformance Index CalculationAggregate ScoresBase Reference Data (Scintilla)How It WorksUsage ExampleSee Also