Biff Space

[1.3] Proximity audio alarm (landing aid)

Recommended Posts

Proximity Audio Alarm

Proximity gives an audio alarm and a visual display indicating distance from the planet surface (and depending on configuration, velocity towards it) during landing.

UPDATED (2017-10-05), v2.9, Doesn't recognize RealChute chutes.

UPDATED (2017-01-24), v2.8, Recognizes RealChute chutes.

UPDATED (2016-10-14), v2.7, Recompiled with 1.2.

UPDATED (2016-07-05), v2.6, Recompiled with 1.1.3. List of changes below.

UPDATED (2016-05-02), v2.5. Recompiled with 1.1.2. List of changes below.

UPDATED (2016-3-8), v2.4. Recompiled with 1.0.5.2 binaries. No changes to functionality.

UPDATED (2014-8-01), v2.1. List of changes below.

UPDATED (2014-7-23), v2.0. List of changes below.

UPDATED (2014-6-5), v1.1. List of changes below.

The Proximity Part

The part, called 'Proximity', is found under the utility tab. In career or science mode, it is found in the 'landing' node of the tech tree.

The part is activated when the ship is below a certain height (default is 4000m) which the pilot can configure. When active, a visual alert and an audio alarm are produced to inform the pilot of the height above the surface and velocity towards it.

From v1.1 onwards, ModuleManager will add Proximity to any command module or probe core, so the separate Proximity part does not have to be used.

Audio Alarm

The audio alarm makes beeps to indicate height above the surface. The beeps become more frequent as the ship gets closer to the surface. If the 'variable frequency' mode is selected, the beeps rise in pitch as the ship moves faster.

The length of the beep and its waveform can be set to match user preference and fit in with other game sounds.

The audio alarm can be turned off altogether.

Visual Display

The visual display shows a horizontal line with two moving blobs to indicate the ship's distance from the terrain below. It can operate in two modes.

In 'Distance' mode, the distance between the blobs corresponds to the ship's height above the surface, so during a descent the blobs start at opposite ends of the line and move towards the centre, meeting when the ship is at ground level.

In 'Speed' mode, the blobs start in the centre and move apart if the ship is moving upwards, and start at the ends and meet in the middle if it is moving downwards. The speed of the blobs increases as the ship gets closer to the gound.

The display can also be set to use distance mode above a certain threshold height, and speed mode below it. If this mixed mode is selected, a field to set the threshold height appears.

The visual display can be turned off altogether.

Download

The proximity folder needs to be unzipped and put in your KSP\GameData folder:

Proximity at SpaceDock

Feedback

This is my first mod for KSP, and I would like to have any comments and suggestions for improvements - please let me know what you think.

Code

The source code is available at GitHub.

Licence

Proximity, its associated files and the source code are all released under the GPL 3 licence, text here: http://www.gnu.org/licenses/gpl.txt.

Version 2.6 updates

- Window now disappears with the rest of the UI on F2
- If the part config file is edited to move the part to a different tech tree node, it will now behave sensibly rather than requiring 'landing' to be unlocked
- efficiency tweaks
- available in map mode
- Recompiled with KSP 1.1.3 binaries.

Version 2.5 updates

- Beep length is not user-configurable any more.
- If Module Manager is used to add Proximity functionality to command pods and probe cores, Proximity is still unavailable until it has been researched
- New look for stock buttons
- Recompiled with KSP 1.1.2 binaries.

Version 2.4 updates

- No change to functionality, just recompiled with 1.0.5.2 binaries.

Version 2.1 updates

- Integration with the new stock toolbar. Proximity can use blizzy's toolbar if preferred, just change 'stock' to 'blizzy' in the config file.

- Potential problem caused by Module Manager config file fixed.

- Obscure bug involving electric charge fixed.

- Some stability improvements and GUI tweaks.

Version 2.0 updates

