linuxgurugamer

[1.5.1+, 1.6+] StageRecovery - Recover Funds+ from Dropped Stages

Recommended Posts

Forum user @magico13 has left the modding scene, and has turned over this mod to me for maintenance.  Original thread is here: https://forum.kerbalspaceprogram.com/index.php?/topic/78226-14-stag

This was a spinoff addon from  Kerbal Construction Time containing only the booster recovery code. It was split it off since 0.24 makes recovery of spent stages practical in the stock game. This mod allows funds to be recovered, at a reduced rate, from dropped stages so long as they have parachutes attached (not necessarily deployed).

What can this mod do:

  • Recover funds from stages that have enough parachutes to drop the terminal velocity to a safe level
  • Two funds recovery models: Flat Rate, where once the velocity drops below a cutoff a flat rate is returned; or Variable Rate (default), where the velocity within an intermediate range determines the recovery percentage (following a quadratic relationship)
  • Recovery percentage (flat rate model only) is configurable (default of 75% of the normal for the current distance from KSC, 100% if a probe core or Kerballed command pod is attached)
  • Works with Stock parachutes and Real Chutes parachutes
  • All cutoff velocities are easily configurable with in-game sliders in the in-game settings menu
  • Recovery does not require that parachutes are deployed, only attached (but it is a good idea to deploy them at low altitudes)
  • Recover Kerbals in dropped/returned stages (improved in 1.6.0, hopefully no more contract failures)
  • Recover science in dropped/returned stages
  • Integrates with stock message system (reports can be disabled in the setting file)
  • Easy to use, non-intrusive GUI for viewing Recovered and Destroyed Stages.
  • Editor helper to help you figure out just how many parachutes you need.
  • Has an easy to use API that other mods can tie into to be notified of recovery events (success or failure)
  • Support for KSP-AVC for version checking
  • Powered recovery of stages. Land with rockets, instead of just parachutes!
  • Unfocused stages can be destroyed by thermal heating if they are going too fast (check below for further details, it's not exactly a scientific way of handling this)
  • Designed to work alongside FMRS! If FMRS is deactivated, SR will handle recovery. If FMRS isn't handling parachute stages or has deferred them to SR, then SR will handle them while FMRS handles controlled stages.
  • With 1.7.1, more advanced support for FMRS. With the new RecoveryController integration you can designate stages to be recovered by StageRecovery, FMRS, auto, or no mods during construction or flight.

Dependencies

 

Powered Recovery requirements:

Spoiler

Now you can be your very own Elon Musk and have your rockets land with their engines! This feature is a work in progress, however, and will be improved in future updates. With that said, if you are having issues with recovery, first try going into the settings and disabling Powered Recovery, then you can report your bugs if they didn't go away.

So, what are the requirements for powered recovery?

  • An activated engine (or multiple), excluding SolidFuel powered engines (engine ISP will be properly averaged).
  • Atmospheric Delta-V of at least 1.5 times the terminal velocity after parachutes. (about 300 m/s without chutes, otherwise just 1.5x the terminal velocity indicated in the editor helper)
  • A point of control, such as a probe body or Kerballed command pod, that has SAS capabilities (so a Pilot kerbal or a probe with SAS)
  • A total Thrust-To-Weight ratio of greater than 1. Even if using parachutes.

 

Explicitly calculating the fuel amounts required for every engine is hard. Several approximations are made:

  1. All engines are averaged together to act as a single engine.
  2. All required propellant types are assumed to be the same as the first engine (non-SRB) found.
  3. This is designed primarily for stock-alike engines. Mod engines that require strange fuels may have unexpected issues.

 

Powered recovery is made possible by Malkuth, of Mission Controller Extended. Malkuth graciously offered the MCE powered recovery code to me, which was used as a base for the code implemented here.

 

Some notes about stages burning up:

Spoiler

The chance of burning up should be 100 x 2 x [(srf_speed / DR_Velocity) - 1], which in other words is 2% per 1% that the surface speed is faster than the DR Velocity setting. As an example, if you set the DR_Velocity to 1500, then a 2000 m/s surface speed will have a 67% chance of burning up, rather than 0% at the default setting of 2000 m/s.

Adding a heat shield can reduce this chance by up to 100% (note that the chance of burning up can exceed 100%) based on how much material remains. If 50% of the heat shield material remains, then the chance of burning up reduces by 50%. 100% remaining -> 100% reduction, 10% remaining -> 10% reduction, and so on.

As an example, consider a stage going 3200 m/s at the point of "deletion" when SR kicks in. This stage has a 120% chance of burning up, meaning it will always be destroyed if it doesn't have a heatshield. Luckily, it has a heatshield attached that has 80% of the ablator left. This reduces the chance of burning up by 80%, down to 40% (120-80=40), greatly increasing the odds of the stage surviving reentry.

As of 1.6.6 for KSP 1.2.2, stages eligible for powered recovery will attempt to reduce their speed to below the minimum speed for burning up by using fuel.

 

PSA: Set your chutes to open at Min Pressure of 0.5 and activate/stage them with your stages!

KSP 1.0 added reentry heating (and parachute breaking) and an increased physics range (now 22.5km). If you drop a stage below ~10km it might hit the ground before you are out of physics range. Setting Min Pressure to 0.5 and activating the chutes will cause them to deploy around 4.5 km at a hopefully low enough speed. Set it higher than 0.5 if you'll be dropping them at speeds higher than 250 m/s at altitudes around 5km or less so they aren't ripped off.

eUotoha.png

Some video reviews:

A very nice review covering the basic usage of StageRecovery by maxrsp

 

 A review by none other than Scott Manley himself (along with the excellent FMRS by SIT89, which StageRecovery is designed to cooperate with)

Mods currently using the API (notify me if you want to be added to this list):

Kerbal Construction Time

Kerbal Konstructs

  

Support me on Patreon!

 Support me on Patreon!

 

Availability

 

Edited by linuxgurugamer
  • Like 7

Share this post


Link to post
Share on other sites

New release: 1.9.0 (10/26/2018)

  • Adoption by Linuxgurugamer
  • Replaced toolbar code with the ToolbarController
  • Added support for the Clickthroughblocker
  • Fixed bug where toobar button wasn't being displayed after first scene if using the stock toolbar
  • Removed blizzy option from settings
  • Version bump from 1.6.5 due to incorrect version info
  • Updated changelog with data from spacedock
  • Like 3

Share this post


Link to post
Share on other sites

Hi.

May I suggest continuing support the CurseForge? (Or perhaps delete the project from there?)

CF is a well know source, and people relying on it would be left behind from mainstream!

Share this post


Link to post
Share on other sites
1 minute ago, Lisias said:

Hi.

May I suggest continuing support the CurseForge? (Or perhaps delete the project from there?)

CF is a well know source, and people relying on it would be left behind from mainstream!

I don’t do Curse.  I’ll ask Magico13 to remove it.

I already support 2 download locations for more than 170 mods, I dont have time or desire to support a third.

  • Like 1

Share this post


Link to post
Share on other sites
Just now, linuxgurugamer said:

I don’t do Curse.  I’ll ask Magico13 to remove it.

On a second though… Perhaps deleting it is a bad idea (sorry for that, I should had though twice before posting).

Locking up the project with a warning to check this page would be a better option, perhaps? There're a good ammount of history there (4 years of releases)

Share this post


Link to post
Share on other sites
38 minutes ago, Lisias said:

On a second though… Perhaps deleting it is a bad idea (sorry for that, I should had though twice before posting).

Locking up the project with a warning to check this page would be a better option, perhaps? There're a good ammount of history there (4 years of releases)

I asked him to delete it or post a message.  The history is also available on Spacedock

Share this post


Link to post
Share on other sites
Just now, linuxgurugamer said:

I asked him to delete it or post a message.  The history is also available on Spacedock

Only two years (2016). The CurseForge goes to KSP 0.24.2 (2014)! :) 

