Skip to content

Commit

Permalink
v2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
adam10603 authored Feb 24, 2023
2 parents 1078f7b + b8d3544 commit ccd1a7e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 24 deletions.
14 changes: 7 additions & 7 deletions ConfigGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ 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 enabled, the [Steering speed](#steering-speed) setting is applied to the steering wheel itself. This means that different 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.
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 different 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.

___

Expand All @@ -49,14 +49,14 @@ ___
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.
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 for experimentation or edge cases. You can ignore this basically.

___

### 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.
Changes the steering angle cap for countersteering. This only applies to manual countersteer input, not the automatic countersteer.

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°.

Expand All @@ -81,7 +81,7 @@ ___
### Response
> Range: `0.0` - `1.0`
Adjusts how easily the car's natural countersteer force can reach it's maximum ([Max angle](#max-angle)). This does not affect manual countersteering.
Adjusts how aggressively the car's own countersteer force ramps up (before it caps out at [Max angle](#max-angle)). This does not affect manual countersteering.

Higher values will make the car feel tighter, causing its natural countersteer force to fight harder to go straight.

Expand Down Expand Up @@ -132,12 +132,12 @@ ___
How much damping force to apply to the car's own countersteer force.

Without damping, the car's countersteering might overshoot and oscillate left and right when trying to straighten out. Damping helps the countersteer force to settle down and prevents it from overcorrecting.
Without damping, the car's countersteer force might overshoot and oscillate left and right when trying to straighten out. Damping helps it to settle down.

This is most noticeable in high-grip cars when you stop giving steering input during a high-speed turn and let the car try to straighten out on its own.

In general, the stronger you make the car's countersteer tendency with the [Response](#response) and [Max angle](#max-angle) settings, the more damping you'll need. You'll also need more damping if the [Use steered wheels](#use-steered-wheels) setting is enabled, as that's naturally less stable.

I wouldn't recommend using more damping than necessary as too much can cause unwanted vibrations in some cars. If you notice the steering spazzing out sometimes (especially under braking), you might want to decrease damping.
I wouldn't recommend using more damping than necessary as too much can cause unwanted vibrations in some cars. If you notice the steering unnaturally spazzing out sometimes, you might want to decrease damping.

![Damping](https://i.imgur.com/SdnhUcA.gif)
2 changes: 1 addition & 1 deletion 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.4-blue.svg) ![Compatibility](https://img.shields.io/badge/Game_compatibility-v27.2.0-green.svg)
![Version](https://img.shields.io/badge/Version-2.4.1-blue.svg) ![Compatibility](https://img.shields.io/badge/Game_compatibility-v27.2.0-green.svg)

## Intro 🖊️

Expand Down
32 changes: 28 additions & 4 deletions lua/vehicle/extensions/auto/arcadeSteering/arcadeSteering.lua
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ local maxTorqueSteer = 1.0 -- Deg
-- =================== State (things that need to be reset)

local steeringSmoother = SmoothTowards:new(3.5, 0.15, -1, 1, 0)
local steeringSmootherAbs = SmoothTowards:new(3.5, 0.15, -1, 1, 0)
-- local counterSmoother = SmoothTowards:new(3.5, 0.15, -1, 1, 0) -- For manual countersteer input
local counterAssistSmoother = SmoothTowards:new(7, 0.15, -1, 1, 0) -- Only for the assist
local counterAssistSmoother2 = SmoothTowards:new(7, 0.15, -1, 1, 0) -- Only for the assist (inward)
Expand Down Expand Up @@ -416,6 +417,25 @@ local function debugBar(vehicleTransform, val, max, colorArr, slot)
)
end

local function debugWheels(allWheelData)
for i,w in ipairs(allWheelData) do
local posOffset = w.transformWorld.upVec:cross(w.transformWorld.fwdVec) * 0.5 * -w.wheelDir
obj.debugDrawProxy:drawCylinder(
w.transformWorld.pos + posOffset,
w.transformWorld.pos + posOffset + w.transformWorld.fwdVec,
0.02,
color(255, 255, 0)
)

obj.debugDrawProxy:drawCylinder(
w.transformWorld.pos + posOffset,
w.transformWorld.pos + posOffset + w.velocityWorld:normalized(),
0.02,
color(0, 255, 255)
)
end
end

local function getHardSurfacesById()
if not hardSurfaceCache then
hardSurfaceCache = {}
Expand Down Expand Up @@ -568,7 +588,8 @@ local function getWheelData(wheelIndex, vehTransform, ignoreAirborne)
tireVolume = wheels.wheels[wheelIndex].tireVolume,
tireSoftness = wheels.wheels[wheelIndex].softnessCoef,
isPropulsed = wheels.wheels[wheelIndex].isPropulsed,
propulsionTorque = wheels.wheels[wheelIndex].propulsionTorque * wheels.wheels[wheelIndex].wheelDir
propulsionTorque = wheels.wheels[wheelIndex].propulsionTorque * wheels.wheels[wheelIndex].wheelDir,
wheelDir = wheels.wheels[wheelIndex].wheelDir
-- tireWidth = wheels.wheels[wheelIndex].tireWidth
}
end
Expand Down Expand Up @@ -659,7 +680,7 @@ local function customPhysicsStep(dtPhys)
if calibrationStage < 2 then
calibrationDuration = calibrationDuration + dtPhys

if calibrationDuration > 2 then
if calibrationDuration > 2.5 then
log("W", logTag, "Steering calibration was canceled because it took longer than expected. Try reloading the vehicle (Ctrl+R) on a flat surface!")
calibrationStage = 3
return
Expand Down Expand Up @@ -738,6 +759,7 @@ end

local function reset()
steeringSmoother:reset()
steeringSmootherAbs:reset()
counterAssistSmoother:reset()
counterAssistSmoother2:reset()
isGroundedSpeedCap:reset()
Expand Down Expand Up @@ -915,7 +937,7 @@ end

-- Gets the baseline steering speed multiplier based on the relative steering speed setting
local function getBaseSteeringSpeedMult()
return steeringCfg["relativeSteeringSpeed"] and (580 / v.data.input.steeringWheelLock) or 1
return steeringCfg["relativeSteeringSpeed"] and (540 / v.data.input.steeringWheelLock) or 1
end

-- Calculates the final steering speed multiplier based on speed, input method, and settings
Expand Down Expand Up @@ -1089,7 +1111,7 @@ local function processInput(e, dt)
-- ======================== Gathering measurements, assembling data

local originalInput = ival
local originalInputAbs = math.abs(ival)
local originalInputAbs = clamp(steeringSmootherAbs:getWithSpeedMult(math.abs(e.val), dt, steeringSpeedMult), e.minLimit, e.maxLimit) -- Using a smooth version of the absolute value instead of the absolute of the smooth version. Needs an additional smoother but works better this way.
local vehicleTransform = getVehicleTransform()
local worldVel = stablePhysicsData.vehVelocity:get() or vec3()
local localVel = vehicleTransform:vecToLocal(worldVel)
Expand Down Expand Up @@ -1220,6 +1242,8 @@ local function processInput(e, dt)
-- gxSmootherTest:add(sensors.gx2 / obj:getGravity())
-- print(string.format("Gx = %8.3f", gxSmootherTest:get()))
-- print(string.format("SPEED: %8.3f", localHVelKmh))

-- debugWheels(allWheelData)
end

-- obj.debugDrawProxy:drawSphere(0.2, vehicleTransform:pointToWorld(wheelsMidPoint), color(255, 0, 255, 255))
Expand Down
22 changes: 11 additions & 11 deletions mod_info/MPRB2QXY3/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
}
],
"resource_id": 24284,
"current_version_id": 44642,
"current_version_id": 44748,
"download_count": 0,
"resource_version_id": 44748,
"version_string": "2.4",
"last_update": 1676536051,
"rating_avg": 4.86667,
"resource_version_id": 44835,
"version_string": "2.4.1",
"last_update": 1676882406,
"rating_avg": 4.875,
"rating_count": 0,
"rating_sum": 0,
"resource_category_id": 7,
"resource_date": 1667383346,
"review_count": 16,
"review_count": 17,
"tag_line": "An overhaul of the steering input system for controller and keyboard.",
"update_count": 6,
"path": "MPRB2QXY3\/44642\/",
"update_count": 7,
"path": "MPRB2QXY3\/44748\/",
"filename": "arcadeSteering.zip",
"title": "Arcade Steering",
"user_id": 474788,
Expand All @@ -34,15 +34,15 @@
"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 Mon, 20 Feb 2023 03:00:39 GMT",
"via": "packed by repo on Fri, 24 Feb 2023 03:00:30 GMT",
"hashes": [
[
"scripts\/arcadeSteering\/modScript.lua",
"ad2e1a31f856b5c7"
],
[
"lua\/vehicle\/extensions\/auto\/arcadeSteering\/arcadeSteering.lua",
"3af7748156274900"
"195c3927f505ae16"
],
[
"lua\/ge\/extensions\/arcadeSteeringGE.lua",
Expand All @@ -66,7 +66,7 @@
],
[
"ui\/modules\/apps\/ArcadeSteering\/app.json",
"3d326e078df309a6"
"0db5c6db690ba91e"
]
]
}
2 changes: 1 addition & 1 deletion ui/modules/apps/ArcadeSteering/app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Arcade Steering Config",
"author": "Adam",
"version": "2.4",
"version": "2.4.1",
"description": "Settings for the Arcade Steering mod",
"directive": "arcadeSteering",
"types": [
Expand Down

0 comments on commit ccd1a7e

Please sign in to comment.