Skip to content

Commit

Permalink
FlightIntegratorPerf optimizations replacing previous FlightPerf patch (
Browse files Browse the repository at this point in the history
#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]>
  • Loading branch information
JonnyOThan and gotmachine authored Oct 15, 2024
1 parent b8cf2e2 commit 0811b6c
Show file tree
Hide file tree
Showing 5 changed files with 1,576 additions and 832 deletions.
6 changes: 3 additions & 3 deletions GameData/KSPCommunityFixes/Settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,9 @@ KSP_COMMUNITY_FIXES
// Various small performance patches (volume normalizer, eva module checks)
MinorPerfTweaks = true
// General micro-optimization of FlightIntegrator and VesselPrecalculate, significantely increase
// framerate in large part count situations.
FlightPerf = true
// General micro-optimization of FlightIntegrator and VesselPrecalculate. This has a significant impact in
// large part count situations, and especially in atmospheric situations.
FlightIntegratorPerf = true
// General micro-optimization of floating origin shifts. Main benefit is in large particle count situations
// but this helps a bit in other cases as well.
Expand Down
7 changes: 7 additions & 0 deletions KSPCommunityFixes/KSPCommunityFixes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class KSPCommunityFixes : MonoBehaviour

public static KSPCommunityFixes Instance { get; private set; }

public static long FixedUpdateCount { get; private set; }

private static string modPath;
public static string ModPath
{
Expand Down Expand Up @@ -125,5 +127,10 @@ public void MMPostLoadCallback()
BasePatch.Patch(patchesType);
}
}

void FixedUpdate()
{
FixedUpdateCount++;
}
}
}
2 changes: 1 addition & 1 deletion KSPCommunityFixes/KSPCommunityFixes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
<Compile Include="Performance\DragCubeGeneration.cs" />
<Compile Include="Performance\FasterPartFindTransform.cs" />
<Compile Include="Performance\FastLoader.cs" />
<Compile Include="Performance\FlightPerf.cs" />
<Compile Include="Performance\FlightIntegratorPerf.cs" />
<Compile Include="Performance\IMGUIOptimization.cs" />
<Compile Include="Performance\LocalizerPerf.cs" />
<Compile Include="Performance\LowerMinPhysicsDTPerFrame.cs" />
Expand Down
Loading

0 comments on commit 0811b6c

Please sign in to comment.