Jump to content

A thought on performance related to space stations


Recommended Posts

I got to thinking something about space stations and game performance. It seems that when I connect more than 4 ships together to form a station the framerate starts dropping like a rock. I even set the physics delta to .03 to maintain it. I wanted to think about why this happens and I think I know (though I don't know what the inner workings of KSP is like).

If each ship is structured as a tree then the docking ports allow multiple trees to be connected together. The collision component is calculating whether a collision happens for each tree. The thing I want to suggest is this:

If multiple trees are connected the game only needs to calculate collisions and structural physics once for the whole interconnected tree choosing only one "root" of one of the space ships as the calculation root. I believe now it calculates the collisions for each tree root in the connected system. This results in redundant collision measurements and cuts into the framerate, dividing it by each connected ship in the system, of course depending on the size of the ship part wise.

I need to test if this is true by connecting together several ships with the same design to see if the framerate divides by the number of ships connected.

It's something worth taking a look at for optimizing large space stations.

Link to comment
Share on other sites

I'm no dev, but to the best of my knowledge... upon docking, the ship trees are completely merged, with only a few extra values being stored (e.g., name of the docked craft, etc.). No information about the previous tree root is kept, to my knowledge, which can be checked by looking at the data tree in a persistence file that contains a docked ship. It's not connecting trees, it's merging them, and then breaking off a branch again when undocking. That's how I understand it whenever Harv went through and explained how it went, anyway.

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