Grinding Tranny

Plugins Grinding Tranny V2.0

Login or Register an account to download this content
MJQT submitted a new resource:

Grinding Tranny - Plugin for rFactor 1 better simulating H-pattern gearbox behaviour

Official README is copied below.



Grinding Tranny Mod
Version 2.0 "High-heel and Toe Edition"
for rFactor by Richard Jackett (hardjack79 at nogrip)
richardjackett | gmail | com


Using your H-pattern shifter, if you change gear without using the clutch and do not match the revs closely enough you will hear the gearbox grinding, and you will remain in neutral until you re-shift using the clutch...

Read more about this resource...
 
Grinding Tranny Mod
Version 2.0 "High-heel and Toe Edition"
for rFactor by Richard Jackett (hardjack79 at nogrip)
richardjackett | gmail | com


Using your H-pattern shifter, if you change gear without using the clutch and do not match the revs closely enough you will hear the gearbox grinding, and you will remain in neutral until you re-shift using the clutch (alternatively you can set the mod to accept just a re-clutching instead of a full re-shift, or even to have a fixed delay). If you use the clutch properly then your shifts will always be successful.

Features

  • Detects when gearshifts should not succeed and makes the gearbox react accordingly, leaving you in neutral.
  • NEW: After missing you need to make a full clutched reshift to get into gear (clutch-only and fixed time options are also available).
  • NEW: Has its own sound engine to play grinding sounds (or optionally use rFactor's horn function to keep CPU load down).
  • NEW: Driver name and control details are now automatically detected so editing of the ini file is no longer needed.
  • NEW: Plugin can be turned on/off from within the upgrades menu, and can use different settings for each car (needs mod support).
  • NEW: Real-time output of gearbox state (grinding or not grinding) so that hobbyists can add FFB to their gear shifters.
  • IMPROVED: Telemetry can be written to a console and/or a text file to help you analyse your shifting technique (aka post-mortem).
  • Automatically loads the current gear ratios for your car every time you hit the track.
  • Highly customisable via an ini file, which is reloaded every time you hit the track.
  • OLD: A developer that is very keen to hear about your experiences, suggestions, and bug reports to improve the plugin in future.

Installation

1.
In your plr file you should have "Gear Select Button Hold" enabled, and "Auto Clutch", "Auto Blip", and "Auto Lift" disabled.

2. Download the Grinding Tranny Mod from NoGripRacing (registration required)

3.
Unpack the archive to your rFactor installation folder (e.g. C:\Program Files\rFactor).

4.
In rFactor, go to the Controller panel, and map a key to the "Neutral" function.

5.
Also in the Controller panel, make sure Upshift and Downshift are unmapped, as these affect how rFactor treats shifts.

And you're done! To check the basic functionality of the mod, I recommend testing with a default car such as the rTrainer, which should work well without modification. If you want to tweak some settings the GrindingTranny.ini file is fully documented. For some addon cars, the car files may need to be edited to get the best results, see this document for details. For general troubleshooting see this document.

Uninstallation
rFactor\Plugins\ holds all the files you need to delete: GrindingTranny.dll, GrindingTranny.ini, GrindingTranny_ReadMe.html, GrindingTranny_Telemetry.txt (created), BASS.dll, Grind_Default.wav

Disclaimer


There is nothing in this mod that will intentionally do anything terrible to your computer or your rFactor install or your favourite of Newton's laws (although your lap times may suffer). However, should anything bad happen as a result of downloading/installing/using these files, I won't be held responsible for it. In other words, the choice to install is all yours, as is the risk.





Grinding Tranny Mod Version 1.0​

The documentation from the original Grinding Tranny Mod is Ctrl-C'ed below:

Direct Download (1.5 MB rar) Support Page at NoGrip

1 Introduction


The Grinding Tranny Mod is a plugin that attempts to provide another dimension to the gearshifts in rFactor by monitoring your rev-matching and use of the clutch during gear changes, and then taking action if you get it all wrong -- you don't complete the shift. It certainly won't make you any quicker around the track, but it will definitely make you more careful about how you change gear and perhaps for the first time give you a real reason to use the clutch pedal while shifting. Ultimately I hope that it adds to your enjoyment of rFactor.
What is wrong with rFactor as it is?
The racing simulation rFactor will let you shift into any gear at any time regardless of the state of the clutch and throttle, or the relative speeds of the gears and output shaft. There are some very good reasons why ISI don't enable gears to be missed, but its not completelyrealistic.
Race car drivers in real-life face the prospect of missed shifts when the dogs/teeth on the gears and the selector are spinning at different speeds and can't engage. Boxes with dog-engagement have an advantage in this respect, and as long as the shifting movement is swift (compared with the relative speeds of the two surfaces) then they usually engage. Boxes with toothed selectors need the destination gear and the selector to already be spinning at similar speeds before they will engage and are therefore a lot more difficult to use in a race (synchromesh is great in road cars, but doesn't cope with the quick shifts required in racing). With either type of selection it is possible to mess up a shift by some combination of accelerator, clutch, stick movement, or rev-matching error, and when that happens the dogs/teeth make a grinding sound, the gearbox stays in neutral, and the car cannot accelerate until a gear is successfully engaged. This mod brings some of that behaviour to rFactor.
Enough with this so-called "real life", what does this mod actually do to rFactor?
First of all you must be manually shifting using an H-pattern shifter (Fanatec wheels, G25, etc) otherwise this mod is not for you. With the mod installed, if you change gear using the clutch then you will always shift successfully (see section 3.7). If you are attempting a clutchless shift and you match the revs closely then your gear change will be successful, but if you do not match the revs closely enough you will hear the gearbox grinding, and you will be held in neutral for a small amount of time to simulate the missed shift. A real gearbox would refuse to enter the gear properly and you'd feel it, but because this mod can't mechanically pop your H-shifter back out of gear we have to make do with forcing the car into neutral for a short time before letting it accept the gear you have physically selected.

