Jump to content

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


magico13

Recommended Posts

On 12/26/2015 at 0:56 PM, magico13 said:

Ah crap. I forgot to test powered recovery with pre-recovered kerbals. Try it with a probe core and it should work. I'll have to add in some code for pre-recovered kerbals. I might not get a chance to do that today.

 

Edit (12/29/2015): Small bugfix update to make powered recovery work with pre-recovered Kerbals. Should work properly now for you @amo28 but let me know if you see anything else weird. Sorry I didn't get to it sooner, the holidays has meant lots of travel and time with family.

Thanks magico!

I'll give this a shot tonight and report back.

Update:

Still seeing the same behavior. Kerbals get recovered before it tries powered recovery, then doesn't have a pilot to control with.
The other concerning part is that I don't actually find the Kerbals recovered. I did a separate test with a parachute on the plane just to see that it would recover without powered recovery. The parts recovered, but the Kerbals did not. In the SR UI, it didn't show any crew under the "CREW" tab. Unfortunately, I didn't capture the log on that first test.

Here's the log for the powered recovery test.

[LOG 21:53:03.434] [SR] Vessel LR-EX2 is going to be destroyed. Recovering Kerbals!
[LOG 21:53:03.435] [SR] Pre-recovered Iosif Yerkhov
[LOG 21:53:03.435] [SR] Pre-recovered Rebecca Vasquez
[LOG 21:53:03.435] Packing LR-EX2 for orbit
[LOG 21:53:03.516] Vessel LR-EX2 was on-rails at 58.7 atm pressure and was destroyed.
[LOG 21:53:03.523] [SR] Searching in RecoveryQueue (0) for 89df3357-c2dd-4b10-aea5-f099ed97fa6f
[LOG 21:53:03.523] [SR] Altitude: 4373.85265758075
[LOG 21:53:03.523] [SR] Vt: 200
[LOG 21:53:03.523] [SR] Trying powered recovery
[LOG 21:53:03.523] [SR] No kerbal pilot found, searching for a probe core...
[LOG 21:53:03.523] [SR] No probe core with SAS found.
[LOG 21:53:03.524] [SR] Final Vt: 200
[LOG 21:53:03.524] [SR] Distance: 51788.31
[LOG 21:53:03.528] [Vessel LR-EX2]: Destroyed. No crews were aboard.
[LOG 21:53:03.531] proceduralTankRealFuels area: 8.56060127006808
[LOG 21:53:03.531] proceduralTankRealFuels area: 3.02508222828088
[LOG 21:53:03.531] RemoteTech: SatelliteManager: OnVesselDestroy(89df3357-c2dd-4b10-aea5-f099ed97fa6f, LR-EX2)
[LOG 21:53:03.531] RemoteTech: SatelliteManager: UnregisterProto(89df3357-c2dd-4b10-aea5-f099ed97fa6f)
[LOG 21:53:03.535] -INFO- Tac.LifeSupportController[FFD897A4][2847.48]: Deleting vessel LR-EX2 - vessel does not exist anymore
[LOG 21:53:03.535] -INFO- Tac.LifeSupportController[FFD897A4][2847.48]: Deleting crew member: Iosif Yerkhov
[LOG 21:53:03.535] -INFO- Tac.LifeSupportController[FFD897A4][2847.48]: Deleting crew member: Rebecca Vasquez

 

Edited by amo28
Update
Link to comment
Share on other sites

Hey Magico!

First of all I would like to thank you for making this amazing mod! I just have a quick question though, on the manual it says that if you attach a probe core or a Kerballed command pod you get 100% of the value back. Are there any other conditions that must be met for the 100% recovery? I can't seem to get it to work no matter what i do.

Thanks again!

Link to comment
Share on other sites

On 12/21/2015 at 6:26 PM, magico13 said:

On the Editor Helper GUI front there were substantial improvements…

