Last active
January 23, 2025 03:08
-
-
Save Sans3108/702d7653a0be0a49ad15acea5787af61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Utils | |
type Quality = 'Normal' | 'Uncommon' | 'Rare' | 'Epic' | 'Legendary'; | |
const ThrusterConsumption: Record<Quality, number> = { | |
Normal: 120, | |
Uncommon: 156, | |
Rare: 192, | |
Epic: 228, | |
Legendary: 300 | |
}; | |
const PumpSpeed: Record<Quality, number> = { | |
Normal: 1200, | |
Uncommon: 1560, | |
Rare: 1920, | |
Epic: 2280, | |
Legendary: 3000 | |
}; | |
// Options | |
const pumpQuality: Quality = 'Rare'; | |
const thrusterQuality: Quality = 'Rare'; | |
const thrusterCount = 17; | |
const desiredLoad = 0.75; | |
// Calculation | |
const thrusterRate = ThrusterConsumption[thrusterQuality]; | |
const totalConsumption = thrusterCount * thrusterRate * desiredLoad; | |
const pumpRate = PumpSpeed[pumpQuality]; | |
const pumpsNeeded = Math.floor(totalConsumption / pumpRate); | |
const leftoverConsumption = totalConsumption % pumpRate; | |
const pumpUnitsPerTick = pumpRate / 60; | |
const activeTicks = leftoverConsumption / pumpUnitsPerTick; | |
console.log(` | |
To sustain ${thrusterCount}x ${thrusterQuality} Thruster @ ${desiredLoad * 100}% load: | |
- Total consumption: ${totalConsumption.toFixed(1)} fluid/s | |
- Pumps required: ${pumpsNeeded}x ${pumpQuality} Pump | |
- Extra ${pumpQuality} Pump active for: ${activeTicks.toFixed(1)} ticks | |
`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Small program that figures out how many pumps and how much fluid you need for your space platform thrusters in Factorio: Space Age