Controls.sii file changes to enhance the trucking experience. First post Updated 20/02/2025

Make your game even better
Italiantrucker97
Posts: 4
Joined: March 21st, 2024, 2:02 pm

Re: Modifiche al file Controls.sii per migliorare l'esperienza di autotrasporto. Primo post Aggiornato 14/02/2024

Post by Italiantrucker97 » March 21st, 2024, 6:58 pm

thanks for answering me, I use the lever which in flying games would be the accelerator, in control.sii it is called joy2 and the axis is the z axis, so joy2.z does not have a centered return so when you release it it stays in the position, position 0 of the retarder should correspond to the lever pushed all the way forward while position 5 to the lever pulled all the way back, in this way it simulates the retarder lever that you pull up and down, when I get home I'll try those strings you wrote to me, I hope please understand I use google translator
User avatar
JHTrucker
Expert
Posts: 1382
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 14/02/2024

Post by JHTrucker » March 21st, 2024, 7:48 pm

@Italiantrucker97 - Here I've added a small deadzone for off and made all values positive, just in case.

"mix retarder0 `! abs(sign(deadzone(joy.z, 0.009))) | semantical.retarder0?0`"
"mix retarder1 `abs(sign(deadzone(joy.z, 0.01))) * ! abs(sign(deadzone(joy.z, 0.2))) | semantical.retarder1?0`"
"mix retarder2 `abs(sign(deadzone(joy.z, 0.21))) * ! abs(sign(deadzone(joy.z, 0.4))) | semantical.retarder2?0`"
"mix retarder3 `abs(sign(deadzone(joy.z, 0.41))) * ! abs(sign(deadzone(joy.z, 0.6))) | semantical.retarder3?0`"
"mix retarder4 `abs(sign(deadzone(joy.z, 0.61))) * ! abs(sign(deadzone(joy.z, 0.8))) | semantical.retarder4?0`"
"mix retarder5 `abs(sign(deadzone(joy.z, 0.81))) | semantical.retarder5?0`"

I tested the above in ETS2 and the truck (new merc) retarder lever only has off and 3 positions, but if your truck has more it should work ok.

This splits the movement into 3 steps:
"mix retarder0 `! abs(sign(deadzone(joy.z, 0.009))) | semantical.retarder0?0`"
"mix retarder1 `abs(sign(deadzone(joy.z, 0.01))) * ! abs(sign(deadzone(joy.z, 0.33))) | semantical.retarder1?0`"
"mix retarder2 `abs(sign(deadzone(joy.z, 0.34))) * ! abs(sign(deadzone(joy.z, 0.66))) | semantical.retarder2?0`"
"mix retarder3 `abs(sign(deadzone(joy.z, 0.67))) | semantical.retarder3?0`"
"mix retarder4 `semantical.retarder4?0`"
"mix retarder5 `semantical.retarder5?0`"

Hopefully that's enough for you to make it work.
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
Italiantrucker97
Posts: 4
Joined: March 21st, 2024, 2:02 pm

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 14/02/2024

Post by Italiantrucker97 » March 22nd, 2024, 2:58 pm

hi, so it works more or less, the problem is that the lever takes the center as the zero point instead of pushing it all the way forward, so from the center downwards or upwards it moves the retarder instead of using the entire stroke, I think that some value must be negative
User avatar
JHTrucker
Expert
Posts: 1382
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: Controls.sii file changes to enhance the trucking experience.

Post by JHTrucker » March 22nd, 2024, 5:43 pm

Control the retarder with a non-centering analogue lever - 1.41+
As requested by forum member Italiantrucker97 - https://roextended.ro/forum/viewtopic.p ... 774#p63774

Note: The analogue lever you use for this should stay in position when you let go of it, that way it can be used as a selector switch.

-------------------------

@Italiantrucker97 - I've found and connected an old joystick that has a small thumb operated analogue throttle, that doesn't auto centre, it works like this:
Centre to forwards = negative
Centre = 0
Centre backwards = positive

Z default = joy2.z = -1.0 <-> 0.0 <-> 1.0
Z converted = (joy2.z + 1) * 0.5 = 0.0 <-> 1.0 (for full forward/backward lever range).

Using ETS2 New Merc and watching the in cab animated retarder lever (off & 3 positions) on the steering column:
My joystick throttle lever fully forward and in game animated lever shown as up.
Pushing joystick throttle lever backwards shows in game animated lever going down.

