1C Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official 1C Company forum > 1C Publishing > IL-2 Sturmovik: Cliffs of Dover > Technical threads > Controls threads

Controls threads Everything about controls in CoD

Reply
 
Thread Tools Display Modes
  #1  
Old 10-16-2011, 12:24 AM
EvilJoven
Guest
 
Posts: n/a
Default How IL2 and CLOD assign Joystick IDs. It's lazy and needs to be changed.

I finally discovered how IL2 and a few other games assign joystick IDs. Now that this is known, is it fixable?

Currently, IL2 assigns IDs to joysticks alphabetically via the Vendor/Device ID. In my case, the list is as follows:

VID_044F&PID_0402 - Thrustmaster Warthog Stick
VID_044F&PID_0404 - Thrustmaster Warthog Throttle
VID_046D&PID_C215 - Logitech Extreme 3D Pro
VID_046D&PID_C216 - Logitech Dual Action Gamepad
VID_068E&PID_C0F2 - CH Pro Pedals USB
VID_068E&PID_00FA - CH THROTTLE QUADRANT

Because of this you have to remap all of your controls whenever something is removed, or if you replace a device and it doesn't happen to fall alphabetically in to the same assignment.

The proper method is to assign joysticks ID's based on the ID assigned in the following registry key: Joystick ID binary value key for the associated controller, located here:

HKEY_CURRENT_USER\System\CurrentControlSet\Control \MediaProperties\PrivateProperties\DirectInput\<VE NDOR AND DEVICE ID>\Calibration\0

Devices are assigned IDs here as they're installed. It adds to better usability as devices retain their IDs, even as they're unplugged and plugged back in. The order of devices can even be changed by editing the values in this key or by using utilities that do it for you.

The development team needs to start using this registry key to assign joystick IDs in game instead of doing it alphabetically by device. That way people like me who use a lot of different hardware won't have to remap our controls simply because we don't want to have everything plugged in permanently.

Last edited by EvilJoven; 10-20-2011 at 03:32 PM.
Reply With Quote
  #2  
Old 10-16-2011, 06:33 AM
AndyJWest AndyJWest is offline
Approved Member
 
Join Date: Jan 2010
Posts: 1,048
Default

I suggest you contact Microsoft, and complain to them. The windows joystick interface is a god-awful mess, and expecting applications programmers to sort it out is ridiculous.
__________________
MoBo: Asus Sabertooth X58. CPU: Intel i7 950 Quad Core 3.06Ghz overclocked to 3.80Ghz. RAM: 12 GB Corsair DDR3 (1600).
GPU: XFX 6970 2GB. PSU: 1000W Corsair. SSD: 128 GB. HDD:1 TB SATA 2.
OS: Win 7 Home Premium 64bit. Case: Antec Three Hundred. Monitor: 24" Samsung.
Head tracking: TrackIR 5. Sore neck: See previous.
Reply With Quote
  #3  
Old 10-16-2011, 06:55 AM
EvilJoven
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by AndyJWest View Post
I suggest you contact Microsoft, and complain to them. The windows joystick interface is a god-awful mess, and expecting applications programmers to sort it out is ridiculous.
I figured out what registry keys to read in order to have better joystick ID assignments in game in just a few hours.

If I can do it, why couldn't any half decent game developer?

EDIT: Here's what I posted on the 777 Forums. It seems that they use the same method of assigning joystick IDs for Rise of Flight.

Rise of flight isn't assigning joystick ID's properly.

Currently, the game does something like this:

When the game is launched, it scans the list of game controllers, probably from here: HKEY_CURRENT_USER\System\CurrentControlSet\Control \MediaProperties\PrivateProperties\Joystick\OEM

And then the game goes down the list and assigns joystick IDs 1 to whatever to each device, if it's currently plugged in.

So, here's the list of ALL the controllers I use on my PC:

