瀏覽代碼

Normalized GatherArmy evaluation.

DJWarmonger 8 年之前
父節點
當前提交
5e8fe083f2
共有 2 個文件被更改,包括 2 次插入22 次删除
  1. 0 21
      AI/FuzzyLite/.gitignore
  2. 2 1
      AI/VCAI/Fuzzy.cpp

+ 0 - 21
AI/FuzzyLite/.gitignore

@@ -1,21 +0,0 @@
-# Compiled Object files
-*.slo
-*.lo
-*.o
-*.obj
-
-# Compiled Dynamic libraries
-*.so
-*.dylib
-*.dll
-
-# Compiled Static libraries
-*.lai
-*.la
-*.a
-*.lib
-
-# Executables
-*.exe
-*.out
-*.app

+ 2 - 1
AI/VCAI/Fuzzy.cpp

@@ -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)