Skip to content

Commit

Permalink
v2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
adam10603 authored Feb 20, 2023
2 parents 16aa5a8 + 6710d3a commit 1078f7b
Show file tree
Hide file tree
Showing 14 changed files with 85 additions and 46 deletions.
31 changes: 21 additions & 10 deletions ConfigGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The default settings should be fine for most people, so you can just enjoy the mod without changing anything.
But if you want to fine tune the steering feel, you can do so in the included UI app. This page explains all the settings in the UI app.

![UI App](https://i.imgur.com/9QktZO0.png)
![UI App](https://i.imgur.com/QhVAyzl.png)

# General

Expand All @@ -22,15 +22,23 @@ You can bring up the console with the <kbd>~</kbd> key.

I suggest enabling force-scrolling with the <kbd>⤓</kbd> button in the top left of the console if you're using this.

# Steering
Settings related to regular steering input.
# Steering input
Settings related to steering input from the player.

### Relative steering speed

If enabled, the [Steering speed](#steering-speed) setting is applied to the steering wheel itself. This means that parts like quick ratio steering racks will change the rate of steering down at the wheels, and vehicles with more steering wheel rotation will have a slower steering feel as a result (like trucks or buses). The default input system also does this for added realism.

If disabled, the [Steering speed](#steering-speed) setting is applied to the steered wheels on the ground instead of the steering wheel. This means that parts like quick ratio steering racks will NOT change the rate of steering down at the wheels, they will only make the steering wheel rotate faster or slower. This is less realistic but it provides a more consistent steering feel across different vehicles.

___

### Steering speed
> Range: `0.0` - `10.0`
How fast the steering is.

When using the ***Key (smooth)*** input filter, this setting is reduced internally to 75% of its value.
When using the ***Key (smooth)*** input filter, this setting is reduced internally to 70% of its value.

![SteeringSpeed](https://i.imgur.com/oYO88Cq.gif)

Expand All @@ -39,21 +47,24 @@ ___
### Steering limit offset
> Range: `-5.0` - `5.0` degrees
Changes the steering angle cap. For example a value of `2.0` would let you steer 2° more than normal.
Changes the steering angle cap for turning inward. For example a value of `2.0` would let you steer 2° more than normal.

The default cap (`0.0`) is already very accurate with keeping the steered wheels near their peak grip in a turn, so I don't see a need to change this. I only left this setting here just in case someone runs into a weird edge case. You can ignore this basically.

___

### Relative steering speed
### Countersteer limit offset
> Range: `0.0` - `10.0` degrees
Changes the steering angle cap for countersteering. This only applies to manual countersteer input, not the automatic countersteer assist.

If enabled, the steering speed will be adjusted to each vehicle's max steering wheel rotation. This means that parts like quick ratio steering racks will change the effective steering speed at the wheels, and vehicles that have more steering wheel rotation will have slower steering as a result (like trucks or buses). The default input system also does this.
This cap is relative to the angle of the slide. For example if the car is in a 20° slide, a value of `0.0` would let you countersteer up to 20° while a value of `5.0` would let you countersteer up to 25°.

If disabled, all vehicles will have a similar-ish steering speed at the wheels. This means that parts like quick ratio steering racks will NOT change the effective steering speed at the wheels.
Higher values make countersteering more responsive and vice versa.

___

# Countersteer force
# Countersteer assist
These settings affect how the car's natural countersteer tendency behaves. Manual countersteering is not affected by these.


Expand Down Expand Up @@ -108,7 +119,7 @@ Think of a lower setting like having a looser grip on the steering wheel and let

The difference this setting makes depends on the [Response](#response) and [Max angle](#max-angle) settings. The stronger you make the car's countersteer force, the more difference you'll notice when you allow it to resist your input.

When using the ***Key (smooth)*** input filter, this setting is reduced internally to 75% of its value.
When using the ***Key (smooth)*** input filter, this setting is reduced internally to 70% of its value.

In the GIF below, the car starts to gently oversteer after the turn begins. Low input authority allows the car to correct the slide to an extent despite the player fully turning inwards.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# BeamNG.drive: Arcade Steering
![Version](https://img.shields.io/badge/Version-2.3.1-blue.svg) ![Compatibility](https://img.shields.io/badge/Game_compatibility-v27.2.0-green.svg)
![Version](https://img.shields.io/badge/Version-2.4-blue.svg) ![Compatibility](https://img.shields.io/badge/Game_compatibility-v27.2.0-green.svg)

## Intro 🖊️

Expand Down Expand Up @@ -32,7 +32,7 @@ Go to ***Options*** ➡ ***Controls*** ➡ ***Bindings*** ➡ ***Vehicle***, and

The mod will not do anything if you use the ***Wheel (direct)*** filter, as it's only meant for keyboard and controller. But for steering input specifically, it does modify the behavior of the other filter types.

The ***Key (smooth)*** filter will lower the [Steering speed](ConfigGuide.md#steering-speed) and [Input authority](ConfigGuide.md#input-authority) settings to 75% of their original value when you drive. This gives a smoother feel that's easier to control on keyboard. The ***Key (fast)*** and ***Gamepad*** filters are identical, and both use the config values as-is.
The ***Key (smooth)*** filter will lower the [Steering speed](ConfigGuide.md#steering-speed) and [Input authority](ConfigGuide.md#input-authority) settings to 70% of their original value when you drive. This gives a smoother feel that's easier to control on keyboard. The ***Key (fast)*** and ***Gamepad*** filters are identical, and both use the config values as-is.

Any steering-related option in the game such as ***Understeer reduction assistant***, ***Oversteer reduction assistant***, ***Slower steering at high speed*** or ***Limit steering at high speed*** will not work as long as you're driving with this mod enabled. This is because the mod completely bypasses the default steering system and uses its own logic for everything.

Expand Down
7 changes: 4 additions & 3 deletions lua/ge/extensions/arcadeSteeringGE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ local defaultConfig = {
["steeringSpeed"] = 1.0,
["relativeSteeringSpeed"] = true,
["steeringLimitOffset"] = 0.0,
["countersteerLimitOffset"] = 5.0,
["counterForce.useSteeredWheels"] = true,
["counterForce.response"] = 0.25,
["counterForce.response"] = 0.2,
["counterForce.maxAngle"] = 8.0,
["counterForce.inputAuthority"] = 0.6,
["counterForce.damping"] = 0.65,
["counterForce.inputAuthority"] = 0.7,
["counterForce.damping"] = 0.7,
}

local steeringCfg = mergeObjects(defaultConfig, {})
Expand Down
16 changes: 9 additions & 7 deletions lua/vehicle/extensions/auto/arcadeSteering/arcadeSteering.lua
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ local lastHardSurfaceVal = 1 -- 0 if driving offroad, 1 on hard surfaces.
local counterForceLPF = newTemporalSmoothingNonLinear(30, 30, 0) -- Low pass filters for the automatic countersteer force. These are used to let small vibrations through even when the countersteer force is meant to be suppressed.
local counterForce2LPF = newTemporalSmoothingNonLinear(30, 30, 0)
local counterBlendSpeedCap = newTemporalSmoothing(6.0, 6.0, 6.0, 0)
local manualCounterBlendCap = newTemporalSmoothing(6.0, 6.0, 6.0, 0)
local manualCounterBlendCap = newTemporalSmoothingNonLinear(10, 10, 0)
local steeredTorqueSmoother = newTemporalSmoothingNonLinear(8, 8, 0)
local steeredGripSmoother = newTemporalSmoothingNonLinear(8, 8, 0)

Expand Down Expand Up @@ -714,7 +714,7 @@ local function customPhysicsStep(dtPhys)
calibrationStage = 3
calibratedLockRad = calibratedLockRad * 1.02
calibrationExpXY[2] = calibrationExpXY[2] * 1.02 -- The angles usually measure slightly low
calibrationExpXY[2] = calibrationExpXY[2] / calibratedLockRad - 0.01 -- A small correction is needed to the curve because of the angle adjustments
calibrationExpXY[2] = calibrationExpXY[2] / calibratedLockRad + 0.001 -- A small correction is needed to the curve because of the angle adjustments
local exponent = getSteeringCurveExponent(calibrationExpXY[1], calibrationExpXY[2])

steeringCurveExp = clamp(exponent, 0.7, 1.3)
Expand Down Expand Up @@ -923,7 +923,7 @@ local function getSteeringSpeedMult(filter, baseSteeringSpeedMult)
local ret = steeringCfg["steeringSpeed"] * ((electrics.values.airspeed / 150.0) + 1.0) -- // TODO add a config value for this or something
ret = ret * baseSteeringSpeedMult
if filter == FILTER_KBD then
ret = ret * 0.75
ret = ret * 0.7
end
return ret
end
Expand Down Expand Up @@ -984,15 +984,15 @@ local function getSteeringLimit(allWheelData, velLen, effectiveAuthority, dt)
local c = math.sqrt(a * a + b * b) -- // FIXME use steered wheel pos or something instead of entire wheelbase // FIXME remove fixme because its probably fine
local beta = math.asin(b / c)
local desiredLimitRad = (math.pi * 0.5) - beta -- Steering angle at which the wheels' normal would point to the center of the turning circle
local authorityCorrection = (1.0 - effectiveAuthority) * 0.4 * steeringCfg["counterForce.response"] * inverseLerpClamped(0, 0.5, steeringCfg["counterForce.maxAngle"], 0, 1) -- Depends on how the input authority is processed. Changing the countersteer force behavior will require a change to this.
local authorityCorrection = (1.0 - effectiveAuthority) * 0.6 * steeringCfg["counterForce.response"] * inverseLerpClamped(0, 0.5, steeringCfg["counterForce.maxAngle"], 0, 1) -- Depends on how the input authority is processed. Changing the countersteer force behavior will require a change to this.
desiredLimitRad = desiredLimitRad + math.rad(getLimitCorrection(allWheelData)) + math.rad(authorityCorrection) + math.rad(steeringCfg["steeringLimitOffset"])

-- print(b)
-- print(math.deg(desiredLimitRad))
-- print(string.format("Authority correction: %8.3f", authorityCorrection))
-- print(string.format("Limit correction: %8.3f", getLimitCorrection(allWheelData)))

return clamp01((desiredLimitRad + math.rad(0.2)) / steeringLockRad)
return clamp01((desiredLimitRad + math.rad(0.4)) / steeringLockRad)
end

local function getHardSurfaceVal(allWheelData, minGroundedWheels, lastVal)
Expand Down Expand Up @@ -1068,7 +1068,7 @@ end

-- Lowers the input authority setting for keyboard
local function getEffectiveInputAuthority(filter)
return (filter == FILTER_KBD) and (steeringCfg["counterForce.inputAuthority"] * 0.75) or steeringCfg["counterForce.inputAuthority"]
return (filter == FILTER_KBD) and (steeringCfg["counterForce.inputAuthority"] * 0.7) or steeringCfg["counterForce.inputAuthority"]
end

-- local gxSmootherTest = RunningAverage:new(100)
Expand Down Expand Up @@ -1160,9 +1160,11 @@ local function processInput(e, dt)
return limit, _counterForce
end

local counterLimitOffset = clamp(1 - rearSlipAngleAbs / 180.0, 0.5, 1.0) * steeringCfg["countersteerLimitOffset"]

-- Returns the steering limit and countersteer force that would be in effect if the player was countersteering
local function processInputCounter()
local manualCounterCap = inverseLerpClamped(0, math.max(steeringLockRad, math.rad(8)), math.rad(rearSlipAngleAbs) + math.rad(4), 0, 1) -- // FIXME travel direction??
local manualCounterCap = inverseLerpClamped(0, math.max(steeringLockDeg, 8), rearSlipAngleAbs + counterLimitOffset, 0, 1) -- // FIXME travel direction??
manualCounterCap = manualCounterCap
manualCounterCap = clamp01(manualCounterCap - (sign(originalInput) * counterForce))
return manualCounterCap, counterForce
Expand Down
Binary file added mod_info/MPRB2QXY3/images/995345.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mod_info/MPRB2QXY3/images/995346.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 27 additions & 16 deletions mod_info/MPRB2QXY3/info.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,72 @@
{
"attachments": [],
"attachments": [
{
"data_filename": "995345.png",
"original_filename": "CGhkVZe.png",
"thumb_filename": "thumbs\/995345.jpg"
},
{
"data_filename": "995346.png",
"original_filename": "QhVAyzl.png",
"thumb_filename": "thumbs\/995346.jpg"
}
],
"resource_id": 24284,
"current_version_id": 44553,
"current_version_id": 44642,
"download_count": 0,
"resource_version_id": 44642,
"version_string": "2.3.1",
"last_update": 1676277502,
"resource_version_id": 44748,
"version_string": "2.4",
"last_update": 1676536051,
"rating_avg": 4.86667,
"rating_count": 0,
"rating_sum": 0,
"resource_category_id": 7,
"resource_date": 1667383346,
"review_count": 16,
"tag_line": "An overhaul of the steering input system for controller and keyboard.",
"update_count": 5,
"path": "MPRB2QXY3\/44553\/",
"update_count": 6,
"path": "MPRB2QXY3\/44642\/",
"filename": "arcadeSteering.zip",
"title": "Arcade Steering",
"user_id": 474788,
"username": "lmaoxd",
"tagid": "MPRB2QXY3",
"message": "[B][I]\nThis is a complete overhaul of BeamNG's steering input system for controller and keyboard players.[\/I][\/B]\n\n[CENTER][IMG]https:\/\/i.imgur.com\/CGhkVZe.png[\/IMG][\/CENTER]\n\nArcade Steering aims to give vehicles a more intuitive steering feel that makes driving more predictable and fun. It's suited for all kinds of driving including track racing, rallying, drifting etc.\n\nThe main features include:\n[LIST]\n[*]Accurate steering limit to utilize the steered wheels' peak grip\n[LIST]\n[*]This is similar to the [I]Understeer reduction assistant[\/I] in 0.26+\n[\/LIST]\n[*]Natural countersteer tendency, simulating the effects of the car's caster angle\n[LIST]\n[*]This is similar to the [I]Oversteer reduction assistant[\/I] in 0.26+\n[\/LIST]\n[*]More refined steering feel compared to the stock assists\n[*]Highly customizable settings\n[\/LIST]\nDespite the \"arcade\" name this isn't an unrealistic or artificial driver-aid. The mod mostly mimics how the steering behaves on real cars, and makes controller and keyboard driving more on par with using a force-feedback steering wheel.\n\nThe mod includes a UI app called [I]Arcade Steering Settings[\/I] which lets you fine tune the steering feel to your liking, although the default settings should be fine for most people.\n\n[CENTER][IMG]https:\/\/i.imgur.com\/9QktZO0.png[\/IMG][\/CENTER]\n\nFor more info you can visit the project's [URL='https:\/\/github.com\/adam10603\/BeamNG-Arcade-Steering'][B][U]Github page[\/U][\/B][\/URL] which also has a [URL='https:\/\/github.com\/adam10603\/BeamNG-Arcade-Steering\/blob\/main\/ConfigGuide.md'][B][U]configuration guide[\/U][\/B][\/URL] explaining all the settings, or you can visit the mod's [URL='https:\/\/www.beamng.com\/threads\/arcade-steering-mod.85494\/'][B][U]forum thread[\/U][\/B][\/URL] for discussions.\n\nHave fun!",
"message": "[B][I]\nThis is a complete overhaul of BeamNG's steering input system for controller and keyboard players.[\/I][\/B]\n\n[CENTER][ATTACH]995345[\/ATTACH] [\/CENTER]\n\nArcade Steering aims to give vehicles a more intuitive steering feel that makes driving more predictable and fun. It's suited for all kinds of driving including track racing, rallying, drifting etc.\n\nThe main features include:\n[LIST]\n[*]Accurate steering limit to utilize the steered wheels' peak grip\n[LIST]\n[*]This is similar to the [I]Understeer reduction assistant[\/I] in 0.26+\n[\/LIST]\n[*]Natural countersteer tendency, simulating the effects of the car's caster angle\n[LIST]\n[*]This is similar to the [I]Oversteer reduction assistant[\/I] in 0.26+\n[\/LIST]\n[*]More refined steering feel compared to the stock assists\n[*]Highly customizable settings\n[\/LIST]\nDespite the \"arcade\" name this isn't an unrealistic or artificial driver-aid. The mod mostly mimics how the steering behaves on real cars, and makes controller and keyboard driving more on par with using a force-feedback steering wheel.\n\nThe mod includes a UI app called [I]Arcade Steering Settings[\/I] which lets you fine tune the steering feel to your liking, although the default settings should be fine for most people.\n\n[CENTER][ATTACH]995346[\/ATTACH] [\/CENTER]\n\nFor more info you can visit the project's [URL='https:\/\/github.com\/adam10603\/BeamNG-Arcade-Steering'][B][U]Github page[\/U][\/B][\/URL] which also has a [URL='https:\/\/github.com\/adam10603\/BeamNG-Arcade-Steering\/blob\/main\/ConfigGuide.md'][B][U]configuration guide[\/U][\/B][\/URL] explaining all the settings, or you can visit the mod's [URL='https:\/\/www.beamng.com\/threads\/arcade-steering-mod.85494\/'][B][U]forum thread[\/U][\/B][\/URL] for discussions.\n\nHave fun!",
"category_title": "",
"prefix_title": "",
"via": "packed by repo on Wed, 15 Feb 2023 23:01:35 GMT",
"via": "packed by repo on Mon, 20 Feb 2023 03:00:39 GMT",
"hashes": [
[
"scripts\/arcadeSteering\/modScript.lua",
"ad2e1a31f856b5c7"
],
[
"lua\/vehicle\/extensions\/auto\/arcadeSteering\/arcadeSteering.lua",
"e36825827bc98964"
"3af7748156274900"
],
[
"lua\/ge\/extensions\/arcadeSteeringGE.lua",
"58585ae671e0be86"
"d0ed0341788cc18c"
],
[
"ui\/modules\/apps\/ArcadeSteering\/app.js",
"c2cebeba9366481d"
"975bfc868f4a930f"
],
[
"ui\/modules\/apps\/ArcadeSteering\/app.css",
"be65d7b1b300e447"
"7e85e1be193d9204"
],
[
"ui\/modules\/apps\/ArcadeSteering\/app.png",
"7bf6c72eb3dd604f"
"892923e120abef90"
],
[
"ui\/modules\/apps\/ArcadeSteering\/app.html",
"ed01991c1e439ac6"
"566b26d8dbd80e54"
],
[
"ui\/modules\/apps\/ArcadeSteering\/app.json",
"64b47069e1ccc9dc"
"3d326e078df309a6"
]
]
}
Binary file added mod_info/MPRB2QXY3/thumbs/995345.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mod_info/MPRB2QXY3/thumbs/995346.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions ui/modules/apps/ArcadeSteering/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ input[type="number"] {
.input-container, .formatted-input-container {
position: relative;
user-select: none;
caret-color: transparent;
}

.formatted-input-container[altered-value]:before {
content: attr(altered-value);
position: absolute;
left: var(--input-padding-left);
pointer-events: none;
}

.formatted-input-container[altered-value] input {
Expand Down
Loading

0 comments on commit 1078f7b

Please sign in to comment.