ARKStatsExtractor icon indicating copy to clipboard operation
ARKStatsExtractor copied to clipboard

The calculation for min food rate is incorrect

Open hallipr opened this issue 2 years ago • 2 comments

I'm pretty sure Crumplecorn's calculations for minRate and maxRate are wrong.

https://github.com/cadon/ARKStatsExtractor/blob/26619f618b75fb50e86b0e5e8f7dae2fc4490d7a/ARKBreedingStats/uiControls/Trough.cs#L41-L44

Daeodon has the taming stats:

babyFoodConsumptionMult: 40,
foodConsumptionBase: 0.01

With Game.ini:

BabyMatureSpeedMultiplier=0.0   <<-- to hold dinos at a specific maturation for long durations
TamedDinoCharacterFoodDrainMultiplier=5.0
BabyFoodConsumptionSpeedMultiplier=3.0

and GameUserSettings.ini

DinoCharacterFoodDrainMultiplier=7.0

The current calculation for minFoodRate would be:

baseMinFoodRate * species.taming.babyFoodConsumptionMult * babyFoodConsumptionSpeedMultiplier = 0.000155 * 40 * 3 = 0.0186

In local tests: A 99.999% daeodon consumed 160 food in 458 seconds. A rate of 0.349 f/s. A 0% daeodon consumed 1000 food in ~23 seconds. A rate of ~43 f/s.

This would indicate that TamedDinoCharacterFoodDrainMultiplier and DinoCharacterFoodDrainMultiplier are used for min and max, and BabyFoodConsumptionSpeedMultiplier is only used in max:

5 * 7 * 0.01 = 0.35
3 * 5 * 7 * 40 * 0.01 = 42

I think the correct formula for minRate and maxRate should be:

var dinoMult = DinoCharacterFoodDrainMultiplier;
var tamedMult = TamedDinoCharacterFoodDrainMultiplier;
var babyMult= BabyFoodConsumptionSpeedMultiplier;
var minRate = species.taming.foodConsumptionBase * dinoMult * tamedMult;
var maxRate = species.taming.foodConsumptionBase * dinoMult * tamedMult * babyMult * species.taming.babyFoodConsumptionMult;

A simple reduction could be:

minRate = speciesBase * dinoMult * tamedMult * 1
maxRate = speciesBase * dinoMult * tamedMult * babyMult * speciesBabyMult

or

specificRate = speciesBase * dinoMult * tamedMult * (1 --> babyMult * speciesBabyMult)

specificRate = speciesBase * dinoMult * tamedMult * (1 + ((1-maturation) * (babyMult * speciesBabyMult - 1))

for the 0%

specificRate = 0.01 * 7 * 5 * (1 + 1 * (3 * 40 - 1))
             = 0.01 * 7 * 5 * (1 + 119)
             = 0.01 * 7 * 5 * 120
             = 42

for 99.999%

specificRate = 0.01 * 7 * 5 * (1 + 0.00001 * (3 * 40 - 1))
             = 0.01 * 7 * 5 * (1 + 0.00001 * 119)
             = 0.01 * 7 * 5 * 1.00119
             = 0.01 * 7 * 5 * 1.00119
             = 0.3504165

hallipr avatar Jan 25 '23 10:01 hallipr

I ran a longer duration test with:

BabyMatureSpeedMultiplier=0.0
BabyFoodConsumptionSpeedMultiplier=0.1
TamedDinoCharacterFoodDrainMultiplier=1.0
DinoCharacterFoodDrainMultiplier=1.0

A 0% Daeodon lost 661 food over 16727 seconds at 0.039995 f/s.

That's:

specificRate = speciesBase * dinoMult * tamedMult * (1 + ((1-maturation) * (babyMult * speciesBabyMult - 1))
             = 0.01 * 1 * 1 * (1 + (1 - 0) * (0.1 * 40 - 1))
             = 0.01 * (1 + 4 - 1)
             = 0.01 * 4
             = 0.04

hallipr avatar Jan 25 '23 16:01 hallipr

Rate over time is just:

startMaturatation = maturation(babyAge)
endMaturatation = maturation(babyAge + duration)

startRate = specificRate(startMaturation)
endRate = specificRate(endMaturation)

foodDrained = (startRate + endRate) / 2 * duration

this would need proper clamps around duration to not bleed into adult time

hallipr avatar Jan 25 '23 16:01 hallipr