Hey team, I'd like to try implement an app to automatically counter-steer to make drifting on a keyboard or controller a little easier. My previous implementations of this have basically boiled down to: Code: Handle the player's steering axis input parameter If the player's steering input axis almost equals 0 (i.e no input) Find the angle between the vehicle's forward direction and direction of velocity around the car's up direction Set the steering input axis value to the target angle's inverse lerp value between the theoretical min/max steering angle. (try set the input to point the wheels in the direction of velocity, basically) Handle steering angle as per usual Would this be possible with a basic BeamNG App? Do we have enough control to get & set the axis input before beamNG reads it & applies it to the car? I looked into the Remote Control app and the Cruise Control app but sadly neither really gave me a base to work off. Do any other apps directly modify input?
Hi, I'd also be interested in this. Mostly to re-implement my own GTA implementation - is there any documentation or any base script example available to start from? I've never used Lua, but as long as there's some API thing to direct set control (judging by that remote control app, there is) and read the current (relative) velocity, it should be fine. For reference - GTA Vs re-implementation: PHP: // Returns in radiansfloat Racer_calculateDesiredHeading(float steeringMax, float desiredHeading, float reduction) { desiredHeading *= reduction; // TODO: Figure out if this is what R* does or not float correction = desiredHeading; Vector3 speedVector = ENTITY::GET_ENTITY_SPEED_VECTOR(vehicle, true); if (abs(speedVector.y) > 3.0f) { Vector3 target = Normalize(speedVector); float travelDir = atan2(target.y, target.x) - static_cast<float>(M_PI) / 2.0f; if (travelDir > static_cast<float>(M_PI) / 2.0f) { travelDir -= static_cast<float>(M_PI); } if (travelDir < -static_cast<float>(M_PI) / 2.0f) { travelDir += static_cast<float>(M_PI); } // Correct for reverse travelDir *= sgn(speedVector.y); // Custom user multiplier travelDir *= settings.CustomSteering.CountersteerMult; // Steering-corrected value travelDir = std::clamp(travelDir, deg2rad(-settings.CustomSteering.CountersteerLimit), deg2rad(settings.CustomSteering.CountersteerLimit)); correction = travelDir + desiredHeading; } return std::clamp(correction, -steeringMax, steeringMax);} (Forgive my abuse of the PHP tag, as there's no Cpp tag I could find) Also for reference / proof that this would be effective - disabling GTA Vs countersteering filtering and directly applying a (lerped) user input, immediately results in the sluggish hard-to-correct driving, much like BeamNG.
Ideally I'd like to see this added as a default option, but the BeamNG team seems to have shot the idea down. For what reason, I don't know. Having the thumb stick force not matching physical force just seems like a very naive implementation.
Yeah. I mean it's playable without it, if you concentrate and drive like a nanny, but oh my gawd it'd be amazing with this.