RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

AI Module ReferenceBackwards Compatibility Module ReferenceBdebug Module ReferenceBdebugImpl Module ReferenceBeamstate Module ReferenceBullettime Module ReferenceController Module ReferenceDamageTracker Module ReferenceDrivetrain Module ReferenceElectrics Module ReferenceElectrics Custom Value ParserEnergyStorage Module ReferenceExtensions Module ReferenceFire Module ReferenceVehicle Engine True GlobalsGuihooks Module ReferenceGUI Streams Module ReferenceHTML Texture Module ReferenceHydros Module ReferenceInput Module ReferenceJBeam-Lua Integration GuideMapmgr Module ReferenceMaterial Module ReferenceBeamNG Math & Unit Conversions Referenceobj (Vehicle C++ Object)PartCondition Module ReferenceParticlefilter Module ReferenceParticles Module ReferencePowertrain Module ReferenceVehicle Property & Module TreeProps Module ReferenceProtocols Module ReferenceRecovery Module ReferenceScriptAI Module ReferenceSensors Module ReferenceSounds Module ReferenceStreams Module ReferenceThrusters Module Reference`v` (Vehicle Data & JBeam)Wheels Module Reference

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 Referenceve

Mapmgr Module Reference

Module defined in `lua/vehicle/mapmgr.lua`. This module interfaces the vehicle with the global navigation graph (NavGraph), handles tracking of nearby vehicles, and provides world analysis tools like

Module defined in lua/vehicle/mapmgr.lua. This module interfaces the vehicle with the global navigation graph (NavGraph), handles tracking of nearby vehicles, and provides world analysis tools like road finding and ground normal estimation.

See Also

  • AI: For higher-level pathfinding logic that uses mapmgr data.
  • Sensors: For physical world sensing.

State Fields

VariableDescription
mapDataThe core graphpath object containing the level's road network, nodes, and edges.
objectsA table containing state data (position, velocity, etc.) for all other tracked vehicles in the world.
objectCollisionIdsA list of object IDs currently in physical contact with this vehicle.
changeSetTracks recent drivability changes in the NavGraph (e.g., roads becoming blocked).

Public API - Navigation & Road Analysis

FunctionSignatureDescription
mapmgr.findClosestRoad(pos, wZ)Finds the nearest road edge using a KD-Tree. Returns nodeA, nodeB, and distance.
mapmgr.findBestRoad(pos, dir, wZ)Similar to findClosestRoad, but weights results based on the vehicle's heading and road one-way rules.
mapmgr.getPointToPointPath(start, target, cutOff, dirMult, ...)Calculates the shortest path between two world coordinates using the NavGraph.
mapmgr.surfaceNormalBelow(pos, radius)Estimates the ground surface normal vector by sampling heights in a triangular pattern around the point.

Public API - World Tracking

FunctionSignatureDescription
mapmgr.getObjects()Returns the most recent snapshot of all nearby vehicle objects.
mapmgr.enableTracking(name) / disableTracking(force)Starts or stops reporting this vehicle's state (position, damage, signals) to the global map manager.
mapmgr.sendTracking()Serializes and transmits local state data (horn, lights, ignition, damage) to the Game Engine. Automatically called during onGraphicsStep.

Public API - Traffic Signals

FunctionSignatureDescription
mapmgr.setSignals(data) / updateSignals(data)Internal synchronization for traffic light states.

Public API - Lifecycle & Data Management

FunctionSignatureDescription
mapmgr.requestMap()Requests a fresh NavGraph snapshot from the Game Engine.
mapmgr.setMap(serial)Imports a new navigation graph from the engine's mailbox.
mapmgr.init() / reset()Standard lifecycle hooks. Initializes tracking and clears object caches.
module.updateDrivabilities()Dynamically Change edge Drivability for the Navgraph
module.setCustomMap(map)Sets the custom map.

JBeam-Lua Integration Guide

A deep dive into how JBeam data structures and Lua logic communicate in BeamNG.drive.

Material Module Reference

Module defined in `lua/vehicle/material.lua`. Manages dynamic vehicle materials, "glowmaps" (lighting), and "deformmaps" (damage textures).

On this page

See AlsoState FieldsPublic API - Navigation & Road AnalysisPublic API - World TrackingPublic API - Traffic SignalsPublic API - Lifecycle & Data Management