Any features worth bragging about?
  • Detects when gearshifts should not have been possible and makes the gearbox react accordingly
  • Automatically loads the current gear ratios for your car every time you hit the track (not foolproof, but pretty good)
  • Customisable experience via the ini file
  • Loading of parameters from the ini file every time you hit the track so that you can quickly try out different settings
  • Uses rFactor's own (mostly unused) horn function to generate the gear thrashing sounds, which keeps CPU load down
  • Choose from a range of gear grinding sounds provided, or substitute one of your own
  • Sneakily over-rides the gear-selected messages coming from DirectX to force the gearbox into neutral
  • Telemetry can be written to a console and a text file to help you analyse your shifting technique in detail (aka post-mortem)
Anything else I should know before I install it?

  • The rFactor horn sound is replaced by the grinding gears sound, so effectively you no longer have a horn. Think of it as a weight-reduction
  • For some addon cars, some car files may need to be edited to get the best results (see section 4: Troubleshooting)
  • It is possible that for some addon cars the gear ratios will need to be manually entered in the ini file (although I haven't come across one yet)
  • As for any rFactor plugin, the extra code will require additional CPU cycles, which may lower fps on older systems (unlikely, but see section 4 for tips)
  • Installing and using this mod won't cause any online mismatches (yay!). However for some addon cars you may need to edit the <model>_Upgrade.ini file to get the mod to work optimally, which may cause online mismatches (boo!).
That's really all you have to know about what it does. If you are up for the adventure then follow the installation instructions below, and if you run into any problems check out the Troubleshooting section. If you feel like learning a bit more about how it works or want to customise it to your needs then read through the Tuning section.
Finally, if you enjoy using the mod or have suggestions (or heaven forbid, bug reports) then email me or leave me a message on nogrip, I'll be very happy to hear from you.

2 Installation

I have tried to make installation as easy as possible, but there are few things you must do to get the mod to work properly.
Note: You must be manually shifting using an H-pattern shifter (any Fanatec wheel, Frex, G25, etc). In your plr file you should have "Gear Select Button Hold" enabled, and "Auto Clutch", "Auto Blip", and "Auto Lift" disabled.
Warning: The standard horn sounds in \rFactor\GameData\Sounds\Secondary will be over-written. A backup of the original rFactor horn wav files will be installed to \rFactor\GameData\Sounds\Secondary\Horns_Original.zip. No other files will be over-written or altered by installing this mod.

2.1 Unpack the archive to your rFactor installation folder (e.g. C:\Program Files\rFactor).

2.2 Open the GrindingTranny.ini file from \rFactor\Plugins and complete the field "PLRName" with your player name. The mod uses this to find the tempGarage.svm file in the \UserData\<Player Name>\ directory, so make sure it matches that path exactly. There should be no space between the equals sign and your player name.

2.3 Also in the GrindingTranny.ini file, set the "NeutralKey" parameter to the keyboard key you would like to map to activate 'neutral' in rFactor (use lower case). The default is 'n'.

2.4 Start rFactor, go to the Controller panel, and map the key you defined in step 3 to activate "Neutral" (it will appear as upper case, but don't worry about that).

2.5 To check the basic functionality of the mod, I recommend testing with a default car such as the rTrainer at first and following the trouble shooting guide below if your experience does not reflect what was described in the introduction.

2.6 Disclaimer
There is nothing in this mod that will intentionally do anything terrible to you or your computer or your rFactor install or your favourite of Newton's laws or anything else that I could list. Your lap times may suffer, but other than that you should have no worries about installing and using the files supplied. However, should anything bad happen as a result of downloading/installing/using these files, or acting on any information contained therein, I won't be held responsible for it. I'll be very keen to hear about it, but you'll still be on your own. In other words, the choice to install is all yours, as is the risk.

2.7 Associated Files
\Plugins\ holds GrindingTranny.dll, GrindingTranny.ini, GrindingTranny_ReadMe.html (this file), GrindingTranny_Telemetry.txt (created)
GameData\Sounds\Secondary\ holds Grind_Sounds.zip, Horns_Original.zip, and horn*.wav and Grind_RJ*.wav files

3 Tuning
The ini file contains most of the information you need to tune the mod to your liking, but I will go over the main tuning features here because I have the luxury of a bit more space to describe how things work.

3.1 Telemetry

The telemetry output is written to the console in realtime, and logged to a text file. It is really useful to find out why you are missing some shifts, and for troubleshooting the mod if you have problems during setup (more on this in the troubleshooting section). Setting 0 or 1 recommended.
0 -- None Console not displayed and no information written to txt file
1 -- Low Console displays information when entering realtime and then only during gear shifts. Also written to txt file.
2 -- High Console displays full information after every frame. Also written to txt file -- generates big files fast!

3.2 Enable Sound
If you are sick of hearing the grinding sound every time you miss a shift then set this to 0. Often you will still be able to hear a pum-pum-pum sound as the car tries to shift back into the gear.

3.3 Activate Neutral
If you want to learn how to match revs without the punishment of actually missing the shift (wimp), then set this to 0 and the gearbox will not be forced to neutral, but the grinding gear sound will still play (if you have it enabled).

3.4 Time in Neutral
This is the number of seconds that a missed shift will be delayed by before the gear finally engages. I think a value of about 1.0-1.5 second feels about right, but play around with it.

3.5 Sound Duration
This is the length of time (in seconds) that the grinding sound will play for when you miss a gear. Depending on the particular grinding sound you have installed, you may need to play around with this to get it right.

3.6 Key Repeat Rate
More of a troubleshooting option, this is the time (in seconds) between the push and the release (and then the re-push) of the virtual neutral key. It should be as low as possible, but if its too low the keypress might not be recognised at all. If it is too long then it won't be able to over-ride the gear-engaged messages being sent to rFactor from your wheel's H-shifter and you'll see and hear the gears switching between engaged and neutral very rapidly.

3.7 Clutch Threshold

With the clutch (mostly) disengaged the engine is no longer applying (much) torque to the layshaft, and therefore the ratios are able to be (forcefully) matched to the output shaft. In practice it should still be possible to miss a shift with the clutch disengaged if the dogs/teeth were very poorly rev-matched, but for this mod if the clutch is disengaged I assume you smashed her into gear hard enough to get the dogs to engage no matter what their respective revs are. This parameter determines the point that we consider the clutch to have disengaged, as a fraction of the raw clutch pedal travel: 0.0 is unpressed, 1.0 is pressed to the floor. For example, the default of 0.7 requires the clutch pedal to be depressed to 70% of its maximum travel before you can guarantee that the shift will be successful. However you still have totime the clutch press correctly, don't blame me if you're getting on the pedal too late or coming off it too soon! (Tip: use full telemetry to study your timing during gear changes, and also check out 4.8)

3.8 Rev-Match Tolerance

Rev-matching is all about correctly judging what engine revs will be required to match the speed of the output shaft for the next ratio. Too many revs, or too few, and the differential between the speeds of the gear and the selector will be too much, the dogs/teeth won't engage, and you'll be left in neutral. This parameter defines how close is 'close-enough', and the change will be successful if abs(GearRPM/OutputRPM - 1) <= RevMatchTolerance. Think of RevMatchTolerance as the fraction above or below the ideal, within which the matching was good enough. The smaller this number, the harder it will be to match the revs closely enough to make the shift. A value of about 0.2 (+/-20%) is probably a good place to start, and you can adjust it as you become more skilled or to model a different type of gearbox. Note: Dog-engagement boxes are much more forgiving than tooth-engagement boxes.

3.9 Upshift /Downshift Tolerance Factors

These factors enable you to increase/decrease the Rev-Match Tolerance to behave differently between upshifts and downshifts. They multiply RevMatchTolerance in the equation in 3.8, so setting one of these above 1.0 makes that direction shifting easier, and setting below 1.0 makes that direction shifting more difficult. The default for downshifts is 1.0, and for upshifts is 2.0 to reflect that with a fast movement its relatively hard to miss an upshift with a dog box. You might find that you are never challenged by upshifts but downshifts are a nightmare (or vice versa) for a given RevMatchTolerance and this is the way you can even that up a bit.

3.10 Ratio Detection Method

This will mainly be used for troubleshooting badly behaved mods, so you should only need to change this if the gear ratios are not being correctly detected automatically.

Method 0 Force use of user defined ratios (use this only if methods 1 and 2 fail)
Method 1 Only works for ratios that are stored as decimals, but is slightly more precise than method 2 (4sf vs 3sf)
Method 2 General use, works with ratios stored as either decimals or fractions (recommended setting)
If you happen to only use cars that store their ratios as decimals then you can use Method 1, but I really recommend you stick with Method 2, which will work with either fractions or decimals. The final gear ratio can be read using either method as long as it is decimal. If it is not recorded as a decimal then the mod will do its best to include the final ratio in each of the gear ratios and set the final ratio to unity. If both of the automatic methods fail to determine the gear ratios correctly then you probably have an issue with how your Player Name was recorded (section 2.2) or a particularly belligerant mod, but you can always set the ratios by hand in the bottom of the ini file and use Method 0. Every time you change car or gear settings you'll need to edit the ini again before you rejoin the track.
 
4 Troubleshooting
TIP: Run rFactor in windowed mode at less than your native resolution to see the telemetry console in real time.

4.1 Instead of going into neutral when I miss a shift it just judders / holds constant revs / feels like its still in gear / neutral feels muddy

The mod forces the car into neutral with a bit of a hack: your gear shifter is constantly shouting "in gear" to the game, so the mod has to shout "in neutral" louder after you've missed a shift. If there is a slight delay (> 0.02 s) between the game hearing "in gear" and actually engaging that gear then the plugin has time to shout another "in neutral" instruction and everything works great. But if the gear change is nearly instantaneous then we end up toggling between in gear and in neutral very fast and the result is not satisfactory (the missed gear pause in neutral is not free-revving). The Historix mod in particular suffers from this, but solutions 2 and 3 work well to solve it.
Solution 1: Decrease the KeyRepeatRate, however you may find you are already as low as you can go on this.
Solution 2: Edit the car files to introduce a small delay to the shifts, even 0.03 seconds is enough in most cases. You can edit the hdv file of the car you are using (look for the parameters UpshiftDelay and DownshiftDelay). This will definitely result in online mismatches.
Solution 3: A more elegant solution is to add the following code to the bottom of the car's <model>_Upgrades.ini file so that you can change back to default settings at any time in game. Note that this might (?) result in online mismatches, so make a backup first. [PS: I have come across some upgrade files that don't close the final set of { these brackets } so you might want to check that the previous section is closed when you add the code].
UpgradeType="Grinding Tranny Mod"
{
UpgradeLevel="Leave Everything Alone"
{
Description="Use this setting if you are not using the Grinding Tranny Mod, or if it working fine already."
}
UpgradeLevel="Fix Muddy Neutral Syndrome"
{
Description="Use this setting if you use a Gated Shifter with the Grinding Tranny Mod and miss-shifts don't leave you in a free-revving neutral."
HDV=[DRIVELINE]
HDV=UpshiftDelay=0.04
HDV=DownshiftDelay=0.04
}
}

4.2 Instead of making a vicious grinding sound, I hear a horn / nothing when I miss a gear

The mod hi-jacks rFactor's horn function to play the sound of gnashing gears, but if the car is using a non-default horn sound then you'll hear that instead (e.g. Historix). You have a few options to solve this (listed worst to best).
Solution 1: Disable the sound in the ini file.
Solution 2: Open up the <model>.sfx file for the car you are using and under the "AMBIENT SOUNDS" section you should be able to see the path of the wav files that it uses for the horn (VS_INSIDE_HORN and VS_OUTSIDE_HORN). I'm not sure if you'll get an online mismatch if you change the path\filename to another wav file here. If you hear no sound you may need to add the paths in yourself: VS_OUTSIDE_HORN=secondary\Horn.wav and VS_INSIDE_HORN=secondary\Horn.wav
Solution 3: Alternatively, after finding the location of the wav file (see Solution 2), replace it with the grinding sound of your choice (no danger of mismatches).
Solution 4: Add the following code to the <model>_Upgrades.ini file for the car model you are using (not sure if this will cause mismatches) and chose the sound you prefer from within the upgrades menu. For Historix you'll need to extract the contents of Grind_Sounds.zip to \GameData\Sounds\HISTORICGT\Secondary.
UpgradeType="Gear Grinding Sound"
{
UpgradeLevel="Horn"
{
Description="Use the original horn sound"
SFX=VS_INSIDE_HORN=secondary\horn_original.wav
SFX=VS_OUTSIDE_HORN=secondary\horn_original.wav
}
UpgradeLevel="Grind 1"
{
Description="Long, low-pitch, rough gear grinding sound"
SFX=VS_INSIDE_HORN=secondary\Grind_RJ3.wav
SFX=VS_OUTSIDE_HORN=secondary\Grind_RJ3.wav
}
UpgradeLevel="Grind 2"
{
Description="Long, high-pitch, metallic sound"
SFX=VS_INSIDE_HORN=secondary\Grind_RJ7.wav
SFX=VS_OUTSIDE_HORN=secondary\Grind_RJ7.wav
}
UpgradeLevel="Grind 3"
{
Description="Long, harsh toothy sound"
SFX=VS_INSIDE_HORN=secondary\Grind_RJ6.wav
SFX=VS_OUTSIDE_HORN=secondary\Grind_RJ6.wav
}
}

4.3 The gear grinding sound is too quiet / is too loud / just sucks

The gear grinding sound is stored as a wav file (see section 4.2 for location details) that you can edit or replace if you like. In fact I encourage you to do exactly that, and if you find/make a better sound then please share it online so others can try it. The sounds I included in the install are real recordings (not always from cars) that I have edited with Audacity, and they definitely suit some cars better than others. In my opinion the synthesised sound from nKPro is better.

4.4 Having this mod installed slows my framerate

Plugins for rFactor operate in soft-realtime, so if your CPU takes longer to process the commands in all your plugins than the GPU takes to render the next frame then you'll see a drop in framerate. I've tried to make the code in this plugin work efficiently, but if it slows down your machine too much there are still a few things you can try, one at a time, to see if it is one thing in particular that is causing the problem.

Test 1: Disable the telemetry
Test 2: Disable the sound
Test 3: Disable the forced neutral
Test 4: Increase the KeyRepeatRate

4.5 Crashes

Obviously this mod works on my system, but there is always the possibility that it won't work on yours. I used ISI's example telemetry plugin as a base, and compiled it with MS Visual C++ 2010 Express (its totally free, go get programming!) in Windows 7 x64. If the example plugin from www.rfactor.com works, but if this one doesn't then please let me know the details.

4.6 It doesn't go into neutral when I miss a shift
There could be a few reasons for this, so let's start with the really embarrassing ones first:

Solution 1: Enable Telemetry level 1 and make sure that you are actually missing the shifts (it will say "UPSHIFT FAILED" or similar). To make sure its a bad shift you should not use the clutch and then upshift slowly with the accelerator flat to the floor.
Solution 2: Make sure that your ini file has Activate Neutral enabled (ActivateNeutral=1).

Solution 3: Check that you have mapped the "Neutral" function in game to the same keyboard key as you entered in the ini file. The ini file should have NeutralKey set to the character that appears if you press that key on its own (without using Shift, Alt, etc.) and with no spaces. e.g. the {[ button it would be NeutralKey=[. If you have Telemetry set to 1 or 2 then you should see this key mapping each time you drive out of the garage in rFactor. I use a US keyboard, and I'm sure that different language keyboards will exhibit different behaviours for some keys, but you have the choice to change the mapping from the default 'n' to 30+ other keys so I hope that you can find one that works for you.
Solution 4: Experiment with the rate that the virtual key is pressed, KeyRepeatRate. Its possible that your computer can't keep up with the default rate of 0.01 seconds between push and release, so try 0.05 and see if that helps.
Solution 5: Try starting a LAN session, join the track, then press 'T' (default) to enable real time chat. If you now miss a gear you should see your NeutralKey repeating like crazy in the chat box. If there is only a very few repeats then you need to adjust the KeyRepeatRate. If you don't see anything repeating there then there is a big problem because the virtual key press is not being detected by rFactor.

4.7 It doesn't register that I have missed a shift... or show any telemetry... its like it was never installed at all

Solution 1: It might pay to check that you have GrindingTranny.dll and GrindingTranny.ini in the \rFactor\Plugins\ folder... just in case. ;)
Solution 2: You might have plugins disabled, the default to toggle plugins while on track is the 'G' key.

4.8 I'm a great driver, I never miss a shift, this mod is conspiring against me!
Solution 1: Set Telemetry to level 1 and check that the input and output revs are similar to within the RevMatchTolerance when you change gear. If they are way out even though you are sure you are matching revs correctly then perhaps the gear ratios weren't loaded correctly (see 3.10 for your options). The main thing to check is that you have provided the correct current Player Name in the PLRName field of the ini file. Also make sure there is no space between the equals sign and the name. In the first few lines of the telemetry stream the path to the tempGarage.svm is printed, check that this path is correct and that the file exists.

Solution 2: Set Telemetry to level 2 and check how you are using the clutch before, during, and after a shift -- it is easy to get the timing wrong, but easy to lean to do it right.

Solution 3: If the car has a long delay time on gear shifts (rFactor does this to eliminate instantaneous sequential shifting) then you may be doing everything right, but the mod can only assess your performance at the instant the new gear is engaged. If this happens some time after you physically selected the gear then you may have already come off the clutch and the shift may fail. The solution here is the same as 4.1 solution 2, except you'll want to decrease UpshiftDelay and DownshiftDelay. The snippet of code for the upgrades file should also work here.

4.9 This mod is totally unrealistic, its impossible to make / miss a gear shift with a dogbox / standard box by doing this / that
Gearbox performance and traits differ greatly between all the different cars that rFactor allows us to drive, and no single set of settings is going to work for all of them. Likewise there are limitations in what can be achieved by back-ending a gearbox model into the application (and certainly in my skill in doing so). The mod offers a reasonable level of tunability, so ultimately its up to you to find the best settings for your application. Whether 'best' means the most accurate, or the perhaps the most (or least) enjoyable to drive is also up to you. Please discuss and debate, and if there are things I can change to improve the mod then I'll certainly consider it.

(c) Richard Jackett 2010
 

Letter to Mod Developers​


The Grinding Tranny plugin is now able to fully integrate with 3rd party mods for rFactor. If you'd like to see what is possible and how it can be accomplished, please read this Google Document (which will always be the latest version) or the copy/paste below dated 21/2/2011.



Grinding Tranny Mod 2

Dear mod developer or enthusiastic rFactor tweaker,

I’ve made Grinding Tranny Mod 2 with you in mind. This plugin still provides an alternative gearbox model for rFactor, but its now much more customisable and user friendly. My aim for version 2 has been to make the plugin as transperant as possible to the end user so that it can be installed as part of a mod without any (much) additional effort being required by the user. The point of this letter then is to inform you about what kind of integration is possible with your mod, and how to get the behaviour you want from the plugin.

Cheers,
Richard
richardjackett | gmail | com (hardjack79 at nogrip)

What the end-user should see

Installation
As far as installation is concerned, the plugin files can be placed in the Plugins folder by the mod installer, the only real issue being whether the GrindingTranny.ini file is overwritten or not if it already exists (more on this later). For the plugin to work, a key must be mapped to the Neutral function in rFactor, and Upshift and Downshift must be unmapped. I have left these tasks up to the end user, although it would be possible for an installer to do this by force... that is your decision. In contrast to version 1, the plugin can now determine the player name and Neutral key mapping automatically.

Usage
Version 2 is able to turn itself on only when it is explicitly supported by the current mod, making it possible to install it as part of your mod without worrying that it will affect the other mods that the user has installed. Within a supported mod, the plugin allows for the end user to turn the Grinding Tranny functionality on or off within rFactor’s GUI by changing the setting of the “Gearbox” upgrade for the current car. The 1st and 2nd levels of upgrade turn the plugin off, the 3rd and 4th turn it on. There can be distinct behaviours of the Gearbox for settings 3 and 4, controlled by parameters contained within the car’s upgrades.ini and/or .veh files. For example, setting 3 could behave like a synchromesh gearbox, and setting 4 could behave like a dog-engagement gearbox; or perhaps 3 could use the plugin’s own sound engine while setting 4 could use rFactor’s horn function to produce the grinding sound. Finally, gearbox parameters can vary car by car.

How the plugin works

Each time you hit the track (the EnterRealtime event) the plugin first loads the current settings from the GrindingTranny.ini file. It then does a scan of the UserData folder to find which driver is active and does its best to read which key has been assigned to Neutral in the Controller.ini. After a pause of 1 second it locates the .veh file for the current car and reads in the state of the “Gearbox” upgrade and any overloaded parameters for the current upgrade state. Finally, it attempts to determine the current gear ratios from tempGarage.svm. Now the plugin watches the game telemetry and triggers a missed shift event as necessary. First the gearbox is forced into neutral by faking a continuous stream of Neutral keypresses, and the grinding sound is played. This continues until the missed shift event is terminated, either by a successful reshift or after 5 seconds, whichever occurs first.

Essential settings for using the plugin

Format of the gear ratios
The ratios are pulled from the comments at the end of the GearNSetting strings in the tempGarage.svm and the text formatting of the gear ratios is crucial if they are going to be read correctly. RatioDetectionMethod in the ini file defines what method the plugin uses to read the ratios. Method 2 is slightly less precise, but far more reliable, so it is recommended. Any double slash at the start of the line is ignored by the plugin.

RatioDetectionMethod=1 works for the native rFactor format by reading in the first 4 characters following the // after the equals sign, but will fail when this number is not a decimal or is greater than 9.99.

RatioDetectionMethod=2 reads the contents of the brackets at the end of the line (which is the gear ratio multiplied by the final ratio) and therefore is far more robust even when the gear ratio is commented as a fraction, as long as the brackets contain a decimal.

The final ratio is determined by finding the number that lies between the final / and the first : in the row. Using Method 2, if it can be determined, the individual gear ratios are divided by it. If it can’t be determined the individual gear ratios are left as is, and a final ratio of 1.0 is used. In either case the plugin will work fine, but for Method 1 it is essential that the final ratio can be read.

Example 1:
Gear1Setting=0//3.60 (10.80)
//Gear2Setting=3//2.40 (7.20)
Gear3Setting=5//13/7 (5.57)
//FinalDriveSetting=1//3.00:1

Method 1 could handle gears 1, 2, and final, but not 3rd, because it is stored as a fraction. Method 2 would read all of them (the bracketed portion), and would back-calculate the individual ratios by division by the final ratio.

Example 2: As above, except,
//FinalDriveSetting=3// 8/37 (bevel 1/1)

Neither method can read this format directly. Method 1 will now determine the final ratio by dividing the bracketed quantity in Gear1Setting by the decimal ratio. Method 2 will just set the final ratio to 1.00, given that the other ratios already include the final.

Any other format is likely to fail. In my opinion Method 2 is preferred even when decimals are used because of its ability to handle numbers larger than 9.99. FYI The lack of a explicit final ratio is no problem as far as the operation of the plugin is concerned, it just doesn’t look as nice in the telemetry.

Car_Upgrades.ini

Due to how the plugin forces the gearbox into neutral after a missed shift (rapidly repeating simulated presses of the neutral key) it is essential that there is a slight delay between rFactor receiving a message to shift and it actually engaging the gear. The NeutralKeyRepeatRate in the GrindingTranny.ini will be set to 0.01 seconds by default, and a system running at 60 fps will get through a cycle of key up down up in a maximum of 0.05 seconds, so the delay between message and engagement should therefore be greater than or equal to 0.05 seconds. Clearly a 30 fps system would require a maximum of 0.10 seconds to be sure that the ‘Force Neutral’ message would always win out against rFactor’s ‘Engage now!’ messages. Unfortunately this latter value is getting towards the point where it starts to interfere with the driver’s ability to time the clutch for quick shifts, so I recommend something from 0.05 to 0.10 seconds for the parameters UpshiftDelay and DownshiftDelay.

These parameters can be set in the .hdv file, but as you will probably want to change these depending on which Gearbox upgrade has been selected, probably the Car_Upgrades.ini is a better place to do it.

Customising plugin behaviour to suit your mod

GrindingTranny.ini

The most obvious place to change settings is the GrindingTranny.ini file, and this is certainly the easiest way to test all the options out, as many parameters are reloaded every time you hit the track. Unfortunately there is only one ini file to be shared by all mods in a given install, so overwriting existing settings is a potential issue. Fortunately there is little in this file that can’t be overloaded by the .veh files, so I encourage you to leave the GrindingTranny.ini as close to default settings as possible for your application, thus minimising the likelihood that any subsequent ini change will mess things up for you.

The GrindingTranny.ini file is quite well documented, and rather than describe each of the parameters again here, I encourage you to have a quick read of the ini to familiarise yourself with the customisation that is possible for the plugin’s operation.

The first thing to do is to set PluginActive=1, as this will make sure that the plugin is inactive unless it is specifically supported by a mod (at the very least, yours).

Telemetry should be set to 0 or 1, as 2 will create big files and eventually cause stutters in rFactor when it reads/writes. Console definitely set to 0 once you have debugged everything.

The [Sound] and [Tuning] sections can be overloaded in the .veh file.

State of the “Gearbox” upgrade

In the car_Uprades.ini file you should create an upgrade called “Gearbox” (apologies to non-English speakers, but it must be exactly as written). As well as the usual upgrades.ini functionality, this has several additional effects:
1) It tells the plugin that it is supported by the current mod.
2) It determines whether the plugin should be switched on or off (ON for the 3rd and 4th upgrade levels, OFF for the 1st and 2nd).
3) It can be used to choose how the plugin’s parameters are overloaded (see below).

