This section is work in progress! Some links might lead to pages that are not yet finished, and will not work.
Summary
The vehicle controller is the main controller for any powered vehicle in beamNG. It manages the powertrain controls and interfaces with the different shift logic controllers for the various transmission types.
Either this controller or the dummy controller must be called on any vehicle or prop for it to work properly.
It is the main source of electrics
data for engine and transmission information.
File Info
|
|
| Filename |
vehicleController.lua |
| Path |
/lua/vehicle/controller/vehicleController.lua |
| Type |
Main |
| Usage type |
Single |
| defaultOrder |
500 |
JBeam Properties
These properties are the properties specific to the vehicle controller itself.
Each shift-logic sub-controllers will also have it’s own specific properties, depending on the type of gearbox.
Only applies to automatic gearboxes and arcade mode.
Only applies to automatic gearboxes and arcade mode.
Only applies to automatic gearboxes and arcade mode.
Only applies to automatic gearboxes and arcade mode.
Only applies to automatic gearboxes and arcade mode.
Used for the optimal shift point calculation.
Only applies to automatic gearboxes and arcade mode.
A higher value means the controller will upshift more quickly when decreasing throttle.
Only applies to automatic gearboxes and arcade mode.
A higher value means the controller will downshift more quickly when increasing throttle
Only applies to automatic gearboxes and arcade mode.
A higher value means the controller will downshift more quickly when increasing throttle.
Only applies to automatic gearboxes and arcade mode.
A higher value means the controller will upshift more quickly when decreasing throttle
Disable for to simulate mechanical or older electronic gearboxes.
Won’t be active if smaller than 0.
Won’t be active if smaller than 0.
Only applies to automatic gearboxes and arcade mode.
Helps stop the car from shifting up immediately when spinning the tires.
Only applies to automatic gearboxes and arcade mode.
Helps stop the car from downshifting immediately when the driven tires lock up from braking.
Mostly used with electric motors, as they aren’t used with a gearbox.
Applies to manual gearboxes when using shiftUp/shiftDown buttons, and when shifting with a DCT gearbox when chosen gear is not preselected.
Does not apply to manual gearboxes when using an H-shifter.
Only applies to automatic gearboxes and arcade mode.
Only applies to automatic gearboxes and arcade mode.
Public Functions
Shifts the transmission up one gear.
Shifts the transmission down one gear.
Shifts the transmission to the selected gear.
Switches between arcade and realistic shifting modes.
Sets the gearbox mode to the defined option.
Applies the parking brake and keeps it on if the user is actually parking the car.
Activates the engine starter.
Activates engine ignition.
Enables the transmission lock.
Sends torque and power related data to the UI.
Called upon active vehicle switch, executes code that upstes the UI.
Public Properties
Array containing a lot of engine related information for use by GUI elements
Exposes the temperature of an engine-like powertrain device to the fire simulation
Electrics
Inputs
Indicates if the ignition is currently on. Will stay on if you stall.
Throttle percentage. Affected by things like rev-matching and throttle cut in the transmission shift logic.
Engine Information
Indicates if the engine is disabled and can’t be turned on due to an issue.
Engine load percentage,based on current torque compared to the maximum amount of torque the engine can produce.
Effective throttle level. Will be 0 if the engine is disabled.
Indicates if the engine is currently on.
Temperature of the engine oil (used as the main engine temp on air cooled cars).
Spin function for the radiator fan,which activates when the radiator fan turns on. Used for props.
Indicates if the ignition is currently on. Will stay on if you stall.
Temperature of the radiator water (used as the main engine temp on water cooled cars).
Fuel Information
Percentage of fuel left in the tank.
Volume of fuel left in the tank
Indicates that there is less than 10% fuel left in the tank.
Transmission Information
Currently selected gear. Same as gear index for manuals,other types will return the shifter position (PRDN) and add an S/M prefix before the gear number in manual modes.
Indicates the current shifter position on automatic and DCT gearboxes.
Currently selected gear index. Reverse gears are negative,neutral is 0
Indicates if the gearbox is currently mid-shift
The smoothed AV shift logic uses to determine arcade reverse switch and auto braking (among other things),exposed for the AI to use
Example Usage
"controller": [
["fileName"],
["vehicleController", {}],
],
"vehicleController": {
"calculateOptimalLoadShiftPoints": true,
"transmissionGearChangeDelay":2,
"gearboxDecisionSmoothingUp":2,
"gearboxDecisionSmoothingDown":2,
"aggressionSmoothingUp":1,
"aggressionSmoothingDown":0.5,
"aggressionHoldOffThrottleDelay":1.75,
"lowShiftDownRPM":1000,
"lowShiftUpRPM":1800,
},
Properties for a vehicle’s vehicleController are usually split between the various engine and transmission components of the vehicle.
Components which reduce the low-end torque might raise the clutchLaunch values, while components which raise the maximum rpm of the engine will raise the highShiftRPM values.