Hell YEAH there were!  I finally got to play with this today and I cannot express the depth and breadth of my love for this enhancement.  Thank you!

Link to comment
Share on other sites

On 12/21/2015 at 6:38 PM, smjjames said:

Oh cool. I was wondering myself about how to tell if the chutes are enough for a given stage, aside from some trial and error.

Yeah, I've always been doing trial-and-error tests (using KCT simulations) of all my reentry vessels and boosters.  I'll have to give the new tools a look-see since I didn't know SR offered preview estimates.

I'm sure I'll still use KCT simulations though, as I also have to test things like clean booster separation, tumble resistance, control issues, Smart Parts deployments at correct altitudes, etc.

Link to comment
Share on other sites

16 hours ago, amo28 said:

Thanks magico!

I'll give this a shot tonight and report back.

It seems that the vessel isn't being added to the RecoveryQueue, thus it isn't found in there when the destruction happens, hence it not recovering properly. I think I know where to look, so I'll have something for you to test later today.

14 hours ago, YelloCanvas said:

Hey Magico!

First of all I would like to thank you for making this amazing mod! I just have a quick question though, on the manual it says that if you attach a probe core or a Kerballed command pod you get 100% of the value back. Are there any other conditions that must be met for the 100% recovery? I can't seem to get it to work no matter what i do.

Thanks again!

That's only for the flat rate model and only applies to the speed percentage. I'll update the OP to make that clearer. It's an artifact of when the Flat Rate model was the default, rather than the variable rate model that's used now. With the variable rate you don't need a probe or command pod at all for 100% speed percentage, just to be below the low cutoff velocity (default of 6 m/s). The distance percentage is always less than 100%: it starts at 98% (same as recovery at KSC) and drops to 10% at some distance based on the Tracking Station level (either quarter of the way around Kerbin, 3/8 of the way around, or 1/2 way around). So maximum total recovery you can get in 98% with any model.

11 hours ago, meyerweb said:

Hell YEAH there were!  I finally got to play with this today and I cannot express the depth and breadth of my love for this enhancement.  Thank you!

If you have any suggestions for it, let me know. The current version is just a first draft for it since I'm not sure how many people will actually use it, or what info they want to see in it. I'm thinking some way of calculating powered recovery from within the editor would be useful, but I don't want to take the time to add that if it'll never be used :P

6 hours ago, robson1000 said:

Is this mod still working in Tracking Station? After updating, when I trying to recover in Tracking Station the stage is deleted, but there is no message from this mod, of course I'm doing this when stage is in the atmosphere.

Try just letting the stage "crash" into Kerbin by itself. It should still work, though pre-recovery of Kerbals doesn't work there. For whatever reason stages aren't destroyed around 23km like they should be in the Tracking Station, it seems the atmosphere no longer can be polled while in that scene. If it's not working after the stage crashes and is deleted, let me know.

5 hours ago, WuphonsReach said:

Yeah, I've always been doing trial-and-error tests (using KCT simulations) of all my reentry vessels and boosters.  I'll have to give the new tools a look-see since I didn't know SR offered preview estimates.

I'm sure I'll still use KCT simulations though, as I also have to test things like clean booster separation, tumble resistance, control issues, Smart Parts deployments at correct altitudes, etc.

Simulations and other tests are always the best, but the Editor Helper is nice when you just want a quick and dirty check to see if things will be recovered. There's also a discrepancy between what SR thinks the landing speed will be and what physics thinks it will be, and SR's value is the one that matters for recovery through SR (obviously). The Editor Helper gives those estimates, but testing and watching something land will frequently give different values. The new Helper is much nicer than the old one since you can get estimates for each stage on a full ship, rather than having to break it into pieces to check each stage individually.

Link to comment
Share on other sites

Hey @magico13, sometimes I get a spam of this exception:

