mdjarv / JoystickVisualizer

Joystick Visualizer software, currently made for the Thrustmaster Warthog
81 stars 28 forks source link

Adapting for Gunfighter #10

Closed grabvba closed 6 years ago

grabvba commented 7 years ago

Just wondering what it would take to update this great project for use with the VKB gunfighter? If I understand this correctly you're basically just pulling hardware ID for the warthog and creating calls for all the buttons and axes. To my limited understanding this should be fairly trivial to adapt the code for use with other sticks.

byjokese commented 7 years ago

I will love to have it also for the X55, but we have to fin the 3D models and code adapt it.

mdjarv commented 6 years ago

@grabvba sorry for the late reply, you are correct in that it would be fairly trivial to adapt to more controllers. The hard part is to find a good suitable 3D model where you can move individual parts (like buttons and switches)

I have tried to learn some Blender in my limited free time, but I'm not nearly at the level to design a controller

grabvba commented 6 years ago

Why cant we continue to use the Warthog 3d? For me it's more about showing the motions I am making with my stick than the model. Any chance you could open it up to read any connected game controllers, or some other means to work with sticks other than the hog? I currently use the hog throttle, gunfighter base with the hog stick, would be awesome to still be able to use the visualizer.

mdjarv commented 6 years ago

Interesting idea, I'll need to think a bit about how I can implement a way to make it translate from one stick to another.

Perhaps if I don't use the USB ID as a lookup key in the visualizer, but instead the second position of the CSV message (name) transmitted from the proxy. That way it would be possible to just change the settings.ini file for the proxy to your current sticks USB ID but set the name to the WH stick identifier.

It might get messy with inverted axis and things like that on other sticks, and making it fully configurable and dynamic (like mapping axis in DCS itself) is not a simple task to solve.

grabvba commented 6 years ago

I think making something fully configurable would be a great long term goal, but perhaps short term just make compatibility updates the the existing platform per stick? If you're using USB ID is it not basically an ID swap to read new hardware?

mdjarv commented 6 years ago

You could swap the ID in the settings file for the proxy to make it pick up the new stick and start transmitting the data, however the visualizer will also need to be changed to listen to the new ID and know what stick model it should bring up (i.e. change the code and recompile the visualizer).

I have very limited free time to work on this project so unless someone is willing to help out, smaller incremental changes are preferable so I don't see the fully configurable thing being done anytime soon.

grabvba commented 6 years ago

Well, sadly I have no programming experience, so I can't help in that way. I can 3D model, so I may be able to help out in that regard. With some guidance, if I provided the hardware info for the gunfighter would you be willing to update the software for me?

mdjarv commented 6 years ago

If you want to try using the warthog model for the gunfighter stick I can make a build for just that, since I don't have a gunfighter model anyway.

First step is to help me figure out the USB VID and PID of the gunfighter, what version of Windows are you running?

grabvba commented 6 years ago

Yeah, lets give it a shot with the gunfighter and WH 3D. Thanks!

I am on Win 10 Pro.

mdjarv commented 6 years ago

alright, this is a bit annoying but this is how you can find the USB ID of your stick:

  1. Open up the start menu, type Control Panel and start it
  2. Under Hardware and Sound click on View devices and printers
  3. Find your stick in the list, right click it and select Properties
  4. Under the Hardware tab see if you have one or multiple devices in the list
  5. Select the one that seems most relevant to the stick and click on Properties
  6. Select the Details tab and under the Property drop down select Hardware Ids and screenshot that for me (example image is from my mouse as I don't have my stick connected at the moment) image
grabvba commented 6 years ago

Alright, lets give this a try;

https://i.imgur.com/tWsMrVj.png

mdjarv commented 6 years ago

Alright, now to verify that we have the right one, open up the settings.ini file for the joystick visualizer and add the following row at the bottom:

231d:011f = VKB Gunfighter

Then start the proxy and see if it says VKB Gunfighter connected and then starts printing out messages when you move the stick or push buttons on it.

If you see it react to stick movement then I have what I need to make a new Visualizer version that handles this stick as well

grabvba commented 6 years ago

Plugged in the ID to the ini file and data is flowing in the proxy when I move the stick.

mdjarv commented 6 years ago

Just uploaded a new version before going to bed, let me know if you get it to work in 0.9.2

https://github.com/mdjarv/JoystickVisualizer/releases/tag/v0.9.2

grabvba commented 6 years ago

Yup, works great! Thanks so much for working on this and getting something going so fast!

As you noted, the button mapping isn't correct, but to be honest I care more about showing the axis movement than the buttons.

mdjarv commented 6 years ago

Since you're using the WH stick we could map up the buttons as well, or take the easy route and just disable the buttons (considering it's not the "correct" stick for that USB device anyway). Mapping up the buttons would be quick and easy for me but more tedious work for you so it depends on how much effort you want to put into it :)

The way I go about mapping buttons is to watch the Proxy window while I push and release the button I want to map, and try to figure out the name of the button from the output in the window.

Buttons are usually (though not always) something like Buttons0 and things like the trim hat could be PointOfViewControllers0.

Since I already have the Warthog Stick rigged up to be able to move buttons and hats as they should I just need to know what the USB device calls each button, for example stage 1 and 2 of the trigger is Buttons0 and Buttons5 on the original Warthog device.

mdjarv commented 6 years ago

Buttons are usually easy enough, like Buttons0=1 is button press and Buttons0=0 is button release... however you may run into some more involved things like the 8-way trim hat PointOfViewControllers0 which is -1 for released, 0 for up, 4500 for up/right, 9000 for right, 13500 for down/right and so on

mdjarv commented 6 years ago

GitHub issues are good and all, but I created a #dev channel on Discord in case you want to do this over chat instead to speed up the communication :)

https://discord.gg/4nc3XtQ