Controls.sii file changes to enhance the trucking experience. First post Updated 20/02/2025
-
- Posts: 150
- Joined: June 14th, 2021, 2:11 am
Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024
Sorry for butting in, but this situation seems similar to the analog stick to steering wheel script I made. I'm not very familiar with the controls.sii file, but as long as you can set the steering input value directly (like when using wheel mode), you should be able to get the wheel to follow your dial 1:1. So for example, if steering input of 1 is all the way right and -1 is all the way left, bind scroll down to increase steering input by 0.01, and scroll up to decrease by 0.01. That would mean 100 steps of scroll will turn the wheel all the way to one side.
My script uses Joystick Gremlin to map the analog stick's rotation input to a virtual vJoy controller. Then the game uses the x axis of that vJoy controller like a steering wheel input. If what I suggested above wouldn't work, I'm sure it would be possible to modify my script to work with scroll wheel inputs to obtain a similar result. If you know a bit of python, that could be something else to try.
But if it's doable within the controls.sii file, that would be better, so you wouldn't need external programs. Side note: JHTrucker, if you're interested in converting my script into a controls.sii edit, feel free to do so, that would be cool!
My script uses Joystick Gremlin to map the analog stick's rotation input to a virtual vJoy controller. Then the game uses the x axis of that vJoy controller like a steering wheel input. If what I suggested above wouldn't work, I'm sure it would be possible to modify my script to work with scroll wheel inputs to obtain a similar result. If you know a bit of python, that could be something else to try.
But if it's doable within the controls.sii file, that would be better, so you wouldn't need external programs. Side note: JHTrucker, if you're interested in converting my script into a controls.sii edit, feel free to do so, that would be cool!
Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024
@a1337cookie - It's all about finding the right solution, 'butting in' is better than keeping quiet!
I did think about your wheel script but wasn't sure if it would work for digital to analogue.
Anyway, hopefully fra_xt comes back as I do now have a working solution, on the next post down.
I did think about your wheel script but wasn't sure if it would work for digital to analogue.
Anyway, hopefully fra_xt comes back as I do now have a working solution, on the next post down.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
Driving Enhancements: viewtopic.php?p=67254#p67254
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
controls.sii edits: viewtopic.php?p=24744#p24744
Driving Enhancements: viewtopic.php?p=67254#p67254
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024
@fra_xt
MS Dial - Analogue steering:
"mix lookpos8 `memory(long_press((mouse.wheel_up?0 * ! lookpos8) + long_press(lookpos8, 1), 0.000001), ! lookpos8)`"
"mix lookpos9 `memory(long_press((mouse.wheel_down?0 * ! lookpos9) + long_press(lookpos9, 1), 0.000001), ! lookpos9)`"
"mix steering `max(min(memory(lookpos8 | lookpos9, steering + sel(lookpos8, 0.1, -0.1)), 1.0), -1.0)`"
+/-0.1 = steps left/right
+/-1.0 = max steering limit left/right
In game with 'controls' = keyboard
The problem is that the steps are acting as multipliers, the more clicks the faster it turns, whereas we want the each click to be positional... and we can fool the game into allowing it!
You'll need to plug in a game controller, but it won't be used, then set, for example:
Controls = keyboard + controller (xbox360)
Controller subtype = Wheel
Now with the exact same 3 lines as above, it works exactly like a wheel input, 5 clicks up = game steering wheel turned half way to the left.
Just change 'step' value +/-0.1 to match the number of click you want on your dial.
If you don't have a controller, add this:
config_lines[2]: "device joy `di8.'{Used to force analogue steering for MS Dial}'`"
In game:
Controls = keyboard + missing di8 {Used to force analogue steering for MS Dial}
Controller subtype = Wheel
The only problem now is that you'll get the 'missing controller' popup, just close it, ignore it, continue to drive...
MS Dial - Analogue steering:
"mix lookpos8 `memory(long_press((mouse.wheel_up?0 * ! lookpos8) + long_press(lookpos8, 1), 0.000001), ! lookpos8)`"
"mix lookpos9 `memory(long_press((mouse.wheel_down?0 * ! lookpos9) + long_press(lookpos9, 1), 0.000001), ! lookpos9)`"
"mix steering `max(min(memory(lookpos8 | lookpos9, steering + sel(lookpos8, 0.1, -0.1)), 1.0), -1.0)`"
+/-0.1 = steps left/right
+/-1.0 = max steering limit left/right
In game with 'controls' = keyboard
The problem is that the steps are acting as multipliers, the more clicks the faster it turns, whereas we want the each click to be positional... and we can fool the game into allowing it!
You'll need to plug in a game controller, but it won't be used, then set, for example:
Controls = keyboard + controller (xbox360)
Controller subtype = Wheel
Now with the exact same 3 lines as above, it works exactly like a wheel input, 5 clicks up = game steering wheel turned half way to the left.
Just change 'step' value +/-0.1 to match the number of click you want on your dial.
If you don't have a controller, add this:
config_lines[2]: "device joy `di8.'{Used to force analogue steering for MS Dial}'`"
In game:
Controls = keyboard + missing di8 {Used to force analogue steering for MS Dial}
Controller subtype = Wheel
The only problem now is that you'll get the 'missing controller' popup, just close it, ignore it, continue to drive...
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
Driving Enhancements: viewtopic.php?p=67254#p67254
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
controls.sii edits: viewtopic.php?p=24744#p24744
Driving Enhancements: viewtopic.php?p=67254#p67254
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024
@JHTrucker @a1337cookie Thanks guys for your participation, that's awesome :)
@a1337cookie I did see your script before writing here, that's cool :) unfortunately this scroll wheel is tricky since it's not an analogue axis, it has no 100% limiter on either direction, it kinda needs to work like mouse steering in a certain way
@JHTrucker of course I'm keeping an eye on the forum now hehe. I was testing your suggestion with on-the-fly sensitivity adjustement and works great, allows to keep a way less dramatical sensitivity curve in the physics file and adjust steering sensitivity when needed. Unfortunately the middle click does not work on the dial but any other key is just fine, keep in mind the dial is just a glorified scroll wheel so this stuff might be useful for anyone with any regular mouse scroll wheel :)
I will now test the latest method you posted and I'll keep y'all updated, that's amazing work. Thanks!!!
@a1337cookie I did see your script before writing here, that's cool :) unfortunately this scroll wheel is tricky since it's not an analogue axis, it has no 100% limiter on either direction, it kinda needs to work like mouse steering in a certain way
@JHTrucker of course I'm keeping an eye on the forum now hehe. I was testing your suggestion with on-the-fly sensitivity adjustement and works great, allows to keep a way less dramatical sensitivity curve in the physics file and adjust steering sensitivity when needed. Unfortunately the middle click does not work on the dial but any other key is just fine, keep in mind the dial is just a glorified scroll wheel so this stuff might be useful for anyone with any regular mouse scroll wheel :)
I will now test the latest method you posted and I'll keep y'all updated, that's amazing work. Thanks!!!
Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024
@fra_xt - If you haven't already realised, you'll need to prevent 'mouse wheel cam zooming' in cam 2 mode, otherwise it'll drive you crazy.
"mix camzoomin `mouse.wheel_up?0 * ! lookpos7?0`"
"mix camzoomout `mouse.wheel_down?0 * ! lookpos7?0`"
"mix lookpos7 `memory((cam2?0 * ! lookpos7) + (sign(cam1?0 + cam3?0 + cam4?0 + cam5?0 + cam6?0 + cam7?0 + cam8?0 + cam9?0 + cam0?0) * lookpos7), ! lookpos7)`"
lookpos7 latched on when cam2 is pressed and off when any other cam is pressed. It doesn't affect map zooming.
There may still be other things to fix/adjust code for...
When the time comes, once you've worked through all the testing and are happy with the results, just reply again in this topic with your 'How to...' instructions. Then I'll add and link that post to the main list.
"mix camzoomin `mouse.wheel_up?0 * ! lookpos7?0`"
"mix camzoomout `mouse.wheel_down?0 * ! lookpos7?0`"
"mix lookpos7 `memory((cam2?0 * ! lookpos7) + (sign(cam1?0 + cam3?0 + cam4?0 + cam5?0 + cam6?0 + cam7?0 + cam8?0 + cam9?0 + cam0?0) * lookpos7), ! lookpos7)`"
lookpos7 latched on when cam2 is pressed and off when any other cam is pressed. It doesn't affect map zooming.
There may still be other things to fix/adjust code for...
When the time comes, once you've worked through all the testing and are happy with the results, just reply again in this topic with your 'How to...' instructions. Then I'll add and link that post to the main list.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
Driving Enhancements: viewtopic.php?p=67254#p67254
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
controls.sii edits: viewtopic.php?p=24744#p24744
Driving Enhancements: viewtopic.php?p=67254#p67254
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024
@JHTrucker Thanks for that, to be honest I had removed the scroll wheel input from camera zoom altogether lol
Of course add this stuff to the main list only if you like it :)
I think I need to redo some fresh testing tomorrow because things are not adding up anymore lol.
In the mean time, the dial-to-analog method works really well without needing to modify the autocentering parameters in the physics file, which is good. I think the on-the-fly sensitivity adjustment might still be a good option
What's holding us back is how the game calculates sensitivity, so if I scroll the mousewheel/dial really fast many inputs are skipped and the in-game steering wheel does not turn any further than if I scroll the mousewheel/dial slowly
If I find other stuff to inject the scroll wheel inputs into an analog signal as a1337cookie was suggesting I'll keep y'all updated on that too :)
Of course add this stuff to the main list only if you like it :)
I think I need to redo some fresh testing tomorrow because things are not adding up anymore lol.
In the mean time, the dial-to-analog method works really well without needing to modify the autocentering parameters in the physics file, which is good. I think the on-the-fly sensitivity adjustment might still be a good option
What's holding us back is how the game calculates sensitivity, so if I scroll the mousewheel/dial really fast many inputs are skipped and the in-game steering wheel does not turn any further than if I scroll the mousewheel/dial slowly
If I find other stuff to inject the scroll wheel inputs into an analog signal as a1337cookie was suggesting I'll keep y'all updated on that too :)
Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024
@fra_xt - If you want to be able to use the 'steering non linearity' slider, use these lines, assuming you're not a VR user.
"mix lookpos8 `memory(long_press((mouse.wheel_up?0 * ! lookpos8) + long_press(lookpos8, 1), 0.000001), ! lookpos8)`"
"mix lookpos9 `memory(long_press((mouse.wheel_down?0 * ! lookpos9) + long_press(lookpos9, 1), 0.000001), ! lookpos9)`"
"mix hmdyaw `max(min(memory(lookpos8 | lookpos9, hmdyaw + sel(lookpos8, 0.01, -0.01)), 1.0), -1.0)`"
"mix steering `dsteering - (pow(normalize(abs(hmdyaw?0), c_steer_dz), (1.0 + c_steer_func * 0.5)) * sign(-hmdyaw?0)) - semantical.steering?0`"
EDIT 27/01/2025:
Just a thought on missing impulses...
The game will have a tick rate of, lets guess 100, which means the game code will loop 100 times a second.
The controls.sii file info will therefore also be read 100 times a second, that would mean a minimum of 10 milliseconds for every impulse to be detected.
Try changing your 1ms to 10ms?
"mix lookpos8 `memory(long_press((mouse.wheel_up?0 * ! lookpos8) + long_press(lookpos8, 10), 0.000001), ! lookpos8)`"
"mix lookpos9 `memory(long_press((mouse.wheel_down?0 * ! lookpos9) + long_press(lookpos9, 10), 0.000001), ! lookpos9)`"
Like I said, the above is just guessing, but I thought it might help you in your testing.
When you turn your dial are you turning it much faster than if you where turning a FFB wheel?
"mix lookpos8 `memory(long_press((mouse.wheel_up?0 * ! lookpos8) + long_press(lookpos8, 1), 0.000001), ! lookpos8)`"
"mix lookpos9 `memory(long_press((mouse.wheel_down?0 * ! lookpos9) + long_press(lookpos9, 1), 0.000001), ! lookpos9)`"
"mix hmdyaw `max(min(memory(lookpos8 | lookpos9, hmdyaw + sel(lookpos8, 0.01, -0.01)), 1.0), -1.0)`"
"mix steering `dsteering - (pow(normalize(abs(hmdyaw?0), c_steer_dz), (1.0 + c_steer_func * 0.5)) * sign(-hmdyaw?0)) - semantical.steering?0`"
EDIT 27/01/2025:
Just a thought on missing impulses...
The game will have a tick rate of, lets guess 100, which means the game code will loop 100 times a second.
The controls.sii file info will therefore also be read 100 times a second, that would mean a minimum of 10 milliseconds for every impulse to be detected.
Try changing your 1ms to 10ms?
"mix lookpos8 `memory(long_press((mouse.wheel_up?0 * ! lookpos8) + long_press(lookpos8, 10), 0.000001), ! lookpos8)`"
"mix lookpos9 `memory(long_press((mouse.wheel_down?0 * ! lookpos9) + long_press(lookpos9, 10), 0.000001), ! lookpos9)`"
Like I said, the above is just guessing, but I thought it might help you in your testing.
When you turn your dial are you turning it much faster than if you where turning a FFB wheel?
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
Driving Enhancements: viewtopic.php?p=67254#p67254
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
controls.sii edits: viewtopic.php?p=24744#p24744
Driving Enhancements: viewtopic.php?p=67254#p67254
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024
@JHTrucker thanks for non-linearity, will test that too :)
I will try comparing the dial and the regular mouse wheel. Rotational speed between dial and FFB wheel is pretty comparable (surely not faster), though the dial (if the marketing is correct) should have 3600 ticks per full rotation, so even with code running 100 times a second it can easily be saturated, in fact the dial has to be rotated quite slowly to not skip inputs
What I've understood so far is that by increasing from 1 ms to higher duration it will increase how long each input tick is kept active. if a new input occurs when the current one is still going, the old one will be overwritten, and that's how the game skips inputs (I think). It becomes pretty easy to skip inputs with regular mouse scroll wheel too
It's been a long time since I've used a steering wheel in ETS2, does the sentivity setting matter for that too or is it only for gamepad/keyboard?
Would be cool to understand how mousesteering works too
I will try comparing the dial and the regular mouse wheel. Rotational speed between dial and FFB wheel is pretty comparable (surely not faster), though the dial (if the marketing is correct) should have 3600 ticks per full rotation, so even with code running 100 times a second it can easily be saturated, in fact the dial has to be rotated quite slowly to not skip inputs
What I've understood so far is that by increasing from 1 ms to higher duration it will increase how long each input tick is kept active. if a new input occurs when the current one is still going, the old one will be overwritten, and that's how the game skips inputs (I think). It becomes pretty easy to skip inputs with regular mouse scroll wheel too
It's been a long time since I've used a steering wheel in ETS2, does the sentivity setting matter for that too or is it only for gamepad/keyboard?
Would be cool to understand how mousesteering works too
Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024
@fra_xt - Perhaps skipping is just a limitation of how we're forcing the game to do something different and the actual scroll inputs for zooming etc are handled differently within the game code?
I only ever "drive" with my old G27 wheel (but test and create stuff on my cheap old laptop, low settings @30fps with keyboard/mouse/xbox360), but the sensitivity does apply to wheels as well, if I put the slider far left and turn my wheel fast to 90 degrees left the on screen wheel slowly rotates until its caught up.
If you don't want auto centering then 'subtype wheel' is the only way to go. But, for your dial, I would use some non-linearity to help high speed driving, perhaps?
Mouse steering seems like a better option, compared to keyboard constant stabbing away at the left/right keys, I guess its more like gamepad thumbstick being able to hold your line through the corner.
If you did use mouse steering then you could also have 'on the fly' sensitivity changes using the scroll wheel, which could give a range of multipliers instead of just 1 with a button press.
Something like this, utilising the previous posted hmdyaw line:
"mix lookpos8 `memory(long_press((mouse.wheel_up?0 * ! lookpos8) + long_press(lookpos8, 1), 0.000001), ! lookpos8)`"
"mix lookpos9 `memory(long_press((mouse.wheel_down?0 * ! lookpos9) + long_press(lookpos9, 1), 0.000001), ! lookpos9)`"
"mix hmdyaw `max(min(memory(lookpos8 | lookpos9, hmdyaw + sel(lookpos8, 0.01, -0.01)), 1.0), -1.0)`"
"mix msteering `-mouse.rel_position.x?0 * c_msens * (1.1 + hmdyaw)`" <-- range 0.1 to 2.1
OR
"mix msteering `lookpos8?0 - lookpos9?0`" <-- test for dial
I only ever "drive" with my old G27 wheel (but test and create stuff on my cheap old laptop, low settings @30fps with keyboard/mouse/xbox360), but the sensitivity does apply to wheels as well, if I put the slider far left and turn my wheel fast to 90 degrees left the on screen wheel slowly rotates until its caught up.
If you don't want auto centering then 'subtype wheel' is the only way to go. But, for your dial, I would use some non-linearity to help high speed driving, perhaps?
Mouse steering seems like a better option, compared to keyboard constant stabbing away at the left/right keys, I guess its more like gamepad thumbstick being able to hold your line through the corner.
If you did use mouse steering then you could also have 'on the fly' sensitivity changes using the scroll wheel, which could give a range of multipliers instead of just 1 with a button press.
Something like this, utilising the previous posted hmdyaw line:
"mix lookpos8 `memory(long_press((mouse.wheel_up?0 * ! lookpos8) + long_press(lookpos8, 1), 0.000001), ! lookpos8)`"
"mix lookpos9 `memory(long_press((mouse.wheel_down?0 * ! lookpos9) + long_press(lookpos9, 1), 0.000001), ! lookpos9)`"
"mix hmdyaw `max(min(memory(lookpos8 | lookpos9, hmdyaw + sel(lookpos8, 0.01, -0.01)), 1.0), -1.0)`"
"mix msteering `-mouse.rel_position.x?0 * c_msens * (1.1 + hmdyaw)`" <-- range 0.1 to 2.1
OR
"mix msteering `lookpos8?0 - lookpos9?0`" <-- test for dial
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
Driving Enhancements: viewtopic.php?p=67254#p67254
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
controls.sii edits: viewtopic.php?p=24744#p24744
Driving Enhancements: viewtopic.php?p=67254#p67254
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
-
- Posts: 150
- Joined: June 14th, 2021, 2:11 am
Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024
Here's a thought, it seems that scroll wheel inputs are usually treated as an axis in game engines, since that's how it's read by the OS. For example, suppose scroll axis is +1 when you scroll up, and -1 when you scroll down. If multiple scroll steps are sent within a single polling interval, you get a bigger number, like +2 or -3. But if you use mouse wheel up or down as a button binding, it converts it to an on or off state, and those additional inputs are lost.
So if there's the option to map the mouse wheel as an axis in the controls.sii file, that may be part of the solution.
So if there's the option to map the mouse wheel as an axis in the controls.sii file, that may be part of the solution.