[Formule] Deuterium Consumption.
Closed this issue · 2 comments
Discussed in #544
Originally posted by FGServers April 29, 2023
I've been looking at various ogame calculators because we know we can't get the original ogame formulas. and use us ChatGPT-4
I came to the conclusion that now ogame uses a single deuterium consumption factor, we have to analyze this well
These functions are inside XGP, that is, chatGPT-4, I modify them.
Formule function Proxyprox - Calculater ogame
options.prm.deutFactor = Selector [100%, 90%, 80%, 70% ,60%, 50%]:
let baseConsumption = Math.floor(Math.floor(options.shipsData[i][3] * 0.1 * options.prm.deutFactor) * (1 - classFactor) * (1 - lfFactor));
function getDeutConsumption(minSpeed, distance, duration, speedPercent, uniSpeedFactor) {
let totalConsumption = 0;
let shipConsumption = 0;
let i;
for(i = 0; i < options.shipsData.length; i++)
{
let shipsCount = getInputNumber($('#' + options.shipsData[i][0])[0]);
options.prm.ships[i] = shipsCount;
if (shipsCount > 0) {
let baseShipSpeed = getShipSpeed(i);
let shipSpeedValue = 35000 / (duration * uniSpeedFactor - 10) * Math.sqrt(distance * 10 / baseShipSpeed);
let classFactor = options.prm.playerClass === 1 ? 0.01 * options.prm.deutConsReduction * (1 + 0.002 * options.prm.lfMechanGE) : 0;
let boostabeID = jQuery.inArray(options.shipsData[i][0], options.boostableShips);
let shipLFBonus = 0;
if (boostabeID > -1 && options.prm.lfShipsBonuses[boostabeID] > 0) {
shipLFBonus = options.prm.lfShipsBonuses[boostabeID];
}
let lfFactor = (options.prm.lfDeutBonus + shipLFBonus) * 0.01;
let baseConsumption = Math.floor(Math.floor(options.shipsData[i][3] * 0.1 * options.prm.deutFactor) * (1 - classFactor) * (1 - lfFactor));
shipConsumption = Math.round(baseConsumption * shipsCount);
shipConsumption = shipConsumption < 1 ? 1 : shipConsumption;
totalConsumption += shipConsumption * distance / 35000 * ((shipSpeedValue / 10) + 1) * ((shipSpeedValue / 10) + 1);
}
}
totalConsumption = Math.round(totalConsumption);
return totalConsumption;
}
getShipSpeed -> determina la velocidad de la flota por nave, creo que la calculadora las divide por tipos dudo que ogame tenga separada las naves en Civilis y de ataque
function getShipSpeed(index) {
let civilShips = [0, 1, 6, 7, 8];
let shipSpeed = options.shipsData[index][1] * (1 + (options.driveBonuses[options.shipsData[index][2]]/100));
if (isSpeedDoubled(options.prm.playerClass, index)) {
shipSpeed += options.shipsData[index][1];
}
if ($('#warrior-bonus')[0].checked) {
shipSpeed += options.shipsData[index][1] * 0.1;
}
if ($('#trader-bonus')[0].checked && index < 2) {
shipSpeed += options.shipsData[index][1] * 0.1;
}
let lfBonus = 0;
if (options.shipsData[index][0] !== 'death-star')
lfBonus += options.prm.lfSpeedBonusAll * 0.01; // данные видны в процентах
if (jQuery.inArray(index, civilShips) > -1)
lfBonus += options.prm.lfSpeedBonusCivil * 0.01;
let boostabeID = jQuery.inArray(options.shipsData[index][0], options.boostableShips);
if (boostabeID > -1 && options.prm.lfShipsBonuses[boostabeID] > 0) {
lfBonus += options.prm.lfShipsBonuses[boostabeID] * 0.01;
}
shipSpeed += Math.round(options.shipsData[index][1] * lfBonus);
return shipSpeed;
}
public static function fleetConsumption($fleetArray, $speed_factor, $mission_duration, $mission_distance, $user)
{
$consumption = 0;
$basic_consumption = 0;
foreach ($fleetArray as $ship => $count) {
if ($ship > 0) {
$ship_speed = self::fleetMaxSpeed(null, $ship, $user);
$combustion_level = $user['research_combustion_engine'] ?? 0;
$spd = 35000 / ($mission_duration * $speed_factor - 10) * sqrt($mission_distance * 10 / $ship_speed);
$basic_consumption = ($count * $spd * self::getConsumptionFactor($ship, $combustion_level)) / 10;
$consumption += $basic_consumption;
}
}
return round($consumption);
}
private static function getConsumptionFactor(int $ship, int $combustion_level): float
{
$consumption_factor = Objects::getInstance()->getPrice($ship, 'consumption_factor');
$combustion_level_bonus = 1 + ($combustion_level * 0.1);
return $consumption_factor * $combustion_level_bonus;
}
consumption_factor table
Nave | Capacidad | Consumo |
---|---|---|
Pequeña Carga | 10 | 0.1 |
Gran Carga | 50 | 0.5 |
Cazador Ligero | 20 | 0.2 |
Cazador Pesado | 75 | 0.75 |
Crucero | 300 | 3.0 |
Nave de Batalla | 500 | 5.0 |
Acorazado | 1000 | 1.0 |
Bombardero | 700 | 7.0 |
Destructor | 2000 | 20.0 |
Estrella de la Muerte | 7000 | 70.0 |
Acorazado de Batalla | 750 | 7.5 |
Colonizador | 1000 | 10.0 |
Reciclador | 300 | 3.0 |
Sonda de Espionaje | 1 | 0.01 |
Satélite Solar | 0 | 0 |
Taladrador | 20 | 0.2 |
Segador | 10 | 0.1 |
Explorador | 10 | 0.1 |
Chat GPT-4 It gave me this but I don't know but it may be that the ogame table is unified in the hangar
I'm sure a while back I did a revision of everything, specially on a server running x1. So I don't think I will look again at this unless there's an actual issue.
IIgual yo me puse analizar e investigar formulas por que vi esto en el Api/ServerData.xml, y me intrigo para que servia jajaja
0.8