RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Auto AnnotationBoosterCalibrate ESCCompile ImpostersCompile MeshesConfig List GeneratorDecal Roads EditorDependency TreeDoc CreatorVehicle ExporterFollow The White RabbitForest GeneratorGround Model DebugInput System UtilsInstanced Line Render DemoJBeam StatsLog StreamsMap TilesNode Beam ExportNode StreamPhotomodePrecompile ShadersPrecompile VehiclesProcedural Track GeneratorRectangle GeneratorRender Components APIResave MaterialsRich PresenceSave Dynamic DataScreenshot CreatorShowroomSort LinesStep HandlerTerrain GeneratorTest Extension ProxiesTest JSON Files SyntaxVehicle Rope DebugBatch WorkerWebSocket Test

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

Batch Worker

Reference for `extensions/util/worker.lua`. Processes batch work items from a JSON file (`/work.json`) for automated tasks like mesh compilation, imposter generation, mod testing, and vehicle previews

Reference for extensions/util/worker.lua. Processes batch work items from a JSON file (/work.json) for automated tasks like mesh compilation, imposter generation, mod testing, and vehicle previews.


Exports

KeySignatureDescription
onExtensionLoaded()Loads work items from /work.json on startup
onJobDone(job, totalRunning)Callback: shuts down when all jobs complete
onPreRender(dt)Processes work items after 120 frame warmup

Work Item Types

TypeFieldsDescription
compileMeshfilenameCompiles a .dae file to .cdae
testImagefilenameTests an image file (stub)
compileImposterslevelsCompiles imposters for specified levels
testModtagid, resource_version_id, disableSpinScrTests a mod package
renderVehiclePreviewvehiclesRenders vehicle preview images
testVehiclesPerformancespcFile, vehicleSaves dynamic performance data
calibrateESCpcFile, vehicleCalibrates ESC for a vehicle

Internals

  • Startup: Loads helper extensions (test/renderVehiclePreview, util/saveDynamicData, util/calibrateESC, util/compileImposters).
  • 120-frame warmup: Waits 120 frames before processing to ensure the engine is fully initialized.
  • Mesh compilation: compileDae(daePath) calls compileCollada() to convert DAE → CDAE with optional validation.
  • Material loading: loadMaterialsInPath(path) finds and loads both .cs and .json material files.
  • Auto-shutdown: After all work items are processed and all jobs complete, calls shutdown(0).
  • Designed for headless/CLI usage: -lua extensions.load('util_worker') -console -nouserpath.

How It Works

  1. Engine starts with util_worker extension loaded.
  2. On load, reads /work.json containing an array of work items.
  3. After 120 frames, iterates all items and dispatches to handler functions.
  4. Handlers may queue async jobs via core_jobsystem.
  5. Once all jobs complete, the process exits cleanly.
// Example /work.json
[
  {"type": "compileMesh", "filename": "vehicles/etk800/etk800.dae"},
  {"type": "compileImposters", "levels": ["west_coast_usa", "italy"]}
]

Additional Exports

  • M.onExtensionLoaded - (undocumented)
  • M.onJobDone - (undocumented)
  • M.onPreRender - (undocumented)

See Also

  • Auto Annotation - Related reference
  • Booster - Related reference
  • Calibrate ESC - Related reference
  • Game Engine Overview - Guide

Vehicle Rope Debug

Reference for `extensions/util/vehicleRopeDebug.lua`. Provides an ImGui debug sandbox for visualizing and editing rope physics parameters on the current vehicle.

WebSocket Test

Reference for `extensions/util/wsTest.lua`. Runs a local WebSocket server for testing GE Lua execution, reloads, and bandwidth measurements from a browser.

On this page

ExportsWork Item TypesInternalsHow It WorksAdditional ExportsSee Also