New SpaceNavigator-to-Virtual Joystick app for games

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
RussB
Posts: 5
Joined: Sat Dec 20, 2014 12:19 am

New SpaceNavigator-to-Virtual Joystick app for games

Post by RussB »

Hi all,

I hope this is acceptable to post here. It seems to follow the board guidelines as a 3DxWare-related product announcement, so i'll give it a go.

I just wanted to do a quick announcement of a new Windows application for gamers and SpaceNavigator users. Using the SDK, it allows SpaceNavigator axis inputs to be passed to a custom virtual joystick driver, which in turn is recognized as a joystick in-game. Users are running it in the new space sims Elite: Dangerous and Star Citizen now with good results. No more .xml hacks required. I created this app because I really, really wanted to use my SpaceNavigator in these games, and along with voice control, it works very well. Anyways, it's over at http://www.controlmyjoystick.com if anyone is interested.

Many thanks to our community devs who helped point me in the right direction to code this. And many thanks for the excellent SDK!

Cheers,

RussB
Tehrasha
Posts: 187
Joined: Thu Apr 22, 2010 3:55 pm
Location: Iowa
Contact:

Re: New SpaceNavigator-to-Virtual Joystick app for games

Post by Tehrasha »

I know another place which that would be happy to announce your software. :)
Spacemice -- Input devices for a 3D world.
Hypersonic
Posts: 265
Joined: Mon Jul 12, 2010 5:58 pm

Re: New SpaceNavigator-to-Virtual Joystick app for games

Post by Hypersonic »

What results do you get from the Microsoft joystick test program?
http://3dconnexion.com/forum/viewtopic. ... 415#p37859
(Use 0.35 instead of 0.25 scale in 3Dx xml)

Matching max knob movement to 1000 app output(350 raw output) by adjusting scale what step size does your virtual joystick have in this joystick testing program? With the 3DxKMJ driver at 0.35 scale (to match knob max with output max) it appears to have 8 step size (8,16,24...), so 125 steps each direction. It should be 350 steps each direction (~2.86 step size) but something is amiss.

Is your virtual joystick based on of http://vjoystick.sourceforge.net/site/ by chance?

I'm curious what step size other 10bit joysticks achieve in the joystick test program. It might be Direct Input reducing the precision and not a fault with the driver.
RussB
Posts: 5
Joined: Sat Dec 20, 2014 12:19 am

Re: New SpaceNavigator-to-Virtual Joystick app for games

Post by RussB »

@Hypersonic,

Haven't tried it with the joystick test program. It isn't based on VJoystick as I wrote a driver for it instead. The SDK seems to indicate that accuracy of the controller increases as the sensitivity in the 3DxWare applet is increased. I scale it for a 0-32767 range of motion. Very precise, and I added curves, deadzones, trim, inversion enablement and voice-activated sensitivity adjustments in ControlMyJoystick.
Hypersonic
Posts: 265
Joined: Mon Jul 12, 2010 5:58 pm

Re: New SpaceNavigator-to-Virtual Joystick app for games

Post by Hypersonic »

Well that was my main concern: Direct Input precision. That test program is a way to find that out. You can't get any more precise than 350 steps per direction as that is what the hardware spits outs. My concern is precision loss when sent to Direct Input. I'm seeing 350 steps per direction being reduced to about 125 steps per direction and I don't yet know if this is a driver or API issue. This seems to be the case for both JOYINFOEX and DIJOYSTATE2.

If an app uses RawInput then drivers aren't even used. Xinput isn't even capable of 6 axis so I don't know how can Microsoft declare Direct Input deprecated, unless they mean to deprecate 6axis devices?! I don't know why HID has 0x04 Joystick and 0x08 Multi-axis Controller. Joysticks have 2-3 axis, is 2 and 3 not enough for 'multi'? Are 6 axis too many axis for joysticks?
RussB
Posts: 5
Joined: Sat Dec 20, 2014 12:19 am

Re: New SpaceNavigator-to-Virtual Joystick app for games

Post by RussB »

@Hypersonic,

I ran a test with the SDK and the SpaceNavigator and found that with the SN applet sensitivities maxed in the main tab and the axis tweaking tab, the SDK reports approx 1400 positions in total (700 in either direction). With normal sensitivity, it was about about 250 per direction. Either way, it is plenty of accuracy as one would be hard-pressed to need this much accuracy since there is such a short throw on the physical axis. Though according to the 3DxWare driver, there is room to go higher (-2800 total), and it has reserved axis position data as a max of 16 bits per axis, although it seems to use maybe 10 bits. From USBlyzer:

Item Tag (Value) Raw Data
Usage Page (Generic Desktop) 05 01
Usage (Multi-Axis Controller) 09 08
Collection (Application) A1 01
Collection (Physical) A1 00
Report ID (1) 85 01
Logical Minimum (-350) 16 A2 FE
Logical Maximum (350) 26 5E 01
Physical Minimum (-1400) 36 88 FA
Physical Maximum (1400) 46 78 05
Unit Exponent (-4) 55 0C
Unit (SI Lin: Length (cm)) 65 11
Usage (X) 09 30
Usage (Y) 09 31
Usage (Z) 09 32
Report Size (16) 75 10
Report Count (3) 95 03
Input (Data,Var,Rel,NWrp,Lin,Pref,NNul,Bit) 81 06
End Collection C0
Collection (Physical) A1 00
Report ID (2) 85 02
Usage (Rx) 09 33
Usage (Ry) 09 34
Usage (Rz) 09 35
Report Size (16) 75 10
Report Count (3) 95 03
Input (Data,Var,Rel,NWrp,Lin,Pref,NNul,Bit) 81 06
End Collection
RussB
Posts: 5
Joined: Sat Dec 20, 2014 12:19 am