NullReferenceException: Object reference not set to an instance of an object
  at StageRecovery.RecoveryItem.DetermineIfBurnedUp () [0x00000] in <filename unknown>:0 

  at StageRecovery.RecoveryItem.Process () [0x00000] in <filename unknown>:0 

  at StageRecovery.StageRecovery.VesselDestroyEvent (.Vessel v) [0x00000] in <filename unknown>:0 

  at EventData`1[Vessel].Fire (.Vessel data) [0x00000] in <filename unknown>:0 

  at Vessel.Die () [0x00000] in <filename unknown>:0 

  at Part.Die () [0x00000] in <filename unknown>:0 

  at Part.explode () [0x00000] in <filename unknown>:0 

  at Part.FixedUpdate () [0x00000] in <filename unknown>:0 

I'm not sure whether it has to do with any specific part, but it seems to happen when one of the heat management radiators is on a ship (or debris) that explodes and burns up in the atmosphere. It usually stops when the chutes on the focused ship fully deploy or land, but this time it didn't stop until I went to KSC, I'm running 1.6.1

Also, I was getting spammed with this exception this time:

ArgumentOutOfRangeException: Argument is out of range.

Parameter name: index
  at System.Collections.Generic.List`1[FlightIntegrator+OcclusionData].get_Item (Int32 index) [0x00000] in <filename unknown>:0 

  at FlightIntegrator.UpdateOcclusionConvection () [0x00000] in <filename unknown>:0 

  at FlightIntegrator.UpdateOcclusion () [0x00000] in <filename unknown>:0 

  at FlightIntegrator.FixedUpdate () [0x00000] in <filename unknown>:0 

Output log: http://sta.sh/0uxxa75uz02

Link to comment
Share on other sites

@amo28 and @smjjames, can you try out the latest .dll from the build server (just click the StageRecovery.dll file under "Last Successful Artifacts")? I think it should fix the problems you're both seeing (hopefully). If not then I'll do some more experimenting.

Edited by magico13
Link to comment
Share on other sites

Thanks @magico13

Saw some definite changes with the new build. It found pilots, attempted powered recovery, but the [SR] entries in the log end abruptly and the recovered Kerbals are killed, vessel destroyed.
See below:

[LOG 20:11:40.109] LR-EX2 Unloaded
[LOG 20:11:40.250] RemoteTech: AntennaManager: RegisterProtos(LR-EX2, d6c1b1f7-a83f-42b0-8b37-23508d35daf9)
[LOG 20:11:40.272] RemoteTech: SatelliteManager: RegisterProto(LR-EX2, d6c1b1f7-a83f-42b0-8b37-23508d35daf9)
[LOG 20:11:40.272] RemoteTech: GetSignalProcessor(LR-EX2): Check
[LOG 20:11:40.295] [SR] Vessel LR-EX2 is going to be destroyed. Recovering Kerbals!
[LOG 20:11:40.296] [SR] Pre-recovered Iosif Yerkhov
[LOG 20:11:40.296] [SR] Pre-recovered Rebecca Vasquez
[LOG 20:11:40.296] Packing LR-EX2 for orbit
[LOG 20:11:40.347] Vessel LR-EX2 was on-rails at 48.8 atm pressure and was destroyed.
[LOG 20:11:40.354] [SR] Searching in RecoveryQueue (1) for d6c1b1f7-a83f-42b0-8b37-23508d35daf9
[LOG 20:11:40.354] [SR] Found vessel in the RecoveryQueue.
[LOG 20:11:40.355] [SR] Altitude: 5760.0425086692
[LOG 20:11:40.357] [SR] Vt: 200
[LOG 20:11:40.361] [SR] Trying powered recovery
[LOG 20:11:40.361] [SR] Found a kerbal pilot!
[LOG 20:11:40.362] [SR] Final Vt: 200
[LOG 20:11:40.363] [SR] Distance: 94120.02
[LOG 20:11:40.365] [SR] Found pre-recovered Kerbals
[LOG 20:11:40.365] FF: kerbal status change: Iosif Yerkhov from Assigned to Dead
[WRN 20:11:40.365] FF: hall of fame entry for kerbal Emilia Volvakova already existing
[LOG 20:11:40.365] FF: creating new hall of fame entry for kerbal Lynn Jones
[WRN 20:11:40.365] FF: hall of fame entry for kerbal Rebecca Vasquez already existing
[WRN 20:11:40.365] FF: hall of fame entry for kerbal Iosif Yerkhov already existing
[WRN 20:11:40.365] FF: hall of fame entry for kerbal Gary Craig already existing
[LOG 20:11:40.366] FF: hall of fame refreshed
[LOG 20:11:40.366] FF: kerbal status change: Iosif Yerkhov from Dead to Dead
[WRN 20:11:40.366] FF: hall of fame entry for kerbal Emilia Volvakova already existing
[WRN 20:11:40.366] FF: hall of fame entry for kerbal Lynn Jones already existing
[WRN 20:11:40.366] FF: hall of fame entry for kerbal Rebecca Vasquez already existing
[WRN 20:11:40.366] FF: hall of fame entry for kerbal Iosif Yerkhov already existing
[WRN 20:11:40.366] FF: hall of fame entry for kerbal Gary Craig already existing
[LOG 20:11:40.366] FF: hall of fame refreshed
[LOG 20:11:40.367] Added 61.23467 (150) reputation: 'VesselLoss'.
[LOG 20:11:40.442] [VCTScenario] Detected discrepancy in rep totals: admin shows 668.5172, VCT shows 668.5172; correcting with [CurrencyTransaction: TimeStamp=57601479.2947606, Reason=None,FundsDelta=0, ScienceDelta=0, ReputationDelta=-88.76538].
[LOG 20:11:40.442] [00:03:46]: Iosif Yerkhov was killed.
[LOG 20:11:40.442] FF: kerbal status change: Rebecca Vasquez from Assigned to Dead
[WRN 20:11:40.442] FF: hall of fame entry for kerbal Emilia Volvakova already existing
[WRN 20:11:40.442] FF: hall of fame entry for kerbal Lynn Jones already existing
[WRN 20:11:40.442] FF: hall of fame entry for kerbal Rebecca Vasquez already existing
[WRN 20:11:40.442] FF: hall of fame entry for kerbal Iosif Yerkhov already existing
[WRN 20:11:40.442] FF: hall of fame entry for kerbal Gary Craig already existing
[LOG 20:11:40.442] FF: hall of fame refreshed
[LOG 20:11:40.442] FF: kerbal status change: Rebecca Vasquez from Dead to Dead
[WRN 20:11:40.442] FF: hall of fame entry for kerbal Emilia Volvakova already existing
[WRN 20:11:40.442] FF: hall of fame entry for kerbal Lynn Jones already existing
[WRN 20:11:40.442] FF: hall of fame entry for kerbal Rebecca Vasquez already existing
[WRN 20:11:40.442] FF: hall of fame entry for kerbal Iosif Yerkhov already existing
[WRN 20:11:40.442] FF: hall of fame entry for kerbal Gary Craig already existing
[LOG 20:11:40.442] FF: hall of fame refreshed
[LOG 20:11:40.442] Added 43.6719 (150) reputation: 'VesselLoss'.
[LOG 20:11:40.529] [VCTScenario] Detected discrepancy in rep totals: admin shows 712.1888, VCT shows 712.1888; correcting with [CurrencyTransaction: TimeStamp=57601479.2947606, Reason=None,FundsDelta=0, ScienceDelta=0, ReputationDelta=-106.3284].
[LOG 20:11:40.529] [00:03:46]: Rebecca Vasquez was killed.
[LOG 20:11:40.537] [Vessel LR-EX2]: Destroyed. No crews were aboard.
[LOG 20:11:40.539] proceduralTankRealFuels area: 3.02508222828088
[LOG 20:11:40.539] RemoteTech: SatelliteManager: OnVesselDestroy(d6c1b1f7-a83f-42b0-8b37-23508d35daf9, LR-EX2)
[LOG 20:11:40.539] RemoteTech: SatelliteManager: UnregisterProto(d6c1b1f7-a83f-42b0-8b37-23508d35daf9)
[LOG 20:11:40.542] -INFO- Tac.LifeSupportController[FFE9DD9A][1185.42]: Deleting vessel LR-EX2 - vessel does not exist anymore
[LOG 20:11:40.548] -INFO- Tac.LifeSupportController[FFE9DD9A][1185.42]: Deleting crew member: Iosif Yerkhov
[LOG 20:11:40.548] -INFO- Tac.LifeSupportController[FFE9DD9A][1185.42]: Deleting crew member: Rebecca Vasquez

 