- An excellent new part model by Justin Kerbice, replacing the copy of the thermometer used previously.

- Recompiled with KSP 0.24 binaries.

- A toolbar button is provided to activate the settings controls anytime, using blizzy78's toolbar plugin. (The toolbar plugin is not included in the Proximity download. It isn't required, but the settings are only available near the surface without it.)

- A configuration file has been added so that ModuleManager picks up Proximity and adds its functionality to all command modules and probe cores, so you don't need to add the part. (The part is still available, and ModuleManager is not required to use it.) Thanks to KerbMav for showing me how to do this.

- There is a new option to automatically switch off Proximity if the craft is a rover-type vessel. This prevents it appearing now and then when driving a rover over bumpy ground.

- There is a new option to automatically switch off Proximity if parachute(s) are open or semi-open.

- The colour of the visual display changes smoothly in speed mode from green through orange to red, depending on a rough calculation of danger (worked out from vertical speed and altitude). It is now white when ascending.

- Proximity switches off automatically after 5 seconds of ascent, since that's probably a launch. It switches back on if the vessel begins descending.

- There is a volume control for the beeps.

- There is an on/off button to quickly disable/enable Proximity.

- The GUI has been re-arranged and tidied up a bit.

Version 1.1 updates

- Altitude above terrain is now used consistently.

- Bug which caused the alarm to occasionally start up when very high above the surface has been fixed.

- Frequency of beeping is now a smooth function of altitude, and beep pitch is now a smooth function of speed.

- The colours of the visual display are now cyan (distance mode) and green, orange, or red (speed mode) depending on a rough calculation of danger.

- Beeping pauses in when the game is paused.

- All preferences are now saved and reloaded properly.

- Part has been moved to Utility tab from Science tab.

- Now released under GPL licence.

 

Review and detailed description of all the settings by Kottabos:

 

 

Edited by Biff Space
updated to 2.9

Share this post


Link to post
Share on other sites

Could you please provide some screenshots and the source code? Especially the latter is very important. :)

Share this post


Link to post
Share on other sites

Good idea!

Here are a couple of screenshots, one expanded, one minimized:

aTN7K2a.png

nuIIXyL.png

This part does not guarantee a successful landing:

6FLp9R3.png

The code is here on GitHub. (If I've got my GitHubbing right).

Share this post


Link to post
Share on other sites

Nice idea!

wrt your issue with vessel state and atmospheres: at least MechJeb shows a real altitude in the surface info (I suppose VOID and company too). Since those projects are open source too you may look what they are doing to get the real altitude and copy (with attribution depending on license), this could save you some time.

Share this post


Link to post
Share on other sites
Nice idea!

wrt your issue with vessel state and atmospheres: at least MechJeb shows a real altitude in the surface info (I suppose VOID and company too). Since those projects are open source too you may look what they are doing to get the real altitude and copy (with attribution depending on license), this could save you some time.

That's really helpful, thanks. I will check and see how they do it, and update my own project. :)

Oh, and I got the idea from this thread, KerbMav came up with it: here.

Edited by Biff Space

Share this post


Link to post
Share on other sites

The beeps don't come out very well in the screenshots, so I've done a YouTube:

Sorry about the appalling sound quality of the commentary, Lenovo's built-in microphones appear to be crap. It sounds as if I'm broadcasting from Eeloo.

Share this post


Link to post
Share on other sites
The beeps don't come out very well in the screenshots, so I've done a YouTube:

Sorry about the appalling sound quality of the commentary, Lenovo's built-in microphones appear to be crap. It sounds as if I'm broadcasting from Eeloo.

If the person/people who make Chatterer ever need more audio tracks for manned craft, they can totally just have you record things for them, that sounded great!

Share this post


Link to post
Share on other sites
The beeps don't come out very well in the screenshots, so I've done a YouTube:

Sorry about the appalling sound quality of the commentary, Lenovo's built-in microphones appear to be crap. It sounds as if I'm broadcasting from Eeloo.

The rockets firing sound as if you're just blowing into the microphone. ;)

Thanks for this mod -- a great idea!

Share this post


Link to post
Share on other sites

:) nice idea, and yes your lenovo microphone is really "NASA/KSP approved" :P and "chatterer ready" ! (hidden feature ? :sticktongue:)