This gives the user the ability to turn the plugin on or off depending on what method of gearshifting they use, and whether they want to be able to miss gears or not. It gives you the ability to get creative with the 3rd and 4th Gearbox upgrade settings, as discussed below.

Upgrade.ini settings

The car_Upgrades.ini is the best place to define the UpshiftDelay and DownshiftDelay parameters, as they will probably change depending on which “Gearbox” upgrade is used. The “Gearbox” upgrade functionality is described in the section above, so I will use this space to show an example of how GrindingTranny could be implemented in a hypothetical mod. Disclaimer: I haven’t experiemented very thoroughly with the other Upgrades.ini parameters so you will want to do your own testing instead of relying on my (guessed) values.

UpgradeType="Gearbox"
{
UpgradeLevel="Sequential"
{
Description="Sequential shifting with automatic clutching and throttle lift/blip"
HDV=[DRIVELINE]
HDV=SemiAutomatic=1
HDV=UpshiftDelay=0.15
HDV=UpshiftLiftThrottle=1
HDV=DownshiftDelay=0.20
HDV=DownshiftBlipThrottle=1
}

UpgradeLevel="Gated Shifter (No Missed Shifts)"
{
Description="Manual H-pattern gearbox with no electronic aids. Missed shifts are not punished."
}

UpgradeLevel="Synchromesh Gated Shifter"
{
Description="Manual H-pattern synchromesh gearbox with possibility to miss shifts (powered by the Grinding Tranny Mod). Please ensure that NEUTRAL is mapped to a key and UPSHIFT and DOWNSHIFT are unmapped."
HDV=[DRIVELINE]
HDV=UpshiftDelay=0.3
HDV=DownshiftDelay=0.3
}

UpgradeLevel="Dog-engagement Gated Shifter"
{
Description="Manual H-pattern dog-engagement gearbox with possibility to miss shifts (powered by the Grinding Tranny Mod). Please ensure that NEUTRAL is mapped to a key and UPSHIFT and DOWNSHIFT are unmapped."
Price=1000
HDV=[DRIVELINE]
HDV=UpshiftDelay=0.06
HDV=DownshiftDelay=0.06
}
}

