To reduce spaghetti ship systems, I recommend a slight bonus with a group of system blocks grouped tightly inside a sphere containing the entire system group. The bonus should be pretty small, to avoid unnecessary restriction on ship system design.
To avoid combat-lag, I recommend that the bonus calculations should only be done in build-mode or otherwise non-laggy ship modification situations. This eliminate any potential for an enemy to "reshape" their target's systems via combat to toy with them as a griefing method.
There should probably also be a server variable that determines how many blocks in the group need to be destroyed before the group becomes nonfunctional. For example, if you blow away half the reactor of your opponent, it wouldn't damage the efficiency under this system. The remaining half-count of reactor blocks would continue to produce at the original efficiency, so they would still be generating half the power of the original reactor group. On the other hand, if the group-damage-threshold is set to 50% (0.5), then that same reactor that has been blown in half will stop functioning altogether, which is an expected result. Under normal circumstances, when you destroy half of a reactor, the remaining half is now scrap.
In many cases, the optimum shape for a group should probably be a sphere with a hole through it, to allow walkways or pass-throughs for conduits or other desired "small cuts" in the shape.
This would be a great way to make a reactor that looks like a reactor bottle, more-or-less. It would also be a great way to add even greater relevance to the spherical and cylindrical build helpers.
Similarly, maybe an algorithm could be designed to calculate bonuses based on a flat-faced sphere, to allow more template-friendly designs.
An algorithm to cover all these scenarios could involve calculating the voxel volume of a sphere containing the group, and then calculating a large fraction of that volume, say 4/5. This would allow a spherical group to remain at maximum efficiency if it contains either a pass-through hole, or a "core" hole. Similarly, if the hole size is calculated, and then the voxel count is then multiplied by the distance of the center of the "hole" sphere from the center of the group sphere, the results of which would be subtracted from the efficiency calculation result, that would encourage centralized holes, and discourage swiss-cheese system groups that are time-consuming, less-builder-efficient, missile-resistant, and weird.
Distance of the hole from the center of the group is zero, so this shape is still 100% efficient for the effect of added system efficiency.
Since the hole in this geometry is offset from the center, it is less efficient, resulting in a reduced efficiency bonus.
To avoid combat-lag, I recommend that the bonus calculations should only be done in build-mode or otherwise non-laggy ship modification situations. This eliminate any potential for an enemy to "reshape" their target's systems via combat to toy with them as a griefing method.
There should probably also be a server variable that determines how many blocks in the group need to be destroyed before the group becomes nonfunctional. For example, if you blow away half the reactor of your opponent, it wouldn't damage the efficiency under this system. The remaining half-count of reactor blocks would continue to produce at the original efficiency, so they would still be generating half the power of the original reactor group. On the other hand, if the group-damage-threshold is set to 50% (0.5), then that same reactor that has been blown in half will stop functioning altogether, which is an expected result. Under normal circumstances, when you destroy half of a reactor, the remaining half is now scrap.
In many cases, the optimum shape for a group should probably be a sphere with a hole through it, to allow walkways or pass-throughs for conduits or other desired "small cuts" in the shape.
This would be a great way to make a reactor that looks like a reactor bottle, more-or-less. It would also be a great way to add even greater relevance to the spherical and cylindrical build helpers.
Similarly, maybe an algorithm could be designed to calculate bonuses based on a flat-faced sphere, to allow more template-friendly designs.
An algorithm to cover all these scenarios could involve calculating the voxel volume of a sphere containing the group, and then calculating a large fraction of that volume, say 4/5. This would allow a spherical group to remain at maximum efficiency if it contains either a pass-through hole, or a "core" hole. Similarly, if the hole size is calculated, and then the voxel count is then multiplied by the distance of the center of the "hole" sphere from the center of the group sphere, the results of which would be subtracted from the efficiency calculation result, that would encourage centralized holes, and discourage swiss-cheese system groups that are time-consuming, less-builder-efficient, missile-resistant, and weird.
Distance of the hole from the center of the group is zero, so this shape is still 100% efficient for the effect of added system efficiency.
Since the hole in this geometry is offset from the center, it is less efficient, resulting in a reduced efficiency bonus.