Forums

Full Version: autoshift mod
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey Joe,
I think I've solved the problem with blocking wheels during downshift into (first) gear.
I modified ShiftAutoClutchThrottle to apply throttle/declutch on downshift to match driveshaft rpm. Like if it's an unsynchronised gearbox.
Code:
float CAR::ShiftAutoClutchThrottle(float throttle, float dt)
{
    if(remaining_shift_time > 0.0)
    {
        const float erpm = dynamics.GetEngine().GetRPM();
        const float crpm = dynamics.CalculateDriveshaftRPM();
        if(erpm < crpm)
        {
            remaining_shift_time += dt;
           return 1.0;
        }
        else
        {
            return 0.0;
        }
    }
    return throttle;
}
Have tested it with the GT40 on Laguna Seca, had no downshift induced problems. Managed to drive a 1:52 using the keyboard. :lol:
I have to clean up the code a bit before committing.
Sounds good. The throttle blip code that was there before was trying to do that, but obviously it wasn't doing a very good job. :-)