diff --git a/GameData/KerbalConstructionTime/KCT_Presets/UpFree.cfg b/GameData/KerbalConstructionTime/KCT_Presets/UpFree.cfg index 166b320..f09346b 100644 --- a/GameData/KerbalConstructionTime/KCT_Presets/UpFree.cfg +++ b/GameData/KerbalConstructionTime/KCT_Presets/UpFree.cfg @@ -37,8 +37,8 @@ KCT_Preset UpgradeFundsFormula = -1 UpgradeScienceFormula = -1 ResearchFormula = [R]^2/86400 - EffectivePartFormula = min([c]/([I] + ([B]*([U]+1))), [c]) - ProceduralPartFormula = (([C]-[A]) + ([A]*10/max([I],1))) / max([B]*([U]+1),1) + EffectivePartFormula = min([c]/([I] + ([B]*([U]+1)))*[MV]*[PV], [c]) + ProceduralPartFormula = (([C]-[A]) + ([A]*10/max([I],1))) / max([B]*([U]+1),1) *[MV]*[PV] BPFormula = ([E]^(1/2))*2000*[O] KSCUpgradeFormula = ([C]^(1/2))*1000*[O] ReconditioningFormula = min([M]*[O]*[E], [X])*abs([RE]-[S]) @@ -50,4 +50,15 @@ KCT_Preset RolloutCostFormula = 0 NewLaunchPadCostFormula = 100000*([N]^3) } + KCT_Preset_Part_Variables + { + Part_Variables + { + //partName = multiplier + } + Module_Variables + { + //moduleName = multiplier + } + } } diff --git a/GameData/KerbalConstructionTime/KCT_Presets/default.cfg b/GameData/KerbalConstructionTime/KCT_Presets/default.cfg index 35d3635..699b96a 100644 --- a/GameData/KerbalConstructionTime/KCT_Presets/default.cfg +++ b/GameData/KerbalConstructionTime/KCT_Presets/default.cfg @@ -50,4 +50,15 @@ KCT_Preset RolloutCostFormula = 0 NewLaunchPadCostFormula = 100000*([N]^3) } + KCT_Preset_Part_Variables + { + Part_Variables + { + //partName = multiplier + } + Module_Variables + { + //moduleName = multiplier + } + } } diff --git a/GameData/KerbalConstructionTime/KCT_Presets/rlowtech.cfg b/GameData/KerbalConstructionTime/KCT_Presets/rlowtech.cfg index bc8aa05..2f4c92d 100644 --- a/GameData/KerbalConstructionTime/KCT_Presets/rlowtech.cfg +++ b/GameData/KerbalConstructionTime/KCT_Presets/rlowtech.cfg @@ -50,4 +50,15 @@ KCT_Preset MaxReconditioning = 16 RolloutReconSplit = 0.25 } + KCT_Preset_Part_Variables + { + Part_Variables + { + //partName = multiplier + } + Module_Variables + { + //moduleName = multiplier + } + } } diff --git a/Kerbal_Construction_Time/KCT_PresetManager.cs b/Kerbal_Construction_Time/KCT_PresetManager.cs index 3b14661..514da2a 100644 --- a/Kerbal_Construction_Time/KCT_PresetManager.cs +++ b/Kerbal_Construction_Time/KCT_PresetManager.cs @@ -282,7 +282,7 @@ public KCT_Preset(KCT_Preset Source) ConfigNode.LoadObjectFromConfig(generalSettings, Source.generalSettings.AsConfigNode()); ConfigNode.LoadObjectFromConfig(timeSettings, Source.timeSettings.AsConfigNode()); ConfigNode.LoadObjectFromConfig(formulaSettings, Source.formulaSettings.AsConfigNode()); - partVariables.FromConfigNode(Source.partVariables.ToConfigNode()); + partVariables.FromConfigNode(Source.partVariables.AsConfigNode()); } public ConfigNode AsConfigNode() @@ -302,6 +302,7 @@ public ConfigNode AsConfigNode() node.AddNode(generalSettings.AsConfigNode()); node.AddNode(timeSettings.AsConfigNode()); node.AddNode(formulaSettings.AsConfigNode()); + node.AddNode(partVariables.AsConfigNode()); return node; } @@ -415,7 +416,7 @@ private Dictionary NodeToDictionary(ConfigNode node) return dict; } - public ConfigNode ToConfigNode() + public ConfigNode AsConfigNode() { ConfigNode node = new ConfigNode("KCT_Preset_Part_Variables"); node.AddNode(DictionaryToNode(Part_Variables, "Part_Variables")); diff --git a/Kerbal_Construction_Time/KerbalConstructionTime.cs b/Kerbal_Construction_Time/KerbalConstructionTime.cs index f4e7dd7..8bf1f85 100644 --- a/Kerbal_Construction_Time/KerbalConstructionTime.cs +++ b/Kerbal_Construction_Time/KerbalConstructionTime.cs @@ -397,8 +397,12 @@ private void EditorRecalculation() public static bool moved = false; private static bool updateChecked = false; private static int failedLvlChecks = 0; + //private static double elapsedTimer = 0; + //private static double elapsedTicks = 0; public void FixedUpdate() { + //System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch(); + /* #if DEBUG if (!updateChecked && KCT_GameStates.settings.CheckForDebugUpdates && !KCT_GameStates.firstStart) @@ -593,6 +597,16 @@ public void FixedUpdate() //print(e.StackTrace); Debug.LogException(e); } + + /* timer.Stop(); + + elapsedTimer += timer.Elapsed.TotalMilliseconds; + elapsedTicks++; + if (elapsedTicks >= 60) + { + KCTDebug.Log("Time per update: "+(elapsedTimer/elapsedTicks)); + elapsedTicks = 0; + }*/ } /* private void RecoverToVAB()