Jump to content

[1.4] StageRecovery - Recover Funds+ from Dropped Stages - v1.8.0 (March 11, 2018)


magico13

Recommended Posts

Stage recovery can be used to recover crew as well? I dunno how I missed that line. Does it trigger contact rewards too?

 

Edit I just checked, and it does. However, it also triggers the contract failure as well. So it's probably best to only use it for noncontract recoveries. =(

Edited by sardia
tested
Link to comment
Share on other sites

Love this thing but I've got a mystery.

A couple of months ago (game time) I dropped a booster in a barely suborbital trajectory--periapsis was fairly high in the atmosphere.  I figured I might lose it to the fire but I didn't expect what happened.

I was cleaning up empty space capsules after rescue missions and I noticed it in the list--how could it still be flying?!?!

To compound things I switched to it to see what's going on--and since it's in the fire it won't let me switch away so I just have to wait it out and see what happens....the engine blew up, that shed enough weight that the rest of it slowed pretty quickly and survived.

Link to comment
Share on other sites

I have the same problem of Kylon-Raider, disappear crews
My situation with a ship in return Kerbin, two days on arrival with periapsis inside the  atmosphere 25 km . 
As they pass the 2 days, I go to the space center, do a tour with a rover at KSC, back to the ship and kerbal disappeared.
I get out of KSP, delete  Stage Recovery, I return to the game, do the same things and kerbal NOT disappears.
Without other evidence. I get out of KSP, put yet Stage recovery, load the same save, repeat as before, the Kerbal disappears. Reloading the save, move the periapsis out of the atmosphere (85km) and Kerbal NOT disappears
I can leave the savegame, but I have many mods
https://drive.google.com/file/d/0B_n0DdXfS_EDelRNd211cmhva2s/view?usp=sharing

Edited by EmpCris
Link to comment
Share on other sites

@magico13

I have a little bit of NULLREF Spam on a highly modded install on the recovery event.
Is this known or do you have a hint for debugging / want more information?
I am using realchute and safechute mods.

Spoiler

[LOG 21:19:46.464] KK: SpaceCenter set to: SpaceCenterMarker
[LOG 21:19:46.464] [SR] Searching in RecoveryQueue (0) for 3f2b33cc-b2d0-443b-bd85-402c99007088
[LOG 21:19:46.464] [SR] Altitude: 24870.0195222463
[EXC 21:19:46.466] NullReferenceException
    UnityEngine.Transform.InverseTransformDirection (Vector3 direction)
    StageRecovery.RecoveryItem.DetermineTerminalVelocity ()
    UnityEngine.Debug:LogException(Exception)
    StageRecovery.RecoveryItem:DetermineTerminalVelocity()
    StageRecovery.RecoveryItem:Process()
    StageRecovery.StageRecovery:VesselDestroyEvent(Vessel)
    EventData`1:Fire(Vessel)
    Vessel:Die()
    Vessel:CheckKill()
    VesselPrecalculate:MainPhysics(Boolean)
    VesselPrecalculate:FixedUpdate()
[EXC 21:19:46.468] NullReferenceException
    UnityEngine.Transform.InverseTransformDirection (Vector3 direction)
    StageRecovery.RecoveryItem.DetermineTerminalVelocity ()
    UnityEngine.Debug:LogException(Exception)
    StageRecovery.RecoveryItem:DetermineTerminalVelocity()
    StageRecovery.RecoveryItem:Process()
    StageRecovery.StageRecovery:VesselDestroyEvent(Vessel)
    EventData`1:Fire(Vessel)
    Vessel:Die()
    Vessel:CheckKill()
    VesselPrecalculate:MainPhysics(Boolean)
    VesselPrecalculate:FixedUpdate()