"mix retarder0 `! sign(deadzone((joy2.z + 1) * 0.5, 0.09)) | semantical.retarder0?0`"
"mix retarder1 `sign(deadzone((joy2.z + 1) * 0.5, 0.01)) * ! sign(deadzone((joy2.z + 1) * 0.5, 0.20)) | semantical.retarder1?0`"
"mix retarder2 `sign(deadzone((joy2.z + 1) * 0.5, 0.21)) * ! sign(deadzone((joy2.z + 1) * 0.5, 0.40)) | semantical.retarder2?0`"
"mix retarder3 `sign(deadzone((joy2.z + 1) * 0.5, 0.41)) * ! sign(deadzone((joy2.z + 1) * 0.5, 0.60)) | semantical.retarder3?0`"
"mix retarder4 `sign(deadzone((joy2.z + 1) * 0.5, 0.61)) * ! sign(deadzone((joy2.z + 1) * 0.5, 0.80)) | semantical.retarder4?0`"
"mix retarder5 `sign(deadzone((joy2.z + 1) * 0.5, 0.81)) | semantical.retarder5?0`"

OR

My joystick throttle lever fully forward and in game animated lever shown as down.
Pushing joystick throttle lever backwards shows in game animated lever going up.

"mix retarder0 `sign(deadzone((joy2.z + 1) * 0.5, 0.81)) | semantical.retarder?0`"
"mix retarder1 `sign(deadzone((joy2.z + 1) * 0.5, 0.61)) * ! sign(deadzone((joy2.z + 1) * 0.5, 0.80)) | semantical.retarder1?0`"
"mix retarder2 `sign(deadzone((joy2.z + 1) * 0.5, 0.41)) * ! sign(deadzone((joy2.z + 1) * 0.5, 0.60)) | semantical.retarder2?0`"
"mix retarder3 `sign(deadzone((joy2.z + 1) * 0.5, 0.21)) * ! sign(deadzone((joy2.z + 1) * 0.5, 0.40)) | semantical.retarder3?0`"
"mix retarder4 `sign(deadzone((joy2.z + 1) * 0.5, 0.01)) * ! sign(deadzone((joy2.z + 1) * 0.5, 0.20)) | semantical.retarder4?0`"
"mix retarder5 `! sign(deadzone((joy2.z + 1) * 0.5, 0.09)) | semantical.retarder5?0`"

Just choose one of the above options and change joy2.z to suit your setup.


Go back to the first post for the full list of what's available: https://roextended.ro/forum/viewtopic.p ... 744#p24744
Last edited by JHTrucker on March 22nd, 2024, 7:41 pm, edited 3 times in total.
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
Italiantrucker97
Posts: 4
Joined: March 21st, 2024, 2:02 pm

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 14/02/2024

Post by Italiantrucker97 » March 22nd, 2024, 6:50 pm

it works, thanks so much for your patience and help
User avatar
JHTrucker
Expert
Posts: 1382
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 14/02/2024

Post by JHTrucker » March 22nd, 2024, 7:25 pm

@Italiantrucker97 - Glad to hear it, enjoy.

It seems that this is something that others may also want, so I'll add my post to the main list.
Thanks.
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
User avatar
fra_xt
Posts: 11
Joined: January 25th, 2025, 1:22 pm

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024

Post by fra_xt » January 25th, 2025, 1:27 pm

Hi, I've been trying to control the steering wheel with the mouse scroll wheel (which would be a surface dial device) without much success. Do you have any suggestions on how to do that? The main problem is that I cannot have the game register scroll wheel inputs for the steering, even though it works for the usual stuff

Great stuff you have on here anyway :) Thanks
User avatar
JHTrucker
Expert
Posts: 1382
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024

Post by JHTrucker » January 25th, 2025, 7:17 pm

@fra_xt - I only have a basic 2 button mouse with an up/down scroll wheel, but you're right, the mouse scroll wheel doesn't do anything except the things its supposed to do, zoom map etc.

But I've managed to force it to work...

My example:
steer left - mouse wheel up
steer right - mouse wheel down

In the controls.sii file, use lookpos8 & lookpos9, they're game default spares, to capture the mouse scroll up/down inputs and lock them on for 250 milliseconds every time you scroll.
(I think perhaps by default the scroll inputs are too fast to register as a pressed input?)

"mix lookpos8 `memory(long_press((mouse.wheel_up?0 * ! lookpos8) + long_press(lookpos8, 250), 0.000001), ! lookpos8)`"
"mix lookpos9 `memory(long_press((mouse.wheel_down?0 * ! lookpos9) + long_press(lookpos9, 250), 0.000001), ! lookpos9)`"
Change 250 as required, 1000 = 1 second etc.
The higher the value the further the steering will turn for each scrolled input.
Also, adjust the steering sensitivity settings as required.

