Sign in to follow this  
Followers 0
ZooNamedGames

How to improve FPS with high part count crafts

32 posts in this topic

12 minutes ago, KerbMav said:

@DMagic@Kerbal101

Was there ever a way to temporarily deactivate docking ports (apart from using the covered stock one)?

I'm working on a module / patch setup that will add and use dummy animations on the ports to effect a manual toggle on the part right click menu.  Essentially the docking port will be disabled until the player manual enables it in the right click-menu.  Will post it up as a 'modlet' similar to my rescue-pod-validation bit...  (probably within the next few weeks).

From my testing, exposed docking ports are a _massive_ performance hit, increasing linearly with the number of docking ports, and again linearly with the number of parts in the scene (as each port checks every part in physics range to see if it is also a docking port).

4 people like this

Share this post


Link to post
Share on other sites
On 7/17/2017 at 5:24 PM, ZooNamedGames said:

It's a stock station so I can't use part altering mods.

 

Yup, forgot that, my derp derp. 

Share this post


Link to post
Share on other sites
21 hours ago, DMagic said:

You could make a mod to do so, I think, docking ports use a state machine to which makes them a little hard to deal with. But stock doesn't have any method to do so. In any event I don't think docking ports would really drag down on performance enough to notice unless you have a ridiculous number of them and none of them are docked (docked ports are basically inactive).

@Kerbal101 The performance impact of docking ports comes from each port looking up every other open port in the scene and checking things like distance, orientation, rotation (there are lots of unused config options to limit docking port connections), size, etc...

Last I checked, active docking ports each scaned every part in the scene, which means they can get pretty nasty pretty fast.  A while back I recommended in the bugtracker that the scene keep a special docking port array so that they each scan only other docking ports (with new ports added and removed as they come into and leave physics range), but I don't think they've had a chance to implement such a thing.

Which is too bad, as it'd reduce the load from (for x ports in an n-part scene) x*n every physics frame, to n for frame 0 (scanning everything on load to populate the open port array), and x^2 for every subsequent frame of the open ports scanning each-other for docking proximity.  And for say 6 ports in a 400 part scene, 400 followed by 36/frame beats the pants off of 2400 every frame.

1 person likes this

Share this post


Link to post
Share on other sites

Hmm... -->  https://github.com/shadowmage45/DockingPortToggle

Will make up a proper release thread (and release package) probably later today.  All it does is add a dummy animation to the stock docking ports, which gives them an 'enable/disable' toggle; when 'disabled', they truly are disabled (no searching, no magnetics, nada).

Currently only works on the stock standard, jr., and sr. ports, but patches could easily be made for other mods' docking ports.  Ports currently start in the 'disabled' state, so this -might- have bad side effects if applied to an existing game  (investigating setting ports to start enabled, should just be a minor alteration to the patch file).

3 people like this

Share this post


Link to post
Share on other sites

@Archgeek The vessel does cache a list of all docking ports, Vessel.dockingPorts, so it doesn't have to scan every loaded part. I assume that was one of the many little tweaks made for 1.2 to improve performance.

2 people like this

Share this post


Link to post
Share on other sites
32 minutes ago, DMagic said:

@Archgeek The vessel does cache a list of all docking ports, Vessel.dockingPorts, so it doesn't have to scan every loaded part. I assume that was one of the many little tweaks made for 1.2 to improve performance.

Oh sweet!  That must've dramatically improved the space station situation.  I'm guessing each port grabs in-range vessels and runs down their dockingPorts lists now.  Dang but that's nice.

Share this post


Link to post
Share on other sites
55 minutes ago, DMagic said:

@Archgeek The vessel does cache a list of all docking ports, Vessel.dockingPorts, so it doesn't have to scan every loaded part. I assume that was one of the many little tweaks made for 1.2 to improve performance.

Interesting; that was certainly not the case when last I tested.  Granted, that was back in 0.90 or maybe 1.0 territory.  Perhaps the docking port toggle is no longer as needed as it once was.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0