diff --git a/ConfigGuide.md b/ConfigGuide.md index ab68e21..49f9a8c 100644 --- a/ConfigGuide.md +++ b/ConfigGuide.md @@ -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 @@ -22,15 +22,23 @@ You can bring up the console with the ~ key. I suggest enabling force-scrolling with the 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) @@ -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. @@ -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. diff --git a/README.md b/README.md index a849a88..82f7ede 100644 --- a/README.md +++ b/README.md @@ -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 🖊️ @@ -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. diff --git a/lua/ge/extensions/arcadeSteeringGE.lua b/lua/ge/extensions/arcadeSteeringGE.lua index e00929c..082ce22 100644 --- a/lua/ge/extensions/arcadeSteeringGE.lua +++ b/lua/ge/extensions/arcadeSteeringGE.lua @@ -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, {}) diff --git a/lua/vehicle/extensions/auto/arcadeSteering/arcadeSteering.lua b/lua/vehicle/extensions/auto/arcadeSteering/arcadeSteering.lua index 38e2d1d..a9ee973 100644 --- a/lua/vehicle/extensions/auto/arcadeSteering/arcadeSteering.lua +++ b/lua/vehicle/extensions/auto/arcadeSteering/arcadeSteering.lua @@ -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) @@ -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) @@ -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 @@ -984,7 +984,7 @@ 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) @@ -992,7 +992,7 @@ local function getSteeringLimit(allWheelData, velLen, effectiveAuthority, dt) -- 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) @@ -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) @@ -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 diff --git a/mod_info/MPRB2QXY3/images/995345.png b/mod_info/MPRB2QXY3/images/995345.png new file mode 100644 index 0000000..0bb4207 Binary files /dev/null and b/mod_info/MPRB2QXY3/images/995345.png differ diff --git a/mod_info/MPRB2QXY3/images/995346.png b/mod_info/MPRB2QXY3/images/995346.png new file mode 100644 index 0000000..2f18b3a Binary files /dev/null and b/mod_info/MPRB2QXY3/images/995346.png differ diff --git a/mod_info/MPRB2QXY3/info.json b/mod_info/MPRB2QXY3/info.json index 42b5e41..9c5d94d 100644 --- a/mod_info/MPRB2QXY3/info.json +++ b/mod_info/MPRB2QXY3/info.json @@ -1,11 +1,22 @@ { - "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, @@ -13,17 +24,17 @@ "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", @@ -31,31 +42,31 @@ ], [ "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" ] ] } \ No newline at end of file diff --git a/mod_info/MPRB2QXY3/thumbs/995345.jpg b/mod_info/MPRB2QXY3/thumbs/995345.jpg new file mode 100644 index 0000000..481db24 Binary files /dev/null and b/mod_info/MPRB2QXY3/thumbs/995345.jpg differ diff --git a/mod_info/MPRB2QXY3/thumbs/995346.jpg b/mod_info/MPRB2QXY3/thumbs/995346.jpg new file mode 100644 index 0000000..1aac672 Binary files /dev/null and b/mod_info/MPRB2QXY3/thumbs/995346.jpg differ diff --git a/ui/modules/apps/ArcadeSteering/app.css b/ui/modules/apps/ArcadeSteering/app.css index 6a8ffbb..d16b4d2 100644 --- a/ui/modules/apps/ArcadeSteering/app.css +++ b/ui/modules/apps/ArcadeSteering/app.css @@ -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 { diff --git a/ui/modules/apps/ArcadeSteering/app.html b/ui/modules/apps/ArcadeSteering/app.html index e2f2f45..acba1e4 100644 --- a/ui/modules/apps/ArcadeSteering/app.html +++ b/ui/modules/apps/ArcadeSteering/app.html @@ -20,8 +20,14 @@ -

Steering

+

Steering input

+
+ +
+ +
+
@@ -30,18 +36,18 @@
-
+
- -
- + +
+
-

Countersteer force

+

Countersteer assist

diff --git a/ui/modules/apps/ArcadeSteering/app.js b/ui/modules/apps/ArcadeSteering/app.js index 5d478ff..be87ad3 100644 --- a/ui/modules/apps/ArcadeSteering/app.js +++ b/ui/modules/apps/ArcadeSteering/app.js @@ -27,9 +27,15 @@ angular.module("beamng.apps").directive("arcadeSteering", [() => { }; scope.formatInput = (inputEm) => { + let originalInput = inputEm.value; + let alteredVal = originalInput; if (inputEm.parentNode.classList.contains("input-format-degree")) { - inputEm.parentNode.setAttribute("altered-value", `${inputEm.value}°`); + alteredVal = `${alteredVal}°`; } + if (inputEm.parentNode.classList.contains("input-format-offset")) { + if (parseFloat(originalInput) > 0) alteredVal = `+${alteredVal}`; + } + inputEm.parentNode.setAttribute("altered-value", alteredVal); }; scope.updateGUIValues = (settings) => { diff --git a/ui/modules/apps/ArcadeSteering/app.json b/ui/modules/apps/ArcadeSteering/app.json index b6060f8..edd6e63 100644 --- a/ui/modules/apps/ArcadeSteering/app.json +++ b/ui/modules/apps/ArcadeSteering/app.json @@ -1,7 +1,7 @@ { "name": "Arcade Steering Config", "author": "Adam", - "version": "2.3.1", + "version": "2.4", "description": "Settings for the Arcade Steering mod", "directive": "arcadeSteering", "types": [ diff --git a/ui/modules/apps/ArcadeSteering/app.png b/ui/modules/apps/ArcadeSteering/app.png index 82d2131..7f36150 100644 Binary files a/ui/modules/apps/ArcadeSteering/app.png and b/ui/modules/apps/ArcadeSteering/app.png differ