[WIP] Realistic Gearshift

Discussion in 'Other' started by Seven Smiles, Dec 11, 2017.

  1. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    798
    Thus far it just forces you to press the clutch when changing gear but I have various plans
    • to add damage
      • based on how poorly you change gears
      • plus "shit happens" random failures
      • having to retry a change because of damage
      • gears becoming not available so you'd have to go say 2nd to 4th
      • eventually complete failure
    • using the shared memory API to get the clutch and engine RPMs
      • to make further decisions on how good the change was
      • to allow for rev matching so you can change without using the clutch
    • other gearbox layouts (particularly dog leg boxes) [yes, you can do that already]
    • double (de-)clutching - not sure why / what cars need that
    • preselector boxes for all the 1930s mods Rfactor is (not) blessed with
    All input welcome. My only expertise in this area is writing software and distant memories of driving a Frogeye Sprite with worn out synchromesh!
     
    Sebastien Sestacq, lagg, elbo and 3 others like this.
  2. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,819
    Likes Received:
    568
    Hello @Seven Smiles , I tried your software, but it can't detect anything when I configure it.
    So I tried to set the .ini file manually using some previous posts here, but I have an error.

    My ini file content and on bold what I changed manually
    Code:
    [clutch]
    controller = JoyWarrior A10-16
    axis = JoyZ
    reversed = 0
    bite point = 50
    reverse = 1
    
    [shifter]
    controller = T500 RS Gear Shift
    1st gear = Joy1
    2nd gear = Joy2
    3rd gear = Joy3
    4th gear = Joy4
    5th gear = Joy5
    6th gear = Joy6
    7th gear = Joy7
    8th gear = 0
    reverse = Joy8
    
    [miscellaneous]
    damage = 1
    wav file = Grind_default.wav
    debug = 0
    test mode = 1
    double declutch = 0
    preselector = 0
    reshift = 1
    neutral button = DIK_NUMPAD0
    
    upload_2018-10-14_15-9-54.png

    If you have an idea?
     
  3. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    798
    Code:
    axis = JoyZ
    axis is a number in this program, and the gears too. My gearbox.ini looks like this
    Code:
    [clutch]
    controller = Logitech G25 Racing Wheel USB
    axis = 4
    reversed = 0
    bite point = 90
    reverse = 0
    
    [shifter]
    controller = Logitech G25 Racing Wheel USB
    1st gear = 8
    2nd gear = 9
    3rd gear = 10
    4th gear = 11
    5th gear = 12
    6th gear = 13
    7th gear = 0
    8th gear = 0
    reverse = 14
    
    [miscellaneous]
    damage = 0
    wav file = Grind_default.wav
    debug = 0
    test mode = 0
    double declutch = 0
    preselector = 0
    reshift = 1
    neutral button = DIK_NUMPAD0
    
    Maybe I need to explain Configurer.exe differently/more clearly.
     
  4. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,819
    Likes Received:
    568
    I changed with values, now I don't have the error, but I don't know how to test if it is working, because when I launch configure, nothing happen when I activate the shifter or cluch (no visual indicator).

    Can't use it for now.
    The list of my devices :
    upload_2018-10-14_16-46-49.png
     
  5. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    798
    Does this help explain how to use Configurer.exe?

    Starting with a blank gearshift.ini:
    blank.JPG

    Choose the clutch controller
    selectClutchController.jpg

    Clutch controller selected
    ClutchControllerSelected.jpg

    Select clutch
    selectClutch1.jpg

    Clutch selected
    ClutchSelected.jpg

    Then do the same thing for the gearshift controller and select each gear.
    1st gear selected
    1stGearSelected.JPG
     
    Last edited: Oct 14, 2018
    vancstar likes this.
  6. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,819
    Likes Received:
    568
    I removed the .ini and redone the procedure and now it's OK.
    Thank you for your support.
     
    Seven Smiles likes this.
  7. dylbie

    dylbie Registered

    Joined:
    Oct 25, 2012
    Messages:
    368
    Likes Received:
    512
    This is amazing, thanks for your work on this. I'll install this tonight and try and get it working. I have two questions...

    1. Will this work with multiple controllers? I have a T500RS with a G25 shifter with a Bodnar box.

    2. Is there anyway this could be incorporated into actual car mods via the HDV? I've made a few cars and it would be nice to force people to use a clutch with them... (as a selectable upgrade perhaps for people without clutch pedals).
     
  8. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    798
    1. Yes, you select the controller for the clutch and separately the one for the shifter.
    2. No, that would require changes to rF2. This program is completely separate, it just tricks rF2 into not selecting a gear by poking the Neutral button.
     
    dylbie likes this.
  9. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    7,105
    Likes Received:
    2,881
    Configurer appears to be saving "Clutch readings are reversed" as 'reverse' instead of 'reversed', so it doesn't actually get saved.

    I expected bite point 90 to mean I needed clutch engagement at 90% in order to change gears, but it's the other way round. (which is why I thought I needed the clutch reversed, but no)

    *Using latest release, not the very latest, so could be outdated feedback
     
    Last edited: Nov 9, 2018
    Seven Smiles likes this.
  10. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    798
    Oops! Fix for that had been sitting on my PC since mid-Oct but not committed. Tut! Tut! V2.0.31 released with that fixed.
     
    Alex72 and Lazza like this.
  11. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    7,105
    Likes Received:
    2,881
    Cheers mate, enjoying the plugin, will be even better when you start some rev-matching etc with some telemetry data :cool:
     
  12. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    7,105
    Likes Received:
    2,881
    @Seven Smiles
    Hmm... sorry, I never actually tried the new version (plus my aggressive antivirus blocked me from the new version for a couple of hours, right when I was going to), I just ran it and it goes straight to grinding mode, nothing stops it. I checked my config and couldn't see anything wrong, kept doing it, just dropped back to the previous version and it works fine. So something might be wrong with that latest one.
     
  13. softslider

    softslider Registered

    Joined:
    Jan 6, 2016
    Messages:
    77
    Likes Received:
    15
    @Seven Smiles:

    It seem really cool but I can't make it work. Can you please help me?

    Below shows my pedal device and H-shitfer in my controller's JSON file.
    "Device Name 1":"DSD 12Bit Controller - ES=#04d833a7", // Protosimtech PT-1 pedal
    "Device Name 2":"Logitech® G27 Shifter=#1dd210a1", // connected to PC directly via adapter

    Executing <configurer.exe>,
    - Visible controllers are <DSD 12Bit Controller - ES> and <Unicode error getting controller name>. And the latter seems for H-SHIFTER.
    - For clutch, I select <DSD 12Bit Controller - ES> and press clutch with<select clutch>. But the value(0)isn't changed. I tried to press accel and brake pedals but same as 0.
    - For shifter, I select <Unicode error getting controller name> and I can see each is defined correctly such as 0,1,2 and so on.
    - But once I execute <gearshift.exe>, there is always sound from <Grind_default.wav> and it shows error as follows.
    Exception in Tkinter callback
    Traceback (most recent call last):
    File "tkinter\__init__.py", line 1702, in __call__
    File "Configurer.py", line 85, in change_dropdown
    File "wheel.py", line 62, in selectController
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa2 in position 8: invalid start byte

    And below is content in <gearshitft.ini>.
    [clutch]
    controller = DSD 12Bit Controller - ES
    axis = 0
    reversed = 0
    bite point = 81

    [shifter]
    controller = Unicode error getting controller name
    1st gear = 0
    2nd gear = 1
    3rd gear = 2
    4th gear = 3
    5th gear = 4
    6th gear = 5
    7th gear = 0
    8th gear = 0
    reverse = 6

    [miscellaneous]
    shared memory = 1
    damage = 0
    wav file = Grind_default.wav
    debug = 0
    test mode = 0
    double declutch = 0
    preselector = 0
    reshift = 1
    neutral button = DIK_NUMPAD0
     
    Last edited: Dec 13, 2018
  14. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    798
    Ah, it's already been reported that the pygame library is stumbling over the ®, I put in a trap so that it didn't actually crash the program but it's obviously only gone on to crash later. Not much I can do until pygame is fixed. I'll check your problem too @Lazza.

    I do have a completely new version that uses @The Iron Wolf's shared memory, that gets rid of all the configuring USB stuff, getting the clutch/gear information direct from rFactor. That's not ready for release though.
     
    Last edited: Dec 13, 2018
    bears and softslider like this.
  15. Sebastien Sestacq

    Sebastien Sestacq Registered

    Joined:
    Jan 11, 2016
    Messages:
    783
    Likes Received:
    1,225
    hello any news? its work or need update?
     
    DrivingFast likes this.
  16. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    798
    Sorry, I lost interest in it so there has been no progress. I'll have another look at it when I get home next month.
     
  17. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    7,105
    Likes Received:
    2,881
    Just to keep this going and highlight the fact this plugin (or the equivalent at least included in the game, one day, but this will do in the meantime...) is very welcome and adds a lot to the experience, I'd like to relate something.

    My last race (in the F3 Fanatics) one of the most enjoyable moments was when I got a gear change wrong and had to do it again. I'm getting better (faster) at doing this when I hear the grinding, without really thinking about it, but the pause in acceleration meant a car harrying me at the time was able to move past down the coming straight.

    Now, I'd like to think it's what separates simmers from gamers, though it might just be my own special kind of crazy, but that was one of the standout moments in that race for me. It perhaps helps that I got back past the driver in question before the race ended, but there was definitely some sort of weird satisfaction in knowing I was paying for my mistake instead of having the game just blindly accept the gearchange despite my left foot getting ahead of the program.

    So @Seven Smiles please do continue to work on this when you can, it's very much appreciated :)
     
    Zoaal, roby13, Dookie and 6 others like this.
  18. DrivingFast

    DrivingFast Registered

    Joined:
    Mar 1, 2018
    Messages:
    1,242
    Likes Received:
    774
    Thank you for the contribution of @Seven Smiles to rF2.

    I apologize in advance, I'm using this thread to ask :

    Does anyone have any information about improving the realism of the gearbox on rF2 ?

    If so, does S397 plan to do it "fast enough" (2019) ?

    Thank you.
     
  19. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    798
    OK, I got it working and have given it a reasonable amount of testing. Download gearshift.exe and Grind_default.wav from here https://github.com/TonyWhitley/gearshift/releases/tag/V2.1.36
    To enable the memory-mapped input, edit gearshift.ini [miscellaneous] section, adding
    Code:
    shared memory = 1
    (or more simply, delete gearshift.ini, the program will create a new one.)

    Note that there is no need to configure anything now, just save gearshift.exe somewhere and have it running while you're playing rFactor 2.

    If this works well for everyone then I'll strip out the original stuff.
     
    Last edited: Apr 22, 2019
    Zoaal, roby13, Mauro and 4 others like this.
  20. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    7,105
    Likes Received:
    2,881
    @Seven Smiles Just your program and the shared memory map plugin needed? Not working for me yet, but my over enthusiastic antivirus might be blocking it despite my best efforts... (until it 'checks' the file...)
     

Share This Page