From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sun, 7 Jul 2024 14:27:52 +0000 (-0400) Subject: The real AME nerf (#29587) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=ed7f00692e38c4fecf37090d364882dcdc54f18e;p=space-station-14.git The real AME nerf (#29587) * The real AME nerf * oh the real change * Update AmeNodeGroup.cs --- diff --git a/Content.Server/Ame/AmeNodeGroup.cs b/Content.Server/Ame/AmeNodeGroup.cs index 40da6222d2..bb482f7726 100644 --- a/Content.Server/Ame/AmeNodeGroup.cs +++ b/Content.Server/Ame/AmeNodeGroup.cs @@ -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 /// 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() diff --git a/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs b/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs index e6abe98b95..eda9158273 100644 --- a/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs +++ b/Content.Server/Ame/EntitySystems/AmeControllerSystem.cs @@ -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 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) diff --git a/Content.Shared/Ame/Components/AmeFuelContainerComponent.cs b/Content.Shared/Ame/Components/AmeFuelContainerComponent.cs index 757a3a515b..455414597e 100644 --- a/Content.Shared/Ame/Components/AmeFuelContainerComponent.cs +++ b/Content.Shared/Ame/Components/AmeFuelContainerComponent.cs @@ -9,11 +9,11 @@ public sealed partial class AmeFuelContainerComponent : Component /// The amount of fuel in the container. /// [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] - public int FuelAmount = 1000; + public int FuelAmount = 500; /// /// The maximum fuel capacity of the container. /// [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] - public int FuelCapacity = 1000; + public int FuelCapacity = 500; }