Jump to content

How to improve FPS with high part count crafts


ZooNamedGames

Recommended Posts

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

Link to comment
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.

Link to comment
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).

Link to comment
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.

Link to comment
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.

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