Author Topic: Elite Dangerous galaxy map control - suggested solution  (Read 9045 times)

GreyArea

  • Guest
Elite Dangerous galaxy map control - suggested solution
« on: March 19, 2017, 12:31:44 PM »
I love this game in VR, but interaction with the galaxy map when you can't see mouse or keyboard is a little challenging to say the least. I thought Voice Attack could help...and in fact it turns out it can, but I am far from a skilled coder...this rough and ready selection comes to you courtesy of a lot of help from Pfeil, Antaniserse, Gary and various people who have written helpful stuff on various weblogs.

All the good stuff is theirs, all the rubbish is mine...but here goes;

The goal is to have full control of the Galaxy Map with just voice and joystick. No mouse, no keyboard, no peeking down the nosehole on your rift (largely because I have the Vive which has no such nosehole...). It requires a joystick with at least four fire buttons and it also requires a particular keybinding in Elite which is not intuitive or normal - but which works. More on that later.

First, Starting Elite;

Display window 'Elite - Dangerous (CLIENT)' as [Normal]
Begin Text Compare : [{ACTIVEWINDOWTITLE}] Does Not Equal 'Elite - Dangerous (Client)'
    Say, 'Elite Client doesn't seem to be running. Would you like to launch it now?'  (and wait until it completes)
    Execute command, 'Confirmation' (and wait until it completes)
    Begin Text Compare : [answer] Equals 'Yes'
        Display window 'Elite Dangerous Launcher' as [Normal]
        Begin Text Compare : [{ACTIVEWINDOWTITLE}] Does Not Equal 'Elite Dangerous Launcher'
            Run application 'C:\Program Files (x86)\Frontier\EDLaunch\EDLaunch.exe'
            Say, 'Starting Launcher'
        End Condition
        Start Loop While : [{ACTIVEWINDOWTITLE}] Does Not Equal 'Elite Dangerous Launcher'
            Display window 'Elite Dangerous Launcher' as [Normal]
        End Loop
        Move mouse cursor to application coordinates (75, 750)
        Click left mouse button
        Say, 'Launcher ready, starting client'
        Start Loop While : [{ACTIVEWINDOWTITLE}] Does Not Equal 'Elite - Dangerous (CLIENT)'
            Display window 'Elite - Dangerous (CLIENT)' as [Normal]
        End Loop
    End Condition
End Condition
Begin Text Compare : [{ACTIVEWINDOWTITLE}] Equals 'Elite - Dangerous (CLIENT)'
    Set Text [Gear] to 'Down'
    Set Text [Scoop] to 'In'
    Set Text [Hardpoints] to 'In'
    Set Text [GMap] to 'Closed'
    Set Text [SMap] to 'Closed'
    Say, 'Welcome back, Commander.
All systems nominal. Ready to launch.'
Else
    Stop VoiceAttack listening
    Say, 'OK, I'm going for a nap.'
End Condition

I tried various options with the (DICTATION) function but recognition of dictation seems very poor on my machine, so I came up with my own "Confirmation" routine (called in the above) as follows;

Marker: Start
Set Text [answer] to [Not Set]
Set Boolean [valid] to False
Start Loop While : [answer] Has Not Been Set
End Loop
Begin Text Compare : [answer] Equals 'yes'
    Set Boolean [valid] to True
Else If Text Compare : [answer] Equals 'no'
    Set Boolean [valid] to True
End Condition
Begin Boolean Compare : [valid] Equals False
    Say, 'Sorry, I was expecting yes or no...I don't understand {TXT:answer}. Please try again.'
    Jump to Marker: Start
End Condition

The above routine waits for the [answer] variable to be either yes or no; you can set up any number of commands in Voice Attack to fill that value; my rubbish recognition engine insists I say "GS" when I say yes...so I just added a spoken "GS" command as well as "yes" as follows;

Set Text [answer] to 'yes'

The Gear, Scoop Hardpoint etc are all toggles I use to try and help Voice Attack keep track of the stat of things...it's not perfect and things like opening the system map from the galaxy map will break it...if anyone can suggest a better way, feel free.

