Jump to content

An observation of the effects of flights in progress


RTS321

Recommended Posts

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?

For instance it could iterate all objects within 1000 km from active ship. And the target. And all other can be iterated one per frame when not in map view. And maybe 30 per frame when in map view.

Also landed objects (such as flags, base stations, stranded Krebals, debris from landing failures) should not require any on-rails processing at all.

Edited by Kasuha
Link to comment
Share on other sites

For instance it could iterate all objects within 1000 km from active ship. And the target. And all other can be iterated one per frame when not in map view. And maybe 30 per frame when in map view.

Also landed objects (such as flags, base stations, stranded Krebals, debris from landing failures) should not require any on-rails processing at all.

Except their positions need to be updated with the rotation and orbit of the planet that they're on. As the landed vessel's relative coordinates change, the game has to keep track of that.

Link to comment
Share on other sites

Yeah, this is why I canceled my Keppler syndrome experiment. After getting 3 500+ part keppler bombs in orbit which generated a total of 1500+ separate bits of debris, the map view became a stuttering slide show whether debris was shown or not.

It was interesting to note how the debris fields slowly turned into a homologous ring of debris. After a few weeks of time warping, you couldn't tell one field from another since they were in the same orbit.

Link to comment
Share on other sites

Except their positions need to be updated with the rotation and orbit of the planet that they're on. As the landed vessel's relative coordinates change, the game has to keep track of that.

The fact is, it does not need any updating at all. According to what HarvesteR said during AMA in KSP the whole SOI rotates with the planet governing it. So when the planet is rotating before you in map view, it's in fact the camera what's running around the stationary planet.

Yes, you need to calculate position of the icon on the screen. But that's only limited to icons you can see.

Edited by Kasuha
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.

Good point. Testing for SOI changes is something else that needs to be done. I don't know if there's a solution for this, and what it is. I do invite everyone who thinks this is peanuts to solve to have a crack at it. That applies to pretty much every "why don't they..." discussion in this game, but I digress.

It's also good to keep in mind that the primary advantage of "on rails" patched conics is not to save computing cycles (although it's a nice benefit) but to prevent accumulating rounding errors.

Yeah, this is why I canceled my Keppler syndrome experiment. After getting 3 500+ part keppler bombs in orbit which generated a total of 1500+ separate bits of debris, the map view became a stuttering slide show whether debris was shown or not.

I think you're confusing the dude of the patched conics (Johannes Kepler, 16th/17th century) with Donald Kessler.

Link to comment
Share on other sites

Testing for SOI changes is something else that needs to be done. I don't know if there's a solution for this, and what it is.

That's an easy one. When you plot a maneuver, the game tells you exact time when each SOI change will occur. So the game can calculate that already. And to execute it right, it only needs to calculate that moment once for each on-rails object and execute it as part of performing the iteration when the time is up. Then, of course, calculate when the next SOI change will occur and store it as the next event, or execute it as well if the last time step was over that moment, too.

Link to comment
Share on other sites

That's an easy one. When you plot a maneuver, the game tells you exact time when each SOI change will occur. So the game can calculate that already. And to execute it right, it only needs to calculate that moment once for each on-rails object and execute it as part of performing the iteration when the time is up. Then, of course, calculate when the next SOI change will occur and store it as the next event, or execute it as well if the last time step was over that moment, too.

Good point. In fact, you could do that for litho-braking as well.

Link to comment
Share on other sites

The fact is, it does not need any updating at all. According to what HarvesteR said during AMA in KSP the whole SOI rotates with the planet governing it. So when the planet is rotating before you in map view, it's in fact the camera what's running around the stationary planet.

Yes, you need to calculate position of the icon on the screen. But that's only limited to icons you can see.

Along the lines of how a planet in KSP actually rotates, are insane Coriolis forces possible if the planet's rotation is sped up? Like how you would be thrown off the fast rotating planet's surface due to the fact that you are already moving beyond orbital velocity, and would have to literally hang on to the planet to prevent from being pulled away, that kind of stuff :0.0:

I was thinking that KSP may be able to at least mimic these forces due to the boost you get from launching east into orbit, but then again the devs haven't made Rama(-aliens) yet, so... :confused:

Link to comment
Share on other sites

Okay everybody, I have performed some more tests under different conditions, and although the conclusion is similar to the original one there is one key point I would like to make, but firstly, the results:

(Note, I removed all mods for these tests, which I did not for the original ones. The tests utilise a stock Kerbal X rocket on the launchpad, without moving the camera)

0 other flights - 42 fps

1 other flight - 41 fps

5 other flights - 38 fps

10 other flights - 36 fps

15 other flights - 33 fps

20 other flights - 34 fps

25 other flights - 33 fps

30 other flights - 31 fps

35 other flights - 29 fps

40 other flights - 28 fps

45 other flights - 27 fps

50 other flights - 26 fps

55 other flights - 25 fps

0 flights after removing all other flights - 40 fps

So, we can immediately see that the largest changes occurred between 0 and 15 other flights in progress, the overall result being a drop of nearly 10 fps. Interestingly, the framerate stagnates at around 33 fps for the next 15 flights, before gradually declining by a rate of about 0.2 fps per flight until the end of the experiment- I assume the trend would continue if I tried more trials.

