Drive Path Editor
Main editor tool for creating and managing AI drive path splines. Supports **Free Mode** (arbitrary nodes on terrain) and **NavGraph Mode** (waypoint-to-waypoint paths on the navigation graph). Featur
Main editor tool for creating and managing AI drive path splines. Supports Free Mode (arbitrary nodes on terrain) and NavGraph Mode (waypoint-to-waypoint paths on the navigation graph). Features vehicle linking, playback, recording, session save/load, bitmap import, and undo/redo.
Public API
| Function | Signature | Description |
|---|---|---|
M.setSelectedSplineIdx | (idx) | Sets the selected spline index |
M.setSelectedNodeIdx | (idx) | Sets the selected node index |
M.onSerialize | () → table | Serializes all drive path splines for persistence |
M.onDeserialized | (data) | Restores splines, recomputes maps, relinks vehicles |
M.onEditorGui | () | Main editor GUI + rendering callback |
M.onEditorInitialized | () | Registers edit mode, window, and icon |
M.onClientEndMission | () | Removes all splines on map exit |
Spline Properties
| Property | Type | Range | Description |
|---|---|---|---|
delayTime | float | 0–60s | Starting delay before AI begins |
routeSpeed | float | 0–100 m/s | Route speed (set or limit mode) |
aggression | float | 0.3–1.0 | AI aggression level |
numLaps | int | 1–10 | Number of laps (loop mode only) |
isDriveInLane | bool | - | AI drives in lane |
isAvoidCars | bool | - | AI avoids other cars |
isLoop | bool | - | Spline forms a closed loop |
startingNode | int | 1–N | Node where AI starts |
Key Features
- Spline Management: Add, remove, split, flip, join, simplify splines
- Vehicle Linking: Link/unlink splines to scene vehicles for AI playback
- Playback: Play all linked vehicle/spline pairs simultaneously with delay
- Recording: Record vehicle path while driving, auto-simplify with RDP
- Bitmap Import: Import splines from PNG bitmap masks via skeleton tracing
- Session Save/Load: JSON session files with map validation
- Undo/Redo: Full history support for all spline operations
Modes
| Mode | Node Source | Rendering |
|---|---|---|
| Free Mode | Arbitrary 3D positions on terrain | Catmull-Rom surface ribbon |
| NavGraph Mode | Navigation graph waypoints | Graph path + surface ribbon |
Usage Example
-- Activated via editor mode icon (traffic cone)
-- Or programmatically:
editor.selectEditMode(editor.editModes.drivePathSplineEditMode)
-- Session is auto-serialized/deserialized with editor stateDependencies
| Module | Purpose |
|---|---|
editor/drivePathEditor/splineMgr | Core spline data management |
editor/drivePathEditor/playback | AI playback orchestration |
editor/drivePathEditor/record | Vehicle path recording |
editor/toolUtilities/splineInput | Mouse/keyboard spline editing |
editor/toolUtilities/render | Spline rendering (ribbons, surfaces) |
editor/toolUtilities/skeleton | Bitmap path tracing |
editor/toolUtilities/rdp | Ramer-Douglas-Peucker simplification |
editor/toolUtilities/style | ImGui color themes |
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Drift Data Editor
Full-featured editor for drift gameplay data. Two tabs: **Drift Stunt Zones** (donut, driftThrough, hitPole zone placement with scoring) and **Drift Spots** (freeroam drift spot management with spatia
Dynamic Decals Tool (Vehicle Livery Creator)
Editor extension providing the Vehicle Livery Creator - a comprehensive tool for painting decals, brush strokes, paths, and fills onto vehicle surfaces in real-time.