Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   Daidalos Team discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=202)
-   -   Technical Question - GameController IDs (http://forum.fulqrumpublishing.com/showthread.php?t=40307)

Artist 07-04-2013 12:17 PM

Technical Question - GameController IDs
 
Dear Members of Team Daidalos,

as you have access to the sourcecode of IL-2: How does IL-2 determine the 4 supported game controllers and how are ID1 through 4 assigned? And how does IL-2 remember these assignments between sessions - or does it?

Background to my question: I have 6 game controllers and, as we all know, IL-2 supports only 4. I am looking for a way to move my game controller No 5 into the first four IL-2 recognizes (I feed the two exceeding ones via YaDeLi into IL-2, but e.g. the new Mixture-axis is not supported in DeviceLink).

Supporting ForceFeedback, afaik IL-2 must use DirectInput (the old multimedia joystick API with JOYINFOEX structure, joyGetPosEx, etc. didn't). That's why such tools as PJP's JoyIDs do not help (which work on that deprecated API). Using DirectInput, the devices are usually identified by GUIDs, which I cannot find anywhere inside IL-2 configurations.

I tried everything[1] short of reinstalling Windows and reconnecting the controllers in a different order. Without some insight I'm now stuck.

Artist

[1] "Everything" includes, amongst others, such tools as USBDeview from http://www.nirsoft.net

Bearcat 07-04-2013 01:01 PM

I think you can use a program like joy to key to combine some of those controllers into on virtual unit and assign that to IL2. Sokol would be better equipped to explain that to you.

Artist 07-04-2013 02:11 PM

Hi Bearcat,

thanks, but I know about all these workarounds/possibilities/tools. Hell and damnation, I've even developed one of my own (YaDeLi). Those are neither the problem nor the solution. I need to understand what is going on inside IL-2, hence the "Dear Members of Team Daidalos"

Artist

FC99 07-04-2013 05:06 PM

Quote:

Originally Posted by Artist (Post 506221)
as you have access to the sourcecode of IL-2: How does IL-2 determine the 4 supported game controllers and how are ID1 through 4 assigned? And how does IL-2 remember these assignments between sessions - or does it?
]

AFAIK game takes first 4 enumerated game controllers. Code is standard. I guess that you can only change the order through Windows. I don't have additional sticks attached at the moment but I believe that it was possible to change their order in Windows/Game Controllers settings.

Artist 07-04-2013 07:47 PM

Thank you, FC99! That's what I needed to know - now I can write me a tool and experiment.
Artist

BrassEm 07-05-2013 02:18 AM

Quote:

Originally Posted by FC99 (Post 506237)
AFAIK game takes first 4 enumerated game controllers. Code is standard. I guess that you can only change the order through Windows. I don't have additional sticks attached at the moment but I believe that it was possible to change their order in Windows/Game Controllers settings.

As per my other post regarding the Saitek Pro Rudders. I was able to fill the first 4 devices in order of installation after clearing out all the USB device drivers. However I went to install a 5th controller and it promptly put itself first in the list of controllers, shuffling the devices allocated to the ID's seen by 1946 upwards. I have tried every trick in the book to re-order how the USB devices are listed. Even shuffling the connections on the Motherboard around to change the Port/Hub listings. I have to leave this controller disconnected as it always hogs the first listing. If someone could post a way to control the order of devices would be appreciated, or increase the number of devices over 4. (If you need a beta tester, Artist, let us know.)

Pfeil 07-05-2013 04:05 PM

Windows includes a setting for legacy applications that only support one controller.
in the list of game controllers, click the advanced button, you'll get a drop down menu to select the controller that is always assigned the first ID.

Note: Only devices that are plugged in show up in the list, even if a device that isn't plugged in is set as preferred.

BrassEm 07-07-2013 12:48 AM

Thanks, but have tried that already. The VRinsight yoke and Razer Nostromo alway hog first listings, shuffling everything up the order. Only by removing the drivers (And my settings for these devices) can I get the order as needed for 1946.

There needs to be some programming with the interface to get this problem sorted. Which is what I am hoping Artist is going to be doing. Or TD will address.

Came across this on another forum. For reference...

Quote:

Maybe I can shed some light on what's going on. First a little history.
The first implementation that was used to get joystick data was called
WinMM. It is very old, Windows 95 and previous. With the coming of DirectX
there was a new way of getting device data, DirectInput. DirectInput
supported the WinMM functions so that older games would still work. In WinMM
you could only have up to 16 devices at a time. Each device would get an ID
number and games would access controller data by this ID number. DirectInput
does not use these ID's unless the game is using the old WinMM interfaces.
It assigns each device it finds a unique GUID and applications get device
data by accessing this GUID. DirectInput will theoretically handle as many
devices as the system can physically handle. I have had 48 devices connected
to a system at once.
In Windows XP the decision was made to only expose to the user what
device was at ID1. This was due to the fact that ID configuration was one of
the biggest areas of confusion by users and most game developers had stopped
using WinMM. Game makers that used WinMM would just take whatever device was
at ID1 and almost always only supported one device. This is why we changed
the Game Controllers control to only expose the Preferred Device, the device
to be set at ID1. From what you wrote it seems you are under the impression
that the order the devices are listed on the main page of the control applet
is the ID order. This isn't the case. When DirectInput runs it calls a
function that finds all the devices attached to the system. Each discovered
device gets a GUID that it can use later to access the device. The devices
are listed in the control applet in the order the system happened to
discover them and has nothing to do with the devices WinMM ID#. When the
developers write the game it is entirely up to them when they stop asking
DirectInput for devices, or devices on ID#'s. Most stop after finding the
first device. Some will give you the option of choosing a single device in
the games options, and a few will allow you to use all the devices attached
to the system.
Now the games. Based on what you describe, and having not debugged the
games, this is what is most likely going on. The game NASCAR 2003 is quite
recent as the name implies. Chances are they are using the DirectInput
device interfaces. They are also making all controllers available to the
game and not quitting after finding the first one. Your other game, Sports
Car GT was released in April 1999. My guess is that they are also using the
DirectInput interfaces. This would explain why it doesn't matter what ID you
set the devices to you always get the shifter, you could only make the game
see the change if it was using WinMM, but unlike the NASCAR 2003 game they
are just enumerating and using the first device that DirectInput returns and
stopping. The only way this can be fixed is to see if you can get the system
to expose the device you want first, but even if you did that chances are
real good that you wouldn't have access to the shifter.

I know this doesn't fix you, but should at least explain what is happening.
Let me know if you have any questions abou this.

Joshua Smith
DirectInput and OpenGL Test Labs
Microsoft
-----

Artist 07-08-2013 08:19 AM

Hi BrassEm,

thanks for that source. It nicely sums up the problem, tallies with my knowledge as described in the opening post, and (with what FC99 wrote) throws a light on what Oleg's team did not consider, when they implemented DirectInput: The code just takes the first four controllers and does not save/remember their GUID. So any additionally connected controller which messes up that window's internal sequence will in consequence mess up the assignments within IL-2.

There are two solutions: Change IL-2's behaviour from using controller one through four identified by their places in the sequence returned by DirectInput->EnumDevices() to identification by GUID. But, and this is a substantial "but", this means quite a lot internal reorganization. And I doubt that there are that many IL-2 pilots out there which do have a problem with a fifth, sixth, or nth controller which cannot be solved with YaDeLi and Autohotkey (except for the new mixture axis, see my signature, TD, will you please?) to merit that effort.

The other solution you already expressed hopes in and I in fact had in mind is: Programatically influence the sequence in which DirectInput->EnumDevices() returns the devices, therefore controlling which devices IL-2 'discovers' and in which order. I'll investigate the possibilities, but it will take some time, spare time that is.

Artist

BrassEm 07-10-2013 02:43 AM

Quote:

Originally Posted by Artist (Post 506448)
I'll investigate the possibilities, but it will take some time, spare time that is.

I only mentioned it if you were heading down that pathway. I can only imagine the time needed with spare time being a rare luxury.


All times are GMT. The time now is 06:54 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.