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
Crash Test BoundariesCrash Test CountdownCrash Test ScoringCrash Test Task ListCrash Test Scenario Manager

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 ExtensionsgameplaycrashTest

Crash Test Scoring

Reference for `gameplay_crashTest_crashTestScoring`, which calculates and aggregates scores for crash test mission steps based on time, speed, damage, and impact location accuracy.

Reference for gameplay_crashTest_crashTestScoring, which calculates and aggregates scores for crash test mission steps based on time, speed, damage, and impact location accuracy.


Overview

Each crash test step can be scored on multiple criteria. This extension computes individual scores per step and provides a total score across all steps. Depends on gameplay_util_damageAssessment.


Exports

| Function | Signature | Description | |------ | M.dependencies | table | { |----|-----------|-------------| | calculateStepScore | (stepData, stepCrashData) | Calculate all score components for a completed step | | getTotalScoreData | () | Get cumulative score data across all steps | | getStepScoreData | (stepIndex) | Get score data for a specific step | | calculateIndividualDamageScore | (damageGoal, damageCondition, vehId) | Score a single vehicle's damage against the goal | | calculateDamageLocationScore | (damageLocationGoal, damageLocationData) | Score impact location accuracy | | reset | () | Clear all stored scoring data |


Score Parameters

ParameterMax ScoreDescription
maxDamageLocationScore1000Impact at the correct vehicle location
maxTimeScore1000Hitting within the time goal
minTimeScore500Minimum time score (within 30% over goal)
maxSpeedScore1000Matching the target impact speed
maxSpeedOffset3 kphSpeed difference beyond which score is 0
sameStepDamageScore1000Damage matches the goal exactly
oneStepDifferentDamageScore500Damage is one severity step off
twoStepsDifferentDamageScore200Damage is two severity steps off
succesfullyCrashedTargetInZoneScore1000Target crashed in the designated zone

How It Works

  1. When a step completes successfully, calculateStepScore() is called
  2. It computes applicable scores: time, speed, damage assessment, impact location
  3. Scores are stored per step in scoringDataPerStep
  4. getTotalScoreData() sums all step scores into a totalScore field

Damage Severity Levels

LevelID
Minor1
Moderate2
A lot3

Damage conditions can be "At least" or "No more than", and scoring is based on how close the actual severity is to the goal.

-- After a step completes successfully
gameplay_crashTest_crashTestScoring.calculateStepScore(stepData, crashData[stepIndex])

-- Get final results
local totalData = gameplay_crashTest_crashTestScoring.getTotalScoreData()
print("Total Score: " .. totalData.totalScore)

Key Behaviors

  • Speed scores use linearScale to interpolate between max and 0 based on offset
  • Time scores give full marks if under goal, scale down to minTimeScore within 30% overshoot
  • Damage location score is proportional: damage at target location / total damage
  • The "Crash target vehicle into target area" objective skips time and speed scoring

Module Variables

VariableTypeDescription
M.dependenciestable{
M.calculateDamageLocationScore(damageLocationGoal, damageLocationData)-
M.calculateIndividualDamageScore(damageGoal, damageCondition, vehId)-
M.calculateStepScore(stepData, stepCrashData)-
M.getStepScoreData(stepIndex)-
M.getTotalScoreData()-
M.reset()-

See Also

  • crashTestBoundaries - Crash Test Boundary Checking - Related reference
  • crashTestCountdown - Crash Test Countdown Timer - Related reference
  • crashTestTaskList - Crash Test UI Task List - Related reference
  • Gameplay Systems Guide - Guide

Crash Test Countdown

Reference for `gameplay_crashTest_crashTestCountdown`, a simple countdown timer that displays a visual countdown and plays audio cues before a crash test step begins.

Crash Test Task List

Reference for `gameplay_crashTest_crashTestTaskList`, which manages the in-game task list UI for crash test missions, showing step objectives and their completion status.

On this page

OverviewExportsScore ParametersHow It WorksDamage Severity LevelsKey BehaviorsModule VariablesSee Also