Skip to content

Commit

Permalink
Fix AME power generation (space-wizards#32825)
Browse files Browse the repository at this point in the history
* Change AME power generation

* Fix negative power, change formula slightly
  • Loading branch information
Golinth authored Dec 17, 2024
1 parent 984b290 commit a9cf54a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Content.Server/Ame/AmeNodeGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,13 @@ public float InjectFuel(int fuel, out bool overloading)
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()
Expand Down

0 comments on commit a9cf54a

Please sign in to comment.