So in the preceding example the first two gearbox upgrade settings are suitable for the default rFactor sequential and gated shifting options respectively, and the next two upgrade settings turn on the Grinding Tranny Mod and make shifts behave like a synchromesh or a dog-box transmission respectively (at least when combined with some overloading in the .veh file). You don’t need to include an upgrade for level 4 if you don’t need it.

Overloading vehicle (.veh) files

If a “Gearbox” upgrade level of 3 or 4 is detected the plugin will look in the current vehicle’s .veh file for Grinding Tranny Mod parameters, and if found will use these in preference to those recorded in the GrindingTranny.ini. There are two levels of overloading possible, general and specific. General overloading is definined by including the parameter name as it appears in the GrindingTranny.ini and will apply to both levels of upgrade. Specific overloading is defined by including a parameter name with either “3” or “4” appendend to the end, and will only apply to the corresponding upgrade level. Specific overloading has a higher priority than general overloading.

To illustrate this, here is an extract from a hypothetical ThisCar.veh (this code could be placed anywhere within the file):

/// Below are some Grinding Tranny parameters for ThisCar
ReshiftMethod=2
SoundVolume=100
SoundFile3=.\Plugins\Grind1.wav
SoundFile4=.\Plugins\Grind2.mp3
SoundVolume4=70
/// This is the end of the parameter overloading example.

