Overview
How to change the game logic with external programs to make split shifting more realistic. You’ll need a realistic shift knob, and AutoHotKey and JoyToKey to make this happen.
Introduction
Hello again fellow truckers, you might remember me from my Twin Sticks and Toothpicks guide on getting a realistic Spicer 6×4 compound transmission set in game. This time, I’m back to tell y’all how to get realistic split shifts going in your game, that way your RPMs aren’t jumping all over the place every time you go from 7L to 7H or vice versa.
First off, this guide to geared towards players who have a realistic shift knob like the Megashifter or, if you’re one of the lucky unfortunate ones, CSIO’s shifter like I have. We’re gonna need 2 external programs to get this jerry-rigged setup going, and those are JoyToKey, and AutoHotkey. You’ll also want to set aside about 5 keyboard keys in game to get everything setup. If you can do all of that, you’ll be set.
Split Shift Theory
So, what exactly is a split shift anyways? In real life, this is actually just 2 really close gears in the AUX section of an Eaton Fuller, and by close, I mean in size. Depending on model, it’s either a slight underdrive (1.13) to direct (1.00) or direct to overdrive (.87), I want to say that the majority of OTR transmissions have the latter, but I could be wrong. So when a driver is cruising along a slight grade and a 6L to 7L shift might slow him down enough to drop outta the powerband, he flips his red (13 speed) or grey (18 speed) splitter button forward to “split” 6th gear to a gear in between 6 and 7 in terms of torque output. What’s actually happening is he’s taking his 6th gear that’s spinning through direct in the splitter section of the aux and (air) shifting the splitter section of the aux to overdrive. This way, he can stay in the powerband, gain a bit more speed, and 7L isn’t such a leap in terms of RPM.
So when he moves the splitter forward, the truck effectively goes into neutral until the RPMs match the new splitter gear, at which point the shift completes, and he goes on his way. To match the RPMs, he either has to let the engine slow down by taking his foot off the loud pedal (5L to 5H shift) or stab it a bit to bring RPMs up (5H to 5L). In game, the RPMs just jump to the new splitter gear, assuming you have the advanced transmission type and clutch/throttle fast split option enabled. Not only is this jarringly unrealistic, but it can mess up shift timing as well. When I do a 6H to 7L upshift, I either have to split back and feather the throttle until the stick is out of gear, or move my splitter while in neutral, otherwise, the RPMs jump due to the game’s splitter behavior.
Controls.sii
So, how do we fix this? Well, pretty easily actually. I know it’s a hassle to have 2 extra programs running just to correct this behavior, but the setup is quick and easy and it’s worth it for the realism.
Before anything, we need to make some changes to our controls.sii file, located in your ATS documents folder (C:UsersNAMEDocumentsAmerican Truck SimulatorprofilesNUMBERS), so go ahead and make a backup of that bad boy in case something goes wonky. I’m going to assume you already have a defined key set in the options for the neutral shift, I forget what the defaults are, but I set mine to ; and ‘. You can probably get away with just setting 1 if ya want, and can set it out of game if you find “mix gear0” in your controls.sii.
What we need to do is:
1. Set our splitter to the keyboard button a (set it to whatever you want, I unbound WASD ingame because I don’t drive with a keyboard, if a is default, it’ll set your wheel all the way to the left).
2. Make our gears a bit more logical in how they operate. Default logic is pretty simple, line 411 in my file is “mix gear2 joy2.b1”, which just means that gear 2 in game is bound to my 2nd joystick in it’s first slot. The game did that for you when you ran through the input wizard or set the gears in game. What we need to do is tell the game that gear 2 in game is bound to the 2nd joystick’s first slot AND the ; OR ‘ keys on the keyboards are NOT being pressed.
So to set the splitter to a on the keyboard, find line 408 in the controls.sii file, and make it so that it and the next line read: config_lines[408]: “mix gearsel2on `keyboard.a?0 | semantical.gearsel2on?0`” config_lines[409]: “mix gearsel2off `! (keyboard.a?0) | semantical.gearsel2off?0`”
All that does is make it so that when a is “pressed” the splitter is in it’s on state, which we used to do by just sliding it forward. The next line [409] just sets the splitter to off if a is NOT(!) pressed.
Next, we have to give logic to our gears. What we have to do is make it so the gears will go to their on state/engage when 2 conditions are met: The joystick (shifter) is in the correct slot for the gear, and the ; OR the ‘ keys aren’t being pressed. To do this, find line [411], and make it this: config_lines[411]: “mix gear1 `joy2.b8?0 & !(keyboard.semicolon?0 | keyboard.apostrophe?0) | semantical.gear1?0`” Do note that your joy numbers might be different, so don’t just blindly copy paste that, the important part is to add & !(keyboard.semicolon?0 | keyboard.apostrophe?0) |. Do this for gears 1 through 7 in the file.
Once done make sure to save, we’re done with that file.
JoyToKey
Assuming you have those programs downloaded and installed, open up JoyToKey and attempt to find your knob’s splitter button. On my system, I told JoyToKey to make my CSIO shifter Joystick 1 in the options, then, after mapping all the buttons to a letter on my keyboard and opening notepad, I found that button 1 is the range button, and button 2 is the splitter. So I cleared all the other keys for the other buttons and set button 2 to z and x. To do this, double click on button 2 from the main program window, navigate to the keyboard (multi) tab, and make sure the radio button “[Input1] when the button is released and [Input2] when it’s pressed”. Then, for Input1 i typed z, clicked over to Input2 and typed x, then clicked OK. That’s it for JoyToKey.
AutoHotKey
Next up is AutoHotkey. If you’re wondering why we need to script keyboard stuff, I promise, it’ll make sense in a minute. Open your Documents folder and create a text file, making sure to rename the extension to whatever.ahk. Then, right click your newly created .ahk file and select edit script.
What we need to do is make a script where when we move our splitter and JoyToKey reinterprets those button presses as keyboard presses AutoHotkey can do a couple things for us using those keyboard presses. We’re going to make it so that when x is pressed (splitter forward) AHK will virtually press the ; key for 100 milliseconds, and when x is pressed, ‘ is pressed for 100 milliseconds. Meanwhile, when x is pressed AHK will hold down a virtual a button, which is our splitter on button in game, and when z is pressed, it quits holding a. This is actually pretty simple to do with AHK, and I’ll save you the hassle of typing it out[pastebin.com]. Make sure to save the file.
The real reason why this script is vital is because of placement and control. You’ll notice I saved the splitter commands for last instead of making them front and center, and in my first version of the script I didn’t have them at all, I was still letting the game use the splitter natively. I found through testing that if the splitter commands (a down/up) were before the neutral commands (; down, keep held down for 100 milliseconds, release 😉 or just omitted entirely like in my first version, the rpms tended to jump like the old logic was being applied before going into neutral or rarely, hopping to the next gear, I’m assuming it was a race condition in the game, activating the splitter before hitting the neutral buttons. By forcing the game to go to neutral before activating/deactivating the splitter, there’s no race condition in the game, and the shifts are smooth and realistic, making the ♥♥♥♥♥♥ pass through neutral so you can match rpms.
Go ahead and save that puppy and close the script, you’re done. Make sure JoyToKey is fired up and setup correctly and then right click on the AHK script and let it run, fire up the game and enjoy that little extra bit of realism.
Logic Explanation and Wrap-Up
I guess to tie everything together, I’ll run through the logic (or rather, what I think is the logic) once more. The splitter is moved forward, JoyToKey turns the button press into a keyboard press, x. AutoHotkey runs a script where if x is pressed, the ‘ key is pressed for 100 milliseconds, which means one of the conditions for a successful shift isn’t fulfilled, forcing the transmission into neutral because of that and the neutral keys being pressed, the’ key is then let up, satisfying the conditions for a gear to be selected (with proper RPMs), after that, the a key is pressed down, making the game think the splitter is in the on/high position, RPMs are then matched, and the split is complete. When the splitter is moved backwards, the same happens, but this time a is released to move the splitter back into the low position. RPMs are matched, and the split shift is complete.
Again, you can probably have it so that just 1 button is needed in JTK and 1 for the neutral keys, and pressing the neutral key might not even be necessary anyways because of the shift logic, but I haven’t actually verified that, so I’m just going with my current tried and true setup.
Well I hope all that made sense and wasn’t too convoluted, if anyone needs help I’d be happy to assist. Happy truckin’
Bonus: Throttle Aware Splitter Behavior
So if you’ve tried the new split logic you probably realized that you can’t be on the throttle when you try to split. This isn’t entirely realistic but at the time I didn’t know how to remedy this. I’ve made some strides in my AHK script to fix this, and it’s about 95% perfect in my opinion. The only issue now is that the script will only execute the first split you do while on the throttle. This means that if you’re gunning it and set the splitter forward, then see a hill and split back before releasing the throttle, the shift will still execute. To fix this, you just have to repeat what you just did. I’m currently working on getting that fixed, but in the mean time the updated script is perfectly usable[pastebin.com], it just doesn’t account for mistakes when splitting yet.
One thing you will have to do is figure out what number joy your pedal is actually configured as by Windows. To do that, download the joystick test script[www.autohotkey.com] for AHK, plug in your pedals, and run the script. Once that’s done, hit your throttle and see if anything changes in the popup window. If nothing happens, you might have to change joysticknumber to 1 or 2 or 3 until you find your joystick. Once you see what axis your throttle is and your joypad number (for reference, my wheel and pedals are the second joypad on my system, and my pedal axis is Z, with 100 being no throttle) you’ll have to make some changes in the updated AHK Splitter Logic script.
You’ll notice in the script under Throtz: and Throtx: there’s a line with: “if GetKeyState(“2JoyZ”) < 100″
You’ll have to change these lines to your particular setup. If your pedals are the first joypad on your system, you don’t need a number in front of them, and you’ll have to replace the Z with whatever axis your throttle is. The 100 might have to become a 0 too, if it shows as 0 for you during the test script. So in my particular case, my axis is Z, and my pedals are the second joypad in my system, hence 2JoyZ, then 100 is the pedal unpressed.
Once both lines are replaced in the script, save it and run it again.