RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
1.03k stars 178 forks source link

Keyboard steering sensitivity #3117

Open cryham opened 10 months ago

cryham commented 10 months ago

I'm steering by keyboard. How do I change how long it takes for steering wheels to turn? It's like 1-2 sec in RoR, and like 0.5 sec or less in StuntRally. It's really annoyingly slow for me, for fast cars.

I don't see any options for it, only mapping in input.map:

TRUCK_STEER_LEFT                   Keyboard            LEFT
TRUCK_STEER_RIGHT                  Keyboard            RIGHT

It seems there are close options but only for analog controllers in RoR.cfg?

; Input/Output
Analog Input Smoothing=1.000000
Analog Input Sensitivity=1.000000

Is it possible through config or only in source code (and where would it be) ?

Gibbzy commented 10 months ago

On current RoR versions theres a option at the top menu bar called steering speed coupling, designed for keyboard users, enable it and it will applied something similar as ffb

cryham commented 10 months ago

Ok. I got RoR 2022-12-29, and I don't see those, so I guess I'd need to build from sources.

Gibbzy commented 10 months ago

You cant see this? image

CuriousMike56 commented 10 months ago

By default the steering rate decreases the faster you drive, disabling the above setting allows you to steer at a constant rate regardless of speed. The steering rate itself can't be changed on keyboard though.

cryham commented 10 months ago

Ah no. I have Waves Height, for water there.

Okay, I see. Well then probably in source code somewhere.

cryham commented 9 months ago

I think it's in here void Actor::CalcHydros() in /source/main/physics/ActorForcesEuler.cpp not sure though. Maybe that float rate = std::max(1.2f, 30.0f / (10.0f)); or similar

ohlidalp commented 9 months ago

Hello CryHam,

I've been dissatisfied with our keyboard steering for a while. Obviously, being a hardcore rally simulator, keyboard steering without any assistance easily throws the vehicle into uncontrolled spin. My complaint is that our "steer speed coupling" setting is very dumb and once you inevitably get into spin, the same mechanism prevents you from doing a counter - steer, effectively forcing you to slow down before driving on.

Ideally, the steering assist should determine optimal non-skidding steer angle and help the player maintain that angle. The intensity of the assistance should be adjustable on scale {from "PRO: slightly slow down or speed up steering to maintain contact" to "NOOB: take keyboard input merely as indication where player wants to go and adjust braking/acceleration/steering to achieve that"}. Such system would improve player experience without compromising our physics-based gameplay.

Creating this will require quite some research, tweaking, trial And error. I think a good approach would be a default script bound to all actors, similarly how a default script is bound to all terrains. This would provide modders with ability to customize and draw UI to adjust settings on the go.

rishabhbhatiamp commented 9 months ago

Hi Ohlidalp,

I am new here but found this problem interesting so here is my take.

"take keyboard input merely as indication where player wants to go and adjust braking/acceleration/steering to achieve" If the idea is to just implement a steering assist, maybe it shouldn't really change the longitudinal speed as lateral and longitudinal control should be maintained independently. The best idea, like you suggested could be to have a slider between pro and noob. For the noob, a hard limit can be imposed on the steering based on when it would lose control. I am not sure how to determine that as it depends on velocity and weather the rear wheels are driving/driven, throttle, friction, terrain etc. For the pro we could free up this constraint.

As for the original complaint of the steering rate being too slow, I am sure that there is an ideal curve which I can try and find with inspiration from other simulators and games.

cryham commented 9 months ago

Right, well IDK much about that steering assist. Definitely something bigger to code. So first I'd recommend adding keyboard sensivity option to Gui, to allow player to steer much faster.

Well Stunt Rally 3 may not be a hardcore simulation but surely isn't arcade either. And in SR3 I really enjoy sliding. I don't have issues controlling it. We have steering sensivity, and steering decrease with speed too. It is still possible to spin out, i.e. loose grip out of control. Buf from my experience it's way more fun to slide AWD cars on gravel in SR3 than in RoR.

I think this bad slow steering (hence this issue) is important, but if it won't fix all, then it's up to tire functions, possibly also differentials (could be set high or to all locked for testing tires). Lastly (but changing these may not be real) maybe too high car inertia or bad center of mass. SR always has AWD, stiff diffs and suspension, around 50-60% mass on front, and a bit lower center of mass. Ah also I made a tire editor (Pacejka coeffs) in game. Anyway SR needs no TCS, ABS (off by default), definitely no AI steering or special code to assist steering and it's all great fun. Either way, I can't test in RoR or contribute code, since I've moved SR3 to OgreNext (I recommend it, but it took me a long year to move) and didn't manage to build Ogre 1.14 too, even for old SR.

rishabhbhatiamp commented 9 months ago

I agree with adding keyboard sensivity option to Gui being the first step. I can try and have a go if I can get it to build but I've never done it before. I was recently playing BeamNG and there they have an option to add a curve for steering ratio. Lets say it takes 0.5s of left button press for the wheel to reach its maximum steerable angle of 40 degrees. If someone presses the left steering button for 0.3s, for the first 0.1s it can only reach maybe 5 degrees but drastically increase for for each ms later on.

cryham commented 9 months ago

OK I managed to build from sources (ogre-13 branch with Ogre 14). And I added this setting https://github.com/RigsOfRods/rigs-of-rods/pull/3120

whitespace-rebel commented 1 month ago

I would like to suggest a small improvement to the current implementation of "Keyboard steering speed coupling". It seems to depend on the wheel speed. Sometimes when the wheels spin like crazy but the actual vehicle speed is slow, the steering is way too slow. IMO it would be better to make it depend on actual vehicle speed. What do you think?