Skip to content

Commit 8571965

Browse files
committed
Merge branch 'dev'
2 parents a5c6a3f + 16f9209 commit 8571965

25 files changed

+3829
-291
lines changed

GameData/KSPCommunityFixes/KSPCommunityFixes.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"NAME": "KSPCommunityFixes",
33
"URL": "https://raw.githubusercontent.com/KSPModdingLibs/KSPCommunityFixes/master/GameData/KSPCommunityFixes/KSPCommunityFixes.version",
44
"DOWNLOAD": "https://github.com/KSPModdingLibs/KSPCommunityFixes/releases",
5-
"VERSION": {"MAJOR": 1, "MINOR": 36, "PATCH": 1, "BUILD": 0},
5+
"VERSION": {"MAJOR": 1, "MINOR": 37, "PATCH": 0, "BUILD": 0},
66
"KSP_VERSION": {"MAJOR": 1, "MINOR": 12, "PATCH": 5},
77
"KSP_VERSION_MIN": {"MAJOR": 1, "MINOR": 8, "PATCH": 0},
88
"KSP_VERSION_MAX": {"MAJOR": 1, "MINOR": 12, "PATCH": 5}

GameData/KSPCommunityFixes/Settings.cfg

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ KSP_COMMUNITY_FIXES
308308
// Optional MM-patcheable toggle to always disable the MH features
309309
OptionalMakingHistoryDLCFeaturesAlwaysDisable = false
310310
311+
// Allow targeting the parent body of the current craft, or any body in the parent hierarchy
312+
TargetParentBody = true
313+
311314
// ##########################
312315
// Performance tweaks
313316
// ##########################
@@ -372,19 +375,25 @@ KSP_COMMUNITY_FIXES
372375
LogGameEventsSubscribers = false
373376
}
374377
375-
// Fix CommNet update throttling mechanism that exists in stock but doesn't work correctly.
376-
// This is supposed to prevent full CommNet network updates from happening every frame, but instead to
377-
// to happen at a regular real-world time interval of 5 seconds while in flight. Enabling this throttling
378-
// mechanism has an detrimental impact on the precision of the simulation, so this patch isn't enabled by
379-
// default to avoid issues in mods relying on the stock behavior. Enabling this can provide a decent
380-
// performance uplift in games having a large amount of celestial bodies and/or vessels.
381-
CommNetThrottling = false
378+
// Implement a throttling mechanism preventing CommNet network updates from happening every frame.
379+
// When this patch is enabled, network updates will only happen at a set interval of in-game seconds,
380+
// defined by below settings. This patch will cause events such as line of sight loss or acquisition,
381+
// or comm link changes to happen with a delay, but provide a significant performance uplift in games
382+
// having a large amount of celestial bodies and/or vessels.
383+
CommNetThrottling = true
382384
383-
// Interval in real-world seconds between full CommNet network updates.
384385
COMMNET_THROTTLING_SETTINGS
385386
{
386-
unpackedInterval = 5 // interval when the active vessel is not timewarping
387-
packedInterval = 0.5 // interval when the active vessel is timewarping
387+
// Maximum duration in in-game seconds between CommNet updates.
388+
// Increasing it further than the 2.5s default won't have any effect on framerate and will make
389+
// CommNet situation changes (such as loss or acqusition of signal) increasingly sluggish.
390+
maxGameTimeInterval = 2.5
391+
392+
// Minimum duration in real world *milliseconds* between CommNet updates.
393+
// Increasing it will only affect medium to fast timewarp situations, and will improve framerate
394+
// and significately reduce simulation precision. Recommended value is either 20 or 500 to 1000,
395+
// values in between will likely result in stuttery framerate and no perceptible improvement.
396+
minRealTimeInterval = 20
388397
}
389398

390399
// This tweak eliminates KSP's stock behavior of saving every time
@@ -448,7 +457,7 @@ KSP_COMMUNITY_FIXES
448457
// strut position tracking...
449458
PartSystemsFastUpdate = true
450459

451-
// Various small performance patches (volume normalizer, eva module checks)
460+
// Various small performance patches (volume normalizer, eva module checks, FlightGlobals.fetch)
452461
MinorPerfTweaks = true
453462

454463
// General micro-optimization of FlightIntegrator and VesselPrecalculate. This has a significant impact in
@@ -458,6 +467,16 @@ KSP_COMMUNITY_FIXES
458467
// General micro-optimization of floating origin shifts. Main benefit is in large particle count situations
459468
// but this helps a bit in other cases as well.
460469
FloatingOriginPerf = true
470+
471+
// Improve performance in the Map View when a large number of vessels and bodies are visible via faster drawing
472+
// of orbit lines and CommNet lines.
473+
OptimisedVectorLines = true
474+
475+
// Faster part icon generation and Part fields parsing.
476+
PartParsingPerf = true
477+
478+
// Significantly reduces the time it takes to open the craft browser and to search by name. Most noticeable with lots of craft.
479+
CraftBrowserOptimisations = true
461480

462481
// ##########################
463482
// Modding
@@ -496,6 +515,11 @@ KSP_COMMUNITY_FIXES
496515
// To use add `Description` attribute to the field.
497516
KSPFieldEnumDesc = false
498517

518+
// Allow dynamically defining additional BaseFields on a Part or PartModule and having the backing
519+
// field for that BaseField in another class / instance than the targetted Part or Module. Look for
520+
// the examples and documentation in the patch source.
521+
BaseFieldListUseFieldHost = true
522+
499523
// ##########################
500524
// Localization tools
501525
// ##########################

KSPCommunityFixes/BasePatch.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ internal class TranspileInDebugAttribute : Attribute
4343
{
4444
}
4545

46+
/// <summary>
47+
/// When applied to a class derived from <see cref="BasePatch"/>, the patch won't be automatically applied.<para/>
48+
/// To apply the patch, call <see cref="BasePatch.Patch"/>. Note that if that call happens before ModuleManager
49+
/// has patched the configs (ie, before part compilation), <see cref="BasePatch.IgnoreConfig"/> must be overriden
50+
/// to return <see langword="true"/>, or the patch won't be applied.
51+
/// </summary>
52+
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
53+
internal class ManualPatchAttribute : Attribute
54+
{
55+
}
56+
4657
public abstract class BasePatch
4758
{
4859
public static readonly string pluginData = "PluginData";
@@ -64,7 +75,7 @@ public static void Patch(Type patchType)
6475

6576
if (!patch.IgnoreConfig && !KSPCommunityFixes.enabledPatches.Contains(patchType.Name))
6677
{
67-
Debug.Log($"[KSPCommunityFixes] Patch {patchType.Name} not applied (disabled in Settings.cfg)");
78+
Debug.Log($"[KSPCommunityFixes] Patch {patchType.Name} not applied (not enabled in Settings.cfg)");
6879
return;
6980
}
7081

0 commit comments

Comments
 (0)