In-Development Prototype planetary landing assistance using VoiceAttack inline function

This video is the first demonstration of an inline function called within VoiceAttack to calculate range and bearing to a set of planetary co-ordinates.

VoiceAttack inline function to assist planetary landings

Although there are several tools already deployed, I still hear of commanders having trouble navigating to a given location on a planetary surface. Something like this might help for the VoiceAttack users out there.

Release 1.2 of the profile and a ReadMe document are attached here; the profile was renamed to .txt to permit upload.

EDIT: Release v1.4.0 is available on gitHub. Read the wiki here . Bear in mind that this is a work-in-progress, but the software developer's mantra is 'ship-it, ship-it, ship-it'.
 

Attachments

Last edited:
This is very cool.

I take it that you read status.json every 5-10 seconds to get Longitude, Latitude then calculate heading to destination based on that.
Care to share how you input your desired destination and the VA Code you used?

Clicker
 
Last edited:
That's pretty impressive. How are the destination coordinates and the planetary diameter set for the calculations?
I create a Waypoint command for each planetary landfall with statements that define the target latitude and longitude, along with the radius of the moon/planet taken from the system map:

Code:
// Bla Dryai LB-W d2-4 1
Set decimal [targetLatitude] value to 15 (save value to profile)
Set decimal [targetLongitude] value to -60 (save value to profile)
Set decimal [bodyRadius] value to 4795 (save value to profile)
Write [Blue] 'Waypoint, is latitude {DEC:targetLatitude}, longitude {DEC:targetLongitude}' to log
 
This is very cool.

I take it that you read status.json every 5-10 seconds to get Longitude, Latitude then calculate heading to destination based on that.
Care to share how you input your desired destination and the VA Code you used?

Clicker
Thank you for the coolness ranking :)

I should have mentioned above that I'm using EDDI, which provides the following variables as you approach the surface - usually before orbital cruise is entered:

Code:
{DEC:Status latitude} the ship's current latitude (if near a surface)
{DEC:Status longitude} the ship's current longitude (if near a surface)
{DEC:Status altitude} the ship's current altitude (if in flight near a surface)
As to sharing the code, the best way will be as a VA profile which I assume I can attach to a post in this thread. At the moment I'm playing with calculating the slope to the target - hence the use of the EDDI altitude read-out. I will share when I've finished that work.
 
This follow-up video demonstrates the use of landing guidance on a large planet (4,800km) and introduces the calculation of the slope from the current latitude, longitude, and altitude to the destination (actually a point 5km above the surface so you don't drop out of the glide too soon).

Landing guidance on a large planet using heading, range, and slope

I've attached the commands as .txt file for those who would like to try this out. I offer no warranties or guarantees that it will work in your configuration, but I would like to know how you get on.
 

Attachments

Thank you for the coolness ranking :)

I should have mentioned above that I'm using EDDI, which provides the following variables as you approach the surface - usually before orbital cruise is entered:

Code:
{DEC:Status latitude} the ship's current latitude (if near a surface)
{DEC:Status longitude} the ship's current longitude (if near a surface)
{DEC:Status altitude} the ship's current altitude (if in flight near a surface)
As to sharing the code, the best way will be as a VA profile which I assume I can attach to a post in this thread. At the moment I'm playing with calculating the slope to the target - hence the use of the EDDI altitude read-out. I will share when I've finished that work.
Ok, thanks for that.

I’ll take a look at EDDI then!

Cheers
 
@Andrew Linton ... have you considered using Voice Attack’s ‘get user input’ functions to input target co-ordinates instead of editing your VA commands?
I did try that at first, so thanks for the suggestion. (y)

For use cases like setting up meeting points for an expedition, which are often published in advanced and which you might want to visit more than once, I opted for saving the settings in commands. I hope that makes sense. There's no reason of course why the profile couldn't offer both approaches, enabling an ad hoc landing.
 
Landing Guidance v1.1
==================
Release Notes
--------------------
  • Stop trying to be clever by aiming for a point 5km above the target which typically causes an overshoot. Let the commander learn to judge the approach slope based on the range to the destination and the altitude above the dropout point from orbital cruise.
  • Removed all settings to save target details to the profile. This is not necessary.
  • Tidied the code, renaming commands and variables to align with the title of 'Landing Guidance'.