And for altitude calculation: there are a few posts already on this subject.

Share this post


Link to post
Share on other sites

Do you plan do add more beeps and alarms?

My suggestion:

- Velocity alarm - if for given altitude velocity is dangerously high, siren sound is played (dramatic one). For example - Alt<50m, velocity>50m/s

- Fuel alarm - if ship is close to surface and fuel is >5%. I mentioned "close to surface" because it woudl be useless to play it on orbit when there is no danger.

Share this post


Link to post
Share on other sites

Holy **** Biff Space you have a blessed mic-voice combo! Can you make a launch countdown with that microphone? :)

Share this post


Link to post
Share on other sites

ok, one request

plese replace proximity part with modulemanager file

really, why woudl i need add additional part to craft?

Share this post


Link to post
Share on other sites
Alt<50m, velocity>50m/s

With these settings you would be hearing the alarm for exactly one second only though. :wink:

plese replace proximity part with modulemanager file

I will be adding the MODULE to my command parts, too. :)


@PART[*]:HAS[@MODULE[ModuleCommand]]
{
//enables Proximity on all pods and probes//
MODULE
{
name = Proximity
}
}

There was a way to enable a MODULE depending on a technology being researched, but I forgot how to do this, so it will be available from the start this way.

Oh, and I got the idea from this thread, KerbMav came up with it

I always love to put others to work be an inspiration. :D

From the video it seems that you set the interval of the beep depending on altitude steps instead of making it a function of altitude?

Share this post


Link to post
Share on other sites
Do you plan do add more beeps and alarms?

My suggestion:

- Velocity alarm - if for given altitude velocity is dangerously high, siren sound is played (dramatic one). For example - Alt<50m, velocity>50m/s

- Fuel alarm - if ship is close to surface and fuel is >5%. I mentioned "close to surface" because it woudl be useless to play it on orbit when there is no danger.

At the moment the visual bar changes colour depending on height / speed - green is 'safe', orange is 'risky', and red would appear if you hadn't crashed into the surface by then. I will have a play with the code and see if I can put a 'dangerously close / fast' alarm in.

Fuel alarm is a bit harder - I'd have to calculate whether the amount of fuel is enough to get the ship safely to the surface, and I don't know how I'd begin going about that.

ok, one request

plese replace proximity part with modulemanager file

really, why woudl i need add additional part to craft?

I'd like to do that, but I don't yet know how. I will investigate, and with luck in later versions it will be possible to get the functionality without having to add a part.

I will be adding the MODULE to my command parts, too. :)


@PART
[*]:HAS[@MODULE[ModuleCommand]]
{
//enables Proximity on all pods and probes//
MODULE
{
name = Proximity
}
}

That's cool, where do you add that in the persistence file?

From the video it seems that you set the interval of the beep depending on altitude steps instead of making it a function of altitude?

True, it is in 'layers' of altitude above the ground at the moment. I'm working on making it smoother, but it's never going to be continuously-varying. KSP calls an update function in my code a certain number of times a second, and I skip a number of them depending on the altitude.

I will have to do an update soon, because there is a bug where the alarm turns itself on high above a planet surface for some reason. I need to fix that, and will try to include some of your suggestions when I do.

And thanks for the comments about the video clip, glad people enjoyed it.

Share this post


Link to post
Share on other sites

I'd like to do that, but I don't yet know how. I will investigate, and with luck in later versions it will be possible to get the functionality without having to add a part.

That's cool, where do you add that in the persistence file?