VID_044F&PID_0402 - Thrustmaster Warthog Stick
VID_044F&PID_0404 - Thrustmaster Warthog Throttle
VID_044F&PID_FFFF - Thrustmaster Virtual Game Controller (root) - THIS ONLY SHOWS UP IF THE TARGET PROFILER IS ACTIVE AND REPLACES THE ABOVE 2 STICKS
VID_046D&PID_C215 - Logitech Extreme 3D Pro
VID_046D&PID_C216 - Logitech Dual Action Gamepad
VID_068E&PID_C0F2 - CH Pro Pedals USB
VID_068E&PID_00FA - CH Throttle Quadrant USB


Normally I use this stuff without the Thrustmaster TARGET profiler running and with the Logitech stuff unplugged as I only use these for console ports and games with simplified flight models like the Battlefield games and ARMA, so most of the time when I launch Rise of flight, it sees these controllers.

VID_044F&PID_0402 - Thrustmaster Warthog Stick
VID_044F&PID_0404 - Thrustmaster Warthog Throttle
VID_068E&PID_C0F2 - CH Pro Pedals USB
VID_068E&PID_00FA - CH Throttle Quadrant USB

And these controllers are assigned 1-4 in game.

Here's where the problem comes in. Let's say, for instance, I try to use TARGET. If I do, all of a sudden my list looks like this:

VID_044F&PID_FFFF - Thrustmaster Virtual Game Controller (root)
VID_068E&PID_C0F2 - CH Pro Pedals USB
VID_068E&PID_00FA - CH Throttle Quadrant USB

So now the Pedals aren't ID3 and the Quadrant isn't ID4, they've both been moved up a spot because the Warthog sticks were replaced by the virtual game controller.

Now I have to remap EVERYTHING that I had mapped to the pedals as well as the quadrant.

And if I didn't run target but forget to unplug my gamepad...

VID_044F&PID_0402 - Thrustmaster Warthog Stick
VID_044F&PID_0404 - Thrustmaster Warthog Throttle
VID_046D&PID_C216 - Logitech Dual Action Gamepad
VID_068E&PID_C0F2 - CH Pro Pedals USB
VID_068E&PID_00FA - CH Throttle Quadrant USB

If I had this, the gamepad axis would be controlling my rudder inputs and my pedals would have throttle inputs mapped to it.

So basically, by assigning joystick IDs this way, it means that once I create a key mapping I need to have only those controllers plugged in. Any variation will cause problems unless I luck out and the controllers I do want to use happen to fall in the same spot, alphabetically.


THIS IS HOW YOU FIX THIS

The proper way a game should be assigning joystick IDs is to query the Joystick ID binary value key for each controller, located here: HKEY_CURRENT_USER\System\CurrentControlSet\Control \MediaProperties\PrivateProperties\DirectInput\<VE NDOR AND DEVICE ID>\Calibration\0

(I thought it was the list in HKEY_CURRENT_USER\System\CurrentControlSet\Control \MediaResources\Joystick\DINPUT.DLL\CurrentJoystic kSettings but I appear to be wrong)

When a controller is plugged in to the PC for the first time it's assigned an ID which generally don't change, even if the device is unplugged and plugged back in, unless a piece of software does it deliberately.

Here's an example. This is how my joysticks are currently set up when everything is plugged in (this software, which allows me to change the joystick IDs around, can be found at http://www.wingmanteam.com/latest_software/gadgets.htm ):



Now, here's what happens when I unplug the Logitech Extreme 3D Pro and run the profiler, which essentially detaches both the Warthog stick and throttle and attaches a virtual joystick which the software assigns as ID 1



Notice how this doesn't cause any problems with the rudders, throttle quadrant and gamepad. They have retained their ID.

So, with this change, people won't have nearly as much trouble with their joysticks.

I've already posted this on the 1C forums as both IL-2 games seem to also use this improper method of assigning joystick IDs.

Fortunately, the DCS games, MS FSX, the FSX FSUIPC addon and a lot of other games are using the proper method.

Last edited by EvilJoven; 10-20-2011 at 03:37 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:29 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2007 1C Company. All rights reserved.