1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.30 Bug Reporting thread
    Solutions and more information may already be available.

Smooth steering? Input curves?

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by Behemoth1702, Sep 5, 2014.

  1. Behemoth1702

    Behemoth1702
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    13
    Hey guys,

    in many games there is a way to make the input to ingameReaction non-linear. This means that when you push your joystick in one direction the response in game begins slowly at first but then speeds up the further you push the joystick.

    http://theses.ulaval.ca/archimede/fichiers/23445/23445_9.png

    This is nice because often I just want to make small corrections while driving but the linear input mapping turns the steering wheel waaay to much. This would be resolved with a customizable input curve.

    Is there anything like that out already? :-/

    I appreciate every reply!
     
  2. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    requested before. Input improvements are coming.
     
  3. Mr.Hankey

    Mr.Hankey
    Expand Collapse

    Joined:
    Aug 9, 2012
    Messages:
    29
    There is already some smoothing going on. I'm not sure what kind it is at the moment but you can have a look at the input.lua script if you know your way around lua code.
     
  4. Lamnatos

    Lamnatos
    Expand Collapse

    Joined:
    Jan 1, 2015
    Messages:
    1
    I've been looking exactly for this thing. If someone is comfortable with basic trigonometry (I'm not), it shouldn't be that hard to implement a non-linear mapping between the stick position and the actual steering.

    I guess it could be done through a similar trick with the one used to map both accelerate & braking on the same axis. Here's how I've seen it done from someone in these forums (sorry, I don't have the actual link right now):

    Code:
    function dynamicFunc(%val) {
        if(%val > .1) {
            accelerate_direct(%val);
        }else if (%val < -.1) {
            //This line is necessary. If %val were passed to brake_direct,
            //nothing would happen, because brake_direct can't handle negative values.
            $i = %val * -1;
            brake_direct($i);
        }else{
            //Here, the function resets both accelerate_direct and brake_direct when the stick value is in the deadzone.
            //Without this, dynamicFunc stops passing new values to the two BeamNG functions when the value enters the deadzone,
            //which means that the last reported value (in this case around 10%) will be passed to the functions until a new value is provided.
            accelerate_direct(0);
            brake_direct(0);
        }
    }
    
    %mm.bind(%device, rzaxis, "I", dynamicFunc);
    
    In our case, instead of using accelerate_direct() and brake_direct(), we would use steer_left() and steer_right(), but instead of using directly %val, we should use a trig function (or a combination of them?) to create the easing in/out.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice