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
| Function | Signature | Returns | Description |
|---|---|---|---|
C:init | () | nil | Initializes debug flag state |
C:draw | () | nil | Renders the full ImGui debug panel and 3D visualizations |
C:setRallyManager | (rm) | nil | Sets the rally manager reference |
C:setDebugLogging | (val) | nil | Enables/disables debug logging |
C:toggleMouseMovementCheckbox | () | nil | Toggles mouse-as-vehicle movement mode |
C:onVehicleResetted | () | nil | No-op placeholder |
M.getRallyManager | () | nil | getRallyManager |
M.getDebugLogging | () | nil | getDebugLogging |
M.getRace | () | nil | getRace |
M.toggleMouseLikeVehicleEnableMovement | () | nil | toggleMouseLikeVehicleEnableMovement |
M.clearReccePoints | () | nil | clearReccePoints |
M.drawDebug | () | nil | drawDebug |
KD-Tree Operations
| Function | Signature | Description |
|---|---|---|
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:
- Build KD-tree from race AI path or driveline route
- Navigate through pacenote waypoints (
</>buttons) - Visualize closest route point, closest line segment, and next pacenote waypoint
- 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 visualsSee 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