]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
The real AME nerf (#29587)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Sun, 7 Jul 2024 14:27:52 +0000 (10:27 -0400)
committerGitHub <noreply@github.com>
Sun, 7 Jul 2024 14:27:52 +0000 (00:27 +1000)
* The real AME nerf

* oh the real change

* Update AmeNodeGroup.cs

Content.Server/Ame/AmeNodeGroup.cs
Content.Server/Ame/EntitySystems/AmeControllerSystem.cs
Content.Shared/Ame/Components/AmeFuelContainerComponent.cs

index 40da6222d20177b24c51f329cdb8124d8b9a4f57..bb482f7726b62264e3a719244b552eed669cd59d 100644 (file)
@@ -134,22 +134,11 @@ public sealed class AmeNodeGroup : BaseNodeGroup
         // The AME is being overloaded.
         // Note about these maths: I would assume the general idea here is to make larger engines less safe to overload.
         // In other words, yes, those are supposed to be CoreCount, not safeFuelLimit.
-        var instability = 0;
         var overloadVsSizeResult = fuel - CoreCount;
 
-        // fuel > safeFuelLimit: Slow damage. Can safely run at this level for burst periods if the engine is small and someone is keeping an eye on it.
-        if (_random.Prob(0.5f))
-            instability = 1;
-        // overloadVsSizeResult > 5:
-        if (overloadVsSizeResult > 5)
-            instability = 3;
-        // overloadVsSizeResult > 10: This will explode in at most 20 injections.
-        if (overloadVsSizeResult > 10)
-            instability = 5;
-
-        // Apply calculated instability
-        if (instability == 0)
-            return powerOutput;
+        var instability = overloadVsSizeResult / CoreCount;
+        var fuzz = _random.Next(-1, 2); // -1 to 1
+        instability += fuzz; // fuzz the values a tiny bit.
 
         overloading = true;
         var integrityCheck = 100;
@@ -179,10 +168,12 @@ public sealed class AmeNodeGroup : BaseNodeGroup
     /// </summary>
     public float CalculatePower(int fuel, int cores)
     {
-        // Fuel is squared so more fuel vastly increases power and efficiency
-        // We divide by the number of cores so a larger AME is less efficient at the same fuel settings
-        // this results in all AMEs having the same efficiency at the same fuel-per-core setting
-        return 20000f * fuel * fuel / cores;
+        // Balanced around a single core AME with injection level 2 producing 120KW.
+        // Overclocking yields diminishing returns until it evens out at around 360KW.
+
+        // 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);
     }
 
     public int GetTotalStability()
index e6abe98b95c6b1d743039fa4aa70f16a6f72b316..eda915827394c8fb0a46584b8e01819b69f58b6c 100644 (file)
@@ -274,9 +274,9 @@ public sealed class AmeControllerSystem : EntitySystem
         At the time of editing, players regularly "overclock" the AME and those cases require no admin attention.
 
         // Admin alert
-        var safeLimit = 0;
+        var safeLimit = int.MaxValue;
         if (TryGetAMENodeGroup(uid, out var group))
-            safeLimit = group.CoreCount * 2;
+            safeLimit = group.CoreCount * 4;
 
         if (oldValue <= safeLimit && value > safeLimit)
         {
@@ -291,10 +291,20 @@ public sealed class AmeControllerSystem : EntitySystem
         */
     }
 
-    public void AdjustInjectionAmount(EntityUid uid, int delta, int min = 0, int max = int.MaxValue, EntityUid? user = null, AmeControllerComponent? controller = null)
+    public void AdjustInjectionAmount(EntityUid uid, int delta, EntityUid? user = null, AmeControllerComponent? controller = null)
     {
-        if (Resolve(uid, ref controller))
-            SetInjectionAmount(uid, MathHelper.Clamp(controller.InjectionAmount + delta, min, max), user, controller);
+        if (!Resolve(uid, ref controller))
+            return;
+
+        var max = GetMaxInjectionAmount((uid, controller));
+        SetInjectionAmount(uid, MathHelper.Clamp(controller.InjectionAmount + delta, 0, max), user, controller);
+    }
+
+    public int GetMaxInjectionAmount(Entity<AmeControllerComponent> ent)
+    {
+        if (!TryGetAMENodeGroup(ent, out var group))
+            return 0;
+        return  group.CoreCount * 8;
     }
 
     private void UpdateDisplay(EntityUid uid, int stability, AmeControllerComponent? controller = null, AppearanceComponent? appearance = null)
index 757a3a515b69b1d42354b695cae7e2987cba5c81..455414597e5a3fc3f03ebebeb7ab41a3a986fa98 100644 (file)
@@ -9,11 +9,11 @@ public sealed partial class AmeFuelContainerComponent : Component
     /// The amount of fuel in the container.
     /// </summary>
     [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
-    public int FuelAmount = 1000;
+    public int FuelAmount = 500;
 
     /// <summary>
     /// The maximum fuel capacity of the container.
     /// </summary>
     [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
-    public int FuelCapacity = 1000;
+    public int FuelCapacity = 500;
 }