Jump to content

An observation of the effects of flights in progress


RTS321

Recommended Posts

I'm not sure if this is already common knowledge, but as a quick Google search yielded no appropriate results so I thought I would share an observation I made today on the subject of frames per second (I apologise if this as already been discussed):

We all know that higher part counts contribute massively to lower FPS, however I have noticed with all three of my saves (0.20,0.21 and 0.23) that I can start with relatively high part counts (100+) and see no lag whatsoever, but as I progressed it seemed as if the same ships induced more and more lag.

Until today, I assumed that I was just imagining this phenomenon, but as I spent a while on KSP I managed to launched several ships, increasing the number of flights by about a third. This seemed to have the overall effect of slowing the game down slightly, so I did a quick experiment to see if my hypothesis was correct in a new save; I used a 111 part rocket on the launchpad to test the number of fps with different numbers of flights in progress. These are my results:

0 Other flights: 39 fps

25 Other flights: 28 fps

50 Other flights: 15 fps

75 other flights: 13 fps

I'm not claiming that these tests were perfect; to start with there aren't enough results to draw a proper conclusion and furthermore I had several mods installed (Engineer Redux, Procedural Fairings, Remote Tech 2, Kethane and KAS) potentially invalidating it completely; but it does seem to me as if there is a strong correlation between the number of flights in progress and lower frames per second; I was wondering if anyone else had experienced something similar, or has any explanations as to why it happens.

EDIT: I have done more testing, the results are visible on page 4.

Edited by RTS321
Link to comment
Share on other sites

A big part of the lag is that the game has to compute data on the movement of ships you're not controlling. Each non-active "vessel" (even if it's just debris or a flag) adds about 1 part's worth of extra load on the game... ideally. In reality, it seems to add a fair bit more than that, likely due to a lack of optimizations. Certainly landed objects should not cause such absurd lag: they're at a stable location and (since we don't have on-rails geological effects like earthquakes or wind, let alone off-rails ones) should not have any need to have on-rails calculations run on them at all.

Link to comment
Share on other sites

Certainly landed objects should not cause such absurd lag: they're at a stable location and (since we don't have on-rails geological effects like earthquakes or wind, let alone off-rails ones) should not have any need to have on-rails calculations run on them at all.

Of course they need calculations. The game has to determine whether or not the Kraken will eat your landed ships while you're not looking :)

Link to comment
Share on other sites

The game's clearly doing "on-rails" calculations for inactive ships on per-frame basis. It has sense for a ship in close vicinity (e.g. if you're doing a rendezvous with your orbital station) but doesn't have much sense for ships far away especially if you're not in map view. So we can hope these things will get optimized in the future.

Link to comment
Share on other sites

I've noticed this as well, and now that I think about it, there is a reason why there's the option to get rid of persistent debris. I may go and get rid of all my debris now. 120 extra flights that are doing little but clutter the place up. Maybe some flags can go as well...

I will report back, fellow sufferers of frame-drop!

Link to comment
Share on other sites

Well, if each flight/debris is the equivalent of around a part, I now have a good reason not to leave upper stages in Low Kerbin Orbit!

Seriously though, after a while any industrious space program will accumulate hundreds of vessels and pieces of debris in orbit; it's no wonder the game eventually lags so much.

Link to comment
Share on other sites

I think Squads working on a lot of optimizations for .23. So let's hope that helps. I'll tell ya what though it gives you a good reason to properly dispose of your spent stages.

While were on this topic I figure id ask. Has anyone experienced symptoms of a memory leak? My game will run smoothly for a few hours. Then crash to desktop ( or just lock up on a scene transition ). Restart.. its good for a few more hours. Then another random crash. So could this be a potential leak? Because my gamedata folder is only at 1.6gb. Should be plenty of room for spikes.

Link to comment
Share on other sites

I said I'd report back, so here I am: Biiiig improvement in my frame rate with the removal of all my debris and several unnecessary flags. It's still not perfect, but it is far superior to what I was experiencing.

