[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
    Three parts: gearshift.exe, grind_default.wav and the shared memory DLL.
     
  2. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    7,105
    Likes Received:
    2,881
    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:
    740
    Likes Received:
    798
    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:
    740
    Likes Received:
    798
    I made a start on a Wiki.
     
  5. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    7,105
    Likes Received:
    2,881
    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:
    740
    Likes Received:
    798
    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:
    7,105
    Likes Received:
    2,881
    @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:
    740
    Likes Received:
    798
    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:
    740
    Likes Received:
    798
    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:
    7,105
    Likes Received:
    2,881
    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:
    740
    Likes Received:
    798
    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:
    310
    Likes Received:
    1,042
    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:
    7,105
    Likes Received:
    2,881
    @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:
    310
    Likes Received:
    1,042
    So is config exe and gear ini file no longer needed?
     
  15. bears

    bears Registered

    Joined:
    Apr 4, 2015
    Messages:
    310
    Likes Received:
    1,042
    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:
    740
    Likes Received:
    798
    Last edited: Apr 25, 2019
  17. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    740
    Likes Received:
    798
    See warning in first post.
     

Share This Page