This goes into a .cfg file in your mod folder - together with the ModuleManager mod it will simply add your MODULE to all parts that are either a crew pod or a probe body.

That way you do not need an extra part to add Proximity to crafts.

Share this post


Link to post
Share on other sites

I've updated to version 1.1 (fresh links and details in first post), taking into account some of the feedback above.

In particular, the pitch and frequency of the alarm varies smoothly with altitude and speed, and a couple of bugs have been fixed.

I had a go at adding voice messages at various altitudes, but no luck so far.

I have also had a look at making the alarm an extension of MonoBehaviour, but that is still work in progress too - I thought I'd use the in-built system rather than investigating ModuleManager, as it will undoubtedly come up again in other projects.

Thanks for all the feedback, keep it coming. :)

Share this post


Link to post
Share on other sites

hey just an FYI: Google has flagged your file/download link/site as Malicious:

tvDEwhA.png

i'm not suggesting nor implying anything other than this is the warning i get when i try to download your file.

Love the mod! thanks for all the hard work!

Edited by PizzaMore
added a few words.

Share this post


Link to post
Share on other sites

Thanks for the warning. I don't know why that's happened, or what I can do about it.

The mod is on dropbox, which I think is OK, and the only thing the plugin does is to make an XML file of user preferences in its own directory in <your ksp folder>\GameData\Proximity\Plugins\PluginData\Proximity

Shouldn't trigger any warnings. :(

Share this post


Link to post
Share on other sites

I just got the same block message as @PizzaMore above. I saved it to Dropbox instead and scanned it. It's perfectly clean. So yeah, no idea why that'd happen.

Should it be relevant, I'm using Chrome Version 35.0.1916.153 m.

Share this post


Link to post
Share on other sites

Google should not be trusted... :cool:

Could you please add a toolbar button ?

I've tried the 1.0, the window disappear quite in a not friendly way ("eeehh stay !!! I didn't tell you to close !") and is always pop-up in the center of the screen (maybe 1.1 update fix that).

The toolbar button could be nice to enable/disable prefs window and also set alarm ON/OFF. Especially with MM config, if all pods get this and you can't really set it as you wish, it would be more an annoyance than a help.

EDIT: there is a move.bat script in plugins folder and the readme is there... where only a few people may be aware of it !

Edited by Justin Kerbice
add note

Share this post


Link to post
Share on other sites

Cool mod, all I need is B!^y Betty to tell me what to do, lol!

Share this post


Link to post
Share on other sites
Google should not be trusted... :cool:

Could you please add a toolbar button ?

I've tried the 1.0, the window disappear quite in a not friendly way ("eeehh stay !!! I didn't tell you to close !") and is always pop-up in the center of the screen (maybe 1.1 update fix that).

The toolbar button could be nice to enable/disable prefs window and also set alarm ON/OFF. Especially with MM config, if all pods get this and you can't really set it as you wish, it would be more an annoyance than a help.

EDIT: there is a move.bat script in plugins folder and the readme is there... where only a few people may be aware of it !

I'm currently working on version 1.2, and I hope to include toolbar integration in that. I haven't had a lot of time to spend on KSP things recently, so I can't say when it will be out.

The window ought to remember where you've dragged it to - it does in v 1.1, I'm not sure if it does in 1.0, there were some issues with the config data in the first version. Note that if you revert a flight, changes to the settings made during it are lost.

And I'll make sure to remove the move.bat file from the next upload, that's just part of my development environment to move the dll from the build folder to the KSP folder. Won't do any harm, but shouldn't be there. :)

Thanks for the feedback, everyone!

Share this post


Link to post
Share on other sites

You're welcome (for feedback ;) )

Tested 1.1: the very annoying this is the window which still be suddenly closed (when distance > quite some safety margin from setting), it's not very user-friendly especially knowing there is currently no way to make it displayed again til reaching the "danger zone".

Take your time and I really hope you can complete the toolbar integration ;).

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.