From 7c92a54f3a3ad23f01d0a9d1a654adbd44585649 Mon Sep 17 00:00:00 2001 From: Coaxgames Date: Sun, 4 May 2025 16:07:34 -0600 Subject: [PATCH 1/9] Added a 12x slider I tested with "* 4" and it seemed a tad small for the Config tweak mod (using Patch Manager to add kos to cockpits) So Working in the Script i noticed a block of math keeping it Clamped. so i left it as 8*BaseDiskSpace and increased smoothing cost is not an issue without a tweak patch, so that has not been changed but using 1024 * 8 with extra cost would be recommended to follow IRL ByteSizes. Most parts in the KOS mod seem to rise just out of that area. i felt as if it was to limited for upgrades One last note: would recommend adjusting "public float ECPerInstruction = 0.000004F;" to 0.000008F. --- src/kOS/Module/kOSProcessor.cs | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/kOS/Module/kOSProcessor.cs b/src/kOS/Module/kOSProcessor.cs index 68d02feb9..7dec96ff0 100644 --- a/src/kOS/Module/kOSProcessor.cs +++ b/src/kOS/Module/kOSProcessor.cs @@ -101,8 +101,8 @@ public string Tag [KSPField(isPersistant = true, guiName = "kOS Base Module Mass", guiActive = false, groupName = PAWGroup, groupDisplayName = PAWGroup)] public float baseModuleMass = 0F; // this is the base mass added to a part for including the kOSProcessor, default to 0. - [KSPField(isPersistant = false, guiName = "kOS Disk Space", guiActive = false, guiActiveEditor = true, groupName = PAWGroup, groupDisplayName = PAWGroup), UI_ChooseOption(scene = UI_Scene.Editor)] - public string diskSpaceUI = "1024"; + [KSPField(isPersistant = false, guiName = "kOS Disk Space", guiActive = false, guiActiveEditor = true, groupName = PAWGroup, groupDisplayName = PAWGroup), UI_FloatRange(scene = UI_Scene.Editor)] + public float diskSpaceUI = 1024f; //needed for the slider, Could convert from String back into float or int. but works better and feels natural to have as a float to begin with [KSPField(isPersistant = true, guiName = "CPU/Disk Upgrade Cost", guiActive = false, guiActiveEditor = true, groupName = PAWGroup, groupDisplayName = PAWGroup)] public float additionalCost = 0F; @@ -111,7 +111,7 @@ public string Tag public float additionalMassGui = 0F; [KSPField(isPersistant = true, guiActive = false, guiActiveEditor = false)] - public float diskSpaceCostFactor = 0.0244140625F; //implies approx 100funds for 4096bytes of diskSpace + public float diskSpaceCostFactor = 0.0244140625F; //implies approx 100funds for 4096bytes of diskSpace. SliderNote: would recommend a small increase to: 0.0484140625F [KSPField(isPersistant = true, guiActive = false, guiActiveEditor = false)] public float diskSpaceMassFactor = 0.0000000048829F; //implies approx 0.020kg for 4096bytes of diskSpace @@ -376,11 +376,19 @@ private void PopulateDiskSpaceUI() diskSpaceUI = diskSpace.ToString(); BaseField field = Fields["diskSpaceUI"]; UI_ChooseOption options = (UI_ChooseOption)field.uiControlEditor; - var sizeOptions = new string[3]; - sizeOptions[0] = baseDiskSpace.ToString(); - sizeOptions[1] = (baseDiskSpace * 2).ToString(); - sizeOptions[2] = (baseDiskSpace * 4).ToString(); - options.options = sizeOptions; + + UI_FloatRange slider = new UI_FloatRange + { + minValue = baseDiskSpace, + maxValue = baseDiskSpace * 8, + stepIncrement = baseDiskSpace / 4f, + scene = UI_Scene.Editor + }; + + //These should be here, yes they are declared above but this is good practice to include parms when making the ui object + field.uiControlEditor = slider; + field.guiActiveEditor = true; + field.guiName = "KOS Disk Space"; } //implement IPartMassModifier component @@ -812,9 +820,10 @@ public void Update() InitUI(); } UpdateRP1TechLevel(true); - if (diskSpace != Convert.ToInt32(diskSpaceUI)) + // This part is now just rounding from INT, this counters any issue with DiskSpace or BaseDiskSpace being incorrect or "Out of range" + if (diskSpace != Mathf.RoundToInt(diskSpaceUI)) //Tested in-game, no issues found { - diskSpace = Convert.ToInt32(diskSpaceUI); + diskSpace = Mathf.RoundToInt(diskSpaceUI); ///Tested as well UpdateCostAndMass(); GameEvents.onEditorShipModified.Fire(EditorLogic.fetch.ship); } From d2a1cf18efe361feef16ff5838879c27ca7f402c Mon Sep 17 00:00:00 2001 From: Coaxgames Date: Sun, 4 May 2025 16:09:38 -0600 Subject: [PATCH 2/9] Update kOSProcessor.cs Forgot to remove the old UI_ChooseOption --- src/kOS/Module/kOSProcessor.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/kOS/Module/kOSProcessor.cs b/src/kOS/Module/kOSProcessor.cs index 7dec96ff0..edc1f7bec 100644 --- a/src/kOS/Module/kOSProcessor.cs +++ b/src/kOS/Module/kOSProcessor.cs @@ -375,7 +375,6 @@ private void PopulateDiskSpaceUI() //populate diskSpaceUI selector diskSpaceUI = diskSpace.ToString(); BaseField field = Fields["diskSpaceUI"]; - UI_ChooseOption options = (UI_ChooseOption)field.uiControlEditor; UI_FloatRange slider = new UI_FloatRange { From 346068e16608fe91af05b02db115e260ab49b3fe Mon Sep 17 00:00:00 2001 From: Coaxgames Date: Sun, 4 May 2025 16:15:08 -0600 Subject: [PATCH 3/9] VSCode reverted changes? Build failed bc of string converting, unsure why it undid the change when im currently running this build in-game --- src/kOS/Module/kOSProcessor.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/kOS/Module/kOSProcessor.cs b/src/kOS/Module/kOSProcessor.cs index edc1f7bec..52f29967d 100644 --- a/src/kOS/Module/kOSProcessor.cs +++ b/src/kOS/Module/kOSProcessor.cs @@ -373,14 +373,18 @@ private void UpdateRP1TechLevel(bool InEditor) private void PopulateDiskSpaceUI() { //populate diskSpaceUI selector - diskSpaceUI = diskSpace.ToString(); + // Set the initial value to current disk space + diskSpaceUI = diskSpace; + + // Get the field and setup the slider BaseField field = Fields["diskSpaceUI"]; + UI_FloatRange slider = new UI_FloatRange { minValue = baseDiskSpace, maxValue = baseDiskSpace * 8, - stepIncrement = baseDiskSpace / 4f, + stepIncrement = baseDiskSpace / 8f, scene = UI_Scene.Editor }; From a30445b560501bbcea8b12200cb08ce250b8f9b5 Mon Sep 17 00:00:00 2001 From: Coaxgames <57080080+Coaxgames@users.noreply.github.com> Date: Mon, 18 May 2026 06:56:07 -0600 Subject: [PATCH 4/9] Update kOSProcessor.cs --- src/kOS/Module/kOSProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kOS/Module/kOSProcessor.cs b/src/kOS/Module/kOSProcessor.cs index 52f29967d..fddec3777 100644 --- a/src/kOS/Module/kOSProcessor.cs +++ b/src/kOS/Module/kOSProcessor.cs @@ -383,7 +383,7 @@ private void PopulateDiskSpaceUI() UI_FloatRange slider = new UI_FloatRange { minValue = baseDiskSpace, - maxValue = baseDiskSpace * 8, + maxValue = baseDiskSpace * 16, stepIncrement = baseDiskSpace / 8f, scene = UI_Scene.Editor }; From 7c5fb96a99c54a107e724a88e54b9bbebebc48f1 Mon Sep 17 00:00:00 2001 From: Coaxgames <57080080+Coaxgames@users.noreply.github.com> Date: Wed, 20 May 2026 22:28:29 -0600 Subject: [PATCH 5/9] Refactor disk space comparison logic Updated disk space comparison to use Convert.ToInt32 for consistency. --- src/kOS/Module/kOSProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kOS/Module/kOSProcessor.cs b/src/kOS/Module/kOSProcessor.cs index fddec3777..6904edd7e 100644 --- a/src/kOS/Module/kOSProcessor.cs +++ b/src/kOS/Module/kOSProcessor.cs @@ -824,7 +824,7 @@ public void Update() } UpdateRP1TechLevel(true); // This part is now just rounding from INT, this counters any issue with DiskSpace or BaseDiskSpace being incorrect or "Out of range" - if (diskSpace != Mathf.RoundToInt(diskSpaceUI)) //Tested in-game, no issues found + if (diskSpace != Convert.ToInt32(Mathf.RoundToInt(diskSpaceUI))) //Tested in-game, no issues found { diskSpace = Mathf.RoundToInt(diskSpaceUI); ///Tested as well UpdateCostAndMass(); From b3d6d89be1f4480a63578fb08d7dd19106785d26 Mon Sep 17 00:00:00 2001 From: Coaxgames <57080080+Coaxgames@users.noreply.github.com> Date: Wed, 20 May 2026 22:52:53 -0600 Subject: [PATCH 6/9] Update kOSProcessor.cs Adjusted the maximum value of the slider to reflect a more realistic ROM space based on NASA's specifications with Read only rom AND magnetic storage. --- src/kOS/Module/kOSProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kOS/Module/kOSProcessor.cs b/src/kOS/Module/kOSProcessor.cs index 6904edd7e..a4cd6fddf 100644 --- a/src/kOS/Module/kOSProcessor.cs +++ b/src/kOS/Module/kOSProcessor.cs @@ -383,7 +383,7 @@ private void PopulateDiskSpaceUI() UI_FloatRange slider = new UI_FloatRange { minValue = baseDiskSpace, - maxValue = baseDiskSpace * 16, + maxValue = baseDiskSpace * 8, //Set i Little higher based on what nasa flew with read only ROM space (4kb is rough and read only doesnt exist in KOS) stepIncrement = baseDiskSpace / 8f, scene = UI_Scene.Editor }; From fbf8b8f9f4726dd49b3740b27b855e72256f4bc7 Mon Sep 17 00:00:00 2001 From: Coaxgames Date: Wed, 20 May 2026 23:11:52 -0600 Subject: [PATCH 7/9] Updated Som Stats for RL cfg. Will also add a MM patch in my other mod to increase these stats. the Size decreaseis because my MM patch isusing mass and cost as well, so doing it here would be better HOWEVER, im considering making the slider start at the old spec, this way one can save money or spend to upgrade past *realistic* --- Resources/GameData/kOS/Parts/kOSMachine0m/part.cfg | 2 +- Resources/GameData/kOS/Parts/kOSMachine0mLegacy/part.cfg | 2 +- Resources/GameData/kOS/Parts/kOSMachine1m/part.cfg | 2 +- Resources/GameData/kOS/Parts/kOSMachineRad/part.cfg | 2 +- src/kOS/Module/kOSProcessor.cs | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Resources/GameData/kOS/Parts/kOSMachine0m/part.cfg b/Resources/GameData/kOS/Parts/kOSMachine0m/part.cfg index a12eef52d..cb01db040 100755 --- a/Resources/GameData/kOS/Parts/kOSMachine0m/part.cfg +++ b/Resources/GameData/kOS/Parts/kOSMachine0m/part.cfg @@ -45,7 +45,7 @@ PART MODULE { name = kOSProcessor - diskSpace = 5000 + diskSpace = 4096 ECPerBytePerSecond = 0 ECPerInstruction = 0.000004 } diff --git a/Resources/GameData/kOS/Parts/kOSMachine0mLegacy/part.cfg b/Resources/GameData/kOS/Parts/kOSMachine0mLegacy/part.cfg index 14993d36d..f70e920fd 100644 --- a/Resources/GameData/kOS/Parts/kOSMachine0mLegacy/part.cfg +++ b/Resources/GameData/kOS/Parts/kOSMachine0mLegacy/part.cfg @@ -51,7 +51,7 @@ PART MODULE { name = kOSProcessor - diskSpace = 5000 + diskSpace = 4096 } RESOURCE diff --git a/Resources/GameData/kOS/Parts/kOSMachine1m/part.cfg b/Resources/GameData/kOS/Parts/kOSMachine1m/part.cfg index 7c9069315..c52b15cfe 100755 --- a/Resources/GameData/kOS/Parts/kOSMachine1m/part.cfg +++ b/Resources/GameData/kOS/Parts/kOSMachine1m/part.cfg @@ -45,7 +45,7 @@ PART MODULE { name = kOSProcessor - diskSpace = 10000 + diskSpace = 8192 ECPerBytePerSecond = 0 ECPerInstruction = 0.000004 } diff --git a/Resources/GameData/kOS/Parts/kOSMachineRad/part.cfg b/Resources/GameData/kOS/Parts/kOSMachineRad/part.cfg index e04b79eab..dc6ccc601 100755 --- a/Resources/GameData/kOS/Parts/kOSMachineRad/part.cfg +++ b/Resources/GameData/kOS/Parts/kOSMachineRad/part.cfg @@ -43,7 +43,7 @@ PART MODULE { name = kOSProcessor - diskSpace = 60000 + diskSpace = 65568 ECPerBytePerSecond = 0 ECPerInstruction = 0.000004 } diff --git a/src/kOS/Module/kOSProcessor.cs b/src/kOS/Module/kOSProcessor.cs index a4cd6fddf..553af2763 100644 --- a/src/kOS/Module/kOSProcessor.cs +++ b/src/kOS/Module/kOSProcessor.cs @@ -102,7 +102,7 @@ public string Tag public float baseModuleMass = 0F; // this is the base mass added to a part for including the kOSProcessor, default to 0. [KSPField(isPersistant = false, guiName = "kOS Disk Space", guiActive = false, guiActiveEditor = true, groupName = PAWGroup, groupDisplayName = PAWGroup), UI_FloatRange(scene = UI_Scene.Editor)] - public float diskSpaceUI = 1024f; //needed for the slider, Could convert from String back into float or int. but works better and feels natural to have as a float to begin with + public float diskSpaceUI = 2048f; //needed for the slider, Could convert from String back into float or int. but works better and feels natural to have as a float to begin with --> raised to 2048 to mimich Apollo [KSPField(isPersistant = true, guiName = "CPU/Disk Upgrade Cost", guiActive = false, guiActiveEditor = true, groupName = PAWGroup, groupDisplayName = PAWGroup)] public float additionalCost = 0F; @@ -111,7 +111,7 @@ public string Tag public float additionalMassGui = 0F; [KSPField(isPersistant = true, guiActive = false, guiActiveEditor = false)] - public float diskSpaceCostFactor = 0.0244140625F; //implies approx 100funds for 4096bytes of diskSpace. SliderNote: would recommend a small increase to: 0.0484140625F + public float diskSpaceCostFactor = 0.0524140625F; //implies approx 100funds for 4096bytes of diskSpace. SliderNote: would recommend a small increase to: 0.0484140625F [KSPField(isPersistant = true, guiActive = false, guiActiveEditor = false)] public float diskSpaceMassFactor = 0.0000000048829F; //implies approx 0.020kg for 4096bytes of diskSpace @@ -134,7 +134,7 @@ public string Tag // IMPORTANT: The value defaults to zero and must be overriden in the module // definition for any given part (within the part.cfg file). [KSPField(isPersistant = true, guiActive = false)] - public float ECPerBytePerSecond = 0F; + public float ECPerBytePerSecond = 0.000002F; //needs tuning, MM can be used for more modern specs public kOSProcessor() { From 4d811c9d2c5c308963e8a3bf625c8f061474dab8 Mon Sep 17 00:00:00 2001 From: Coaxgames Date: Thu, 21 May 2026 00:39:18 -0600 Subject: [PATCH 8/9] Pushing for a test save, currently balancing KOS for all --- src/kOS/Module/kOSProcessor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kOS/Module/kOSProcessor.cs b/src/kOS/Module/kOSProcessor.cs index 553af2763..a3968e0b7 100644 --- a/src/kOS/Module/kOSProcessor.cs +++ b/src/kOS/Module/kOSProcessor.cs @@ -102,7 +102,7 @@ public string Tag public float baseModuleMass = 0F; // this is the base mass added to a part for including the kOSProcessor, default to 0. [KSPField(isPersistant = false, guiName = "kOS Disk Space", guiActive = false, guiActiveEditor = true, groupName = PAWGroup, groupDisplayName = PAWGroup), UI_FloatRange(scene = UI_Scene.Editor)] - public float diskSpaceUI = 2048f; //needed for the slider, Could convert from String back into float or int. but works better and feels natural to have as a float to begin with --> raised to 2048 to mimich Apollo + public float diskSpaceUI = 1024f; //needed for the slider, Could convert from String back into float or int. but works better and feels natural to have as a float to begin with --> raised to 2048 to mimich Apollo [KSPField(isPersistant = true, guiName = "CPU/Disk Upgrade Cost", guiActive = false, guiActiveEditor = true, groupName = PAWGroup, groupDisplayName = PAWGroup)] public float additionalCost = 0F; @@ -111,7 +111,7 @@ public string Tag public float additionalMassGui = 0F; [KSPField(isPersistant = true, guiActive = false, guiActiveEditor = false)] - public float diskSpaceCostFactor = 0.0524140625F; //implies approx 100funds for 4096bytes of diskSpace. SliderNote: would recommend a small increase to: 0.0484140625F + public float diskSpaceCostFactor = 0.0644140625F; //implies approx 100funds for 4096bytes of diskSpace. SliderNote: would recommend a small increase to: 0.0484140625F [KSPField(isPersistant = true, guiActive = false, guiActiveEditor = false)] public float diskSpaceMassFactor = 0.0000000048829F; //implies approx 0.020kg for 4096bytes of diskSpace From 57f218528f47cc501befd3770ec7c2b51a02fef5 Mon Sep 17 00:00:00 2001 From: Coaxgames Date: Wed, 27 May 2026 22:47:37 -0600 Subject: [PATCH 9/9] Increased Cost of DiskSpace directly, in 1969 the cost of a bit was roughly a dollar for magnetic core memory; 32k for 1000$ did not make sense whatso ever That said inflation (according to google..) the current cost now would be roughly $275K... the current new cost is x8 more than "the base mods" specs and roughly 10x cheaper than in 1969 --- src/kOS/Module/kOSProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kOS/Module/kOSProcessor.cs b/src/kOS/Module/kOSProcessor.cs index a3968e0b7..72ad96a0c 100644 --- a/src/kOS/Module/kOSProcessor.cs +++ b/src/kOS/Module/kOSProcessor.cs @@ -111,7 +111,7 @@ public string Tag public float additionalMassGui = 0F; [KSPField(isPersistant = true, guiActive = false, guiActiveEditor = false)] - public float diskSpaceCostFactor = 0.0644140625F; //implies approx 100funds for 4096bytes of diskSpace. SliderNote: would recommend a small increase to: 0.0484140625F + public float diskSpaceCostFactor = 0.0984140625F; //implies approx 100funds for 4096bytes of diskSpace. SliderNote: would recommend a small increase to: 0.0484140625F [KSPField(isPersistant = true, guiActive = false, guiActiveEditor = false)] public float diskSpaceMassFactor = 0.0000000048829F; //implies approx 0.020kg for 4096bytes of diskSpace