1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Normalized GatherArmy evaluation.

This commit is contained in:
DJWarmonger
2017-06-16 21:14:24 +02:00
parent 9623f7caf3
commit 5e8fe083f2
2 changed files with 2 additions and 22 deletions

View File

@@ -473,7 +473,8 @@ float FuzzyHelper::evaluate (Goals::GatherArmy & g)
//the more army we need, the more important goal
//the more army we lack, the less important goal
float army = g.hero->getArmyStrength();
return g.value / std::max(g.value - army, 1000.0f);
float ratio = g.value / std::max(g.value - army, 2000.0f); //2000 is about the value of hero recruited from tavern
return 5 * (ratio / (ratio + 2)); //so 50% army gives 2.5, asymptotic 5
}
float FuzzyHelper::evaluate (Goals::ClearWayTo & g)