Share this post


Link to post
Share on other sites

@linuxgurugamerI couldn't get the SR button to pop up, and i couldn't get it to save any of my stages. My log said it was missing dependencies Toolbar Controller and Click Through Blocker. Installed those and it works. Not sure if those are supposed to be dependencies or not, but I figured I'd let you know.

 

edit: doing all of this through CKAN

Edited by CajunInABox

Share this post


Link to post
Share on other sites

Just can't get enough of supporting mods, can you?   XD

Seriously, thank you for picking this one up-- it's one of my must-haves.   (Well, maybe that's a tad strong.  Really-prefer-to-haves.)

Share this post


Link to post
Share on other sites

Hello, fellow Stage Recoverers!

How do I keep it from "recovering" aircraft & pilot I had parked at KSC during a rocket launch? Is this Pre-Recovery?  There's a DistanceOverride setting in the config, but it's -1 and from searching the previous topic, that seems to be more to do with distance from KSC for recovery.

Any ideas? Was this just a fluke?

Share this post


Link to post
Share on other sites
6 hours ago, Beetlecat said:

Hello, fellow Stage Recoverers!

How do I keep it from "recovering" aircraft & pilot I had parked at KSC during a rocket launch? Is this Pre-Recovery?  There's a DistanceOverride setting in the config, but it's -1 and from searching the previous topic, that seems to be more to do with distance from KSC for recovery.

Any ideas? Was this just a fluke?

it is Pre-Recovery

but probably just a fluke
my worst fluk was wen doring a lunch the crew of a ship on the way back from mun whit a pe of 24 was pre-recoverd doring the lunch even tho thy wer just out of mun soi

edit

more options

in one of my first games i parked a rover too close to the lunch tower
doring lunch it was sprayed all over the KSC

Edited by danielboro
  • Like 1

Share this post


Link to post
Share on other sites
6 hours ago, danielboro said:

it is Pre-Recovery

but probably just a fluke
my worst fluk was wen doring a lunch the crew of a ship on the way back from mun whit a pe of 24 was pre-recoverd doring the lunch even tho thy wer just out of mun soi

Heh. I'm still sandboxing while I learn some new mods/tricks, so maybe I'll try to re-create that setup and see if it keeps happening. I think the plane was parked at/near the monolith, but I routinely leave aircraft at the hangar/taxiways.

