Split shifts: What they are, how the game messes them up, and how to make them right

flyboy463
Posts: 38
Joined: 12 Jun 2016 07:34

Split shifts: What they are, how the game messes them up, and how to make them right

#1 Post by flyboy463 » 04 Jun 2021 03:35

Hello again fellow truckers, you might remember me from my Twin Sticks and Toothpicks guide on getting a realistic Spicer 6x4 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.

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 trannys 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.

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:\Users\NAME\Documents\American Truck Simulator\profiles\NUMBERS), 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.



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.

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. 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 tranny 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.

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, 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 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.
Last edited by flyboy463 on 10 Jun 2021 21:57, edited 1 time in total.
User avatar
bobgrey1997
Posts: 3618
Joined: 30 Nov 2015 02:13
Location: Minnesota, Iowa, Dekotas, and Nebraska
Contact:

Re: Split shifts: What they are, how the game messes them up, and how to make them right

#2 Post by bobgrey1997 » 04 Jun 2021 03:52

I seen "split shifts" and immediately thought it was about the Sleeper Berth Provision.
That's what I get for not driving manuals, I guess.
User avatar
flight50
Posts: 30304
Joined: 20 May 2017 03:33
Location: Dallas/Ft. Worth, Tx - USA

Re: Split shifts: What they are, how the game messes them up, and how to make them right

#3 Post by flight50 » 04 Jun 2021 13:01

Honestly, I don't have issues with my splitter. I own both a Megashifter and 6 months ago upgraded to a STG. Both splitters on both work flawlessly. Imho, its the user needing to know how and when to shift. Normally I don't even split gears until I am in 7L. A ton of it depends on the load and the terrain. I only drive 18 speeds hands down but I drive them more like a 13 spd.
flyboy463
Posts: 38
Joined: 12 Jun 2016 07:34

Re: Split shifts: What they are, how the game messes them up, and how to make them right

#4 Post by flyboy463 » 04 Jun 2021 18:22

@flight50 Your split shifts don't immediately jump to the splitted gear? Maybe it's my csio shifter at fault then. Since I've had it my split shifts had no delay to them at all, the RPMs just jump to the new gear, which is not what happens in real life.
User avatar
flight50
Posts: 30304
Joined: 20 May 2017 03:33
Location: Dallas/Ft. Worth, Tx - USA

Re: Split shifts: What they are, how the game messes them up, and how to make them right

#5 Post by flight50 » 04 Jun 2021 19:13

Considering its a video game that sends electronic signals vs hydraulic fluids, it can't be realistic like real life unless you add a delay. But yes on both my shifters, the switch is instant. But I release my clutch moderately so its feathered for me.
flyboy463
Posts: 38
Joined: 12 Jun 2016 07:34

Re: Split shifts: What they are, how the game messes them up, and how to make them right

#6 Post by flyboy463 » 04 Jun 2021 19:24

Yeah clutching allows it to be somewhat realistic. I know it'd be hard to simulate the actual air system used for these, but I think my delay does the job well enough, I'm just trying to add more realistic simulation in a simulation game
User avatar
natvander
SCS Software
Posts: 2991
Joined: 01 Feb 2015 01:42
Location: NSW, Australia

Re: Split shifts: What they are, how the game messes them up, and how to make them right

#7 Post by natvander » 05 Jun 2021 08:16

Does the delay occur immediately after the splitter is moved or when your foot's off the accelerator?
Never argue with idiots. They bring you down to their level and beat you with experience.
flyboy463
Posts: 38
Joined: 12 Jun 2016 07:34

Re: Split shifts: What they are, how the game messes them up, and how to make them right

#8 Post by flyboy463 » 05 Jun 2021 16:39

I think delay might be the wrong word, but everything happens when the splitter is moved. This does mean that standard in game logic will take over if you preselect your split, wait a second, and then get off the accelerator. I haven't figured out the logic and exactly what I need to do in JTK and AHK to have the skinny pedal also hit the neutral keys only after a preselect of the splitter, but once I do, I'll be sure to add it in the main post
flyboy463
Posts: 38
Joined: 12 Jun 2016 07:34

Re: Split shifts: What they are, how the game messes them up, and how to make them right

#9 Post by flyboy463 » 10 Jun 2021 21:57

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, 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 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.

@natvander I believe this is what you were after in your question.
Kracken243
Posts: 2
Joined: 15 Jun 2021 19:22

Re: Split shifts: What they are, how the game messes them up, and how to make them right

#10 Post by Kracken243 » 15 Jun 2021 19:29

Flyboy463, I have read some of your analysis of this problem and plan to finish with some more, but you seem to be the most knowledgable about the shifters so I was hoping that I could ask you a question
I'm really enjoying the game but am having trouble with my g29 shifter button number to gear assignment. Shifting with a Eaton Fuller shifter Eaton Fuller 10 speed transmission which I should assign the following.
R 2 4
| | |
1 3 5
with the Range flipped up it should let me get the following
R 7 9
| | |
6 8 10

The game will not allow me to assign the reverse in what the g29 sees as button 12 it makes it neutral. It also makes the 1/6 into Reverse. So when I make the assignment (from left to right)
R 2 4
1 3 5
the software makes my assignment as below:
N 1/6 3/8
R 2/7 4/9 so no 5th gear and no 10th gear!??

I've calibrated in windows and am showing for the g29 gear 1 thru 6 as being the following buttons:
12 14 16
13 15 17 as I move the shifter.

Can you help me get to the bottom of this please. I would love to have this shift as a real Eaton Fuller 10 speed .. Thanks!
Post Reply

Return to “General discussion about the game”

Who is online

Users browsing this forum: FierbetoN, Killer-Of-Night, pepkansek, San_Sany4 and 19 guests