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

util/worker - Batch Job 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)

util/vehicleRopeDebug - Rope Physics Debug UI

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

util/wsTest - WebSocket Test Server

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 Exports