I also have a command I call "Set Launch Conditions" as follows in case stuff gets too badly borked;

Set Text [Scoop] to 'In'
Set Text [Hardpoints] to 'In'
Set Text [Gear] to 'Down'
Set Text [GMap] to 'Closed'
Set Text [SMap] to 'Closed'
Say, 'Cargo Scoop and Hardpoints Retracted, Landing Gear Down'

As this profile grows there are others I'll need to add (lights for example)

Right, onto the stuff for the galaxy map. First, you're going to need to open it. I use the spoken command "galaxy";

Press M key and hold for 0.1 seconds and release
Begin Text Compare : [GMap] Equals 'Closed'
    Set Text [GMap] to 'Open'
    Say, 'Galaxy Map Open'  (and wait until it completes)
    Execute command, 'Control Panel' (and wait until it completes)
    Set integer [panelnumber] value to 1
    Set Text [panelname] to 'Info'
Else
    Set Text [GMap] to 'Closed'
    Say, 'Galaxy Map Closed'  (and wait until it completes)
    Execute command, 'Control Panel' (and wait until it completes)
End Condition

It calls a command "Control Panel", which is very simple;

Release Left Shift key
Set Text [mastercontrol] to 'panel'
Say, 'Panel controls activated'

It has a counterpart "Control Map"

Press down Left Shift key
Set Text [mastercontrol] to 'map'
Say, 'Map controls activated'

Yep, all it's doing is either releasing or holding shift for me. This is important, because you have to set up your controls in Elite in a particular way and it's not something that's very commo; combined keyboard and joystick inputs.

Basically, you can hold down left shift and then make a joystick input (including axes) and ED will recognise it as different from an unshifted input. Panel control has to be unshifted (or funny stuff happens with the cockpit panels), but Map control in the Galaxy Map can all be set to the same commands - but shifted.

Setting the two commands above to a voice command ("Activate Map" or "Activate Panels") thus allows you to toggle what you're controlling in the galaxy map - without taking your hand off the stick. I'll post my bindings later. On with the Galaxy Map panels interaction;

For each of the five panels (I call them Info, Search, Bookmarks, Filters and Options) you want a recorded voice command as follows - this is my "Info" version - replace "Info" with the appropriate name.

Begin Text Compare : [GMap] Equals 'closed'
    Execute command, 'Galaxy' (and wait until it completes)
End Condition
Set integer [maxmoves] value to 5
Set integer [moves] value to the converted value of {EXP:{INT:panelnumber}-1}
Begin Integer Compare : [moves] Is Less Than 0
    Set Text [movedir] to 'right'
    Set integer [moves] value to the converted value of {EXP:{INT:moves}-({INT:moves}*2)}
Else If Integer Compare : [moves] Is Greater Than 0
    Set Text [movedir] to 'left'
Else
End Condition
Begin Integer Compare : [moves] Is Greater Than Or Equals 3
    Set integer [maxmoves] to [maxmoves] minus [moves]
    Set integer [moves] value to the value of [maxmoves]
    Set Text [movedir] to '{EXP:IIF('{TXT:movedir}'='right','left','right')}'
Else
End Condition
Start Loop While : [moves] Does Not Equal 0
    Begin Text Compare : [movedir] Equals 'right'
        Press E key and hold for 0.1 seconds and release
    Else If Text Compare : [movedir] Equals 'left'
        Press Q key and hold for 0.1 seconds and release
    End Condition
    Set integer [moves] to [moves] minus 1
End Loop
Set integer [panelnumber] value to 1
Set Text [panelname] to 'Info'
Say, '{TXT:panelname} panel active'

On line 5 and the line third from last above, you also have to replace the "-1" and "value to 1" with the appropriate number for the panel named in the command - Info is 1, Search is 2 up to Options at 5. These numbers allow voiceattack to move the appropriate number of panels - it also works out which way is quickest.