.
.
.
.
[EXC 21:19:46.490] NullReferenceException
    UnityEngine.Transform.InverseTransformDirection (Vector3 direction)
    StageRecovery.RecoveryItem.DetermineTerminalVelocity ()
    UnityEngine.Debug:LogException(Exception)
    StageRecovery.RecoveryItem:DetermineTerminalVelocity()
    StageRecovery.RecoveryItem:Process()
    StageRecovery.StageRecovery:VesselDestroyEvent(Vessel)
    EventData`1:Fire(Vessel)
    Vessel:Die()
    Vessel:CheckKill()
    VesselPrecalculate:MainPhysics(Boolean)
    VesselPrecalculate:FixedUpdate()
[EXC 21:19:46.492] NullReferenceException
    UnityEngine.Transform.InverseTransformDirection (Vector3 direction)
    StageRecovery.RecoveryItem.DetermineTerminalVelocity ()
    UnityEngine.Debug:LogException(Exception)
    StageRecovery.RecoveryItem:DetermineTerminalVelocity()
    StageRecovery.RecoveryItem:Process()
    StageRecovery.StageRecovery:VesselDestroyEvent(Vessel)
    EventData`1:Fire(Vessel)
    Vessel:Die()
    Vessel:CheckKill()
    VesselPrecalculate:MainPhysics(Boolean)
    VesselPrecalculate:FixedUpdate()
[LOG 21:19:46.594] [SR] Vt: 3.349607
[LOG 21:19:46.594] [SR] Distance: 696164.4
[LOG 21:19:46.594] [SR] Adding funds: 44568.38671875, New total: 2533201.37227168
[LOG 21:19:46.597] KK: onVesselRecovered called
[LOG 21:19:46.597] [Vessel Test Debris]: Vessel was destroyed.
[LOG 21:19:46.601] IR: [ServoController] OnVesselUnloaded, v=Test Debris
[WRN 21:19:46.674] KK: StaticDatabase.updateCache(): vPlayerPos is still v3.zero 
[WRN 21:19:47.115] KK: StaticDatabase.updateCache(): vPlayerPos is still v3.zero 

 

Edited by Jebs_SY
Link to comment
Share on other sites

14 minutes ago, Li0n said:

@Jebs_SY I guess those exception appears when a jettisoned stage leave physic range ? If so it should be harmless, I post the same things some time ago. Here, with the answer from magico13 in the post below.

OK, it seems not to be caused by realchute. Just tested it without realchute, same problem. It occures when the falling stage reaches the "delete it height". Around 20-25km. Without beeing loaded.

Even if it's not bad, it would be fine, if this could be addressed somewhen. My installation is highly modded with 180+ mods and I need to monitor at least the exceptions to have a chance to see when something is not working well. So I have the exceptions monitor enabled and every time I see something red it "scares" me a little. :D .... however, if this is much work, I just have to live with it... will work, too. :)
 

Edited by Jebs_SY
Link to comment
Share on other sites

1 hour ago, Jebs_SY said:

Even if it's not bad, it would be fine, if this could be addressed somewhen. My installation is highly modded with 180+ mods and I need to monitor at least the exceptions to have a chance to see when something is not working well. So I have the exceptions monitor enabled and every time I see something red it "scares" me a little. :D .... however, if this is much work, I just have to live with it... will work, too. :)

+1

I *only* have 90 mods and I got the same feeling. But I also understand that mod's authors don't want to waste time for harmless messages when they have feature and/or serious bug to figured out.

Best thing to do probably is to log a github issue so magico13 can remember about it and fix it when he got time. I'm investigating bugs on another mod right now but I'll see to it.

 

Edit : Github issue here

Edited by Li0n
Link to comment
Share on other sites

Hi, got a problem with Stage Recovery 1.6.5 on KSP 1.2.1: an NRE when debris is destroyed. The result is that this mod effectively does nothing at all - no stages are recovered. Log file:

Spoiler

$ tail -f KSP.log|grep -i stage
[LOG 11:41:02.045] [RealChute]: parachuteRadial was activated in stage 7
[LOG 11:41:02.046] [RealChute]: parachuteRadial was activated in stage 7
[ERR 11:42:52.974] Exception handling event onVesselWillDestroy in class StageRecovery:System.NullReferenceException: Object reference not set to an instance of an object
  at KerbalKonstructs.Addons.StageRecovery.PreRecovery (.Vessel vessel) [0x00000] in <filename unknown>:0 
  at StageRecovery.RecoveryProcessingEvent.Fire (.Vessel vessel) [0x00000] in <filename unknown>:0 
  at StageRecovery.StageRecovery.VesselDestroyEvent (.Vessel v) [0x00000] in <filename unknown>:0 
	KerbalKonstructs.Addons.StageRecovery.PreRecovery (.Vessel vessel)
	StageRecovery.RecoveryProcessingEvent.Fire (.Vessel vessel)
	StageRecovery.StageRecovery.VesselDestroyEvent (.Vessel v)