Then you can use lookpos8 & lookpos9 to control the steering.
Keyboard steering:
"mix dsteerleft `lookpos8?0`"
"mix dsteerright `lookpos9?0`"
OR
Mouse steering:
"mix msteering `(lookpos8?0 - lookpos9?0) * c_msens`"

Hopefully that should help you to make the changes to suit your device, unless I've misunderstood something?
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
User avatar
fra_xt
Posts: 11
Joined: January 25th, 2025, 1:22 pm

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024

Post by fra_xt » January 26th, 2025, 12:40 am

@JHTrucker That's amazing, thanks!! That's exaclty what I was talking about. I thought I had some kind of an idea of how to make it work but I would have never got it right :swoon:
JHTrucker wrote:
January 25th, 2025, 7:17 pm
In the controls.sii file, use lookpos8 & lookpos9, they're game default spares, to capture the mouse scroll up/down inputs and lock them on for 250 milliseconds every time you scroll.
(I think perhaps by default the scroll inputs are too fast to register as a pressed input?)
Yeah I think maybe the difference between a scroll wheel input and keyboard input is that regular keyboard has 2 strokes (key press and key release), while the scroll wheel has only one impulse for each detent, so that the game counts how many pulses the scroll wheel sends and then scrolls the corresponent amount of lines up or down. Unfortunately unless SCS makes the steering wheel to also work as a slider it will never be perfect, but your solution is great!! I have done some testing and the following is what I've got so far

As you can see I've set the long_press time to 1 ms. Also, I've multiplied the lookpos value times 0.01 to obtain fine input steps; the 0.01 shall be increased for lower resolution scroll wheels. I kept the keyboard.arrow input but with sensitivity set at 10 it only goes from 100% left to 100% right lol. Steering non-linearity in-game is set at zero (c_asteersens = 1)

Code: Select all

config_lines[36]: "constant c_rsteersens 10.000000"
config_lines[37]: "constant c_asteersens 1.000000"

config_lines[41]: "constant c_relatsteer 1.000000"
 
config_lines[264]: "mix lookpos8 `memory(long_press((mouse.wheel_up?0 * ! lookpos8) + long_press(lookpos8, 1), 0.000001), ! lookpos8)`"
config_lines[265]: "mix lookpos9 `memory(long_press((mouse.wheel_down?0 * ! lookpos9) + long_press(lookpos9, 1), 0.000001), ! lookpos9)`"

config_lines[314]: "mix dsteerleft `keyboard.larrow?0 + lookpos8?0 * 0.01`"
config_lines[315]: "mix dsteerright `keyboard.rarrow?0 + lookpos9?0 * 0.01`"
config_lines[316]: "mix dsteering `dsteerleft - dsteerright`"
It was also necessary to edit the physics file because this method only works for gamepad mode (relatsteer, aka relative steering). With the following lines I've reduced autocentering to almost zero. Zero autocentering (steering_ratio_coef = 0.0) works fine but maybe having a little autocentering helps when manouvering

Code: Select all

steering_speed_coef:	1.0
steering_angle_coef:	0.01
steering_ratio_coef:	0.01
The main issue is that if I want to have smooth steering with a high resolution scroll wheel like the MS surface dial, the steering wheel maximum speed is really low, and vice versa (I think it's the games' limitation). I wanted to have one to one ratio between the dial and the in-game steering wheel but it's undrivable, so I set the steering sensitivity curve as follows. It's not smooth but fast enough at slow truck speed, it's not fast but it's smooth and responsive enough at high truck speeds

Code: Select all

	
steering_sensitivity_multiplier_0kmh:		3.07
steering_sensitivity_multiplier_100kmh:		-2.5
steering_sensitivity_multiplier_minimum:	0.52
steering_sensitivity_multiplier_maximum:	3.00
I haven't tried injecting this method in the mouse steering mix yet but I'll update this post if I find differences. Thanks again for your code and help, feel free to add this stuff to your list if you'd like to do so :dance2:
User avatar
JHTrucker
Expert
Posts: 1382
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 20/10/2024

Post by JHTrucker » January 26th, 2025, 3:21 am

@fra_xt - If you're going to hang around here for a while, whilst you develop your solution, I'll post some other ideas for you to test out, if or when I have any, and I'll add your post to the list, thanks.

I googled your dial... it seems that you can press it, like a middle mouse wheel button...
How about using that to change the turn speed on the fly?
Example only - Turn speed is 10 x faster when toggled on.
"mix lookpos7 `memory(mouse.button_middle?0, ! lookpos7)`"
"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 dsteerleft `lookpos8?0 * (1.0 + (9.0 * lookpos7))`"
"mix dsteerright `lookpos9?0 * (1.0 + (9.0 * lookpos7))`"
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
Post Reply