You can also thumb through the panels with the bound controls in Elite (I use button 5 and 6 on my joystick as they are left and right of centre, so it feels "logical"). These commands have no spoken tag, they are just activated by a joystick input;

This one is "Panel Left"

Begin Text Compare : [GMap] Equals 'Open'
    Begin Text Compare : [panelname] Equals 'Info'
        Set Text [panelname] to 'Options'
    Else If Text Compare : [panelname] Equals 'Search'
        Set Text [panelname] to 'Info'
    Else If Text Compare : [panelname] Equals 'Bookmarks'
        Set Text [panelname] to 'Search'
    Else If Text Compare : [panelname] Equals 'Filters'
        Set Text [panelname] to 'Bookmarks'
    Else If Text Compare : [panelname] Equals 'Options'
        Set Text [panelname] to 'Filters'
    End Condition
Else
End Condition
Set integer [panelnumber] to [panelnumber] minus 1
Begin Integer Compare : [panelnumber] Is Less Than Or Equals 0
    Set integer [panelnumber] value to 5
Else
End Condition
Say, 'Panel {INT:panelnumber}, {TXT:panelname}'

The next one is "Panel right"

Begin Text Compare : [GMap] Equals 'Open'
    Begin Text Compare : [panelname] Equals 'Info'
        Set Text [panelname] to 'Search'
    Else If Text Compare : [panelname] Equals 'Search'
        Set Text [panelname] to 'Bookmarks'
    Else If Text Compare : [panelname] Equals 'Bookmarks'
        Set Text [panelname] to 'Filters'
    Else If Text Compare : [panelname] Equals 'Filters'
        Set Text [panelname] to 'Options'
    Else If Text Compare : [panelname] Equals 'Options'
        Set Text [panelname] to 'Info'
    End Condition
Else
End Condition
Set integer [panelnumber] to [panelnumber] plus 1
Begin Integer Compare : [panelnumber] Is Greater Than Or Equals 6
    Set integer [panelnumber] value to 1
Else
End Condition
Say, 'Panel {INT:panelnumber}, {TXT:panelname}'

