ED:Runner. A help program for VR headsets with joysticks/HOTAS.

Greetings,

I know there is another AHK script out there that does some of what this program does, but this is a compiled autoit script, so no need to download AutoHotKey or similar to run it.

So, why? The biggest problem I have in Elite using my Oculus Rift is when something else steals focus from the game window. I then have to quickly lift the headset and focus back on the game window. I hated that.

Another thing that bothered me was, when the rift was on, I could not hear any other sounds from other sources. While I have the elite sounds in the rift, all other sounds went to my normal headphones/speakers instead. For example, I run the E:D Market Connector and I could not hear the sound it made when sending the market results.
This can be fixed by changing the default playback device to "HeadPhones", but then I could not hear youtube or other sounds with my normal headphones and had to change the default playback device back to "Speakers".

The third thing that annoyed me was that I forgot to launch E:D Market Connector when starting elite.

Fourth, apparently you can get rid of a lot of microstudder if you set the EliteDangerous64.exe to High priority and Watchdog64.exe to Low priority.

So I made this program to take care of all 4 things.

1: When the Elite game window is not active, but exists, it will monitor the joystick for movement and/or button presses. If it detects that, it will switch focus back to the Elite window automatically.
2: When Elite is the active window, the Default Playback Device is automatically set to "HeadPhones". When elite is NOT active, it will switch it to "Speakers" (So I can remove the rift, put on my headphones and watch youtube or whatever, while elite is minimized).
3: You can specify programs to launch when starting ED:Runner. You can even launch elite from it if you want, so when you start it, it starts E:D Market Connector and any other programs you want.
4: Specify processes and what priority they should have. By default, EliteDangerous64.exe is set to HIGH and Watchdog64.exe is set to LOW, but you can specify any process to any priority and it will make sure its set that way.

Since you have to specify which joystick to monitor and you may not know that before hand, I've added 5 small test programs, labeled 0 to 4. Run each one until you see which one shows and reacts to your joysticks movements.

There is also a Debug folder in the package containing the same program, but it will open a CMD prompt to show you when it does stuff and why. If you find that the Elite window is activated even though you did not move the joystick on purpose, run the debug version and it will show you which axis caused it.

Download it: http://grandis.nu/downloads/ED_Runner_1.3.zip

Most of the settings can be edited in the INI file it creates on the first run. It will also include instructions for the settings, so I'll just paste a default INI file here:
Observe that you can disable any setting you like by putting a # infront of the it. IE, if you do not want it to switch audio devices, just set:
#VRAudioDevice=HeadPhones
#NormalAudioDevice=Speakers

If you dont want it to announce the "Game refocused" voice:
#Game refocused=Refocused

You may also specify the option as NA to disable it. IE:
VRAudioDevice=NA
NormalAudioDevice=NA


[General]
JoystickID=1
JoyMonitor=1,2,3,6,7
JoyTolerance=200
VRAudioDevice=HeadPhones
NormalAudioDevice=Speakers
EliteWindowTitle=Elite - Dangerous (CLIENT)

[LaunchPrograms]
E:D Market Connector=C:\Program Files (x86)\EDMarketConnector\EDMarketConnector.exe
EliteDangerousCrosshair v1.2.2=C:\Program Files (x86)\EliteDangerousCrosshair\EliteDangerousCrosshair2.exe

[Voice]
Enable Speech=True
Voice Rate=0
ED Start=E D runner starting
VR Audio Active=<VRAudioDevice> audio active
Normal Audio Active=<NormalAudioDevice> audio active
Activating Game=Joystick <JoyID> axis <JoyAxisMoved> moved. Focusing Elite window
Lost focus=Lost Elite focus. Monitoring joystick <JoyID>
Game found=Game found. Activating
Game refocused=Refocused
Game not found=Game not found. Idling

[Priority]
EliteDangerous64.exe=HIGH
WatchDog64.exe=LOW


[Notes below here]
JoystickID:
Run the different Joystick_Test programs until you find one that reacts to your joystick movement.
Set the number of the working joystick as JoystickID above.

JoyMonitor:
When you find the program/number showing your joystick values, take note of which numbers change without
you moving anything at all. Some will most likely. The "JoyMonitor" setting defines which ones you WANT
to monitor, comma separated. So, if you see that number 4 and 5 are changing numbers even when you do not
move the joystick, do not include those numbers here. Valid numbers are 1-7.
If they only change a little bit, you can still use them with the JoyTolerance setting below, but its safer not to enable them...
If you do NOT want to monitor the joystick at all, set "JoyMonitor" and/or "JoystickID" to "NA" or remove the line.

JoyTolerance:
The numbers you see when running the joytest program range from 0 to 65535. Sometimes, just typing on your keyboard will
cause the joystick X or Y to move a few points. This sets a tolerance to that, so setting this at 100 will not activate
the Elite window if the movement is less that 100 points.
If you set this to high, you need to make hard and quick movements to actually trigger the Elite window activation...
This does NOT apply on JoyMonitor 7, if you have that enabled in JoyMonitor above, as that is the buttons and the fire
button goes from 0 to 1 when pressed, so you'll always get best result when pressing a joystick button.

