Page 1 of 2

Erratic class 166 keyboard and/or raildriver behavior

Posted: Fri Oct 14, 2011 10:55 am
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.

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Fri Oct 14, 2011 11:04 am
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.

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Fri Oct 14, 2011 12:19 pm
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).

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Fri Oct 14, 2011 3:48 pm
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.

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Fri Oct 14, 2011 3:55 pm
by DescendingSadly
On a tangent, is it possible to assign power control to a joystick at all?

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Fri Oct 14, 2011 4:08 pm
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.

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Fri Oct 14, 2011 8:05 pm
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

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Fri Oct 14, 2011 10:37 pm
by VernonDozier
Thnaks but the mod isn't working for me. With the joystick/raildriver at zero, the game is showing 50% throttle.

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Sat Oct 15, 2011 7:14 am
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

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Sat Oct 15, 2011 10:49 am
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

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Sat Oct 15, 2011 11:51 am
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

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Sat Oct 15, 2011 12:13 pm
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.

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Sat Oct 15, 2011 12:42 pm
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

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Sat Oct 15, 2011 1:14 pm
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...

Re: Erratic class 166 keyboard and/or raildriver behavior

Posted: Sat Oct 15, 2011 1:59 pm
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