Erratic class 166 keyboard and/or raildriver behavior

General discussion about RailWorks, your thoughts, questions, news and views!

Moderator: Moderators

User avatar
VernonDozier
Established Forum Member
Posts: 483
Joined: Thu Apr 21, 2011 6:57 am
Location: Toronto, Ontario, Canada

Erratic class 166 keyboard and/or raildriver behavior

Post by VernonDozier »

Has anyone else been getting problems controlling this train? It seems that if I even tap the key slightly it either jumps to 100% throttle or emergency. I can rarely go up or down one step at a time. ANyone else experience this?

Also has anyone experienced problems running this with their raildriver? I don't actually use a raildriver but i use Cadde's joystick API which uses the same dll.
'Coolerdown' = The BEST job title EVER :D

Specs: Windows 7; i5 53570k 4.7Ghz, 4GB DDR3 1866, Radeon HD 5770.
nigeltouatievans
Established Forum Member
Posts: 439
Joined: Thu Nov 05, 2009 9:58 am

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by nigeltouatievans »

Yes, definitely have the throttle/brake running to +/- 100% sometimes when tapping the keys, and also when using the mouse with the F4 HUD the same thing happens. The 450 has similar problems in my experience.
User avatar
quickthorn
Been on the forums for a while
Posts: 210
Joined: Mon Aug 08, 2011 7:14 pm
Location: North Notts

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by quickthorn »

Yes, I find it often slips into full throttle or emergency brake when trying to move it 1 notch.

I've found it works ok with the raildriver, except throttle idle on the raildriver gives 0% on the f4 hud, which is not idle on the 166, you still have some power on. To get zero power/no brakes, you have to put the raildriver throttle into the dynamic braking range slightly (-30% on the f4 HUD).
AMD Phenom II X4 955 3.2 GHz CPU ~ Sapphire HD 6770 1 Gb GPU
Gigabyte GA-990XA-UD3 Mb ~ Realtek AL889 onboard codec
Corsair Vengeance 1600 MHz DDR3 8 Gb RAM ~ Seagate SATA3 1 Tb HDD
BenQ 21.5" 1920x1080 monitor ~ Antec Earthwatts 650W 80%+ PSU
User avatar
VernonDozier
Established Forum Member
Posts: 483
Joined: Thu Apr 21, 2011 6:57 am
Location: Toronto, Ontario, Canada

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by VernonDozier »

quickthorn wrote:Yes, I find it often slips into full throttle or emergency brake when trying to move it 1 notch.

I've found it works ok with the raildriver, except throttle idle on the raildriver gives 0% on the f4 hud, which is not idle on the 166, you still have some power on. To get zero power/no brakes, you have to put the raildriver throttle into the dynamic braking range slightly (-30% on the f4 HUD).
Right, that's the same problem I'm having with the joystick/raildriver api and the 166. I can't get the throttle and brakes to both be at zero. I could in RW2 though.
'Coolerdown' = The BEST job title EVER :D

Specs: Windows 7; i5 53570k 4.7Ghz, 4GB DDR3 1866, Radeon HD 5770.
User avatar
DescendingSadly
Very Active Forum Member
Posts: 1327
Joined: Mon Feb 13, 2006 11:33 am
Location: Cardiff

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by DescendingSadly »

On a tangent, is it possible to assign power control to a joystick at all?
User avatar
VernonDozier
Established Forum Member
Posts: 483
Joined: Thu Apr 21, 2011 6:57 am
Location: Toronto, Ontario, Canada

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by VernonDozier »

DescendingSadly wrote:On a tangent, is it possible to assign power control to a joystick at all?
http://forums.uktrainsim.com/viewtopic. ... 8&t=112879 :)

Like Raildriver though, it doesn't work well with scripted locos. It worked better in RW2 though.
'Coolerdown' = The BEST job title EVER :D

Specs: Windows 7; i5 53570k 4.7Ghz, 4GB DDR3 1866, Radeon HD 5770.
pinfold31
New to the Forums
Posts: 5
Joined: Fri Oct 14, 2011 7:49 pm

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by pinfold31 »

Hi, I notice a few people are having the same problem I was having with the 166 combined power/brake handle.

