RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
Auto AnnotationBoosterCalibrate ESCCompile ImpostersCompile MeshesConfig List GeneratorDecal Roads EditorDependency TreeDoc CreatorExport (glTF)Follow The White RabbitForest GeneratorGround Model DebugInput System UtilsInstanced Line Render DemoJBeam StatsLog StreamsMap TilesNode Beam ExportNode StreamPhotomodePrecompile ShadersPrecompile VehiclesProcedural Track (Gymkhana Generator)Rectangle GeneratorRender Components APIResave MaterialsRich PresenceSave Dynamic DataScreenshot Creator (Vehicle Thumbnails)ShowroomSort LinesStep HandlerTerrain GeneratorTest Extension ProxiesTest JSON Files Syntaxutil/vehicleRopeDebug - Rope Physics Debug UIutil/worker - Batch Job Workerutil/wsTest - WebSocket Test Server

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 Extensionsutil

Calibrate ESC

Automated ESC (Electronic Stability Control) calibration tool that iterates through vehicle configs and runs measurement tests.

Automated ESC (Electronic Stability Control) calibration tool that iterates through vehicle configs and runs measurement tests.


Overview

util_calibrateESC automates ESC calibration by loading each vehicle configuration on a test level, spawning the vehicle, and running the vehicle-side escMeasurement extension. Uses the job system for async operation with watchdog timeouts.

Extension path: lua/ge/extensions/util/calibrateESC.lua


Exports (M)

FunctionSignatureDescription
onInit()Logs initialization.
onExtensionLoaded()Sets physics speed to 2x, loads blacklist.
onExtensionUnloaded()Logs unload.
vehicleDone()Called by vehicle-side code to signal test completion.
heartbeat()Called by vehicle-side code to reset the watchdog timer.
onClientStartMission(levelPath)Marks the level as ready when the test level is loaded.
work(pcFile, vehicle)Starts the calibration process for a given config/vehicle.

Internals

Test Pipeline

  1. work(pcFile, vehicle) is called with optional filters.
  2. If the test level (/levels/smallgrid/info.json) is not loaded, it loads it.
  3. A job system coroutine iterates through all vehicle configs:
    • Filters by vehicleToTest and pcFileToTest if specified.
    • Skips configs in vehicleBlacklist.
    • Skips configs that already have a .touched info file.
  4. For each config:
    • Replaces the current vehicle with core_vehicles.replaceVehicle().
    • Waits for the new vehicle to appear.
    • Positions it at origin (0, 0, 0.5).
    • Loads and runs escMeasurement.performTests() on the vehicle.
    • Waits until moveNext is set, watchdog triggers (20s no heartbeat), or max runtime (10M ms) exceeded.

Blacklist

Loaded from blacklist.json or blacklistDefault.json at extension load. Vehicles in the blacklist are skipped entirely.

Watchdog

The vehicle-side code must call heartbeat() periodically. If no heartbeat arrives within 20 seconds, the test is aborted and moves to the next config.


How It Works

  1. Load the extension and call work() with optional filters.
  2. The system loads the smallgrid test level.
  3. Each config is tested sequentially via the job system.
  4. The vehicle-side escMeasurement extension performs the actual tests.
  5. Results are written as .touched files to prevent re-testing.
  6. After all configs, the game shuts down with shutdown(0).

Lua Examples

-- Run calibration on all vehicles
extensions.util_calibrateESC.work()

-- Run calibration for a specific vehicle
extensions.util_calibrateESC.work(nil, "pickup")

-- Run calibration for a specific config
extensions.util_calibrateESC.work("sport_config", "pickup")

-- Vehicle-side heartbeat (called from escMeasurement)
extensions.util_calibrateESC.heartbeat()
extensions.util_calibrateESC.vehicleDone()

Additional Exports

  • M.heartbeat - (undocumented)
  • M.onClientStartMission - (undocumented)
  • M.onExtensionLoaded - (undocumented)
  • M.onExtensionUnloaded - (undocumented)
  • M.onInit - (undocumented)
  • M.vehicleDone - (undocumented)
  • M.work - (undocumented)

Booster

Simple trigger-based booster that applies an upward impulse to vehicles entering a trigger zone.

Compile Imposters

Batch imposter compilation tool that iterates through levels and triggers imposter texture updates.

On this page

OverviewExports (M)InternalsTest PipelineBlacklistWatchdogHow It WorksLua ExamplesAdditional Exports