Diazo

[1.3](Jan09/17) Landing Height: Show distance from bottom of your vessel to ground

Recommended Posts

Landing Height

Found on the CKAN as Landing Height Display

Found of Spacedock as Landing Height

Caution: This mod only affects the altimeter display at the top of the screen, it does not change the altitude at which equipment operates. So if a parachute is set to open at 500m ASL, the parachute will still open at 500M ASL, not when this mod causes the altimeter on the screen to display 500m.

Version 2.1: KSP 1.3 compatible, no update required.

Show the distance from the bottom of your vessel, not the center of mass, to the ground below you.

Land on the dark side of the Mun with confidence.

6vs1sPq.jpg

 

New Version 2.0: Mode Display

yZ8xvJJ.png

AGL: Altimeter showing distance to ground/object below vessel.

ASL: Altimeter showing distance to sea level.

Green Text or no text visible: Automatic mode based on Surface or Orbital mode as displayed just above nav-ball.

Red Text: Mode locked, will always stay in the displayed mode.

Click inside the red box to change mode, this is a game-wide setting. Due to oddities in how the UI works I could not make the entire altimeter clickable, just the left side. (Red box is not visible in-game.)

Download version 2.1 here

Source code here

Released under the GPL3 License.

Notes:

1) To make it clear when touchdown happens but you can't tell because of the lighting, a displayed altitude of 0meter means a part of your vessel is touching the ground (or water if over the ocean). A displayed altitude of 1meter or higher means no part of your vessel is touching the ground.

2) Any mod that extends parts, such as the winches in KAS, are detected by this mod. For example, if you are lowering a KAS winch, this mod will report the altitude from the bottom of the winch head being lowered as that is the lowest part of the vessel. This is working as designed and the player needs to be aware of it happening when using such equipment.

3) The raycast checks the current vessel to determine if the part hit is valid or not. Vessels connected by some method, such as a fueling hose, may be considered one vessel by this mod and could cause unexpected values to be displayed.

D.

Edited by Diazo

Share this post


Link to post
Share on other sites

Great idea! I've been having to use an additional display to get my alt above ground. This will make it much easier.

Share this post


Link to post
Share on other sites
FYI: This is already in Mechjeb, don't know how it's determined.

Center of mass, this plugin is exactly what's been suggested before.

Share this post


Link to post
Share on other sites

Yes, as far as I know all other mods out there that show "height above terrain" show it from terrain to the vessel's center of mass.

So depending on the size of your lander, you can be touching down when "height above terrain" is still showing 10 to 15meters when calculated that way for the larger landers.

True, not a huge issue usually, but if you are trying to land on the dark side of a moon and can't see the terrain at all, that 10 to 15meters can make a difference.

Also, vessel center of mass height is always to directly below the center of the vessel, if you are landing on a hill your landing gear on the side that touches down first will touch down even sooner then expected as the hill rises to meet it.

Not game changing, but it this makes a lot more sense to me then the in-game default, so I put this out for others who also want to tweak the in-game default.

D.

Share this post


Link to post
Share on other sites

This makes a lot of sense but lore-addled folks may decry that "The altitude (above sea level) reading is based on wherever the instrument is located..." ;)

I never noticed that the radar altimeter (in IVA and used by a few mods) currently indicates distance from terrain to center of mass. If so, this mod could correct that to be to bottom of whatever vessel is doing the landing--minus the distance of the landing legs of course, but that could be calibrated per-craft: If the my landing legs extend 1m past the bottom of my craft (~wherever the radar is installed), the altitude upon touchdown should be 1m? Maybe that would only be doable with an actual "radar part."

'guess this wasn't a problem if landing craft and reentry capsules are relatively small. :) It was also fairly Kerbal-ish to simply fly at a moon, ignore the altitude, watch the IVA dial and keep your speed down.

I may still prefer to keep the big numbers at the top showing the "sea level" altitude, with other mods providing the radar alt, but I like where this is going.

Share this post


Link to post
Share on other sites
Great idea should be stock in the game, I suggest though an indicator to tell you which mode it is in. :cool:

I don't see why that's needed. It makes perfect sense to me for surface mode to be radar and orbit sea level. You're not landing with orbit on or orbit with surface mode.

Share this post


Link to post
Share on other sites

@Landing legs: It checks for the bottom of the vessel in real time based on the position of parts, so when you extend your landing legs, it should display the distance from the bottom of the landing leg pad to ground as your altitude.

I only tested with the landing legs that come with the stock game, but any modded legs (and all modded parts) should behave the same.

D.

Share this post


Link to post
Share on other sites

Would this integrate with RPM without issue? I'm trying to go full first person, only viewing "map" when in tracking station. :D

Share this post


Link to post
Share on other sites

Depends on how RPM deals with the altimeter.

I don't actually change the vessel.altitude variable, instead I intercept the display number as sent to the altimeter display and have it display the number I calculated instead.

Does RPM keep the default altimeter? Then yes, the altimeter will work with this mod.

Does RPM display the altitude itself somewhere else? Then no, this mod will not affect RPM.

Note that regardless, the mods can both be running at the same time, it is just a question of if RPM displays the altitude in a way that my mod can intercept.

D.

Share this post


Link to post
Share on other sites

I think kOS and this mod would simply not interact as they deal with seperate parts of the game.

In my plugin I did leave the method exposed so other mods could call it directly, but that would require an edit to the kOS mod so that it knew my mod was there.

D.

Share this post


Link to post
Share on other sites

I have a small issue with this otherwise great mod. When flying over water, it seems as the number displayed is distance to the bottom of the ocean, rather than the surface.

Disregard, seems I had a bit outdated version

Edited by Aedile

Share this post


Link to post
Share on other sites

Re-hosted the mod on my Google drive.

Let me know if I need to rehost.

No changes made to the mod at this time.

D.

Share this post


Link to post
Share on other sites

bump for reupload, can anyone make a mirror, since spaceport is dead?

Share this post


Link to post
Share on other sites
bump for reupload, can anyone make a mirror, since spaceport is dead?

He did...like 5 hours ago :P

Share this post


Link to post
Share on other sites

oh, my mistake, didn't refresh page since yesterday, i thought i did, apparently not

Share this post


Link to post
Share on other sites

Quick request-in the next update can you make this toggleable?

Share this post


Link to post
Share on other sites

This should be stock!

Still, doesn't this...

Version 1.1: Compile against KSP 0.24 64 bit.

...mean that this will not work for 32bit KSP? I only see a single binary in the archive.

Share this post


Link to post
Share on other sites

Clicking on the "Surface" indication just above the navball to change it to "Orbit" is not enough of a toggle?

I was thinking that would be enough of a toggle for people who were using it.

I suppose I could also ask what kind of toggle? Just on/off? Or is there some flight profile you are on that it is not working for you?

This should be stock!

Still, doesn't this...

...mean that this will not work for 32bit KSP? I only see a single binary in the archive.

The single binary works for both 32 and 64 bit.

D.

Share this post


Link to post
Share on other sites

Thank you for the quick info! Might want to mention this in the OP - as it is, it sounds a bit as if this is for 64bit only.

Share this post


Link to post
Share on other sites

Yes, I've gone and updated the OP.

Compiling for 64 bit has turned out to be a non-issue anyway. I did it as a precaution when 0.24 launched to make sure everything would keep working but with what is exposed in the modding API in KSP for me to work with is the same for both 32 and 64 bit so the same file works for both versions.

D.

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.