浏览代码

Merge pull request #3782 from Alexander-Wilms/typo

Fix typo: preasure -> pressure
Andrii Danylchenko 1 年之前
父节点
当前提交
50432b9614

+ 1 - 1
AI/Nullkiller/AIGateway.cpp

@@ -682,7 +682,7 @@ void AIGateway::showBlockingDialog(const std::string & text, const std::vector<C
 					&& components.size() == 2
 					&& components.front().type == ComponentType::RESOURCE
 					&& (nullkiller->heroManager->getHeroRole(hero) != HeroRole::MAIN
-						|| nullkiller->buildAnalyzer->isGoldPreasureHigh()))
+						|| nullkiller->buildAnalyzer->isGoldPressureHigh()))
 				{
 					sel = 1;
 				}

+ 5 - 5
AI/Nullkiller/Analyzers/BuildAnalyzer.cpp

@@ -120,9 +120,9 @@ TResources BuildAnalyzer::getTotalResourcesRequired() const
 	return result;
 }
 
-bool BuildAnalyzer::isGoldPreasureHigh() const
+bool BuildAnalyzer::isGoldPressureHigh() const
 {
-	return goldPreasure > ai->settings->getMaxGoldPreasure();
+	return goldPressure > ai->settings->getMaxGoldPressure();
 }
 
 void BuildAnalyzer::update()
@@ -167,15 +167,15 @@ void BuildAnalyzer::update()
 
 	if(ai->cb->getDate(Date::DAY) == 1)
 	{
-		goldPreasure = 1;
+		goldPressure = 1;
 	}
 	else
 	{
-		goldPreasure = ai->getLockedResources()[EGameResID::GOLD] / 5000.0f
+		goldPressure = ai->getLockedResources()[EGameResID::GOLD] / 5000.0f
 			+ (float)armyCost[EGameResID::GOLD] / (1 + 2 * ai->getFreeGold() + (float)dailyIncome[EGameResID::GOLD] * 7.0f);
 	}
 
-	logAi->trace("Gold preasure: %f", goldPreasure);
+	logAi->trace("Gold pressure: %f", goldPressure);
 }
 
 void BuildAnalyzer::reset()

+ 3 - 3
AI/Nullkiller/Analyzers/BuildAnalyzer.h

@@ -84,7 +84,7 @@ private:
 	std::vector<TownDevelopmentInfo> developmentInfos;
 	TResources armyCost;
 	TResources dailyIncome;
-	float goldPreasure;
+	float goldPressure;
 	Nullkiller * ai;
 
 public:
@@ -95,8 +95,8 @@ public:
 	TResources getTotalResourcesRequired() const;
 	const std::vector<TownDevelopmentInfo> & getDevelopmentInfo() const { return developmentInfos; }
 	TResources getDailyIncome() const { return dailyIncome; }
-	float getGoldPreasure() const { return goldPreasure; }
-	bool isGoldPreasureHigh() const;
+	float getGoldPressure() const { return goldPressure; }
+	bool isGoldPressureHigh() const;
 	bool hasAnyBuilding(int32_t alignment, BuildingID bid) const;
 
 private:

+ 2 - 2
AI/Nullkiller/Behaviors/BuildingBehavior.cpp

@@ -47,13 +47,13 @@ Goals::TGoalVec BuildingBehavior::decompose(const Nullkiller * ai) const
 		totalDevelopmentCost.toString());
 
 	auto & developmentInfos = ai->buildAnalyzer->getDevelopmentInfo();
