RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Rally Audio ManagerRally Camera Path PlayerRally ClientRally Cut CaptureRally EnumsRally Extension HelperRally GeometryRally ManagerRecce ManagerRecce AppRecce SettingsRally Settings ManagerSnap-to-RoadTraffic Exclusion ZonesRally UtilityRally Vehicle CaptureRally Vehicle Tracker
Rally Dev ToolsRally Loop ToolboxRally Toolbox

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 Extensionsgameplayrallytools

Rally Toolbox

Comprehensive ImGui debug panel for rally stage development. Provides visualization controls for race paths, driveline routes, pacenotes, KD-tree spatial queries, and mouse-as-vehicle simulation.

Comprehensive ImGui debug panel for rally stage development. Provides visualization controls for race paths, driveline routes, pacenotes, KD-tree spatial queries, and mouse-as-vehicle simulation.


Constructor

local RallyToolbox = require('/lua/ge/extensions/gameplay/rally/tools/rallyToolbox')
local rt = RallyToolbox()

Public API

FunctionSignatureReturnsDescription
C:init()nilInitializes debug flag state
C:draw()nilRenders the full ImGui debug panel and 3D visualizations
C:setRallyManager(rm)nilSets the rally manager reference
C:setDebugLogging(val)nilEnables/disables debug logging
C:toggleMouseMovementCheckbox()nilToggles mouse-as-vehicle movement mode
C:onVehicleResetted()nilNo-op placeholder
M.getRallyManager()nilgetRallyManager
M.getDebugLogging()nilgetDebugLogging
M.getRace()nilgetRace
M.toggleMouseLikeVehicleEnableMovement()niltoggleMouseLikeVehicleEnableMovement
M.clearReccePoints()nilclearReccePoints
M.drawDebug()nildrawDebug

KD-Tree Operations

FunctionSignatureDescription
C:buildKdTreeRaceAiPath()Builds KD-tree from race AI path points
C:buildKdTreeDrivelineRouteStatic()Builds KD-tree from static driveline route
C:calcClosestLineSegmentKD()Finds closest AI path segment to selected waypoint
C:calcClosestDrivelineRouteKD()Finds closest driveline route point to vehicle
C:calcNextPacenoteWpForDrivelineRoutePoint()Finds next pacenote waypoint from closest route point

How It Works

Debug Visualization Flags

The panel exposes ~25+ toggleable debug visualizations organized in sections:

Race Path:

  • Pathnodes, AI Route, Splits, Vehicle Tracker
  • Start/Finish Lines, Stop Zone

Race Debug (only when race is active):

  • Current Segment - shows active segment with alternating orange/yellow prisms and intersection planes

Pacenotes:

  • Notebook Pacenotes (CS/CE waypoints with text)
  • Recce Pacenotes (driving-mode preview)

Driveline:

  • Route, Static Route, Short (100-point excerpt)
  • Pacenotes on route, Pacenote text
  • Pathnodes (visible + hidden), Point index, Point metadata
  • Next pacenote waypoint and race pathnode from recalc
  • Completion percentage (km and %)

KD-Tree Tools Section

Interactive spatial query debugging:

  1. Build KD-tree from race AI path or driveline route
  2. Navigate through pacenote waypoints (< / > buttons)
  3. Visualize closest route point, closest line segment, and next pacenote waypoint
  4. Shows squared distance to nearest segment

Mouse-as-Vehicle Mode

Replaces vehicle position with mouse raycast for testing driveline tracking without driving:

  • Toggle tracking: uses mouse position instead of vehicle
  • Toggle movement: enables/disables position updates

Panel Header Info

Displays:

  • Mission name and ID
  • Driveline distance (km)
  • Time allocation (based on distance รท speed limit)
  • Debug logging state
local rt = RallyToolbox()
rt:setRallyManager(rallyManager)
rt:draw()  -- Renders ImGui panel + all enabled 3D debug visuals

See Also

  • devTools - Rally Developer Tools Panel - Related reference
  • loopToolbox - Rally Loop Debug Panel - Related reference
  • Gameplay Systems Guide - Guide

Rally Loop Toolbox

ImGui debug panel for rally loop mode. Displays mission schedule, timing, penalties, proximity data, signboard locations, and provides vehicle/clock controls for testing multi-stage rally events.

Rally Transcripts Entry

Class-based object representing a single transcript entry in the rally editor. Stores vehicle position/rotation data, speech-to-text results, and capture data for pacenote corner analysis. Provides de

On this page

ConstructorPublic APIKD-Tree OperationsHow It WorksDebug Visualization FlagsKD-Tree Tools SectionMouse-as-Vehicle ModePanel Header InfoSee Also