[WIP] Realistic Gearshift

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

  1. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    Three parts: gearshift.exe, grind_default.wav and the shared memory DLL.
     
  2. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    No worries, still got the wav in there but either way it's not yet throwing me out of gear, so I'll try it when my lovely antivirus stops playing with it (this file is rare! they usually contain viruses! lol :confused:).

    PS I like the 'mock input' parameter name. I'd like to think it shouts "YOU CALL THAT A GEARSHIFT? YOU SPINELESS MAGGOT!" when you do a sloppy change :D
     
    Last edited: Apr 23, 2019
  3. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    That would fit neatly with Crew Chief's "sweary" message option :) Sorry to disappoint you but "mock input" is a software term for faked inputs to test the program.

    Do you have this line in gearshift.ini?
    Code:
    'neutral button' : 'DIK_NUMPAD0',
    'wav file' : 'Grind_default.wav',
    And Numpad 0 mapped to "Neutral" in rF2?
     
  4. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    I made a start on a Wiki.
     
  5. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    I know ;)

    Yep, the window says it'll send numpad0 as well, and it worked before (I took out the existing .ini so it created a new one). Even with my antivirus (finally) not blocking it it's not doing anything in the game (sound or gear). I'll try again tomorrow, maybe it's just having a bad day.

    I haven't used the shared memory map plugin before, so that's another possibility. I'm assuming the python stuff you've used doesn't have any extra dependencies.
     
  6. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    I extended the GUI to show rF2 status and if graunching. Made it a permanent part of the program. This will help with debugging any problems like @Lazza is having. If you don't see these three ticks then something is wrong.

    Gearshift.JPG

    The Gear buttons change and the Revs sliders move as you (or the AI) drive the car.

    [It's not a thing of beauty (and the code is even worse!) but it will do for now]
     
    Hazi and Mauro like this.
  7. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    @Seven Smiles thanks mate, that confirmed shared memory wasn't working, checked in rF2 and it said it was Off... which is strange as that's the first thing I checked when I put the plugin in yesterday, but anyway... all good now :)

    Default bite point of 90 on my G27 pedals (and same with my T500 pedals previously) makes it insanely easy to shift. Not sure if you intended it to be easy out of the box or your axes are different to mine, but I much prefer 20.


    *If I can offer more feedback: this version keeps 'graunching' until you engage the clutch again. The engine stalling, the car stopping, selecting neutral, exiting realtime, exiting the game.. don't stop it. It'll also start graunching when the engine is already stopped and you engage gear (without the clutch, obviously).
     
    Last edited: Apr 23, 2019
  8. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    Feedback is very welcome. There are two problems I still have to fix that cause that. One is that the way gearshift works has changed because it no longer gets shifter inputs directly from the shifter, only secondhand from rF2. Because it uses the Neutral button itself it can no longer tell when the player has selected neutral (stopped trying to get a gear). The second is I haven’t yet managed to tidily stop the timer and shut the program down. Both solvable but I wanted to get this new method out there to make sure it works for everyone.

    Bite point is a personal preference. I have it quite high because it’s quite high in my road car. There is another set of parameters that I may add and that's timing - I don’t have to dip the clutch very far but I have to wait X mS before I can actually select another gear. Setting the bite point lower possibly simulates that delay. It means adding a couple of states to the "gearbox" state machine (incidentally I haven’t touched that since I wrote the original AutoHotKey version, I just translated it semi-automatically into Python).

    Anecdote about gearshift timing: I have been a passenger on track in a racing Caterham with its champion driver at the wheel. His shifts were brutal (as was the whole experience!). I asked him about it and he he said that there might be a hundred gear changes in even a short race and if you treat the gearbox to a leisurely half second per change you’ve gone from first place to last, 50 seconds behind the leader. As far as he was concerned, even in entry-level racing, gearboxes are a consumable item.
     
    Last edited: Apr 24, 2019
    lagg and David Kolody like this.
  9. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    New version uploaded that shuts off the graunching when not actually racing - note that the only way of stopping the graunching is dipping the clutch (rF2 already thinks the box is in neutral so shifting to neutral does nothing). Also shuts down cleanly.
     
    Mauro likes this.
  10. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    Fair enough with the logic change needed with different inputs. I imagine the gear will re-engage very quickly if you stop hammering the neutral, so you should be able to poll by stopping for a moment and seeing if the gear still engages. Then keep hammering for a bit longer and try again.

    The bite point is interesting, my value of 20 is a bit extreme but part of the reason I've ended up down there is the in-game bite point is low. By having your program set to a high value (which I tried at first, months ago) you end up in a situation where the program allows you a clean change (no graunching!) but as soon as you engage the gear the clutch is basically fused and the vehicle spins. Having the bite point lower forces you to actually disengage the clutch in the game, and you're in a position to reengage at that point.
     
    Seven Smiles likes this.
  11. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    Thanks, I'd missed that it does re-engage so with a careful bit of timing I should be able to spot when the player stops trying to force it into gear.
     
  12. bears

    bears Registered

    Joined:
    Apr 4, 2015
    Messages:
    807
    Likes Received:
    3,094
    Hi first thanks so much for working on this it’s very much needed in rf2

    Sorry if this is a rookie question I have a Logitech g920 wheel and I am having no luck detecting the clutch or gears I saw a post previously about the g 27 wheel could I be experiencing a similar issue ?

    Any help appreciated
     
  13. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    @bears the latest version doesn't require you to configure it, it reads it through the game. It won't do anything if the game isn't running, since it doesn't read it directly.
     
    Seven Smiles likes this.
  14. bears

    bears Registered

    Joined:
    Apr 4, 2015
    Messages:
    807
    Likes Received:
    3,094
    So is config exe and gear ini file no longer needed?
     
  15. bears

    bears Registered

    Joined:
    Apr 4, 2015
    Messages:
    807
    Likes Received:
    3,094
    Thanks Lazza i answered my own question just tried it and it worked Seven Smiles this is a great little add on thanks again ;-)
     
    Seven Smiles likes this.
  16. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    Last edited: Apr 25, 2019
  17. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    See warning in first post.
     
  18. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,386
    Likes Received:
    6,602
    Digging this thread up temporarily to share a version aimed at helping drive the S397 Caterham with its forced clutch usage but lack of feedback when you get it wrong. Unfortunately the method they're using means a hybrid of the old and new Realistic Gearshift versions is needed, which I may get to later if the game's implementation doesn't get improved.

    I'm linking below to a modified v1.5.7 of the RG program. This is an older version, pre- status UI and pre- shared memory map. It has the configurer program to set the shifting device and inputs, and the clutch device and parameters. Then the gearshift program which outputs the configured Neutral keypress if you shift incorrectly.

    These files should stay in their own folder, will create their own .ini file in that folder, and are completely standalone. If you want to use this for the Caterham (and maybe the Mini) just run it before starting the game, and don't run any other RG versions at the same time.

    Changes from v1.5.7:
    • The clutch axis reverse option is applied correctly, and the test is reversed too. Bite points closer to 100 require more clutch pedal travel whether reversed or not.
    • The reshift option works correctly.
    • Shifter input of 0 is handled properly (my VNM shifter has gear 1 output as 0; this was being ignored by v1.5.7)
    • Default settings are bite point 60 and reshift off. This matches the Caterham behaviour, so you get the grinding noise only* when the game detects a failed shift, and you only need to depress the clutch to fix it.
    *1st gear is handled a bit strangely by the game, where you can sometimes get into it without a clutch but RG will play the grinding noise and force Neutral. Just do it properly :D

    Notes/known issues:
    • This program isn't aware of what's happening in the game. It will continue to play the grinding noise (and output the Neutral keypress) whether the game is running or not, whether you're in the menu, when you're not driving the car, when the car has stalled, when the engine isn't even running, if you move the shifter into gear without using the clutch. (the neater method of reading the game telemetry as inputs won't work because then the program doesn't know you've put the shifter into gear; hence a hybrid version will be required - I'll have to make a plugin for it)
    • This is not a replacement of any later versions of Realistic Gearshift. I've thrown this together for my own use and am sharing in case even one other person might find it useful.
    • I don't have the Mini, so I don't know if its required clutch input is the same as the caterham. The bite point might need adjustment (you could have 2 separate folders with different settings, if that's easier).
    • You don't need to have the program running before starting rF2, but I did have some intermittent FFB issues when going in and out of the game and restarting RG with new settings, so having it running before rF2 would be my usual usage scenario.
    • Antivirus programs will probably flag this as malware/trojan. My antivirus wasn't too bad with it, I just created an exception and it was ok. I've only made a handful of modifications from the 1.5.7 available from Seven Smiles' github as linked in the first post, and created the exe files using the latest pyinstaller. If you're not comfortable with that, don't download or use it.

    https://mega.nz/file/Od5XDBya#Ur9lxvdAfavQdlrz0xLtZQDpS23Z4r-U-pyRgrMysp0
     
    yashiman, atomed and ebeninca like this.

Share This Page