Re: New SpaceNavigator-to-Virtual Joystick app for games

Post by RussB »

>>If an app uses RawInput then drivers aren't even used. Xinput isn't even capable of 6 axis

from Microsoft's stuff on RawInput: http://msdn.microsoft.com/en-ca/library ... 85%29.aspx
An application receives raw input from any HID whose top level collection (TLC) matches a TLC from the registration.

So I think it does receive messages from HID, and it is using the driver. A lot of new games sure seem to use RawInput, because as soon as the game window loses focus, it can't receive joystick, keyboard or mouse messages. Microsoft has pretty well buried DirectInput it seems. RawInput is really nice since it's just handling windows messages.
Hypersonic
Posts: 265
Joined: Mon Jul 12, 2010 5:58 pm

Re: New SpaceNavigator-to-Virtual Joystick app for games

Post by Hypersonic »

"...the SDK reports approx 1400 positions in total (700 in either direction)."
There's a difference between number of positions and number of steps:
-In the Joystick test program it displays 2000 positions (-1000 to 1000), but the step size is 8, so there are merely 256 steps.
-An app may have 65536 positions, but with the step size of 256, there are merely 256 steps.

The number of steps can't be increased. Position is malleable with scaling. Steps represents the actual resolution/precision of a device. Also one should consider the stability of the steps. Place an object (<350 grams) on the device (steady input) and you might notice it bouncing between 2-3 steps. One's fingers is even less stable, bouncing between more than 2-3 steps while trying to keep it steady.
"Either way, it is plenty of accuracy as one would be hard-pressed to need this much accuracy since there is such a short throw on the physical axis."
700 steps seems to be sufficient for a 1.6 mm throw 3.4 Newton max force device. The longer the throw the longer it takes to move to different input values (not to mentioned increased energy usage.) I believe stiffer springs is the answer, but that's another topic.

RawInput seems to have a resolution of 700, but RawInput isn't totally 'raw', it does some processing on the data. From the HID data packets it seems that each axis is 2 bytes signed
http://3dconnexion.com/forum/viewtopic. ... =15#p33711
-I do believe pre-wireless versions are 7 byte packets. 1 byte description, 2 byte axis, 2 byte axis, 2 byte axis.
-I suppose wireless versions are 13 byte packets: 1 byte description, 2 byte axis, 2 byte axis, 2 byte axis, 2 byte axis, 2 byte axis, 2 byte axis.

So the axis data is put into a 'container' capable of holding the range of –32,768 to 32,767. But what is the actual range of signed ints (and more importantly the number of steps) that are put into the 2 byte containers sent over the USB wire? RawInput might round/scale these values according to the descriptor.
"So I think it does receive messages from HID, and it is using the driver."
Which driver? With RawInput you don't need to install any drivers, unless you're referring to a default 'pre-installed by the OS installtion' driver?
"Microsoft has pretty well buried DirectInput it seems."
But what is Microsoft promoting, Xinput? How do you fit 6 axis into this structure? http://msdn.microsoft.com/en-us/library ... 85%29.aspx

RawInput is nice, but some developers seem to have trouble with it, like Unity3D. Also you're at the mercy of what the developer lets you configure since the input can't be configured via a driver. Direct Input is still used by many apps. however, and Direct Input somehow reduces the number of steps from 700 to 256. I'd like to test some USB 10bit and 12bit joysticks to see if they have the same problem.
mynamehere
Posts: 3
Joined: Thu Apr 09, 2015 6:58 pm

Re: New SpaceNavigator-to-Virtual Joystick app for games

Post by mynamehere »

RussB wrote:Hi all,

I hope this is acceptable to post here. It seems to follow the board guidelines as a 3DxWare-related product announcement, so i'll give it a go.

I just wanted to do a quick announcement of a new Windows application for gamers and SpaceNavigator users. Using the SDK, it allows SpaceNavigator axis inputs to be passed to a custom virtual joystick driver, which in turn is recognized as a joystick in-game. Users are running it in the new space sims Elite: Dangerous and Star Citizen now with good results. No more .xml hacks required. I created this app because I really, really wanted to use my SpaceNavigator in these games, and along with voice control, it works very well. Anyways, it's over at http://www.controlmyjoystick.com if anyone is interested.

Many thanks to our community devs who helped point me in the right direction to code this. And many thanks for the excellent SDK!

Cheers,

RussB
Will this work with my SpaceMouse Pro?
Also, can this be used to make it work as the (global?) mouse windows as well as in games, etc..?
Reason I ask is I'd like to use it to replace my MS Trackball Explorer that I use for everything. I have hand issues, so mice are a pain, and "thumb" balls are a problem for me as well.

Thanks
rEvolvingDesigns
Posts: 11
Joined: Tue Mar 13, 2007 9:21 am
Location: Chicago

Re: New SpaceNavigator-to-Virtual Joystick app for games

Post by rEvolvingDesigns »

Im curious about this as well.
Post Reply