Jump to content

How does KSP handle out of range vessels?


Recommended Posts

Dunno whether this comes under gameplay, mods or general discussion but here goes... I have a couple of large vessels in orbit, each with several hundred parts, which cause quite a lag-fest when in view. However, is there any performance hit in tracking a large vessel over a small one while it's out of sight?

Presumably it takes KSP time to read through and handle all the parts every time it updates the persistent.sfs file even when the vessel is out of view. Is it constantly updating the whole vessel in any other file while I'm playing elsewhere?

The reason I ask is that I have written an editor to quickly remove a vessel (including the trajectory data) from the persistent.sfs so it can be pasted into another save and I wonder if it is worth extending the editor to insert a 'placeholder' (eg a single probe core) into the current file to carry on orbiting out of sight, while freeing up CPU capacity for my current mission.

Edited by percyPrune
Formatting went to pot!
Link to comment
Share on other sites

Physics for a vessel are unloaded when it get's outside of a range of about 2.5 km around the active vessel (the one you are controlling at the moment). It will go 'on-rails'. That means only its orbit is calculated, nothing else (just like when you activate timewarp in space). When the periapsis is at <30 km above ground it will get deleted because the devs said, that one can assume a burn-up or crash. Above 30 km the vessel will be perfectly fine as the atmosphere doesn't have any effect on the craft without loaded physics.

That 'on-rails' mode costs almost no computing power. Some people say they feel a performance hit when they have a lot of vessels on-rail. I never experienced that (even with 20+ vessels).

Edited by *Aqua*
Link to comment
Share on other sites

I found my lower stage should survived after I jettison it.

Maybe it skips the whole atmosphere due to time warp.

My final stage was on LKO so I can time warp at 50x at most, however. I don't think that's enough to skip the re-entry.

Link to comment
Share on other sites

I found my lower stage should survived after I jettison it.

Maybe it skips the whole atmosphere due to time warp.

My final stage was on LKO so I can time warp at 50x at most, however. I don't think that's enough to skip the re-entry.

That depends. If you are in timewarp and your active craft enters the atmosphere you are pulled out of warp. But unloaded debris doesn't, so it will keep going through the atmosphere on rails. On rails means no physics calculated, and thus no drag, and thus no effect from the atmosphere

Link to comment
Share on other sites

I think Kerbal updates the persistance file every time you change scene or at other times when it flashes up saving.

Writing even a large persist file doesn't take very long, the time it takes seems pretty insignificant and it might even be doing it on another thread.

Link to comment
Share on other sites

Thanks for the quick reply. I take it that the individual parts aren't read then.

Yes. Whether it's a single piece of debris or a vessel of 2000 parts makes no difference when it is "on rails". You can still bog down your game by having many individal vessels (e.g. accumulate lots of debris).

Link to comment
Share on other sites

Thanks for the quick reply. I take it that the individual parts aren't read then.

Correct.

For unfocused, on-rails craft, a few checks are made.

One is sphere-of-influence - ships can change SoI in the background and the orbits are recalculated in the new SoI. This is why, at high warps, a ship's orbit after SoI cahnge can be very different from the predicted trajectory before the change.

Another is a deletion check - if the ship has a negative altitude on any body (i.e. sub-surface) or is in atmosphere with an atmospheric pressure greater than 1% of the datum (or sea level) pressure for that body (this translates to about 23 km on Kerbin) is deleted, as it is deemed to have crashed and been destroyed.

I can't think of any other checks that are made.

The upshot is that the number of ships may have a performance cost (those checks aren't free), but the number of parts does not, for unloaded (on-rails) ships.

Link to comment
Share on other sites

Size doesn't matter for trajectory calculations in a vacuum. Beyond that, I don't think they calculate much of anything for ships that don't have focus. A few days ago I sent two ships to the same planet and tried to aerobrake them both at the same time. Only the one with focus slowed down. The other one continued on as if the atmosphere didn't exist at all.

Also, I was able to defeat atmospheric friction at Duna by having the pilot go on EVA. Not sure what happened there.

Link to comment
Share on other sites

That 'on-rails' mode costs almost no computing power. Some people say they feel a performance hit when they have a lot of vessels on-rail. I never experienced that (even with 20+ vessels).

I've had more than 100 flights ongoing at once, and I'll tell you there is a decrease in performance.

Link to comment
Share on other sites

I've had more than 100 flights ongoing at once, and I'll tell you there is a decrease in performance.

What is the number of debris flying around? Each debris object acts like a vessel until it gets deleted. I saw people on YouTube which build a Kessler syndrome and it didn't look like they had a problem with the performance. But we can assume they have a pretty powerful computer which may able to run a higher amount of vessels without slowdowns.

For example:

Yeah, his time display is yellow meaning the simulation starts to slow down. But look at the number of debris! I can't read it for sure but it appears to be >3000. Also his computer had to record a video at the same time so the slow down could be caused by that. I don't know for sure.

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...