“ReshiftMethod=2” will require the user to make a full clutched reshift for ThisCar, regardless of what is set in the GrindingTranny.ini (but only if the Gearbox setting is 3 or 4). You can also see that for setting 3 we will use a wav file for the sound, and for setting 4 we’ll use an mp3 as the grinding sound. The wav will be played at 100% volume and the mp3 will be played at 70% volume, because a specific (numbered) parameter takes precedence over a general one. All unlisted parameters will take their values from the GrindingTranny.ini.

Examples:

I will complete the example I started in the section on “Upgrade.ini Settings”, where Gearbox=3 is a synchromesh box and Gearbox=4 is a (better) dog-engagement gearbox.

ThisCar.veh:
/// Grinding Tranny parameters for ThisCar
// Synchro box (Gearbox=3)
SoundFile3=.\Plugins\Grind_Synchro.wav
SoundDuration3=0.7
RevMatchTolerance3=0.15
ClutchThreshold3=0.85
// Dogbox (Gearbox=4)
SoundFile4=.\Plugins\Grind_Dogbox.mp3
SoundDuration4=-2.0
RevMatchTolerance4=0.25

I don’t know if these values are realistic, but you should see that in this example the synchro box is much more difficult to clutchless shift with (c.f. RevMatchTolerance), and also slightly more demanding on the amount of clutch needed if clutching the shift (c.f. ClutchThreshold). From the Car_Upgrades.ini you might recall that the synchro box also involves a 0.3 s delay before the gear is engaged, to simulate the transition through the synchro, whereas the dog engagement is very fast. Finally, there is a different grinding sound for each box, the synchro grind playing once for a maximum of 0.7 seconds, while the dog box grind file will be repeated over and over for a maximum of 2 seconds in total.