[LOG 11:43:30.188] [RealChute]: parachuteRadial was activated in stage 3
[LOG 11:43:30.188] [RealChute]: parachuteRadial was activated in stage 3

 

As you can see, my parachutes were activated during staging. I've been using SR for about 1.5 years so I know how to make it work, until now. :)

edit 1: let me try without KK in there...

edit 2: Yes, Kerbal Konstructs was stopping SR from working. Any idea which mod is doing something "wrong"?

Edited by Bluebottle
Link to comment
Share on other sites

@magico13

I've taken over the Extensive Engineer Report.

I am trying to see if I can come up with a check for parachutes.  Given the ability of EER (gad, going to get confused with abbreviations), to break a ship into sections, can you point me to the code in Stage Recovery which can calculate if there are enough chutes available for a safe recovery?

Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

@magico13

I've taken over the Extensive Engineer Report.

I am trying to see if I can come up with a check for parachutes.  Given the ability of EER (gad, going to get confused with abbreviations), to break a ship into sections, can you point me to the code in Stage Recovery which can calculate if there are enough chutes available for a safe recovery?

It's not in the best of places and I've been meaning to move it to a more general place. There's no way for you to call it as it's too baked in. Here it is while in flight and here it is in the editor. Note that neither are working exactly correct with Stock stuff for some reason and I need to try to figure that out. The stock stuff is derived from RCS Build Aid.

I'll move the calculation stuff at the very least into its own method (it should be moved anyway) and I'll figure out a way to tie it into the API so you can just pass in a Vessel (or just a List<Part>) and get an estimate straight from StageRecovery. I'll do it two ways so that you can pass an entire Vessel and have SR split into stages based on decouplers, or have it treat the entire passed Vessel as a single stage (in case you want to use Ship Sections or are alternatively determining stages).

Link to comment
Share on other sites

1 hour ago, magico13 said:

It's not in the best of places and I've been meaning to move it to a more general place. There's no way for you to call it as it's too baked in. Here it is while in flight and here it is in the editor. Note that neither are working exactly correct with Stock stuff for some reason and I need to try to figure that out. The stock stuff is derived from RCS Build Aid.

I'll move the calculation stuff at the very least into its own method (it should be moved anyway) and I'll figure out a way to tie it into the API so you can just pass in a Vessel (or just a List<Part>) and get an estimate straight from StageRecovery. I'll do it two ways so that you can pass an entire Vessel and have SR split into stages based on decouplers, or have it treat the entire passed Vessel as a single stage (in case you want to use Ship Sections or are alternatively determining stages).

That would be great.  I had been planning on just copying the code, but this is much better.

So I can plan my work, do you have any idea about when this would be available?

Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

That would be great.  I had been planning on just copying the code, but this is much better.

So I can plan my work, do you have any idea about when this would be available?

I might be able to get it transitioned tonight but I'm not sure when the next release that would contain the change would be. I can shoot for by the end of the week.

Link to comment
Share on other sites

10 hours ago, linuxgurugamer said:

Ok, no rush, I have LOTs of other stuff to do :D

Alright, it's in the development branch right now but I haven't actually tested it yet. As of right now it's just one method that takes a List<Part> and you have to split into stages yourself. I need to think of a good way of representing different stages without using any custom classes (probably just a ConfigNode) and then I might add in another method that does the splitting automatically. If it's not really needed then I won't even bother with that.

Link to comment
Share on other sites

  • 3 weeks later...

@magico13

Thx for the new release and much thx for fixing this NRE. This declutters the error log of my highly modded install much. Very appreciated!

EDIT: Oh, tested without a chute on the dropped parts. With chute I still have an NRE. (Using Realchute and Safechute mod, too). Any chance to get this out of the log?

Spoiler