Link to comment
Share on other sites

@amo28 alright, this time the vessel isn't having powered recovery do anything, presumably due to the engines. Can you upload the craft file you're using? I'd like to see the ModuleEngines in use. I'm adding some more debug code as well so if you can try out the new build when you get a chance and upload that section of the log again, I'd be grateful. There aren't any changes other than additional logging.

Link to comment
Share on other sites

Is anybody getting FPS drops while launching and in Kerbin orbit with the newer .dll or possibly 1.6.1? Because that's the only thing which I've updated today and I'm noticing that today, it seems worse with the new dll.

Edit: @magico13 Nope, the exception spam still isn't fixed, along with the massive FPS drop and glitching out sound. You know, it seems like it thinks my ship is exploding when it isn't and keeps looping explosion sounds.

Edited by smjjames
Link to comment
Share on other sites

@smjjamesthe fps drop might be because of the exception spam. You're seeing StageRecovery exceptions still being spammed with that new .dll? Can you upload the log again? There's not anything else I can think of that would be null and causing that exception :huh:

Link to comment
Share on other sites

Theres a FPS drop before the whole exception spam. Seems to be connected to the ship which has the part that is causing the problem.

You'll probably have to install and play around with heat management to see what's going on.

@magico13 Heres the output log: http://sta.sh/0l4rg2iajxg The later explosions and stuff was me messing around.

Edited by smjjames
Link to comment
Share on other sites

@smjjames are these things just blowing up, not going out of physics range? SR shouldn't really even be activating on those, but I can't think of a good way to avoid that off the top of my head right now. I surrounded the code that's currently throwing an error in a try/catch block so it should move past that part now, but I'm half expecting it'll hit a snag later on in the processing. If it does, let me know. I might have to come back to this tomorrow when my mind's fresher because there's probably an easy way to filter these situations out.

Link to comment
Share on other sites

5 minutes ago, smjjames said:

@magico13 Pretty sure they're just exploding rather than going out of physics range. Also, is there a new dll you want me to try? Sounded like you had made one in your post.

Yep, same link as before. If you'd rather wait I'll probably have another one tomorrow that will avoid trying to process exploding things.

Link to comment
Share on other sites

17 hours ago, magico13 said:

@amo28 alright, this time the vessel isn't having powered recovery do anything, presumably due to the engines. Can you upload the craft file you're using? I'd like to see the ModuleEngines in use. I'm adding some more debug code as well so if you can try out the new build when you get a chance and upload that section of the log again, I'd be grateful. There aren't any changes other than additional logging.

That must be the issue. I just looked at the craft file and there aren't ModuleEngine or ModuleEngineFX -- only ModuleEnginesRF and ModuleEnginesAJEPropeller. Craft here.
(Remember this is an RSS/RO/RP-0 save.)

I'll try out the new DLL and upload the log a bit later anyway.

Link to comment
Share on other sites

3 hours ago, amo28 said:

That must be the issue. I just looked at the craft file and there aren't ModuleEngine or ModuleEngineFX -- only ModuleEnginesRF and ModuleEnginesAJEPropeller. Craft here.
(Remember this is an RSS/RO/RP-0 save.)

I'll try out the new DLL and upload the log a bit later anyway.

Hmm, unfortunately those modules don't seem to provide the info I need in an easy to access manner so I'd have to do a pretty decent amount of work for them to work with powered recovery. This might be an instance where FMRS might serve you better. I'll make a not on GitHub to look into supporting those in the future though. I'll have to dig around in the source code of whichever mods add those modules to figure out how to extract the info I need.

1 hour ago, smjjames said:

@magico13 I'm still getting the exception spam. Looks like it's when it goes out of range (I think) rather than explode.

Can you upload that section of the log again? I'm curious if it made it any further in the process. I didn't get a chance to change up the code today like I had planned, though there are already checks that should prevent anything from happening unless the vessel is either packed or unloaded (and I'm not sure explosions can happen in either case, though maybe in the packed case). I'm still having trouble wrapping my head around what is happening and what could be triggering the error.

Link to comment
Share on other sites

I'll have to reproduce it because I don't have the log anymore due to needing to restart due to memory leaks.

edit: I noticed that it wasn't spamming explosion sounds, so, that's progress I guess.....

Edited by smjjames
Link to comment
Share on other sites

I'm going to test it out on my stripped down branchoff KSP, maybe get better data that way or something, and also reduce the noise in the output log.

@magico13 Did some testing last night in an attempt to try to understand when it was happening.

Output log: http://sta.sh/0qkyhawuo77

Edited by smjjames
Link to comment
Share on other sites

18 hours ago, smjjames said:

I'm going to test it out on my stripped down branchoff KSP, maybe get better data that way or something, and also reduce the noise in the output log.

Alright, I think I fixed it now. StageRecovery expects things with ModuleAblator to have the Ablator resource on them (aka, heat shields), but the radiators from Heat Management use a different resource. I've changed StageRecovery to now look for whatever resource is defined as the ablativeResource in the ModuleAblator on the part. If you grab the latest .dll from the build server than I think it should work properly for you :)

Link to comment
Share on other sites

Suggestion for distance costs.  Upgrades at KSC should reduce the losses due to distance.  Maybe tie it to the tracking center.

TC default level = normal losses due to distance

TC mid-level = distance loss reduced by 20%

TC top-level = distance loss reduced by 50%

Link to comment
Share on other sites

16 hours ago, WuphonsReach said:

Suggestion for distance costs.  Upgrades at KSC should reduce the losses due to distance.  Maybe tie it to the tracking center.

TC default level = normal losses due to distance

TC mid-level = distance loss reduced by 20%

TC top-level = distance loss reduced by 50%

The Tracking Station actually does factor in, but it starts with penalties and has the "standard" at Tier 3.

Tier 1: MaxDist is cut in half such that recovery is 98% at KSC and 10% a quarter of the way around Kerbin (and any further distances) (about 1000 km up to 1/2 way around Kerbin which is ~1900km)

Tier 2: MaxDist is 3/4 normal. 98% at KSC and 10% at 3/8 of the way around Kerbin (about 1400km)

Tier 3: MaxDist is normal (1/2 Kerbin circumference). 98% at KSC and 10% at 1/2 Kerbin (~1900 km, the absolute maximum distance from KSC you can get)

 

StageRecovery should never give higher returns than a manually landing, so I went with slight penalties for lower tiered tracking stations. If you recover stages near KSC nearly all the time then the differences aren't even noticeable; it only comes up for recoveries that happen far away from KSC.

Here's a chart that demonstrates all this:

O1bssLa.png

 

 

Edit: Released version 1.6.2 which should fix the issues with the Heat Management mod and fixes a bug where things that unload below 23km aren't added to the Recovery Queue (the thing that makes pre-recovery work)

Edited by magico13
Link to comment
Share on other sites

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