You may be able to conjure up much better values after some experimentation, and I would love to hear about your findings. Of course ‘better’ for your mod may mean more realistic, or it may mean more worthy of paying a steep upgrade price, or it may mean having two very different but finely balanced settings to decide between. For the latter, I would be tempted to include the following lines:
ReshiftMethod3=2
ReshiftMethod4=3
This would require a full clutched reshift to recover with the dog-box, while the synchro would require only a quick dip of the clutch to unload the layshaft and let the gear engage.

To illustrate another example given at the start of this document, the final two settings could determine whether the plugin’s sound engine or rFactor’s sound engine handles the grinding sound (only the last 2 upgrade levels shown!):

ThisModel_Upgrades.ini:
UpgradeLevel="Gated Shifter (external sound engine)"
{
Description="Manual H-pattern gearbox with possibility to miss shifts (powered by the Grinding Tranny Mod). Uses an external sound engine for grinding sounds."
HDV=[DRIVELINE]
HDV=UpshiftDelay=0.06
HDV=DownshiftDelay=0.06
}
UpgradeLevel="Gated Shifter (internal sound engine)"
{
Description="Manual H-pattern gearbox with possibility to miss shifts (powered by the Grinding Tranny Mod). Uses an external sound engine for grinding sounds."
HDV=[DRIVELINE]
HDV=UpshiftDelay=0.06
HDV=DownshiftDelay=0.06
SFX=VS_INSIDE_HORN=\Secondary\Grind_Default_In.wav
SFX=VS_OUTSIDE_HORN=\Secondary\Grind_Default_Out.wav
}

