Automatic Gearbox Shift Logic
Shift logic module for traditional torque-converter automatic transmissions. Manages upshift/downshift points based on throttle position, vehicle speed, and driver aggression. Supports sport mode, kickdown, and manual override.
Shift logic module for traditional torque-converter automatic transmissions. Manages upshift/downshift points based on throttle position, vehicle speed, and driver aggression. Supports sport mode, kickdown, and manual override.
State Fields
| Field | Type | Description |
|---|---|---|
gearboxHandling, timer, timerConstants, inputValues, shiftPreventionData, shiftBehavior, smoothedValues | table | Internal references to core vehicle controller shared data structures. |
currentGearIndex, maxGearIndex, minGearIndex | number | Active and allowable gear ranges. |
throttle, brake, clutchRatio | number | Active user inputs after arcade or safety processing. |
shiftingAggression | number | Value from 0..1 determining shift speed and RPM thresholds. |
isArcadeSwitched, isSportModeActive, isManualModeActive | boolean | status flags for the active control logic. |
smoothedAvgAVInput, rpm, idleRPM, maxRPM | number | Smoothed engine and gearbox speeds. |
engineThrottle, engineLoad, engineTorque, flywheelTorque, gearboxTorque | number | Real-time powertrain load and torque telemetry. |
ignition, isEngineRunning | boolean | engine status state. |
oilTemp, waterTemp, checkEngine | number | Thermal and diagnostic status. |
energyStorages | table | List of fuel/energy sources for the engine. |
Public API
| Function | Description |
|---|---|
shiftUp() | Manually cycles through PRNDS modes or triggers shifts in M mode. |
shiftToGearIndex(index) | Attempts to shift to a specific mode or gear via H-shifter or external request. |
setDefaultForwardMode(mode) | Configures the primary forward driving mode. |
getGearName() | Returns formatted gear names (e.g., 'D1', 'S2', 'R') and visual position for UI clusters. |
getState() | Handles serialization of transmission mode for saves and reloads. |
Hooks
| Hook | Description |
|---|---|
init(jbeamData, sharedFunctionTable) | Initializes the shift logic, defines available modes (PRNDS), and sets up torque converter lockup parameters. |
gearboxBehaviorChanged(behavior) | Switches the logic handlers based on the user's selected gearbox behavior. |
See Also
- Vehicle Controller — Parent controller
- DCT Gearbox — Dual-clutch alternative
- CVT Gearbox — Continuously variable alternative
Vehicle Controller
The "brain" of the vehicle — maps player inputs (throttle, brake, clutch) to powertrain actions, manages shifting logic, and handles arcade vs. realistic driving modes. Coordinates between input processing, gear selection, engine control, and dashboard output.
CVT Gearbox Shift Logic
Shift logic module for Continuously Variable Transmissions (CVT). Manages the target ratio based on power demand and efficiency, providing seamless ratio changes without discrete gear steps.