Go the to the following file: RailVehicles>Diesel>Class166>Default>Simulation>Class 166 Engine Simulation.LUA, find the section that starts "-- Regulator control" (it's a simple script so anyone can do this) and paste the following over the original values:

-- Regulator control.
if (CombinedLever == 1) then
SetReg = 1
elseif (CombinedLever >= 0.90) then
SetReg = 0.857
elseif (CombinedLever >= 0.85) then
SetReg = 0.714
elseif (CombinedLever >= 0.80) then
SetReg = 0.571
elseif (CombinedLever >= 0.71) then
SetReg = 0.429
elseif (CombinedLever >= 0.65) then
SetReg = 0.286
elseif (CombinedLever >= 0.51) then
SetReg = 0.143
else
SetReg = 0
end

if (gEmergencyAWSSet == 0) then
Call( "*:SetControlValue", "Regulator", 0, SetReg )
end

end

gLastCombined = CombinedLever

---

P.S I should have added the problem I was referring to was the the power staying on with the throttle at zero on a raildriver, the above doesn't do anything to address the over sensitivity when using the keyboard, it's been a long day!

Andrew
User avatar
VernonDozier
Established Forum Member
Posts: 483
Joined: Thu Apr 21, 2011 6:57 am
Location: Toronto, Ontario, Canada

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by VernonDozier »

Thnaks but the mod isn't working for me. With the joystick/raildriver at zero, the game is showing 50% throttle.
'Coolerdown' = The BEST job title EVER :D

Specs: Windows 7; i5 53570k 4.7Ghz, 4GB DDR3 1866, Radeon HD 5770.
pinfold31
New to the Forums
Posts: 5
Joined: Fri Oct 14, 2011 7:49 pm

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by pinfold31 »

That's weird, are you using MacroWorks3 with your raildriver? If so I'm completely stumped to be honest, I've just tested it again and on my machine the combined brake/throttle is in sync with the position of the throttle/dynamic brake on my raildriver.

---

Andrew
User avatar
pjt1974
Very Active Forum Member
Posts: 3800
Joined: Tue Feb 09, 2010 8:30 pm
Location: Ballaugh Isle of Man
Contact:

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by pjt1974 »

Hi Andrew

Are those settings just for setting up the Raildriver or can they be used to de-sensitize the keyboard control aswell?

Regards

Phil
For disclosure, I am affiliated with a third party developer however, I do not know anything about any future releases unless I'm working on them and even then, I'd be breaking years worth of built up trust to say anything about it ;-)
pinfold31
New to the Forums
Posts: 5
Joined: Fri Oct 14, 2011 7:49 pm

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by pinfold31 »

Phil,

The above settings (at least on my machine!) correct the relationship between the position of the combined throttle/brake handle and the actual throttle settings, so you don't get 13%(?) throttle in the sim when your raildriver throttle is at zero.

I've been thinking about the keyboard sensitivity problem and I would try altering the "DigitalInputSensitivity" of the "ThrottleAndBrake" control in the .bin file of the unit you are driving. I'm not sure it will completely fix the problem but it's worth a try. See what happens if you change this value from 1.0000 to 0.3000, i.e:

<ControlName d:type="cDeltaString">ThrottleAndBrake</ControlName>
<DefaultValue d:type="sFloat32" d:alt_encoding="000000000000D03F" d:precision="string">0.2500</DefaultValue>
...other stuff here...
<AnalogInputSensitivity d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1.0000</AnalogInputSensitivity>
<DigitalInputSensitivity d:type="sFloat32" d:alt_encoding="000000403333D33F" d:precision="string">1.0000</DigitalInputSensitivity>

to

<ControlName d:type="cDeltaString">ThrottleAndBrake</ControlName>
<DefaultValue d:type="sFloat32" d:alt_encoding="000000000000D03F" d:precision="string">0.2500</DefaultValue>
...other stuff here...
<AnalogInputSensitivity d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1.0000</AnalogInputSensitivity>
<DigitalInputSensitivity d:type="sFloat32" d:alt_encoding="000000403333D33F" d:precision="string">0.3000</DigitalInputSensitivity>

You will need to find the appropriate .bin file, the "default" folder refers to the white/blue version, "FGW" refers to the blue/purple one, and then for example either class166_dmocl_fgw.bin or class166_dmos_fgw.bin depending which carriage you're driving from. Let me know if it helps at all.

Andrew
User avatar
VernonDozier
Established Forum Member
Posts: 483
Joined: Thu Apr 21, 2011 6:57 am
Location: Toronto, Ontario, Canada

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by VernonDozier »

pinfold31 wrote:That's weird, are you using MacroWorks3 with your raildriver? If so I'm completely stumped to be honest, I've just tested it again and on my machine the combined brake/throttle is in sync with the position of the throttle/dynamic brake on my raildriver.

---

Andrew
Nope. I am using the Joystick API (from the previous link) which works off the raildriver .dll. Basically functions the same as the raildriver but instead can be configured for a game controller.

