Jump to content

[1.12.x] StageRecovery - Recover Funds+ from Dropped Stages


linuxgurugamer

Recommended Posts

  • 6 months later...
On 5/12/2023 at 9:35 AM, Mark L said:

Hi, I have a problem that has also been mentioned in this thread. It's when Stage Recovery and Real Chutes are both installed together, causing lag/stuttering in the VAB.

 

On 5/14/2023 at 10:44 AM, linuxgurugamer said:

Stage Recovery is doing lots of calculations, trying to keep track of all the chutes.  What I see happening is the following:

You select a part

You then start waving that part around.  Notice how, when you move the mouse over the rocket, it actually puts down 8 parachutes for a moment, then removes them

It's that moment when KSP creates 8 new parachutes, and calls all the modules which are in each part.  There are at least three modules in each RC part, so you now are initializing 24 modules, and then almost immediately destroying all those modules.  If you don't have a fast computer, you are going to see the lag.

Regarding Stage Recovery, it doesn't add any modules to the parts, but, it is doing calculations anytime the ship is modified.  With what you are doing, I believe it is being called numerous times per second while your mouse is moving over the ship.  Notice that there isn't any lag when the mouse is not over the vessel.

The only think I can suggest doing is to increate the VAB Autocalculation delay a bit to try to avoid all the multiple recalculations

 

I've hunted down the source of the issue here. It seemed to be a drastic overuse of Reflection calls to obtain the RealChute assembly, calling it quite literally every time any singular chute part was iterated over!

I've opened a pull request that solves this issue by caching the obtained Reflection info. With an i7-13700K I've gone from horribly stuttering for a good 1.5-3.0s every time I pick up/place down a part on large crafts to being buttery smooth.

Link to comment
Share on other sites

22 hours ago, TuckMeIntoBread said:

I've hunted down the source of the issue here. It seemed to be a drastic overuse of Reflection calls to obtain the RealChute assembly, calling it quite literally every time any singular chute part was iterated over!

I've opened a pull request that solves this issue by caching the obtained Reflection info. With an i7-13700K I've gone from horribly stuttering for a good 1.5-3.0s every time I pick up/place down a part on large crafts to being buttery smooth.

Good job, hope it gets a fix.

Link to comment
Share on other sites

New release, 1.9.7

  • Thanks to github user @TuckMeIntoBread for this:
    • Optimize Reflection Usage in ProcessRealchute Method.  This pull request introduces optimizations to the ProcessRealchute method, significantly improving performance and all but eliminating VAB hiccup/lags related to StageRecovery + RealChute being used in combination.
       
Link to comment
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.

×
×
  • Create New...