VRAudioDevice and NormalAudioDevice:
If you do NOT want to switch the default Playback Device between the VR headset and normal speakers/headset, then
set VRAudioDevice and NormalAudioDevice to "NA" (without the quotes), or remove both lines from the INI file.

If you do want to use it however, right click on the Volume Mixer in the traybar and select "Playback devices".
You may also check Control Panel / Sounds / Playback tab.
Check the names of the two devices you want to switch between. My normal speakers are called "Speakers" and
my Rift Audio is called "HeadPhones". Set the exact names in the INI. When Elite is active, all audio will go to
the "VRAudioDevice" device. When Elite is not running or not active, the audio will go to the "NormalAudioDevice"
This is the reason that ED:Runner wants to run as administrator if you're curious why it asks for it at startup (with UAC on).

EliteWindowTitle:
The "EliteWindowTitle" setting is the title of the Elite game window. You should not need to change it but I've
added it here anyway if it changes in the future, or use this program for any other game.

LaunchPrograms:
Regarding the [LaunchPrograms] section, you can have other programs launched at the same time as you start the ED:Runner.
Look at the examples here. The first part is the windows title of the program and after the "=" is the full path to the
program to run. If the window title is not found when you start ED:Runner, it will launch it. You can even launch Elite here.

Voices:
This is the speech engine. It uses the default Microsoft Voice installed in your system (Vista and up).
Enable Speech: Set to True to enable speech. False disables all of the below.
Voice Rate: Speed of voice. -20 to 20. 0 is "normal".
ED Start: This is spoken at the start of the program.
VR Audio Active: This is spoken when the audio device is switched to the VR headset.
Normal Audio Active: This is spoken when the audio device is switched to the Normal Audio device.
Activating Game: Spoken when Elite is reactivated due to joystick movement.
Lost focus: Spoken when the game window loses focus.
Any of the above spoken sentences can be set to NA to disable that single line.
The following can be put in the text and will be translated to the actual setting:
<JoyID>, <JoyMonitor>, <JoyTolerance>, <VRAudioDevice>, <NormalAudioDevice> & <EliteWindowTitle>
The "Activating Game" setting can also take <JoyAxisMoved> to tell you what was moved.

Priority:
If you want to make sure certain processes has a set priority, you can specify them here with either
HIGH, NORMAL or LOW. One process per row.
 
Last edited:
Interesting - could be helpful for some other CMDRs out there. Repped for effort!

Can you post a couple of screen grabs etc showing the script window?
 
Last edited:
Not that I've heard anyone using it yet, I've updated the first post with version 1.1

I added speech to it. Can be disabled of course. It now tells you what its doing and why. Quite nice IMO =)

New settings:

Code:
[Voice]
Enable Speech=True
Voice Rate=0
ED Start=E D runner starting
VR Audio Active=<VRAudioDevice> audio active
Normal Audio Active=<NormalAudioDevice> audio active
Activating Game=Joystick <JoyID> axis <JoyAxisMoved> moved. Focusing Elite window
Lost focus=Lost Elite focus. Monitoring joystick <JoyID>
And the explanation for them:

Voices:
This is the speech engine. It uses the default Microsoft Voice installed in your system (Vista and up).
Enable Speech: Set to True to enable speech. False disables all of the below.
Voice Rate: Speed of voice. -20 to 20. 0 is "normal".
ED Start: This is spoken at the start of the program.
VR Audio Active: This is spoken when the audio device is switched to the VR headset.
Normal Audio Active: This is spoken when the audio device is switched to the Norma Audio device.
Activating Game: Spoken when Elite is reactivated due to joystick movement.
Lost focus: Spoken when the game window loses focus.
Any of the above spoken sentences can be set to NA to disable that single line.
The following can be put in the text and will be translated to the actual setting:
<JoyID>, <JoyMonitor>, <JoyTolerance>, <VRAudioDevice>, <NormalAudioDevice> & <EliteWindowTitle>
The "Activating Game" setting can also take <JoyAxisMoved> to tell you what was moved.
 
I have a saitek x56. None of the joystick tests show any change when moving the joystick. Joy 1 does show when moving the throttle. I'll set it for the throttle for now. Curious why the joystick doesn't register.
 
That is strange indeed. Did you have the joysticks control panel up at the same time possibly? I've noticed some functions on my X-52 does not work in Elite if I have the joystick control panel open.
 
Looks like a great little helper program Turranius.

Could you please post the source perhaps on GitHub?
 
I tried this yesterday, it appears that when Elite loses focus my audio is muted for a split second. I think I've disabled the sound stuff, I'm not using VR. I just want it to get me back in control when stars are looming. ;) Any idea why the audio is being muted? Windows 10, by the way.
 
Top Bottom