The problem I'm having is I can't get 0% throttle and 0% brakes at the same time. The throttle stays on no matter what setting.
'Coolerdown' = The BEST job title EVER :D

Specs: Windows 7; i5 53570k 4.7Ghz, 4GB DDR3 1866, Radeon HD 5770.
pinfold31
New to the Forums
Posts: 5
Joined: Fri Oct 14, 2011 7:49 pm

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by pinfold31 »

VernonDozier wrote: Nope. I am using the Joystick API (from the previous link) which works off the raildriver .dll. Basically functions the same as the raildriver but instead can be configured for a game controller.

The problem I'm having is I can't get 0% throttle and 0% brakes at the same time. The throttle stays on no matter what setting.
Yeah I should have read your first post properly! I have no experience of the set up you're using but the one thing I would say is there are three different controls related to the throttle/brake on the 166. There is a "throttleandbrake" control as well as individual throttle and brake controls like there are on other loco's/units. I believe the "throttleandbrake" is intended to sit on top and be accessed by the user whereas the individual throttle and brake controls sit underneath and are not accessed directly by the user. Therefore the joystick should be moving the "throttleandbrake" control not trying to access the throttle or brake individually, there is a script to set the values of the throttle and brake based on the position of the "throttleandbrake".

If you already knew all that, then you know as much or more than I do! If not I hope it was of some help.

Andrew
User avatar
VernonDozier
Established Forum Member
Posts: 483
Joined: Thu Apr 21, 2011 6:57 am
Location: Toronto, Ontario, Canada

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by VernonDozier »

pinfold31 wrote:
VernonDozier wrote: Nope. I am using the Joystick API (from the previous link) which works off the raildriver .dll. Basically functions the same as the raildriver but instead can be configured for a game controller.

The problem I'm having is I can't get 0% throttle and 0% brakes at the same time. The throttle stays on no matter what setting.
Yeah I should have read your first post properly! I have no experience of the set up you're using but the one thing I would say is there are three different controls related to the throttle/brake on the 166. There is a "throttleandbrake" control as well as individual throttle and brake controls like there are on other loco's/units. I believe the "throttleandbrake" is intended to sit on top and be accessed by the user whereas the individual throttle and brake controls sit underneath and are not accessed directly by the user. Therefore the joystick should be moving the "throttleandbrake" control not trying to access the throttle or brake individually, there is a script to set the values of the throttle and brake based on the position of the "throttleandbrake".

If you already knew all that, then you know as much or more than I do! If not I hope it was of some help.

Andrew
No I can honestly say I had no idea about this. :lol: Thanks for the info!
Are the settings you mention in the lua file?
Is there a way to get the loco to use default controls?
It seems the whole structure of the 166 simulation folder and files is different than in RW2. For one thing the RW2 166/simulation folder is missing the Class166 Engine Simulation.xml file and the .lua file consists of the following:

Code: Select all

------------------------------------------------------------
-- Simulation file for the Class 47
------------------------------------------------------------


------------------------------------------------------------
-- Setup
------------------------------------------------------------
-- Called when the engine script is initialised
------------------------------------------------------------

function Setup ()

end

------------------------------------------------------------
-- Update
------------------------------------------------------------
-- Called every frame to update the simulation
------------------------------------------------------------
-- Parameters:
--	inteval = time since last update
------------------------------------------------------------

function Update (inteval)

end
:-?

Missing a few lines...
'Coolerdown' = The BEST job title EVER :D

Specs: Windows 7; i5 53570k 4.7Ghz, 4GB DDR3 1866, Radeon HD 5770.
pinfold31
New to the Forums
Posts: 5
Joined: Fri Oct 14, 2011 7:49 pm

Re: Erratic class 166 keyboard and/or raildriver behavior

Post by pinfold31 »

You should have a file called "Class166 Engine Simulation.Lua" in RailVehicles>Diesel>Class166>Default>Simulation, as I said this controls the throttle and train brake values based on the combined control which is basically a cosmetic control that doesn't actually move or stop the unit by itself.

The controls themselves are implemented in each of the .bin files for the various liveries and variant of unit.

The folder Assets>Kuju>RailSimulatorCore>InputMappers contains the definitions of what should happen when a particularly key is pressed, whether this has anything to do with joysticks I'm not really sure.

It is probably possible to remove the scripting and combined control and just use your joystick to directly input the values of throttle and brake, however I haven't tried this and can't offer a step by step guide unfortunately.

Andrew
Locked

Return to “[RW] General RW Discussion”