Now to wait for 0.23 and it's optimisations (hopefully, anyway).

Link to comment
Share on other sites

I also tried removing orbital debris:

Before removal, my 100 part ship received 24 fps without moving the camera on the launchpad;

After removing 54 jettisoned upper stages and other miscellaneous debris, the same ship under the same conditions achieved 26 fps.

This seems very minor when compared to the large differences described above, however I have a hypothesis as to why: When returning to the first post, we can see that the largest variations occurred between 0 and 50 other parts; the increase from 50 to 75 only reduced the framerate by 2 fps in comparison to the ten-or-so achieved by the previous two.This seemed irrelevant, and I considered by above results anomalous, until I remembered that I have 50 other flights not classified as debris still in progress.

Therefore I hypothesise that the negative impact of having more flights decreases sharply per flight after around 50 flights; beforehand it being relatively large.

If I can, I shall try to obtain more detailed results, especially between 0 and 50 flights, where most of the change appears to be taking place.

Link to comment
Share on other sites

I've also noticed a bit of buginess in the debris department, too.

It seems more often since .22 that the game incorrectly classifies obvious debris as a ship/rover/probe now, after staging. Also multiple parts have been left laying around without any designation at ALL, removing them from my ability to just terminate their "flights". And yet, if I cycle through the various vessels in an area, there they are, accepting the camera's focus as viable ships/debris.

Even weirder, removing another piece of debris in the area that is at least classified as something in the tracking station view will also silently remove those other "ghost" components.

Big head scratcher for sure, but I've noticed the flight count vs frame rate thing for quite a long time now, and figured it was already well enough known to not be concerned over it more than to just terminate any debris.

Link to comment
Share on other sites

If you want to nuke all your debris at once, go into the options and set persistent debris to 0. Load your save, then quit and raise the limit to where you want it again.

Which is fair enough, but the way the game is currently behaving, that will get rid of maybe half of the debris items out there. It may not do anything with the debris that was actually classified as a ship/rover/probe on detachment, or debris that never got a classification or name at all, for whatever kraken-provided reason....

Link to comment
Share on other sites

The game's clearly doing "on-rails" calculations for inactive ships on per-frame basis. It has sense for a ship in close vicinity (e.g. if you're doing a rendezvous with your orbital station) but doesn't have much sense for ships far away especially if you're not in map view. So we can hope these things will get optimized in the future.

the only thing here is... how does the game know when an object becomes close enough in order to need to calculate it, if it hasn't been continuously calculating it's location?... I think that's really why it doesn't matter how far away things are.

I think it might calculate based on SOI, that would make sense... no need to be calculating ship orbits over on jool if you're heading for the mun.

I wonder if the OP tested only in the SOI of Kerbin?

Link to comment
Share on other sites

My own hypothesis is that it's because of the orbits it has to keep track of.

Yes, exactly that. Background on-rails physics does not take much processing power, but it still does. Disappointing that even Landed craft are still a factor though.

Link to comment
Share on other sites

the only thing here is... how does the game know when an object becomes close enough in order to need to calculate it, if it hasn't been continuously calculating it's location?... I think that's really why it doesn't matter how far away things are.

I think it might calculate based on SOI, that would make sense... no need to be calculating ship orbits over on jool if you're heading for the mun.

I wonder if the OP tested only in the SOI of Kerbin?

It covers all craft/debris so that they will be correctly shown on the map screen at all times.

Link to comment
Share on other sites

Yes, exactly that. Background on-rails physics does not take much processing power, but it still does. Disappointing that even Landed craft are still a factor though.

Even more disappointing that flags are a factor. FLAGS!

In the end, I think OP has a dead-on observation, but I also think what we're experiencing at this point is a kind of peak in performance "bugs" resulting from a lot of content and feature additions over the versions, with not much optimization.

From what I understand, the next update will be focusing largely on tweaks and fixes that (I'm very hopeful) will address things like this, as well as some of the audio bugs the game has been increasingly offering up with each new version.

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