From bd3894d2072e9f12eb72475c8e7969df667a8953 Mon Sep 17 00:00:00 2001 From: DaymareOn Date: Sun, 21 Jun 2026 22:05:19 +0200 Subject: [PATCH] feat: add "Skip SMP for small on-screen NPCs" slider (minScreenSizePercent) Adds an MCM slider on the Simplification page for the new FSMP minScreenSizePercent setting (float 0-100, shown as a percentage), wired like the other global options (JMap -> configs.xml -> smp reset). - keys/defaultValues: add minScreenSizePercent (default 0) to the smp series - buildConfigString: bump the smp/solver/wind section boundaries - OnPageReset + State SliderMinScreenSizePercent (range 0-100%, step 0.1, shown as "{1}%") - bundled configs.xml + presets: add the tag (2.5 Performance, 1.5 Reasonable, 0 elsewhere) Folds into the unreleased MCM 3.1.0 (no version bump) alongside skip dead actors. Compiled .pex are produced by CI (Commit Compiled Scripts step). Implements the MCM portion of DaymareOn/hdtSMP64#379. Co-Authored-By: Claude Opus 4.8 --- .../Plugins/hdtSkinnedMeshConfigs/configs.xml | 1 + .../configsPresets/2.5.1 Default.xml | 1 + .../configsPresets/Debug.xml | 1 + .../configsPresets/Default.xml | 1 + .../configsPresets/Performance.xml | 1 + .../configsPresets/Quality.xml | 1 + .../configsPresets/Reasonable.xml | 1 + Source/Scripts/FSMPM.psc | 62 ++++++++++++------- 8 files changed, 47 insertions(+), 22 deletions(-) diff --git a/SKSE/Plugins/hdtSkinnedMeshConfigs/configs.xml b/SKSE/Plugins/hdtSkinnedMeshConfigs/configs.xml index 0bca6df..a64ab39 100644 --- a/SKSE/Plugins/hdtSkinnedMeshConfigs/configs.xml +++ b/SKSE/Plugins/hdtSkinnedMeshConfigs/configs.xml @@ -16,6 +16,7 @@ 5 true false + 0 16 diff --git a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/2.5.1 Default.xml b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/2.5.1 Default.xml index af43062..d925d78 100644 --- a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/2.5.1 Default.xml +++ b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/2.5.1 Default.xml @@ -16,6 +16,7 @@ 5 true false + 0 8 diff --git a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Debug.xml b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Debug.xml index 76d119f..d49287c 100644 --- a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Debug.xml +++ b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Debug.xml @@ -16,6 +16,7 @@ 5 false false + 0 20 diff --git a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Default.xml b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Default.xml index 93c2ba5..8afa909 100644 --- a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Default.xml +++ b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Default.xml @@ -16,6 +16,7 @@ 5 true false + 0 16 diff --git a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Performance.xml b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Performance.xml index eed152e..41017a9 100644 --- a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Performance.xml +++ b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Performance.xml @@ -16,6 +16,7 @@ 5 true true + 2.5 8 diff --git a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Quality.xml b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Quality.xml index c572496..422cb4a 100644 --- a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Quality.xml +++ b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Quality.xml @@ -16,6 +16,7 @@ 5 false false + 0 32 diff --git a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Reasonable.xml b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Reasonable.xml index 75843b7..d5c80a7 100644 --- a/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Reasonable.xml +++ b/SKSE/Plugins/hdtSkinnedMeshConfigs/configsPresets/Reasonable.xml @@ -16,6 +16,7 @@ 5 false false + 1.5 16 diff --git a/Source/Scripts/FSMPM.psc b/Source/Scripts/FSMPM.psc index 804ad4d..92923ae 100644 --- a/Source/Scripts/FSMPM.psc +++ b/Source/Scripts/FSMPM.psc @@ -135,6 +135,7 @@ Event OnPageReset(String aPage) AddEmptyOption() AddHeaderOption("Enabling nearest NPCs") AddSliderOptionST("SliderMinCullingDistance", "SMP is always on below this distance", JMap.getStr(configMapId, "minCullingDistance", 300) as float, "{0}") + AddSliderOptionST("SliderMinScreenSizePercent", "Skip SMP for NPCs smaller on screen than", JMap.getStr(configMapId, "minScreenSizePercent", 0) as float, "{1}%") SetCursorPosition(1) AddHeaderOption("Disabling SMP NPCs") bool autoAdjust = JMap.getStr(configMapId, "autoAdjustMaxSkeletons", "") == "true" @@ -265,7 +266,7 @@ function initConfig() Pages[6] = "" Pages[7] = sLabelPresets - keys = new String[23] + keys = new String[24] keys[0] = "logLevel"; first serie keys[1] = "enableNPCFaceParts"; unused by FSMP... keys[2] = "disableSMPHairWhenWigEquipped" @@ -281,16 +282,17 @@ function initConfig() keys[12] = "sampleSize" keys[13] = "disable1stPersonViewPhysics" keys[14] = "skipDeadActors" - keys[15] = "numIterations"; second serie - keys[16] = "erp" - keys[17] = "min-fps" - keys[18] = "maxSubSteps" - keys[19] = "enabled"; third serie - keys[20] = "windStrength" - keys[21] = "distanceForNoWind" - keys[22] = "distanceForMaxWind" - - defaultValues = new String[23] + keys[15] = "minScreenSizePercent" + keys[16] = "numIterations"; second serie + keys[17] = "erp" + keys[18] = "min-fps" + keys[19] = "maxSubSteps" + keys[20] = "enabled"; third serie + keys[21] = "windStrength" + keys[22] = "distanceForNoWind" + keys[23] = "distanceForMaxWind" + + defaultValues = new String[24] defaultValues[0] = "0"; first serie defaultValues[1] = "true"; unused by FSMP... defaultValues[2] = "true" @@ -306,14 +308,15 @@ function initConfig() defaultValues[12] = "5" defaultValues[13] = "false" defaultValues[14] = "false"; skipDeadActors - defaultValues[15] = "10"; second serie - defaultValues[16] = "0.2" - defaultValues[17] = "60" - defaultValues[18] = "2" - defaultValues[19] = "true"; third serie - defaultValues[20] = "2.0" - defaultValues[21] = "50.0" - defaultValues[22] = "2500" + defaultValues[15] = "0"; minScreenSizePercent + defaultValues[16] = "10"; second serie + defaultValues[17] = "0.2" + defaultValues[18] = "60" + defaultValues[19] = "2" + defaultValues[20] = "true"; third serie + defaultValues[21] = "2.0" + defaultValues[22] = "50.0" + defaultValues[23] = "2500" presetsInt = new int[50] endfunction @@ -423,7 +426,7 @@ string Function buildConfigString() string result = "\n\n \n" int index = 0 string value = "" - While (index < 15) + While (index < 16) string tag = keys[index] value = JMap.getStr(configMapId, tag, "") string ev = entaggedValue(tag, value) @@ -431,7 +434,7 @@ string Function buildConfigString() index += 1 EndWhile result += " \n \n" - While (index < 19) + While (index < 20) string tag = keys[index] value = JMap.getStr(configMapId, tag, "") string ev = entaggedValue(tag, value) @@ -439,7 +442,7 @@ string Function buildConfigString() index += 1 EndWhile result += " \n \n" - While (index < 23) + While (index < 24) string tag = keys[index] value = JMap.getStr(configMapId, tag, "") string ev = entaggedValue(tag, value) @@ -600,6 +603,21 @@ State SliderMinCullingDistance EndEvent EndState +State SliderMinScreenSizePercent + event OnSliderOpenST() + setOpenedSlider(0.0, 100.0, 0.1, "minScreenSizePercent", 0) + endEvent + + event OnSliderAcceptST(float a_value) + setFloatTag("minScreenSizePercent", a_value, "{1}") + SetSliderOptionValueST(a_value, "{1}%") + endEvent + + Event OnHighlightST() + SetInfoText("Skip SMP for non-player NPCs whose on-screen size is below this percentage of screen height (0 = off).\nHigher skips more distant/small NPCs. The player is never affected.") + EndEvent +EndState + State SliderMaxSkeletons event OnSliderOpenST() setOpenedSlider(0,200,1,"maximumActiveSkeletons", 40)