0 votes
by
edited by
I’d like to obtain the RPM of the clutch, /engine side of the gearbox - assuming that is used in VPP.

I want to give the player some feedback on how well they use the clutch, i.e. let them see/hear if they don’t clutch well.

‘Not clutching well’ would mean that the engine RPM is not well matched to the RPM of the engine side of the gearbox.

I can get the engineRPM from the databus, but not the clutch/gearbox RPM.

Is there any way to do this? Or am I misunderstanding how VPP’s powertrain works?

1 Answer

0 votes
by
selected by
 
Best answer

VPP exposes the transmission rpm, which is the rpm at the output of the gearbox. If there's a gear engaged, then multiplying by the gear ratio gives the rpm at the input of the gearbox.

The RPM at the output of the gearbox can be read from the vehicle channel in the data bus. From a custom add-on script:

float transmissionRpm = vehicle.data.Get(Channel.Vehicle, VehicleData.TransmissionRpm) / 1000.0f;

Other values in this channel can be used to check if a gear is engaged.

  • The value VehicleData.GearboxShifting is zero.
  • VehicleData.GearboxGear is non-zero and equals to the engaged gear number.
bool gearboxShifting = vehicle.data.Get(Channel.Vehicle, VehicleData.GearboxShifting) != 0;
int gearNumber = vehicle.data.Get(Channel.Vehicle, VehicleData.GearboxGear);

The ratio of the engaged gear can be consulted in the vehicle controller. With that, the rpm at the input of the gearbox (clutch side) can be calculated:

if (!gearboxShifting && gearNumber > 0)
{
    float gearRatio = (vehicle as VPVehicleController).gearbox.forwardGearRatios[gearNumber-1];
    float clutchRpm = transmissionRpm * gearRatio;
}
...