Author Topic: Is CurrentJoystickID actually useful?  (Read 716 times)

0 Members and 1 Guest are viewing this topic.

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Is CurrentJoystickID actually useful?
FSO's current selection of the joystick for use is done within fs2_open.ini or within the registry.  It has two values:

CurrentJoystickID
CurrentJoystickGUID

The ID is simply the index of the joystick within the vector the operating system uses to store all joysticks, and possible also peripherals.  The ID is basically a random first-come-first-served value that can change whenever the operating system feels like it.

The GUID is at least semi-persistant in that OS restarts and moving the device to another USB port doesn't affect it, but there is still the question of it changing during an update (something I'm looking into).

This discussion however focuses on the usefulness of the ID.  Since the ID's are volitile, is it even worth storing them in the .ini to begin with?  Would it be better to have the ID reference instances of itself (use the n'th Logitech Gamepad) instead of the current implementation (use the n'th controller)?

The latter I think has more merit for use since the indexing will be dependant on only the controllers that have the same GUID.  But it is still vulnerable to the fact that the order of the controllers in the OS vector can move around, thus making the ID moot anyway.  Therefore, I only see the ID as useful for selection when the client selects their joystick each time before launching.
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.