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

Input System Utils

Utilities for analyzing and re-formatting input map JSON files. Prints binding statistics and resaves all inputmap files with consistent formatting and sorting.

Utilities for analyzing and re-formatting input map JSON files. Prints binding statistics and resaves all inputmap files with consistent formatting and sorting.


Overview

util_inputSystemUtils provides two main tools: printStats() dumps statistics about input bindings across all inputmap files, and resave() reformats every inputmap JSON with consistent sorting, vendor name resolution, and custom pretty-printing.

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


Exports (M)

FunctionSignatureDescription
printStats()Prints total binding count and top 20 most-used actions.
resave()Resaves all inputmap JSON files with consistent formatting.

Internals

printStats

  1. Scans all *.json files containing inputmaps/ in the path.
  2. Counts total bindings and per-action usage.
  3. Prints the top 20 most-used actions sorted by frequency.

resave

For each inputmap JSON file:

  1. VID/PID resolution: Extracts vendor/product IDs from vidpid field or filename.
  2. Vendor name lookup: Uses vendorNames.json to resolve vendor names.
  3. Binding sorting: Bindings are sorted by control (natural sort), then by action.
  4. Custom JSON encoding: Uses jsonPrettyEncoderCustom with:
    • Key weight ordering: control first (10), default (50), bindings last (99).
    • Folding callback: Collapses small tables (< 4 items) under /bindings/.
  5. Only writes if content changed.

Natural Sort

Uses zero-padded number comparison for natural sorting:

"axis1" < "axis2" < "axis11"  -- instead of "axis1" < "axis11" < "axis2"

VID/PID Validation

isValidVIdPId() checks that the string is exactly 8 hex characters. Invalid IDs are cleared.


How It Works

  1. Call printStats() to see binding statistics.
  2. Call resave() to reformat all inputmap files in-place.
  3. Files that are already correctly formatted are skipped.

Lua Examples

-- Print input binding statistics
extensions.util_inputSystemUtils.printStats()
-- Output:
-- 1523 total bindings
-- top 20 actions:
--  * steering - 45
--  * throttle - 42
--  * brake - 41
--  ...

-- Resave all inputmap files with consistent formatting
extensions.util_inputSystemUtils.resave()

Additional Exports

  • M.printStats - (undocumented)
  • M.resave - (undocumented)

Ground Model Debug

ImGui-based debug tool for visualizing and editing ground model physics properties in real time.

Instanced Line Render Demo

Demo extension showcasing the instanced line and dot rendering API. Features an N-body gravity simulation, grid drawing, sine waves, edge tests, and traffic signal visualization.

On this page

OverviewExports (M)InternalsprintStatsresaveNatural SortVID/PID ValidationHow It WorksLua ExamplesAdditional Exports