Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear AME power generation #2783

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions Content.Server/Ame/AmeNodeGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,21 @@ public float CalculatePower(int fuel, int cores)
{
return 0f;
}

// Power generation curve assuming x is the number of cores and the injection scales linearly to always be the twice the number of cores.
// https://www.wolframalpha.com/input?i=200000+*+log10%28%28x*2%29%5E1.9%29+*+%280.4+*+%28%28x*2%29+%2F+x%29%29+for+x+from+1+to+10
return 200000f * MathF.Log10(MathF.Pow(fuel, 1.9f)) * (0.4f * (fuel / cores));

//more parametrized and linear AME power function https://www.desmos.com/calculator/qsdxxvpcq8
float wattsPerCore = 80000f;
float efficencyPenalty = 2f;
float tailPenaltyFactor = 0.9f;

float efficency = fuel / (2 * efficencyPenalty * cores);

if (fuel >= 2 * cores - 1)
efficency += (fuel - (2 * cores - 1)) * (1 - 1 / efficencyPenalty);

if (fuel >= 2 * cores)
efficency -= (fuel - (2 * cores)) * (1 - 1 / efficencyPenalty) * tailPenaltyFactor;

return efficency * wattsPerCore * cores;
// End of DeltaV code
}

Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Catalog/Cargo/cargo_engines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
sprite: Objects/Power/AME/ame_jar.rsi
state: jar
product: CrateEngineeringAMEJar
cost: 2000
cost: 20000
nkokic marked this conversation as resolved.
Show resolved Hide resolved
category: cargoproduct-category-name-engineering
group: market

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
state: jar
- type: AmeFuelContainer
- type: StaticPrice
price: 500
price: 5000
nkokic marked this conversation as resolved.
Show resolved Hide resolved
- type: GuideHelp
guides: [ AME, Power ]
1 change: 0 additions & 1 deletion Resources/Prototypes/Procedural/salvage_rewards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
CrateMaterialPlastic: 1.0
CrateMaterialSteel: 1.0
# things the station might want
CrateEngineeringAMEJar: 0.25
nkokic marked this conversation as resolved.
Show resolved Hide resolved
CrateFoodPizzaLarge: 0.25
CrateFoodSoftdrinks: 0.25
CrateFunInstrumentsVariety: 0.25
Expand Down
Loading