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

Compile Imposters

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

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


Overview

util_compileImposters loads levels one-by-one in freeroam mode and calls Engine.Render.updateImposters(true) to regenerate imposter textures. Uses the job system for async level loading and waiting. Designed for build pipelines.

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


Exports (M)

FunctionSignatureDescription
compileImposters(queue)Starts imposter compilation for a list of level names.
onInit()Sets unload mode to manual.
onPreRender(dt)Manages log cooldown timer and timeout shutdown.
onModManagerReady(mod)Signals that mods are activated.
onConsoleLog(timer, lvl, origin, line)Resets log cooldown on any console output.

Internals

Compilation Pipeline

  1. Waits for core_levels and freeroam_freeroam to initialize.
  2. Waits for mod manager activation.
  3. Sleeps 10 seconds for system stabilization.
  4. For each level in the queue:
    • Calls freeroam_freeroam.startFreeroamByName(levelName).
    • Waits for the level and player vehicle to be ready.
    • Sleeps 120 seconds for full level load.
    • Waits for console log activity to cease (cooldown).
    • Calls Engine.Render.updateImposters(true).
    • Sleeps 20 seconds, then waits for log activity to cease again.

Timeout Safety

  • onPreRender increments a frame counter. If it exceeds 6000 frames without reset, the game shuts down.
  • Frame counter resets when moving to a new level or after each wait cycle.

Log Cooldown

Console log activity resets logCooldown to 6000. The system waits until cooldown reaches 0 (no log output) before proceeding, ensuring rendering operations have completed.


How It Works

  1. Call compileImposters() with an array of level names.
  2. The system loads each level sequentially.
  3. After each level loads fully, imposters are updated.
  4. The process continues until all levels are done.

Lua Examples

-- Compile imposters for specific levels
extensions.util_compileImposters.compileImposters({
  "west_coast_usa",
  "east_coast_usa",
  "italy"
})

-- Only one job can run at a time; calling again while active returns false

Additional Exports

  • M.compileImposters - (undocumented)
  • M.onConsoleLog - (undocumented)
  • M.onInit - (undocumented)
  • M.onModManagerReady - (undocumented)
  • M.onPreRender - (undocumented)

See Also

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

Calibrate ESC

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

Compile Meshes

Batch COLLADA (.dae) to compiled COLLADA (.cdae) converter for faster mesh loading. Used in build pipelines.

On this page

OverviewExports (M)InternalsCompilation PipelineTimeout SafetyLog CooldownHow It WorksLua ExamplesAdditional ExportsSee Also