Clearly, some factor was also reducing the framerate over time, with a difference of two fps recorded for 0 other flights before and after the tests.

So, the question now is how easy this will be for the developers to optimise; I just hope it won't be engine restricted like the part count issue. The most important thing to learn from this is that a large number of flights does have a significant affect on framerate, arguably on par with that of increasing part count.

(Oh, and yes, all flights remained in Kerbin's SOI)

EDIT: I forgot to mention that the results in the range of 50 vessels achieved 10 more fps than in the first test; I wonder if the removal of mods, especially remote tech, caused this discrepancy...)

Edited by RTS321
Link to comment
Share on other sites

Within any particular saved game, what I do after attaining an objective (usually this means reaching and circularizing an orbit) is: quick save, go to the Tracking Station, recover/ destroy the debris, go back to my latest flight and quick save again. That way, if I need to load the latest quick save, the debris doesn't reappear. I do find that flight counts affect game play.

Edit: I use Kerbal Engineer and MechJeb (and seldom use auto piloting). I've read that some mods impact performance as well.

Edited by Dispatcher
Added mods used.
Link to comment
Share on other sites

This is an important observation of an unwelcome result...but I'm surprised the effect is as large as it is. I would think that the program could test if an object is anywhere near the current object (or have any chance of getting anywhere near it) and ignore the far-off objects.

Does turning off the DISPLAY of certain classes of objects in Map view speed things up?

In any case, I think I may create a "parallel world" save of my big on-going game (with the UT times synced, but with extraneous ships around the Kerbol system removed) when I do my next transfer of multiple ships to Jool to perform the transfer...and then I'll paste the resultant ships data into my main persistent file after adjusting its time.

Link to comment
Share on other sites

The trend I notice is ~10% slow down with 5 flights, ~20% slow down with 20 flights and ~30% slow down with 35 flights and 40% slow down with 55 flights.

So it seems like the biggest impact is in the first few flights and then it progresses at slightly less than a linear fashion there after.

I am sure it depends a lot on the processor involved, out of curiousity, what are you running? I'd think the on-rails stuff would be things easily farmed out to one of the core not doing physics calcs (could be wrong).

At any rate, very good for me to keep in mind, both for my laptop, which already struggles a bit sometimes and for my future failed attempt to run it on a Bay Trail tablet (I am assuming it'll fail, but I won't know until I am in posession of the tablet).

It seems like based on this, I probably don't want to be running more than MAYBE 30 flights at once, no matter what.

I would be nice if there is a way to remove the load for things that are landed and/or flags (especially flags) at some future update. Otherwise it is rather limiting if you have in the back of your mind "welp. I can put down a couple flags on each moon and planet, but I can't do more than that if I want my two space station up and running, that mission on Jool running in the background AND the flight to Dres to kick off without some real lag starting to be noticable"

Link to comment
Share on other sites

In regard to Brotro's question, apparently the display filters are meant to reduce clutter on the map screen purely for aesethics; as all but one of the 'other flights' were in fact debris and therefore not automatically shown. I think this would only explain it if the lag was due to drawing the orbits on the map view.

I am using an AMD Athlon II quad core (ugh!) 630 at 2.8 GHz, certainly not the best for KSP but by no means the worst.

Link to comment
Share on other sites

Along the lines of how a planet in KSP actually rotates, are insane Coriolis forces possible if the planet's rotation is sped up? Like how you would be thrown off the fast rotating planet's surface due to the fact that you are already moving beyond orbital velocity, and would have to literally hang on to the planet to prevent from being pulled away, that kind of stuff :0.0:

I was thinking that KSP may be able to at least mimic these forces due to the boost you get from launching east into orbit, but then again the devs haven't made Rama(-aliens) yet, so... :confused:

In fact it does so. Have you seen Inaccessable from the Planet Factory mod? It works correctly using AFAIK normal KSP physics.

Scott Manley made a

, including some experiments with that planet.

There is one unwelcome consequence of this implementation, though. All on-rails ships' orientation is not stationary in the space. They rotate together with the planet of their current SOI. That effect can be seen in the Inaccessable video, too.

Link to comment
Share on other sites

They really need to do some severe optimization or change to fix this I think.

I have been wondering about this as well since i noticed that clean install seems to improve the performance even though there are no ships or debris in close range.

There is no reason why it should have such a big impact for something just being on rails especially if that object/ship is sitting still on for example the surface of a moon or a planet.

Link to comment
Share on other sites

Do note that the OP is using remotetech. That mod has to check for LOS between ships. So it should have a O(n!) complexity. That's going to bog down your game if you have a lot of relays I reckon.

More like O(n^2) if done the "naive" way. And while I don't know how that mod really works I'd expect it to skip things like flags or debris with no remote communication devices.

Link to comment
Share on other sites

Do note that the OP is using remotetech.

Yes, but only in the initial tests shown on the first page. The more detailed ones on page four were done without Remote Tech 2 or indeed any other mods installed, and consequentially I believe that the effect on the framerate was not as great, but still very much significant.

Link to comment
Share on other sites

Does the size of the ships have any effect on this? ie would it be better docking several ships together around a planet or better to keep them seperate?

Something I may experiment with later if I get time.

Docked ships = one ship. Size doesn't matter for unattended objects because physics is not running for them.

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