Share this post


Link to post
Share on other sites

Aw, heck. It happened again while doing some aicraft ops in the water East of KSC. My spotter plane got "recovered" when the main rescue craft flew back to KSC.

Turns out I had forgotten to de-select pre-recovery. Will try to re-enact that and see if it makes a difference.

Share this post


Link to post
Share on other sites

Thanks for all the outstanding work you have done adopting orphaned and abandoned mods!  I know you are currently maintaining a whole slew of mods and am not sure if you plan on making any changes to the mods currently under your care.  If so, would you be willing to consider adjusting the settings for StageRecovery?  Currently any changes to the settings are applied globally and affect all saves in a given KSP install.  It would really be beneficial, in my opinion, to be able to change the settings on a per save basis.

For example, in a sandbox save  I click the StageRecovery button in the KSC scene to open the settings menu and uncheck "Mod Enabled" to disable the mod since it is not really relevant in the sandbox.  Currently, this also disables StageRecovery in my career mode save, where I do want it to remain active so I have to remember to re-enable the mod.

Share this post


Link to post
Share on other sites
6 hours ago, BlkBltChemie said:

Thanks for all the outstanding work you have done adopting orphaned and abandoned mods!  I know you are currently maintaining a whole slew of mods and am not sure if you plan on making any changes to the mods currently under your care.  If so, would you be willing to consider adjusting the settings for StageRecovery?  Currently any changes to the settings are applied globally and affect all saves in a given KSP install.  It would really be beneficial, in my opinion, to be able to change the settings on a per save basis.

For example, in a sandbox save  I click the StageRecovery button in the KSC scene to open the settings menu and uncheck "Mod Enabled" to disable the mod since it is not really relevant in the sandbox.  Currently, this also disables StageRecovery in my career mode save, where I do want it to remain active so I have to remember to re-enable the mod.

I would consider this a bug, not a feature.  And I do fix bugs.

I’ll take a look at it, will probably move that into the stock settings, which are applied on a per-save basis

  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, linuxgurugamer said:

I would consider this a bug, not a feature.  And I do fix bugs.

I’ll take a look at it, will probably move that into the stock settings, which are applied on a per-save basis

That would be fantastic, thanks!  And Happy Thanksgiving!

Share this post


Link to post
Share on other sites
4 hours ago, BlkBltChemie said:

That would be fantastic, thanks!  And Happy Thanksgiving!

Thank you.

I will be moving that whole window into the settings page, which will simplify the code since I'll be able to remove two files devoted to the settings

Should be out by Sunday.

 

  • Like 1

Share this post


Link to post
Share on other sites

I have a beta release, I'd appreciate some people trying it out:

Changed:

  • Changed license to MIT
  • Moved all settings into stock settings page, both to reduce code and to have the settings persist on a per-save basis
    • Note:  Existing settings are not migrated

https://jenkins.spacetux.net/job/M-S/job/StageRecovery/7/artifact/StageRecovery-1.9.0.1.zip

  • Like 2

Share this post


Link to post
Share on other sites

Going for MIT is probably the safer option, but had you secure permissions from magico13, rem02, phwoelfel, fommil and Kerbas-ad-astra?

StageRecovery was originally released under the GPL3, and you need (registered and trackable) permissions from every committer in order to  relicense it - under the sanction of having the GPL revoked for you - rendering your whole worked unlicensed, unless an additional license was granted to you.

It's unfortunate in this case, but you do not have the rights to relicense other people's work - only the Copyright Owner(s) of the work can do it, and ownership is the one thing that GPL does not grant to you.

Share this post


Link to post
Share on other sites
37 minutes ago, Lisias said:

Going for MIT is probably the safer option, but had you secure permissions from magico13, rem02, phwoelfel, fommil and Kerbas-ad-astra?

StageRecovery was originally released under the GPL3, and you need (registered and trackable) permissions from every committer in order to  relicense it - under the sanction of having the GPL revoked for you - rendering your whole worked unlicensed, unless an additional license was granted to you.

It's unfortunate in this case, but you do not have the rights to relicense other people's work - only the Copyright Owner(s) of the work can do it, and ownership is the one thing that GPL does not grant to you.

See this:

 

  • Like 2

Share this post


Link to post
Share on other sites
2 minutes ago, linuxgurugamer said:

See this:

 

Thank you. It was not clear on the repo. If you allow me, may I advice to commit on the repo a screenshot and a link to the post with the permission? Just in case - better safe than sorry!

  • Like 1

Share this post


Link to post
Share on other sites
31 minutes ago, Lisias said:

Thank you. It was not clear on the repo. If you allow me, may I advice to commit on the repo a screenshot and a link to the post with the permission? Just in case - better safe than sorry!

Done, will be there on my next commit

Thanks for the suggestion

Share this post


Link to post
Share on other sites
Just now, Critter79606 said:

@linuxgurugamer I thought I'd let you know that the in game AVC download link is still pointing at a forum page that no longer exists.

Keep up the great work!

Thanks, I'll fix that before the next release

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now