-	auto isGoldPreasureLow = !ai->buildAnalyzer->isGoldPreasureHigh();
+	auto isGoldPressureLow = !ai->buildAnalyzer->isGoldPressureHigh();
 
 	for(auto & developmentInfo : developmentInfos)
 	{
 		for(auto & buildingInfo : developmentInfo.toBuild)
 		{
-			if(isGoldPreasureLow || buildingInfo.dailyIncome[EGameResID::GOLD] > 0)
+			if(isGoldPressureLow || buildingInfo.dailyIncome[EGameResID::GOLD] > 0)
 			{
 				if(buildingInfo.notEnoughRes)
 				{

+ 1 - 1
AI/Nullkiller/Behaviors/BuyArmyBehavior.cpp

@@ -46,7 +46,7 @@ Goals::TGoalVec BuyArmyBehavior::decompose(const Nullkiller * ai) const
 
 		for(const CGHeroInstance * targetHero : heroes)
 		{
-			if(ai->buildAnalyzer->isGoldPreasureHigh()	&& !town->hasBuilt(BuildingID::CITY_HALL))
+			if(ai->buildAnalyzer->isGoldPressureHigh()	&& !town->hasBuilt(BuildingID::CITY_HALL))
 			{
 				continue;
 			}

+ 1 - 1
AI/Nullkiller/Behaviors/GatherArmyBehavior.cpp

@@ -344,7 +344,7 @@ Goals::TGoalVec GatherArmyBehavior::upgradeArmy(const Nullkiller * ai, const CGT
 
 					if(scoutReinforcement >= armyToGetOrBuy.upgradeValue
 						&& ai->getFreeGold() >20000
-						&& !ai->buildAnalyzer->isGoldPreasureHigh())
+						&& !ai->buildAnalyzer->isGoldPressureHigh())
 					{
 						Composition recruitHero;
 

+ 1 - 1
AI/Nullkiller/Behaviors/RecruitHeroBehavior.cpp

@@ -85,7 +85,7 @@ Goals::TGoalVec RecruitHeroBehavior::decompose(const Nullkiller * ai) const
 				continue;
 
 			if(ai->cb->getHeroesInfo().size() < ai->cb->getTownsInfo().size() + 1
-				|| (ai->getFreeResources()[EGameResID::GOLD] > 10000 && !ai->buildAnalyzer->isGoldPreasureHigh()))
+				|| (ai->getFreeResources()[EGameResID::GOLD] > 10000 && !ai->buildAnalyzer->isGoldPressureHigh()))
 			{
 				tasks.push_back(Goals::sptr(Goals::RecruitHero(town).setpriority(3)));
 			}

+ 4 - 4
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -85,7 +85,7 @@ void PriorityEvaluator::initVisitTile()
 	rewardTypeVariable = engine->getInputVariable("rewardType");
 	closestHeroRatioVariable = engine->getInputVariable("closestHeroRatio");
 	strategicalValueVariable = engine->getInputVariable("strategicalValue");
-	goldPreasureVariable = engine->getInputVariable("goldPreasure");
+	goldPressureVariable = engine->getInputVariable("goldPressure");
 	goldCostVariable = engine->getInputVariable("goldCost");
 	fearVariable = engine->getInputVariable("fear");
 	value = engine->getOutputVariable("Value");
@@ -1017,9 +1017,9 @@ public:
 		
 		if(evaluationContext.goldReward)
 		{
-			auto goldPreasure = evaluationContext.evaluator.ai->buildAnalyzer->getGoldPreasure();
+			auto goldPressure = evaluationContext.evaluator.ai->buildAnalyzer->getGoldPressure();
 
-			evaluationContext.addNonCriticalStrategicalValue(evaluationContext.goldReward * goldPreasure / 3500.0f / bi.prerequisitesCount);
+			evaluationContext.addNonCriticalStrategicalValue(evaluationContext.goldReward * goldPressure / 3500.0f / bi.prerequisitesCount);
 		}
 
 		if(bi.notEnoughRes && bi.prerequisitesCount == 1)
@@ -1111,7 +1111,7 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task)
 		rewardTypeVariable->setValue(rewardType);
 		closestHeroRatioVariable->setValue(evaluationContext.closestWayRatio);
 		strategicalValueVariable->setValue(evaluationContext.strategicalValue);
-		goldPreasureVariable->setValue(ai->buildAnalyzer->getGoldPreasure());
+		goldPressureVariable->setValue(ai->buildAnalyzer->getGoldPressure());
 		goldCostVariable->setValue(evaluationContext.goldCost / ((float)ai->getFreeResources()[EGameResID::GOLD] + (float)ai->buildAnalyzer->getDailyIncome()[EGameResID::GOLD] + 1.0f));
 		turnVariable->setValue(evaluationContext.turn);
 		fearVariable->setValue(evaluationContext.enemyHeroDangerRatio);

+ 1 - 1
AI/Nullkiller/Engine/PriorityEvaluator.h

@@ -109,7 +109,7 @@ private:
 	fl::InputVariable * strategicalValueVariable;
 	fl::InputVariable * rewardTypeVariable;
 	fl::InputVariable * closestHeroRatioVariable;
-	fl::InputVariable * goldPreasureVariable;
+	fl::InputVariable * goldPressureVariable;
 	fl::InputVariable * goldCostVariable;
 	fl::InputVariable * fearVariable;
 	fl::OutputVariable * value;

+ 3 - 3
AI/Nullkiller/Engine/Settings.cpp

@@ -26,7 +26,7 @@ namespace NKAI
 		: maxRoamingHeroes(8),
 		mainHeroTurnDistanceLimit(10),
 		scoutHeroTurnDistanceLimit(5),
-		maxGoldPreasure(0.3f), 
+		maxGoldPressure(0.3f), 
 		maxpass(30),
 		allowObjectGraph(false)
 	{
@@ -71,9 +71,9 @@ namespace NKAI
 			maxpass = node.Struct()["maxpass"].Integer();
 		}
 
-		if(node.Struct()["maxGoldPreasure"].isNumber())
+		if(node.Struct()["maxGoldPressure"].isNumber())
 		{
-			maxGoldPreasure = node.Struct()["maxGoldPreasure"].Float();
+			maxGoldPressure = node.Struct()["maxGoldPressure"].Float();
 		}
 
 		if(!node.Struct()["allowObjectGraph"].isNull())

+ 2 - 2
AI/Nullkiller/Engine/Settings.h

@@ -25,14 +25,14 @@ namespace NKAI
 		int mainHeroTurnDistanceLimit;
 		int scoutHeroTurnDistanceLimit;
 		int maxpass;
-		float maxGoldPreasure;
+		float maxGoldPressure;
 		bool allowObjectGraph;
 
 	public:
 		Settings();
 
 		int getMaxPass() const { return maxpass; }
-		float getMaxGoldPreasure() const { return maxGoldPreasure; }
+		float getMaxGoldPressure() const { return maxGoldPressure; }
 		int getMaxRoamingHeroes() const { return maxRoamingHeroes; }
 		int getMainHeroTurnDistanceLimit() const { return mainHeroTurnDistanceLimit; }
 		int getScoutHeroTurnDistanceLimit() const { return scoutHeroTurnDistanceLimit; }

+ 1 - 1
config/ai/nkai/nkai-settings.json

@@ -3,5 +3,5 @@
 	"maxpass" : 30,
 	"mainHeroTurnDistanceLimit" : 10,
 	"scoutHeroTurnDistanceLimit" : 5,
-	"maxGoldPreasure" : 0.3
+	"maxGoldPressure" : 0.3
 }

+ 13 - 13
config/ai/nkai/object-priorities.txt

@@ -91,7 +91,7 @@ InputVariable: strategicalValue
   term: MEDIUM Triangle 0.250 1.000 2.000
   term: HIGH Triangle 1.000 2.000 3.000
   term: CRITICAL Ramp 2.000 3.000
-InputVariable: goldPreasure
+InputVariable: goldPressure
   description: Ratio between weekly army cost and gold income
   enabled: true
   range: 0.000 1.000
@@ -238,19 +238,19 @@ RuleBlock: gold
   disjunction: AlgebraicSum
   implication: AlgebraicProduct
   activation: General
-  rule: if goldReward is HUGE and goldPreasure is HIGH and heroRole is SCOUT and danger is NONE then Value is HIGHEST
-  rule: if goldReward is HUGE and goldPreasure is HIGH and heroRole is SCOUT and danger is not NONE and armyLoss is LOW then Value is BITHIGH
+  rule: if goldReward is HUGE and goldPressure is HIGH and heroRole is SCOUT and danger is NONE then Value is HIGHEST
+  rule: if goldReward is HUGE and goldPressure is HIGH and heroRole is SCOUT and danger is not NONE and armyLoss is LOW then Value is BITHIGH
   rule: if goldReward is HUGE and heroRole is MAIN and danger is not NONE and armyLoss is LOW then Value is HIGHEST
-  rule: if goldReward is HUGE and goldPreasure is HIGH and heroRole is MAIN and danger is NONE then Value is HIGH
-  rule: if goldReward is BIG and goldPreasure is HIGH and heroRole is SCOUT and danger is NONE then Value is HIGH
-  rule: if goldReward is BIG and goldPreasure is HIGH and heroRole is SCOUT and danger is not NONE then Value is MEDIUM
-  rule: if goldReward is BIG and goldPreasure is HIGH and heroRole is MAIN and danger is not NONE and armyLoss is LOW then Value is HIGH
-  rule: if goldReward is BIG and goldPreasure is HIGH and heroRole is MAIN and danger is NONE then Value is MEDIUM
-  rule: if goldReward is MEDIUM and goldPreasure is HIGH and heroRole is SCOUT and danger is NONE then Value is BITHIGH
-  rule: if goldReward is MEDIUM and goldPreasure is HIGH and heroRole is SCOUT and danger is not NONE then Value is SMALL
-  rule: if goldReward is MEDIUM and goldPreasure is HIGH and heroRole is MAIN and danger is not NONE and armyLoss is LOW then Value is BITHIGH
-  rule: if goldReward is SMALL and goldPreasure is HIGH and heroRole is SCOUT and danger is NONE then Value is MEDIUM
-  rule: if goldReward is SMALL and goldPreasure is HIGH and heroRole is MAIN and danger is not NONE and armyLoss is LOW then Value is SMALL
+  rule: if goldReward is HUGE and goldPressure is HIGH and heroRole is MAIN and danger is NONE then Value is HIGH
+  rule: if goldReward is BIG and goldPressure is HIGH and heroRole is SCOUT and danger is NONE then Value is HIGH
+  rule: if goldReward is BIG and goldPressure is HIGH and heroRole is SCOUT and danger is not NONE then Value is MEDIUM
+  rule: if goldReward is BIG and goldPressure is HIGH and heroRole is MAIN and danger is not NONE and armyLoss is LOW then Value is HIGH
+  rule: if goldReward is BIG and goldPressure is HIGH and heroRole is MAIN and danger is NONE then Value is MEDIUM
+  rule: if goldReward is MEDIUM and goldPressure is HIGH and heroRole is SCOUT and danger is NONE then Value is BITHIGH
+  rule: if goldReward is MEDIUM and goldPressure is HIGH and heroRole is SCOUT and danger is not NONE then Value is SMALL
+  rule: if goldReward is MEDIUM and goldPressure is HIGH and heroRole is MAIN and danger is not NONE and armyLoss is LOW then Value is BITHIGH
+  rule: if goldReward is SMALL and goldPressure is HIGH and heroRole is SCOUT and danger is NONE then Value is MEDIUM
+  rule: if goldReward is SMALL and goldPressure is HIGH and heroRole is MAIN and danger is not NONE and armyLoss is LOW then Value is SMALL
   rule: if goldReward is LOWEST then Value is SMALL with 0.1
   rule: if goldReward is SMALL then Value is SMALL with 0.2
   rule: if goldReward is MEDIUM then Value is SMALL with 0.5