ikt Posted February 1, 2016 Share Posted February 1, 2016 (edited) Manual Transmission & Steering Wheel Support For GTA VManual Transmission for GTA V is a mod which allows you to control vehicles manually, by directly interfacing with the vehicles in-game gearbox and engine data. Additionally, steering wheel support is provided. Nearly all wheels using DirectInput are supported!Technical demonstration Please note this version was very early in development with just manual shifting, many more features have been added since then!Wheel in action Credits to 6e660DownloadManual Transmission on GTA5-Mods.comDiscuss on GTA5-Mods.com forumSource codeGTAVManualTransmission on GitHubLatest builds RequirementsGTA VAlexander Blade's C++ ScripthookFeedback is extremely welcome. Post in any of the threads if you want to say anything.ChangelogCan be found on GTA5-Mods.com or GitHub releases.An active development thread can be followed on the GTA5-Mods forum.Recommended modsLeFix SpeedometerNFS GaugeAnd other speedometers reading gears and RPMs from memory.Custom Steering for racing wheel usage Edited September 25, 2016 by ikt mojito, turbocharger, savidge and 3 others 6 Link to comment Share on other sites More sharing options...
Jitnaught Posted February 1, 2016 Share Posted February 1, 2016 Awesome! ikt 1 Link to comment Share on other sites More sharing options...
ikt Posted February 6, 2016 Author Share Posted February 6, 2016 (edited) So, now for something about the clutch. It seems that it can't really be influenced when the game decides it should be 0.1, this is when either the vehicle is in a standstill in any gear, or the vehicle is moving and in a gear that's too low or too high for its speed. Otherwise, if the game has the clutch fully engaged, setting the clutch freely is possible. Now, so to let the user press the clutch isn't a problem, but the game also automatically presses the clutch and I can't seem to force values when that's happening. I've looked around a bit in CheatEngine around the vehicle address but I haven't found any other offset showing values like a clutch. What I already found, 0x7E0, is the address where the clutch float value is. This can be read and written to. Another thing is the throttle values being written 0 by the game, so power just disappears. This can be somewhat countered by writing the throttle values, but that just revs the engine at this point. This is annoying because high gears can't pull the vehicle at medium to low speeds, the game just does the clutch thing and the car basically rolls freely. It is somehow related to the input, as flooring it in this situation will make the game set the clutch to 0.1, but gently touching the throttle allows for the clutch to stay at 1. Such is situation is Michael's fully upgraded Obey Tailgater using Realistic Driving V going 100km/h in 2nd and then switching into 3th gear. Flooring it just makes the car roll freely, but keeping the throttle just right allows for maintaining the speed and accelerating a tiny little bit, until it gets into the range where the game allows full throttle (and then really starts accelerating). Fooling around with the power/torque multipliers in these situations didn't have an impact nor has any fiddling around with the throttle do anything. I'm kinda stuck here now, I really want to get this under control before tacking on more features (mostly because they rely on reliable clutch control). Edit - Got something: GTA5.exe+ECE34A - C7 43 40 CDCCCC3D - mov [rbx+40],3DCCCCCD Just gotta NOP these instructions. Now to figure out how. Lots of credits to leftas and InfamousSabre: http://gtaforums.com/topic/841308-reading-top-gear-and-other-vehicle-details Edited February 6, 2016 by ikt Link to comment Share on other sites More sharing options...
ikt Posted February 19, 2016 Author Share Posted February 19, 2016 Anybody with a steering wheel setup (G27, whatever) willing to help? If you've got it working, please do post how (what tools you used to map things) and if it works correctly (analog clutch etc) Link to comment Share on other sites More sharing options...
aXurez Posted February 19, 2016 Share Posted February 19, 2016 (edited) I'd love to help, I currently am trying to get my g27 with the H Shifter working with the use of the Logitech SDK instead of any "xbox controller emulator". This way i can implement Force Feedback (i hope haha). This is what I have got so far, manual transmission was not enabled in the video, but it works just fine when enabled: And the source: https://github.com/aXurez/NativeSteeringWheel Oh, and I am using your VehicleExtentions and NativeMemory to display the RPM's on the wheel and to control the clutch, this is working pretty good so far. Except I can go in reverse while in first gear, and go forward in the reverse gear when pressing the gas or brake pedal. This however is not the case when using an xbox controller, this might just be a compatibility problem with the native I used to simulate the xbox controller's Gas and Brake input: CONTROLS::_SET_CONTROL_NORMAL I would like to hear any ideas and feedback. I'll be sure to help out any way i can. PS. I didnt want to release it anytime soon, but i should have asked for your permission to use these files anyway, even when used only for myself. Do you allow me to use the VehicleExtentions and NativeMemory classes or perhaps could you provide some sort of library just like NativeUI, so i can use your mod to enable some features at my side? Thank you! Edited February 19, 2016 by aXurez Link to comment Share on other sites More sharing options...
ikt Posted February 20, 2016 Author Share Posted February 20, 2016 I'll try and extract things, I've never made a library before Using those files is fine, but a mention would be nice. The NativeMemory class was extracted from ScriptHookVDotNet (my attempt didn't work out so I got to use XMODs), VehicleExtensions is fine too. GTA V doesn't really block reversal in 1 and higher or going forward in R. I did write something to stop that (check for input, apply handbrake if wrong input for that gear). I also wrote a thing that swaps the controls (with _SET_CONTROL_NORMAL) so you might look at that. The result was being able to reverse with the gas pedal. The clutch is very wonky without patching the instructions so you should do that too (makes it incompatible with this mod though). Without patching, the clutch automatically disengages if the game wants to shift down (thus, the gears are too high) and the clutch doesn't really fully depress since there's still something being written to it. How's the manual transmission working out with the H-shifter? I have no idea how a G27 actually works. Also you should check out @InfamousSabre's Custom Steering mod for direct control over the wheels. Link to comment Share on other sites More sharing options...
aXurez Posted February 20, 2016 Share Posted February 20, 2016 To be honest, not at all the way I am using the H shifter, I now am using the VehicleExtentions to set the gears, this only works without the Manual Transmission enabled. But there remains one problem, almost everything overrides the gears. You can see in the video that at first without the manual transmission it works, but when i start accelerating, the gears "reset" to automatic. When i later enable Manual Transmission you can see your debug screen updates the CurGear and NextGear for just a split second before going back to what is was. https://github.com/aXurez/NativeSteeringWheel/blob/master/NativeSteeringWheel/script.cpp#L67 this is how it is done, I have to ask the Logitech SDK if certain buttons are triggered, when that's true, Set the gears to a value. Buttons 8-13 is gear 1-6 and button 14 is reverse in my setup. (This might be different at other wheels, another reason why i should make a config file) InfamousSabre's Custom steering mod can really help me out with the way the wheel works now (with a lot of delay), thank for that! Really looks like you are helping me more than vise versa haha Link to comment Share on other sites More sharing options...
ikt Posted February 20, 2016 Author Share Posted February 20, 2016 (edited) Of course, Manual Transmission just forcefully sets the gears so any other script touching those addresses and the two scripts will conflict If you want to keep a gear in place, you will need to spam the game with the gear you want, or to disable the game shifting by patching an instruction. If you don't move, the game allows you to choose any gear, even invalid ones, but once you start touching anything it sets the gears right again. I'm sort of getting around that by choosing a gear value on shift and write that value every loop. Then you'll get problems with the clutch, since you need to patch that too, or the clutch just presses itself. If you're going to implement manual shifting you might be better off forking my script or doing very similar things. GTA V is rather finicky. Edited February 20, 2016 by ikt Link to comment Share on other sites More sharing options...
ikt Posted February 22, 2016 Author Share Posted February 22, 2016 Well, in the meantime I got the cars to definitely pop in the correct gear, apparently the gear "struct" of what I thought was a 4-byte variable is actually just two separate variables 2-byte variables, what I thought was the current gear was the next gear, or something like that. I'll need to do some more testing to get the terminology right, but at least lower-range RPM @ high gears is totally fixed now and cruising is super nice. Link to comment Share on other sites More sharing options...
ikt Posted February 28, 2016 Author Share Posted February 28, 2016 Well this feels spammy I updated the mod, version 2.0 is available now. Link to comment Share on other sites More sharing options...
InfamousSabre Posted February 29, 2016 Share Posted February 29, 2016 Not spammy theres quite some time between posts. Going to check out the changes. Link to comment Share on other sites More sharing options...
aXurez Posted February 29, 2016 Share Posted February 29, 2016 Awesome, script looks promising! Unfortunately I can't try anything atm with my g27, motherboard is ready to be send for RMA.. I'll get back to it as soon as possible. The latest version on my github has the pedal shifter and h shifter working, only the pedals and the keyboard h shifter did not work with the modifications. https://github.com/aXurez/GTAVManualTransmission/blob/master/Gears/script.cpp#L517 Link to comment Share on other sites More sharing options...
ikt Posted February 29, 2016 Author Share Posted February 29, 2016 (edited) Not spammy theres quite some time between posts. Going to check out the changes. Not quite used to triple-posting Awesome, script looks promising! Unfortunately I can't try anything atm with my g27, motherboard is ready to be send for RMA.. I'll get back to it as soon as possible. The latest version on my github has the pedal shifter and h shifter working, only the pedals and the keyboard h shifter did not work with the modifications. https://github.com/aXurez/GTAVManualTransmission/blob/master/Gears/script.cpp#L517 Ah, sorry to hear that. You might want to (try) merging the new version as I've made the main update(); a bit less terrible to look at. You're Dutch, right? Know where I could get a G27 for not too expensive? Edited February 29, 2016 by ikt Link to comment Share on other sites More sharing options...
InfamousSabre Posted March 1, 2016 Share Posted March 1, 2016 Will you be looking into a fix for the engine restarting on version 350? Link to comment Share on other sites More sharing options...
aXurez Posted March 1, 2016 Share Posted March 1, 2016 I have gotten mine from Marktplaats for 150 euro's with lots of luck. The prices went up since the production stopped not too long ago... You should take a close look at Marktplaats and tweakers and ask for video's of the g27 being used, because the gears inside might have been damaged so the force feedback doesn't properly work anymore. 150 - 200 euro's are normal prices atm Link to comment Share on other sites More sharing options...
ikt Posted March 1, 2016 Author Share Posted March 1, 2016 Will you be looking into a fix for the engine restarting on version 350? Yes, but I don't think very soon due to irl I have gotten mine from Marktplaats for 150 euro's with lots of luck. The prices went up since the production stopped not too long ago... You should take a close look at Marktplaats and tweakers and ask for video's of the g27 being used, because the gears inside might have been damaged so the force feedback doesn't properly work anymore. 150 - 200 euro's are normal prices atm Ah, I'll try V&[email protected] then. Link to comment Share on other sites More sharing options...
ikt Posted May 16, 2016 Author Share Posted May 16, 2016 Version 3.0 is in alpha! Native racing wheel support, woot! Link to comment Share on other sites More sharing options...
ikt Posted May 22, 2016 Author Share Posted May 22, 2016 (edited) Version 3.0 is in beta! Stability! Wooh! It'll be finding and fixing bugs now for the stable release. If you have a Logitech racing wheel, please try it out. More info is very welcome as I have a grand sample size of me and my G27. Also, have this GitHub Releases link. Edited May 22, 2016 by ikt Link to comment Share on other sites More sharing options...
ikt Posted June 6, 2016 Author Share Posted June 6, 2016 (edited) Version 3.0 is released! I released this 3 days ago but forgot things. 3.0.2 is up already with small bug fixes. I might do DirectInput later. Quadposting so lonely here ;_; Edited June 7, 2016 by ikt Link to comment Share on other sites More sharing options...
ikt Posted September 11, 2016 Author Share Posted September 11, 2016 (edited) Version 4.0 is in alpha! Switched over from Logitech specific wheels to any DirectInput wheel that identifies as a driving input. Setting up is a bitch, but I'll figure out a small helper program or something to set things up. Update: alpha2 crashes 2000% less, grab that one if you grabbed alpha1. Edited September 14, 2016 by ikt Link to comment Share on other sites More sharing options...
ikt Posted September 25, 2016 Author Share Posted September 25, 2016 Version 4.0 is released! It should be fully usable now, but still a bit hard to configure. I'm not the best terrible at UI stuff (and I've got no experience with non-VSC#/.NET user interfaces) so that'll probably be the next step. Please - try it, especially if you own a wheel of some sorts Link to comment Share on other sites More sharing options...
ikt Posted October 15, 2016 Author Share Posted October 15, 2016 Fun little test I did Seeing how this mod affects car performance, mainly acceleration from 0 to 100 kph. Measured using NFS Gauge's performance tool: Stock Sultan /w Realistic Driving V 1.1 Start driving in gear (no handbrake hold or clutch or anything), no wheelspin Vanilla Automatic: 5.0 seconds: https://my.mixtape.moe/yrwugn.png Mod Automatic: 4.4 seconds: https://my.mixtape.moe/synjui.png Manual Sequential: 4.4+/- 0.1 seconds: https://my.mixtape.moe/xvtejt.png Manual H-shifter: 4.6 +/- 0.1 seconds: https://my.mixtape.moe/alhxuh.png This is because I bypass the Clutch parameters from handling.meta with my own clutch. Naturally, both manual modes are completely up to the driver. I'm pretty crappy as you can see from the variance in the manual tests. Tested with this build: https://github.com/E66666666/GTAVManualTransmission/tree/7a99dfeb859764a01c4f8e9f2b1e3cff116d03aa Link to comment Share on other sites More sharing options...
ikt Posted December 22, 2016 Author Share Posted December 22, 2016 A big thing that's still bugging me is how I fake force feedback. This is dictated by the suspension and tire dynamics in real cars where the resulting self-aligning torque is what is felt at the wheel. Games like Assetto Corsa and such simulate this pretty great but there isn't anything like that in GTA V. Any automotive people around who can engineer their way around this using only the following parameters? - Vehicle direction of travel - Steering angle - Raw acceleration/velocity vectors - Lateral acceleration /w constant speed in a circle (g-force) I'm just using a weird combination of oversteer angle, understeer angle and g-force (approximation) now, which works somewhat but results in this oscillation: I could also be overlooking things and R* might have simulated this in some way, but it doesn't look like this to me. XMDS 1 Link to comment Share on other sites More sharing options...
sfinktah Posted February 7, 2017 Share Posted February 7, 2017 I kinda thought that was just a G27 problem in general, although obviously far more pronounced in your case Okay, just thinking out loud here. I'm not a car person, I'm a code person, and I'm about to dive head first into yours, but surely you could fix the ossicilation (i'm not a speller either) by, well, insert some more _feedback_? Specifically some negative feedback? Let me think through this again, aloud.... As I said, I haven't looked at the code yet, but I'm assuming you have a memory version of what would be called GET_VEHICLE_STEER_BIAS if it existed, at offset 0x8f0 in CVehicle, and you also have the (actual) direction of travel, as well as the heading of the vehicle (which I guess would be the same in this case). I guess what I'm looking for is a formula for describing the change in direction (vs time) that would occur given the current wheel bias (the car wheels, not the g27), and then calculating the inverse of this to use as the force value to apply to the steering wheel... which I guess is what you are doing now, but a more complex version... but you need to dampen the force applied to the steering wheel to avoid the feedback loop. Well, I've confused myself really, and I'm too lazy to unpack the G27. ikt 1 Link to comment Share on other sites More sharing options...
ikt Posted March 11, 2017 Author Share Posted March 11, 2017 Update 4.2.0 has just been released. Get it here. Short summary: It now supports multiple input devices, so using a TH8RS along with a joystick as hand brake, some expensive Fanatec direct drive wheel and standalone pedals is totally possible now. Force feedback has been overhauled though I am still looking for a better way to emulate this. One gear has been added (7th gear) for steering wheel/shifter, while the 8th gear option was removed due to GTA V only supporting up to gear 7. Not much changed on the non-steering wheel side of things, but it should be more stable in general and stuff. Link to comment Share on other sites More sharing options...
ikt Posted March 18, 2017 Author Share Posted March 18, 2017 I kinda thought that was just a G27 problem in general, although obviously far more pronounced in your case Okay, just thinking out loud here. I'm not a car person, I'm a code person, and I'm about to dive head first into yours, but surely you could fix the ossicilation (i'm not a speller either) by, well, insert some more _feedback_? Specifically some negative feedback? Let me think through this again, aloud.... As I said, I haven't looked at the code yet, but I'm assuming you have a memory version of what would be called GET_VEHICLE_STEER_BIAS if it existed, at offset 0x8f0 in CVehicle, and you also have the (actual) direction of travel, as well as the heading of the vehicle (which I guess would be the same in this case). I guess what I'm looking for is a formula for describing the change in direction (vs time) that would occur given the current wheel bias (the car wheels, not the g27), and then calculating the inverse of this to use as the force value to apply to the steering wheel... which I guess is what you are doing now, but a more complex version... but you need to dampen the force applied to the steering wheel to avoid the feedback loop. Well, I've confused myself really, and I'm too lazy to unpack the G27. The stuff I'm doing now is rather basic, simple and physically not accurate for how the steering wheel works with forces. Increasing the damper and decreasing the physics force both work, but they don't address the issue at the source. I'd very much like to know what approach Rockstar used for GTA IV/GTA V vehicle steering correction/help and maybe use those values for my own, or to implement something that's like a fake self aligning torque. I might start experimenting again when ScriptHookV is released. Link to comment Share on other sites More sharing options...
ikt Posted March 19, 2017 Author Share Posted March 19, 2017 This feels spammy... Anyhow, new release. Beta 2 mostly tries to improve the configuration tool, DIUtil. All wheel-assignable buttons are in there now. Aside from that, all axes and all buttons should also automatically choose a device. The H-shifter configuration remains the same. ## 4.2.0 - beta 2No configuration changesChanges:* Fix messed up clutch for single-axis throttle/brake settings* Fix lag when patching fails: Limit patching attempts* Update strings for game version 1.0.1011.1* Fix vehicle moving before clutch catch point if throttle is pressedWheel changes:* Fix crash when FFB applied on a null device after re-initialization* Cleaner DirectInput Force Feedback code* Cleaner wheel compression retrieval method for FFB detail* Improve radio changing* Add hold radio buttons to turn radio offDIUtil changes:* Fix a crash when refreshing after removing all devices* Add dynamic device & axis detection* Add dynamic device & button detection* Add current function display for buttons* Add wheel->keyboard input blocking option Link to comment Share on other sites More sharing options...
ikt Posted April 22, 2017 Author Share Posted April 22, 2017 (edited) Anybody want to help test the ingame menu setup thingy? Having a wheel is a must btw. Or a secondary controller.\ edit nvm Edited April 23, 2017 by ikt Link to comment Share on other sites More sharing options...
Gorrak Posted March 5, 2021 Share Posted March 5, 2021 (edited) Hi, I am having an issue displaying RPM on the ingame HUD. But first, thanks for a fantastic mod!!!I should mention that I am playing in vr using the REAL mod.While I can get the gear and speed to display no problem the rmp is hidden and I really dont know why or how to fix it. After activating it I have tried moving the location and size but it is nowhere on the screen.Is something different with this gauge? Edit: Ok, I discovered that I can see the rpm meter....but only when I am aiming with a gun in the car!!Then it appears normally but goes away again as soon as I stop. It does not matter where I place it, as soon as I lower my weapon it disappears so I think it must be linked to the view change that happens when going from driving to driving and aiming/shooting.Any ideas? Edited March 5, 2021 by Gorrak New info Link to comment Share on other sites More sharing options...
Gorrak Posted March 5, 2021 Share Posted March 5, 2021 1 hour ago, Gorrak said: Hi, I am having an issue displaying RPM on the ingame HUD. But first, thanks for a fantastic mod!!!I should mention that I am playing in vr using the REAL mod.While I can get the gear and speed to display no problem the rmp is hidden and I really dont know why or how to fix it. After activating it I have tried moving the location and size but it is nowhere on the screen.Is something different with this gauge? Edit: Ok, I discovered that I can see the rpm meter....but only when I am aiming with a gun in the car!!Then it appears normally but goes away again as soon as I stop. It does not matter where I place it, as soon as I lower my weapon it disappears so I think it must be linked to the view change that happens when going from driving to driving and aiming/shooting.Any ideas? E66666666 fixed this for me. The solution was to disable the custom first person camera. (Manual gearbox ingame menu/Misc options) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now