170123T144229.321 [INFO] [SCANsat.SCAN_Data.SCANdata.generateHeightMap] [SCANsat] Height Map Of [Eve] Completed...
170123T144237.638 [INFO] [Chatterer.chatterer.begin_exchange] [CHATR] Capsule starts the exchange...
170123T144238.337 [INFO] [SCANsat.SCAN_Data.SCANdata.generateHeightMap] [SCANsat] Height Map Of [Gilly] Completed...
170123T144238.370 [INFO] [SCANsat.SCANcontroller.checkHeightMapStatus] [SCANsat] All Height Maps Generated
170123T144253.268 [INFO] [Vessel.CheckKill] [F: 147847]: Vessel Untitled Space Craft Debris was on-rails at 1.0 kPa pressure and was destroyed.
170123T144253.269 [INFO] [RSTUtils.Utilities.Log] 1/23/2017 2:42:53 PM,DeepFreeze,DeepFreezeEvents onVesselWillDestroy d55b4c22-6e82-48ae-afc8-028408d39587
170123T144253.278 [INFO] [KerbalKonstructs.Core.Log.Normal] KK: OnVesselRecoveryRequested
170123T144253.279 [INFO] [KerbalKonstructs.Core.Log.Normal] KK: OnVesselRecoveryRequested is career
170123T144253.279 [INFO] [KerbalKonstructs.Core.Log.Normal] KK: Distance to KSC is 40264.8218158957
170123T144253.280 [WARNING] [ConfigNode.Load] File 'D:/Spiele/Steam/SteamApps/common/KSP/KSP_x64_Data/../saves/122-Twitch/KK.cfg' does not exist
170123T144253.282 [INFO] [KerbalKonstructs.Core.Log.Normal] KK: SpaceCenter set to: SpaceCenterMarker
170123T144253.283 [INFO] [StageRecovery.StageRecovery.VesselDestroyEvent] [SR] Searching in RecoveryQueue (0) for d55b4c22-6e82-48ae-afc8-028408d39587
170123T144253.284 [INFO] [StageRecovery.RecoveryItem.Process] [SR] Altitude: 24931.2459160229
170123T144253.292 [ERROR] [StageRecovery.StageRecovery.GetChuteArea] [SR] Error occured while trying to determine total chute area.
170123T144253.293 [EXCEPTION] [StageRecovery.StageRecovery.GetChuteArea] InvalidCastException: Cannot cast from source type to destination type.
   at StageRecovery.StageRecovery.GetChuteArea (System.Collections.Generic.List`1 parts)
   at UnityEngine.Debug:LogException(Exception)
   at StageRecovery.StageRecovery:GetChuteArea(List`1)
   at StageRecovery.StageRecovery:ProcessPartList(List`1)
   at StageRecovery.RecoveryItem:DetermineTerminalVelocity()
   at StageRecovery.RecoveryItem:Process()
   at StageRecovery.StageRecovery:VesselDestroyEvent(Vessel)
   at EventData`1:Fire(Vessel)
   at Vessel:Die()
   at Vessel:CheckKill()
   at VesselPrecalculate:MainPhysics(Boolean)
   at VesselPrecalculate:FixedUpdate()
170123T144253.295 [INFO] [StageRecovery.RecoveryItem.DetermineTerminalVelocity] [SR] Vt: 200
170123T144253.295 [INFO] [StageRecovery.RecoveryItem.TryPoweredRecovery] [SR] Trying powered recovery
170123T144253.296 [INFO] [StageRecovery.RecoveryItem.ReduceSpeed_Engines] [SR] Attempting to use engines to reduce speed from 200 to 4
170123T144253.297 [INFO] [StageRecovery.RecoveryItem.ReduceSpeed_Engines] [SR] Stage not controlled. Can't perform powered speed reduction.
170123T144253.298 [INFO] [StageRecovery.RecoveryItem.SetRecoveryPercentages] [SR] Distance: 40264.82
170123T144253.299 [INFO] [KerbalKonstructs.Core.Log.Normal] KK: onVesselRecovered called
170123T144253.300 [INFO] [Vessel.Die] [Vessel Untitled Space Craft Debris]: Vessel was destroyed.
170123T144253.303 [INFO] [InfernalRobotics.Command.ServoController.OnVesselUnloaded] IR: [ServoController] OnVesselUnloaded, v=Untitled Space Craft Debris
170123T144306.989 [INFO] [TimeControl.Log.Write] [1/23/2017 2:43:06 PM] [TimeControl(2.50): ]: <Info> (TCGUI.onShowUI) - Unhiding GUI for Settings Lock
170123T144306.989 [INFO] [KSP.UI.UIMasterController.ShowUI] [UIMasterController]: ShowUI
170123T144306.990 [INFO] [FlightDriver.SetPause] Game Paused!
 

 

Edited by Jebs_SY
Link to comment
Share on other sites

1 hour ago, Jebs_SY said:

Any chance to get this out of the log?

Well, that appears to be an actual error, not just the harmless one that pops up. Looks like it's not working correctly with RealChute :( I'll get that fixed tonight.

Link to comment
Share on other sites

On 12/1/2016 at 3:01 AM, Jacchus said:

It's an awesome and very useful mod, a must have for my career.

But now I was using "drop-probes" for science and my question is:

 

Should be posible to add a "desactivate" button on the fly?

As this mod will only activate when KSP would otherwise just delete the vessel in question, disabling his mod would do you no good.

If you want drop-probes to work, you will need to find a way to get them onto the ground before KSP wants to delete them, all StageRecovery does is make it less expensive when this happens.

 

On 12/24/2016 at 11:07 AM, Loren Pechtel said:

Love this thing but I've got a mystery.

A couple of months ago (game time) I dropped a booster in a barely suborbital trajectory--periapsis was fairly high in the atmosphere.  I figured I might lose it to the fire but I didn't expect what happened.

I was cleaning up empty space capsules after rescue missions and I noticed it in the list--how could it still be flying?!?!

To compound things I switched to it to see what's going on--and since it's in the fire it won't let me switch away so I just have to wait it out and see what happens....the engine blew up, that shed enough weight that the rest of it slowed pretty quickly and survived.

While a part is out of focus, it is 'on-rails' and it's orbit will not change unless it goes low enough in the atmosphere to count as 'destroyed'.

This is stock behavior.

Link to comment
Share on other sites

Getting some unwanted behavior:

 

Additional Information:

RealChute Module used.

Terminal velocity of 2068.39 (less than 12 needed)

Attempted propulsive landing but could not find a point of control.  Add a pilot or probe core with SAS for propulsive landings.

Stage contained the following parts:

1 x Rockomax Brand Decoupler

1 x Rockomax X200-128-FTP 2.5m Fuel Tank

1 x RE-M3 "Mainsail" Liquid Fuel Engine

8 x RealChute Radial Chute

Nothing about burning up.  It happens every time with this rocket.  The SRBs that fall off earlier recover fine.  In the past a stage discarded at that speed had a small chance of destruction, not a certainty and it would get a message about burning up if that happened.

Link to comment
Share on other sites

58 minutes ago, Loren Pechtel said:

The SRBs that fall off earlier recover fine

Did those have RealChute parachutes as well? The chance of a 2069 m/s stage burning up is pretty low, but you should definitely get a message if that was the case. It looks like it's not recognizing the chutes, but it's recognizing that a realchute module is used. Could be related to the changes I made that were supposed to fix an issue with RealChute. If you get a chance, logs would be appreciated and I'm curious if the editor helper tool works correctly.

Edited by magico13
Link to comment
Share on other sites

22 minutes ago, magico13 said:

Did those have RealChute parachutes as well? The chance of a 2069 m/s stage burning up is pretty low, but you should definitely get a message if that was the case. It looks like it's not recognizing the chutes, but it's recognizing that a realchute module is used. Could be related to the changes I made that were supposed to fix an issue with RealChute. If you get a chance, logs would be appreciated and I'm curious if the editor helper tool works correctly.

The SRBs do not use RealChutes, they're using the ones from LET.

I'm not getting a message one way or another about the booster that's discarded on the way back, again with RealChutes.  It's always been problematic, though, so I hadn't paid much attention to it.  If I were to jettison it in space the odds of destruction would be very high, what I normally do is leave it on and burn any remaining fuel as low in the atmosphere as I can without it going boom.  This greatly increases its survivability but it's still iffy.

This time it did recover, though.  I separated it at 1,800 m/s and it recovered--it uses RealChutes.  I was holding onto it as long as I could but had to jettison when it started to threaten my stability.

I also have been having problems with RealChutes behaving like chutes used to before 1.2--you have to pull them at the right time rather than staging them when you drop the booster and they simply work.

Link to comment
Share on other sites

Hmm, weird that it sounds like RealChutes is working but sometimes not :/ (hey, they added a face for that finally!) Could be RealChute itself I guess... Btw, for stages that are burning up like they'll now do a "reentry" burn if they're controlled. Same mechanics as powered recovery, but it'll first drop the speed to the DRMaxVelocity setting to avoid burning up.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...