The new profile is attached (renamed to .txt) along with an updated ReadMe.
 

Attachments

Since the planetary radius is now part of the status.json file, EDDI reads this and you should be a able to push this to VA in the Near Surface event. That would save changing the commands or looking up the planetary radius manually.
 
Since the planetary radius is now part of the status.json file, EDDI reads this and you should be a able to push this to VA in the Near Surface event. That would save changing the commands or looking up the planetary radius manually.
Great tip, thank you (y)

Except...I've tried using the ((EDDI near surface)) event and, according to the documentation, it only exposes
  • {TXT:EDDI near surface bodyname} The name of the body
  • {TXT:EDDI near surface systemname} The name of the starsystem
...and the bodyname is 'Not set'. I'm using EDDI 3.4.0. Am I missing something?
 
EDDI does not automatically publish all its available variables to VA, only the ones that the developers see fit so to do. I think it is probably a way to force people to use EDDI instead of VA. However, there may be a way to "push" a variable to VA in the same way that EDDI allows VA to publish variable to EDDI using the setState command (I think). See here for details of this,

If this is not the case, then perhaps an extension to your inline c# code to read the status.json contents and retrieve the values from there.

This VA command works as expected, when you drop below the blue line the name of the planet and system are displayed:
ed-va-near-surface.png
 
Last edited:
So, here is how to get the body radius from EDDI and into VA:

Close VA and open EDDI.
Select the 'SpeechResponder' tab and locate the 'Near surface' event.
Click on the 'Edit' button for this event and set the event to:

Code:
{SetState("body_radius", 0.0)}

{if event.approaching_surface:
    {_ Fetch from context}
    {set reportbody to BodyDetails(event.bodyname, event.systemname)}

    {if reportbody.name && reportbody.name != "":
        {SetState("body_radius", reportbody.radius)}
    }
}
Click on 'OK' to save this.
Close EDDI
Open VA
Edit your profile.
Add a new command named '((EDDI near surface))'. See my prior post for an example of this.
Add the following commands:

Code:
Set Text [approaching_surface] to '{BOOL:EDDI near surface approaching_surface}'
Begin Text Compare: [approaching_surface] Equals 'True'
  Set Decimal [body_radius] value to the converted value of {DEC:EDDI state body_radius}
Else
  Set Decimal [body_radius] value to 0
End Condition
The VA variable 'body_radius' should now be set to the radius of the body whose gravity well you have just entered.
 
Last edited:
Great work, I'll try this, thanks. I haven't looked in any detail at the SpeechResponder, but this looks like it's worth the effort. Now that the Near surface event is giving me the body name, I can also check that it's the right planet/moon.
 
Great work, I'll try this, thanks. I haven't looked in any detail at the SpeechResponder, but this looks like it's worth the effort. Now that the Near surface event is giving me the body name, I can also check that it's the right planet/moon.
Looking forward to the update.
 
Looking forward to the update.
The code above worked a charm - but you knew that already. I will credit you in the documentation. The code that goes into the near surface SpeechResponder script is the only code that isn't part of the VoiceAttack profile, so there is the question of how to share scripts with other EDDI users. Is this normally by text listing or is there another way?
 
Last edited:
The code above worked a charm - but you knew that already. I will credit you in the documentation. The code that goes into the near surface SpeechResponder script is the only code that isn't part of the VoiceAttack profile, so there is the question of how to share scripts with other EDDI users. Is this normally by text listing or is there another way?
I did know it worked as I tried it out before posting :)

The normal way to share scripts with other EDDI users is to post the script and the details, much as I have done in my post. I'd say that your installation instructions should detail how to enter the required script into the correct event in EDDI as well as the script itself.

Just as an aside, you'll notice that in the scripts the default value of the body_radius is zero and this is deliberate since you can trap the zero value in your VA scripts and output the appropriate response. The timing of the state variables is not guaranteed in EDDI so there is a possibility that the body_radius will not be set when the near surface VA command is triggered.
 
Top Bottom