Skip to content

Commit 0811b6c

Browse files
FlightIntegratorPerf optimizations replacing previous FlightPerf patch (#267)
* **FlightIntegratorPerf** : General micro-optimization of `FlightIntegrator` and `VesselPrecalculate`, components in charge of most of heavy lifting for newtonian physics as well as atmospheric and thermal physics. * FlightIntegratorPerf : fixed various bugs in drag computation reimplementation. --------- Co-authored-by: gotmachine <[email protected]>
1 parent b8cf2e2 commit 0811b6c

File tree

5 files changed

+1576
-832
lines changed

5 files changed

+1576
-832
lines changed

GameData/KSPCommunityFixes/Settings.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,9 @@ KSP_COMMUNITY_FIXES
451451
// Various small performance patches (volume normalizer, eva module checks)
452452
MinorPerfTweaks = true
453453
454-
// General micro-optimization of FlightIntegrator and VesselPrecalculate, significantely increase
455-
// framerate in large part count situations.
456-
FlightPerf = true
454+
// General micro-optimization of FlightIntegrator and VesselPrecalculate. This has a significant impact in
455+
// large part count situations, and especially in atmospheric situations.
456+
FlightIntegratorPerf = true
457457
458458
// General micro-optimization of floating origin shifts. Main benefit is in large particle count situations
459459
// but this helps a bit in other cases as well.

KSPCommunityFixes/KSPCommunityFixes.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public class KSPCommunityFixes : MonoBehaviour
2424

2525
public static KSPCommunityFixes Instance { get; private set; }
2626

27+
public static long FixedUpdateCount { get; private set; }
28+
2729
private static string modPath;
2830
public static string ModPath
2931
{
@@ -125,5 +127,10 @@ public void MMPostLoadCallback()
125127
BasePatch.Patch(patchesType);
126128
}
127129
}
130+
131+
void FixedUpdate()
132+
{
133+
FixedUpdateCount++;
134+
}
128135
}
129136
}

KSPCommunityFixes/KSPCommunityFixes.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
<Compile Include="Performance\DragCubeGeneration.cs" />
173173
<Compile Include="Performance\FasterPartFindTransform.cs" />
174174
<Compile Include="Performance\FastLoader.cs" />
175-
<Compile Include="Performance\FlightPerf.cs" />
175+
<Compile Include="Performance\FlightIntegratorPerf.cs" />
176176
<Compile Include="Performance\IMGUIOptimization.cs" />
177177
<Compile Include="Performance\LocalizerPerf.cs" />
178178
<Compile Include="Performance\LowerMinPhysicsDTPerFrame.cs" />

0 commit comments

Comments
 (0)