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

- Significantly improved exploration algorithm

- Workaround to make AI gather army when exploration is not possible anymore
- Possibly fixed issue with AI not capturing guarded objects
This commit is contained in:
DjWarmonger
2014-02-07 20:09:15 +00:00
parent a9b10c8099
commit d17b3a14bd
4 changed files with 40 additions and 10 deletions

View File

@@ -471,6 +471,13 @@ float FuzzyHelper::evaluate (Goals::VisitHero & g)
g.setpriority(Goals::VisitTile(obj->visitablePos()).sethero(g.hero).setisAbstract(g.isAbstract).accept(this));
return g.priority;
}
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::min(g.value - army, 1000.0f);
}
float FuzzyHelper::evaluate (Goals::BuildThis & g)
{
return 1;