`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
Debug extension that measures suspension natural frequencies on the player vehicle's front and rear axles. Displays an ImGui window with frequency spectrum analysis and category matching (Luxury, Spor
Debug extension that measures suspension natural frequencies on the player vehicle's front and rear axles. Displays an ImGui window with frequency spectrum analysis and category matching (Luxury, Sporty, Rally, etc.).
Exports
| Function | Signature | Description |
|---|---|---|
run | () | Open the tester window and reset all measurements |
Lifecycle Hooks
| Hook | Description |
|---|---|
onUpdate | Per-frame: samples node Z positions and feeds frequency filters |
How It Works
Running the Tester
Activate from the in-game console:
extensions.suspensionFrequencyTester.run()Setup for accurate results:
- Move the vehicle to a flat, low-friction surface (ice)
- Remove suspension damping if possible (isolates spring frequency)
- Run the tester - let the vehicle bounce for several seconds
What It Measures
The tester samples the Z-position of two axle nodes each frame, then passes the signal through a bank of frequency-existence filters spanning 0.5 Hz to 5.0 Hz. This produces an amplitude spectrum showing which frequencies are present in the suspension's natural oscillation.
Frequency Categories
Results are categorized against real-world suspension frequency benchmarks:
| Category | Frequency (Hz) | Description |
|---|---|---|
| Too Soft | 0.9 | Below usable range |
| Luxury | 1.1 | Comfort-oriented (limousines) |
| Average | 1.2 | Typical passenger car |
| Sporty | 1.4 | Sport sedans, GTs |
| Rally | 1.8 | Rally / off-road |
| Racetrack | 2.2 | Circuit racing |
| Aero-Critical | 5.0 | F1 / downforce-dependent |
Each category shows a "match" score (integral of amplitudes in that frequency range, divided by the Hz range), color-coded by intensity.
ImGui Window
The debug window provides:
- Node ID inputs: Front and rear axle node IDs (default: 279, 425)
- Frequency resolution: Slider for number of detected frequencies (100–3000)
- Detector accuracy: Slider for frequency-existence window (1–5, higher = more lag)
- Category table: Per-node breakdown of frequency category matches
- Spectrum plot: Full frequency spectrum graph (0.5–5.0 Hz)
Internals
- Frequency detection: Uses
newFreqExists()- a C++ frequency-existence filter that detects whether a given frequency is present in a time-domain signal - Sampling: Each frame,
veh:getNodePositionXYZ(nodeId)provides the Z-coordinate of the axle node. This is fed to all frequency filters simultaneously - Filter bank: By default, 1000 filters spaced linearly from 0.5 Hz to 5.0 Hz
- Dual-node: Measures front and rear axles independently to detect pitch-mode vs heave-mode frequencies
- Category scoring: For each category, sums amplitudes in the frequency range and divides by the Hz width, then normalizes across all categories for color intensity
Configuration
The default node IDs (279, 425) are hardcoded for a specific vehicle. For other vehicles, you'll need to find the correct axle node IDs:
-- Use the node editor or console to find axle nodes
-- Then adjust in the ImGui window's input fieldsUse Cases
- Suspension tuning: Verify that spring rates produce the intended ride frequency
- Mod validation: Check that custom suspension setups fall within realistic ranges
- Debugging: Identify unexpected resonance or overly soft/stiff setups
- Education: Visualize the relationship between spring rate, mass, and natural frequency
Additional Exports
| Key | Signature | Description |
|---|---|---|
M.onUpdate | (dtReal, dtSim, dtRaw) | (No description available) |
M.run | () | (No description available) |
`spawn` - Vehicle Spawning & Safe Placement
Core vehicle spawning, safe teleportation, and collision-free placement system. Handles creating vehicles, finding non-intersecting positions, ground snapping, and trailer coupling.
C2 WebSocket Handler
Core WebSocket server for the C2 (Command & Control) system. Provides a JSON message bus on localhost for external tools to communicate with the game engine.