APWVO_funkrami Posted January 22, 2022 Posted January 22, 2022 (edited) WARNING: before adding controller devices without fully committing to rebinding everything, backup your IL-2/data/input folder. To revert, launch IL-2 with the backup settings and only the devices you had connected before. Intro You want some extra axes or buttons but got less than fifty bucks to spare? I got you covered. Acquire a USB MIDI controller with a layout you'd think you could use. I already had a pad controller (M-Audio Trigger Finger, displayed here in professional use (right)) lying around when I started playing and ended up using the four sliders on it for cooling axes and the lowest row of buttons for 110/spit cooling. While I had got fed up with the engine selection buttons, I eventually happened to run across a used entry level DJ controller for sale and instantly saw a two engine all-in-one gaming controller in my mind. However I enjoy my Warthog Cougar throttle for single engine use, which is where part 2 & 3 come into play. Part 1: midi2vjoy There are many forks of this project on github, some of which might fill your devices specific needs. The main project gets you going. I made a fork to cover encoders that only send note-on messages. It is jank tho, I am not a programmer by any means. You may need to install Python. The readme of the original project covers installing and configuring vJoy shortly and configuring itself pretty well. You'll want to make use of the "Monitor vJoy" tool that comes with the package while configuring. Always ctrl+c out of midi2vjoy, clicking on the X to close the terminal window might lock the device. For quick launching the app you'll want to make a batch file (rename an empty text file to filename.bat, rightclick/edit to open in notepad) in the same folder and make a windows shortcut of it which you can move to the desired location. The batch file only needs to contain the launch command: .\midi2vjoy.py -m 3 -c .\imix.conf As you set up the vJoy devices, be advised IL-2 seems not to work well for buttons beyond 61 (can bind in game, but does not function). IL-2 can also only utilise eight devices at once. If anyone knows how to hide vJoy devices from IL-2 process let me know. You also need to take note that Joystick Gremlin identifies the vJoy devices by axes&button&pov count, so if you're to use Joystick Gremlin you can't have two vJoy devices with exactly 8 axes, 16 buttons & no pov hat for example. When you have the correct midi input mapped to vJoy device and the app running, you should be able to use it like any game controller. Part 2: Joystick Gremlin If you want to switch between different control schemes without restarting IL-2 with different input config, Joystick Gremlin (JG) is your go-to app. It can also do calibration, deadzones, axis inversion, merged axes for if you want to for example use your racing pedals for rudder input, mapping button presses to happen at certain axis positions etc. The UI might feel alien at first glance. Check out the bottom of the overview page to comprehend the structure. As I wanted to use my HOTAS for fighters I needed to switch between single engine and dual engine config. You can practically only bind one device axis to an input ingame since if you got any stutter on one axis, the value will change to where that stuttering axis is currently set, overriding the input from the other axis. Because it is possible I also configured the single engine mode to operate two or three engines in unison as well to make my life easier when I so prefer. Above is a flowchart of how stuff works. Of course, JG reading the inputs doesn't disable their use in IL-2, so you can also bind anything before JG to IL-2 as well. More on that in part 3. To set up every axis and button of the DJ controller I needed two vJoy devices. If I were to switch between inputs, I needed two more vJoy devices. There are eight axes in each so I have 16. For two engine operation I needed one axis for my merged racing pedal rudder and two of each: throttle, rpm, mixture, water rads, oil rads / inlet cowl shutters (these can be bound on the same axis as no plane uses both at the same time) and outlet cowl shutters. I had three axes left, so for the third engine I'd have throttle, mixture and a compromise in the form of an axis I would bind both oil rad & inlet cowl shutter to. I could have gone for a third final output vJoy device, but I wanted to leave options for the future. The mode logic I created for Joystick Gremlin is as follows. I have the unison mode as the default. Bi-engine mode has unison as parent to inherit those mappings from unison mode I do not wish to change. Then I have three modes where I can separate each of the tante engines on one side as needed left+right: 12+3, 1+23, 13+2, all of which have bi-engine mode as parent. I use one button to switch between uni & bi modes and another to switch between the trio setup. At the same button press I use to change mode I play a TTS sound to indicate which mode I am moving to, using JG's Play Sound action. These are my personal notes for creating the mappings. May contain bugs and may not be too helpful per se: Notes about using Joystick Gremlin: - To use a vJoy device as input for JG, you need to check a box in the settings tab. - You can not simultaneously output to the same vJoy device that midi2vjoy is using even if you are not reading it as input. - When you change mode and want some input to NOT inherit it's previous action while you are not going to bind it to anything else, use the NoOp action. - Most changes require reactivating the profile (gamepad icon) - There are known and unknown bugs https://github.com/WhiteMagic/JoystickGremlin/issues, mostly with the UI. It is a one person project and undergoing a (partial) rewrite, so a lot of stuff will not be fixed until the rewritten section is ready. Make regular backups of your JG profile if you're looking to do something as time consuming to configure as mine. Part 3: Binding remapped buttons and axes in IL-2 Now that you have a fine mode switching configuration you will run into a problem: IL-2 just finds the first input it sees. This is usually the unprocessed original axis or button, although in ten tries you might accidentally get the right one. The keybinds need to be written manually in both setting files in IL-2 directory: data/input/current.map and data/input/current.actions. You can view your device IDs in data/input/devices.txt. The file is autogenerated and changing its contents doesn't seem to do anything. In this file for example 3,%2268f43a30-850c-11eb-0000545345440280%22,Joystick%20-%20HOTAS%20Warthog| makes my joystick's x-axis in the config file correspond to joy3_axis_x. You can view the vJoy GUIDs in Joystick Gremlin's Tools/Device Information. Both files need to contain the same bind(s). I am not sure if they need to be in the same order. IL-2 uses button numbering starting from 0, while vJoy and JG both start the numbering from 1. Axes' correlation in IL-2 config files vJoy JG IL-2 X X x Y Y y Z Z z Rx X rotation w Ry Y rotation s Rz Z rotation t sl0 Slider p sl1 Dial q Tips: - It helps if you map (in Joystick Gremlin) the axes and buttons in the final output at the same position where you can (for example vjoy1 button 10 to vjoy3 button 10), so you can bind them ingame and then edit only the device number in the config files. - If you know you're going to bind an action, bind it to anything ingame. This way you have an entry of it in both config files and only need to change the bind - You could also do the above for all actions you know you're going to bind and bind them all to the same button/axis so you can just ctrl+f in the config files to make sure you bind everything you need Like and subscribe? Thanks to BrahGuevara for suggesting to write this guide. Edited February 6, 2022 by APWVO_funkrami fixed errors 2
Noisemaker Posted January 28, 2022 Posted January 28, 2022 Wow, thanks for this! As I play IL-2 in my studio when it's not busy (Which thanks to the pandemic is more often than I'd like), and my desk is already covered in MIDI controllers, this opens up a lot of new options.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now