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
Activity ManagerAudio Bank ManagerAudio Ribbon SystemBus Route ManagerCamera SystemCore Chat (IRC)Core CheckpointsCore Command HandlerCoupler Camera ModifierDevices (RGB Peripherals)Dynamic PropsEnvironmentFlowgraph ManagerForestFun StuffGame ContextGame StateGround Marker ArrowsGround MarkersHardware InfoHighscoresHotlappingInventoryJob SystemLap TimesLevelsLoad Map CommandMetricsMod ManagerMultiseatMultiseat CameraMulti SpawnOnlinePaths (Camera Paths)Quick Access (Radial Menu)Recovery PromptRemote ControllerReplayRepositoryRope Visual TestScheme Command ServerCore SnapshotCore SoundsCore TerrainTraffic SignalsTrailer RespawnVehicle Active PoolingVehicle Bridge (GE ↔ VLua Communication)Vehicle MirrorsVehicle PaintsCore VehiclesVehicle TriggersVersion UpdateWeather SystemWindows Console

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 Extensionscore

Metrics

ImGui-based performance metrics overlay. Displays FPS, frame times, GPU wait times, and detailed rendering statistics with three display modes.

ImGui-based performance metrics overlay. Displays FPS, frame times, GPU wait times, and detailed rendering statistics with three display modes.


Public Functions

FunctionSignatureDescription
M.toggle()Cycles through display modes: 0 (off) → 1 (minimal) → 2 (simple) → 3 (full) → 0
M.onUpdate(dtReal, dtSim, dtRaw)Renders the metrics overlay each frame
M.onInit()Sets extension to manual unload mode
M.onSerialize() → tableSaves current display mode
M.onDeserialized(d)Restores display mode

Module State

FieldTypeDescription
M.currentModenumberDisplay mode: 0=off, 1=minimal, 2=simple, 3=full
M.dependenciesTable. Required extensions: {'ui_imgui', 'ui_visibility'}
dependenciestable{"ui_imgui", "ui_visibility"}
currrentModevariesd.currentMode

Display Modes

ModeContent
0Hidden (extension unloads itself)
1Single line: FPS instant/avg/min/max
2Table with FPS + DT rows, percentile stats (p90/p95/p99), GPU wait, framerate managers
3Mode 2 plus GFX stats, terrain cells, ground cover, forest, shadow, light manager, deferred lights

Console Variables Read

VariableDescription
fps::instantaneousCurrent frame rate
fps::avgAverage frame rate
fps::min / fps::maxMin/max frame rates
fps::p90 / fps::p95 / fps::p99Percentile frame rates
fps::instantaneousUncapUncapped frame rate
fps::waitForGPUGPU wait time in ms
$GFXDeviceStatistics::*Draw calls, poly count, state changes
$TerrainBlock::*Terrain rendering stats
$Forest::*Forest cell rendering stats
$ShadowStats::*Shadow map stats

Usage Example

-- Toggle metrics overlay
core_metrics.toggle()

-- Check current mode
if core_metrics.currentMode > 0 then
  print("Metrics overlay is visible")
end

Dependencies

  • ui_imgui - ImGui rendering
  • ui_visibility - Checks if ImGui is visible; falls back to debugDrawer text

Notes

  • When ImGui is not visible, metrics are drawn using debugDrawer:drawTextAdvanced.
  • The Performance Graph can be opened from mode 2+ via a button (CTRL+SHIFT+F).
  • FPS limiter randomness is displayed as a warning when active.
  • Window is non-dockable, auto-sized, and anchored to the top-left corner.

See Also

  • globals - settings.getValue, getConsoleVariable

Load Map Command

Handles deep-link/startup commands to load a specific map with optional camera position. Parses level paths and camera transforms from structured command data.

Mod Manager

Core mod management system. Discovers, validates, mounts, activates/deactivates, packs/unpacks mod ZIP files and unpacked mod directories. Persists mod state in `mods/db.json`.

On this page

Public FunctionsModule StateDisplay ModesConsole Variables ReadUsage ExampleDependenciesNotesSee Also