ThisCar.veh:
/// Below are some Grinding Tranny parameters for ThisCar
SoundFile=.\Plugins\Grind_Experimental.wav
SoundVolume3=70
SoundVolume4=-1

For setting 3 the plugin’s own sound engine is used with the file Grind_Experimental.wav being played at 70% volume. For setting 4 the plugin is instructed to activate rFactor’s horn every time a shift is missed (by SoundVolume4=-1) and the upgrades.ini has pointed the internal and external horn sounds to grinding sound files that you placed in the \GameData\Sounds\Secondary folder.

There are countless other possibilities, and if you come up with any good ones please let me know.

Disclaimer, Legal, and Acknowledgements

You may include this plugin and supporting files in any freely distributed mod provided that they are not modified in any way. The only exception to this is the GrindingTranny.ini file, in which you may change parameter values (you may also add some text if necessary). Somewhere visible in your mod you should mention that it employs the Grinding Tranny Mod, not least because some people may want to delete it as the first thing they do. I also encourage you to include a mention of “Grinding Tranny Mod” somewhere in the description for Gearbox upgrades 3 and 4 if that makes sense in the context of your mod. The disclaimer bit is very simple: I am sure that there is nothing in this plugin or accompanying files that could cause any harm to your system, security, or privacy, but you use and distribute this work completely at your own risk and I take no responsibility for any repurcussions of doing so. If you accept all that then you are free to distribute the Grinding Tranny Mod as part of your mod without my explicit permission (but please drop me an email so that I know!).

To conclude this document, I’d like to pay special thanks to the HistorX mod team, especially Rantam, Yoshi, Gonzas, and Hugh, for all the encouragement, suggestions, testing, and bandwidth I received from them while trying to make this plugin play nice with an AAA mod like theirs. Also a big thanks to the developers of the BASS sound library for making it simple enough even for me to use. Finally, thank you for considering using Grinding Tranny Mod as part of your project and for bothering to read this far through the guidance document.
 

Latest News

Shifting method

  • I use whatever the car has in real life*

  • I always use paddleshift

  • I always use sequential

  • I always use H-shifter

  • Something else, please explain


Results are only viewable after voting.
Back
Top