All the above is just setup...now we get to the good stuff...first, you need to search for a system; I call this routine "Search for" (to distinguish from "Search" for activating the panel;

Stop Dictation Mode
Clear Dictation Buffer
Say, 'Can you spell it for me please?'  (and wait until it completes)
Start Dictation Mode
Start Loop While : [{DICTATION}] Equals ''
End Loop
Stop Dictation Mode
Set Windows clipboard to '{DICTATION}'
Say, 'Searching for {DICTATION}'
Begin Text Compare : [GMap] Equals 'closed'
    Execute command, 'Galaxy' (and wait until it completes)
End Condition
Begin Text Compare : [panelname] Does Not Equal 'Search'
    Execute command, 'Search' (and wait until it completes)
End Condition
Press A key and hold for 0.8 seconds and release
Press W key and hold for 0.8 seconds and release
Press A key and hold for 0.1 seconds and release
Press W key and hold for 0.1 seconds and release
Press Space key and hold for 0.1 seconds and release
Press Left Ctrl+V keys and hold for 0.1 seconds and release
Press Enter key and hold for 0.1 seconds and release
Press D key and hold for 0.1 seconds and release
Press Space key and hold for 0.1 seconds and release
Say, 'Search completed.'

Sadly, I had to use dictation. If anyone has any ideas how to improve the results (which is why the voice says "Can you spell it for me please?" - it did seem slightly better, but you can't pause for breath) I'd like to hear them!

If there's more than one result, try "Search Again"

Say, 'Next result'
Press A key and hold for 0.1 seconds and release
Press Space key and hold for 0.1 seconds and release

(it automatically jumps on to the little selection menu over the system - the "A" press is necessary to bring it back)

You can make that system your selected location with "Select Location";

Execute command, 'Info' (and wait until it completes)
Press A key and hold for 1 second and release
Pause 0.1 seconds
Press D key and hold for 0.1 seconds and release
Pause 0.1 seconds
Press Space key and hold for 0.1 seconds and release
Say, 'Location selected'

The reason it goes back to the info tab is because there are no other selectable items on the info page - this is the most reliable way to move the cursor onto the floating tab over the selected system (the one-second "A" press).

From there, it's quite easy to modify so you can (finally!) "Plot Route" as follows;

Execute command, 'Info' (and wait until it completes)
Press A key and hold for 1 second and release
Pause 0.1 seconds
Press D key and hold for 0.1 seconds and release
Pause 0.1 seconds
Press D key and hold for 0.1 seconds and release
Pause 0.1 seconds
Press Space key and hold for 0.1 seconds and release
Say, 'Course Plotted'

At any point you can say "Activate Map" (or whatever runs the "Control Map" command and Voice Attack will hold down Left Shift for you so you can use the joystick commands to whizz around the map in total freedom.

Longer post than I expected - I'll post ED key bindings in the next post.

If anyone tries this and wants the profile I'm happy to share.

GreyArea

  • Guest
Re: Elite Dangerous galaxy map control - suggested solution
« Reply #1 on: March 19, 2017, 12:48:39 PM »
Key bindings as promised...screenshot just seemed easier...




GreyArea

  • Guest
Re: Elite Dangerous galaxy map control - suggested solution
« Reply #2 on: March 19, 2017, 12:50:03 PM »
Key bindings part two


Rhaedas

  • Jr. Member
  • **
  • Posts: 72
Re: Elite Dangerous galaxy map control - suggested solution
« Reply #3 on: March 19, 2017, 02:48:38 PM »
The key modifier is a nice simple solution to the problem, and credit to the ED devs for having that flexibility. Even for non-VR users, this could be useful.

Any reason you decided you needed that though? My bindings for galaxy and for ship controls aren't linked, i.e., I can use the stick as is and move around the map, and come back to ship view and it's still in the same heading, no effect. Just seems like extra programming unless you ran into particular problems with yours.

Also, I don't see any examples of an escape mode. Say for instance you're heading towards a far spot and decide to check the map for a second. If something happens, usually an interdiction, the game will throw you out of the map so you can deal with it. If you have it in a different input mode for the stick, you'll need a way to quickly get out of it so you can control the ship again. A voice command could work, so could tying a specific stick button to abort (since you have things shifted, a shift-fire button or something else that's not used for map selection). Of course, not using the modifier, like I mentioned seems to work for me, means that the game gives you access right away, no problem. Might still need some cleanup in any variables that think you're still in the map mode.

Just some ideas. I can appreciate the complex coding, mine is robust now, and sometimes after not being in the middle of it for a while it takes some effort to relearn what I was doing. I've actually thought of a revamp of how my panel and stuff would work better, but I'd have to tear things apart a lot, and I haven't gotten the motivation yet to go that deep, since it works fine as is.

GreyArea

  • Guest
Re: Elite Dangerous galaxy map control - suggested solution
« Reply #4 on: March 19, 2017, 04:40:51 PM »
Menus in the cockipt were never the problem...it was interacting with the Galaxy Map and the menu tab - I wanted to use the same physical controls for both, but that resulted in the map moving whenever I navigated around the panel...

...the shifted state solves that...and it's better than the shift state button on my Cyborg EVO...that will shift buttons, but not axes...the fact that ED accepts "shift" with axes two effectively means you have an entire other joystick to play with...

...I've realised though that I could do away with the "next tab" and "previous tab" bindings on the joystick...they could be bound to any key (even something unintuitive) and the voice commands would activate them easily.

Yes - cleanup needed - profile doesn't check enough for where it is, meaning you get random messages in the cockpit...

Learning curve - very similar to my session in ED this evening where I got to within 77km of a black hole, dropped out of the FSD and realised this was a very, VERY bad thing to do...it was a little warm in the cockpit there for a while...

sutex

  • Jr. Member
  • **
  • Posts: 91
Re: Elite Dangerous galaxy map control - suggested solution
« Reply #5 on: July 13, 2017, 05:30:53 PM »
Any downloadable VA profiles coming  ?