Jump to content

Some parts lags more than others?


brusura

Recommended Posts

I am asking because I just loaded one of the fantastic Mareczex333 craft and my face turned sad when I saw it was a 160 parts, that would have lagged quite a bit on my pc...but with great surprise I got no lag at all running around 60 fps, meanwhile in orbit my 140 parts vessel is starting to lag quite a bit.

Considering that Mareczex333's crafts are almost all made of wings, I suppose wings lag less? Collision box for wings should be a simple cube, while for a tank is something more complex like cylinder.

What are your experience about?

Link to comment
Share on other sites

As far as I know wings should lag more, particularly in atmosphere because some extra calculations (lift) are made for them.

Also a ship cannot collide with itself so collision boxes don't play a role unless the ship is just about to crash or unless some other ship is nearby.

What might cause more lag is if you bring two ships with large amount of parts together.

Link to comment
Share on other sites

Some parts are more lag-inducing. From memory docked docking ports have a bigger penalty than regular parts, for example.

The Engineer calculations, used to display vessel delta-V in Engineer and VOID, also aggravate lag, so if your ship has that on and running there's your explanation.

Link to comment
Share on other sites

One of the worst offenders is the OX-STAT solar panel. The tiny one that is always active. Every one of them is constantly calculating its position relative to the sun and whether or not it is being blocked by another part. Since people have a tendency to put a lot of these on their crafts it can really slow things down.

Link to comment
Share on other sites

When I was building my zero-G chamber (a chamber that falls through atmosphere exactly as fast as EVA Kerbal) I had two main "counterweight" parts at my disposal - the Mk2 cockpit and inline docking port. They were equivalent in the sense that they have the same mass and drag coefficient. But they were very different in FPS. When I built the chamber using inline docking ports, the FPS was almost half the value when it was built with cockpits. I'm not sure what to blame for it.

Link to comment
Share on other sites

As far as I know wings should lag more, particularly in atmosphere because some extra calculations (lift) are made for them.

I suspect the extra lift calculations aren't really very significant when compared to all the other stuff that gets calculated as I believe the stock "aerodynamics" uses a simple lookup table to get the lift from the angle of attack (or probably a FloatCurve actually, which is basically an linearly interpolated lookup table).

Some parts are more lag-inducing. From memory docked docking ports have a bigger penalty than regular parts, for example.

Docking ports do extra calculations during docking to look for nearby ports and calculate the magnetic forces but I wouldn't expect them to do much when docked (though I wouldn't be surprised if they do exactly the same calculations).

The extendable ladders decrease framerate a lot, though I'm not sure why. Try adding ladders in 8x symmetry in the VAB and see what I mean.

It could either be because they are "animated" or because they are set to have no physical significance. Logic (yeah, right) would seem to suggest that no physics significance should make a part cause less lag but I can easily believe that there is something weird going on with them (e.g. the various kraken incidents they sometimes seem to provoke).

The Engineer calculations, used to display vessel delta-V in Engineer and VOID, also aggravate lag, so if your ship has that on and running there's your explanation.

Yes, the KER (and VOID) simulation code does impact the frame rate but the most recent version of KER (0.6.2.4) should be significantly better than earlier versions and also has a tweakable slider on the flight engineer part that allows you to control how often the simulation code is run. Most of the simulation code runs in a background thread so a single CPU machine will be affected considerably more than a multiple CPU machine. The speed of the simulation does depend on the part count but is more dependent on the number of stages, the number of engines and the complexity of the fuel flow in the vessel (e.g. it is slower when an engine draws fuel from a tank that is a large number of parts away).

The particular structure of the part tree may also contribute to lag, a very "deep" tree (e.g. where each part only has 1 or 2 children) seems to lag more than a "shallow" tree (where each part has lots of children) with the same number of parts. This would make sense as most tree scanning and manipulation code will get slower if it has to deal with more levels of tree.

Edit:

One of the worst offenders is the OX-STAT solar panel. The tiny one that is always active. Every one of them is constantly calculating its position relative to the sun and whether or not it is being blocked by another part. Since people have a tendency to put a lot of these on their crafts it can really slow things down.

The calculation of the position/orientation relative to the sun is not very complex but I presume the occlusion test is done by casting a ray from the part to the sun and seeing if it hits anything which is known to be quite slow.

When I was building my zero-G chamber (a chamber that falls through atmosphere exactly as fast as EVA Kerbal) I had two main "counterweight" parts at my disposal - the Mk2 cockpit and inline docking port. They were equivalent in the sense that they have the same mass and drag coefficient. But they were very different in FPS. When I built the chamber using inline docking ports, the FPS was almost half the value when it was built with cockpits. I'm not sure what to blame for it.

If the inline port was "closed" then it shouldn't be doing any docking port stuff but it is an "animated" part again, like the ladders...

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