]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix AME power generation (#32825)
authorGolinth <amh2023@gmail.com>
Tue, 17 Dec 2024 23:56:02 +0000 (17:56 -0600)
committerGitHub <noreply@github.com>
Tue, 17 Dec 2024 23:56:02 +0000 (00:56 +0100)
* Change AME power generation

* Fix negative power, change formula slightly

Content.Server/Ame/AmeNodeGroup.cs

index bb482f7726b62264e3a719244b552eed669cd59d..f4eb1bb302f4819cca1135e7c3153b66158cecab 100644 (file)
@@ -169,11 +169,13 @@ public sealed class AmeNodeGroup : BaseNodeGroup
     public float CalculatePower(int fuel, int cores)
     {
         // Balanced around a single core AME with injection level 2 producing 120KW.
-        // Overclocking yields diminishing returns until it evens out at around 360KW.
+        // Two core with four injection is 150kW. Two core with two injection is 90kW.
 
-        // The adjustment for cores make it so that a 1 core AME at 2 injections is better than a 2 core AME at 2 injections.
-        // However, for the relative amounts for each (1 core at 2 and 2 core at 4), more cores has more output.
-        return 200000f * MathF.Log10(fuel * fuel) * MathF.Pow(0.75f, cores - 1);
+        // Increasing core count creates diminishing returns, increasing injection amount increases 
+        // Unlike the previous solution, increasing fuel and cores always leads to an increase in power, even if by very small amounts.
+        // Increasing core count without increasing fuel always leads to reduced power as well.
+        // At 18+ cores and 2 inject, the power produced is less than 0, the Max ensures the AME can never produce "negative" power.
+        return MathF.Max(200000f * MathF.Log10(2 * fuel * MathF.Pow(cores, (float)-0.5)), 0);
     }
 
     public int GetTotalStability()