diff --git a/AI/Nullkiller/AIGateway.cpp b/AI/Nullkiller/AIGateway.cpp index c803a9259..ac23c2149 100644 --- a/AI/Nullkiller/AIGateway.cpp +++ b/AI/Nullkiller/AIGateway.cpp @@ -281,6 +281,9 @@ void AIGateway::tileRevealed(const std::unordered_set & pos) for(const CGObjectInstance * obj : myCb->getVisitableObjs(tile)) addVisitableObj(obj); } + + if (nullkiller->settings->isUpdateHitmapOnTileReveal()) + nullkiller->dangerHitMap->reset(); } void AIGateway::heroExchangeStarted(ObjectInstanceID hero1, ObjectInstanceID hero2, QueryID query) diff --git a/AI/Nullkiller/Analyzers/DangerHitMapAnalyzer.cpp b/AI/Nullkiller/Analyzers/DangerHitMapAnalyzer.cpp index 792225b7d..5a8d0a24f 100644 --- a/AI/Nullkiller/Analyzers/DangerHitMapAnalyzer.cpp +++ b/AI/Nullkiller/Analyzers/DangerHitMapAnalyzer.cpp @@ -348,6 +348,7 @@ std::set DangerHitMapAnalyzer::getOneTurnAccessibleObj void DangerHitMapAnalyzer::reset() { hitMapUpToDate = false; + tileOwnersUpToDate = false; } } diff --git a/AI/Nullkiller/Engine/Settings.cpp b/AI/Nullkiller/Engine/Settings.cpp index 17f38ad64..0e01aaf09 100644 --- a/AI/Nullkiller/Engine/Settings.cpp +++ b/AI/Nullkiller/Engine/Settings.cpp @@ -37,6 +37,7 @@ namespace NKAI pathfinderBucketSize(32), allowObjectGraph(true), useTroopsFromGarrisons(false), + updateHitmapOnTileReveal(false), openMap(true), useFuzzy(false) { @@ -55,6 +56,7 @@ namespace NKAI retreatThresholdAbsolute = node["retreatThresholdAbsolute"].Float(); safeAttackRatio = node["safeAttackRatio"].Float(); allowObjectGraph = node["allowObjectGraph"].Bool(); + updateHitmapOnTileReveal = node["updateHitmapOnTileReveal"].Bool(); openMap = node["openMap"].Bool(); useFuzzy = node["useFuzzy"].Bool(); useTroopsFromGarrisons = node["useTroopsFromGarrisons"].Bool(); diff --git a/AI/Nullkiller/Engine/Settings.h b/AI/Nullkiller/Engine/Settings.h index 769c5ae91..7e8f9ffbf 100644 --- a/AI/Nullkiller/Engine/Settings.h +++ b/AI/Nullkiller/Engine/Settings.h @@ -33,6 +33,7 @@ namespace NKAI float safeAttackRatio; bool allowObjectGraph; bool useTroopsFromGarrisons; + bool updateHitmapOnTileReveal; bool openMap; bool useFuzzy; @@ -51,6 +52,7 @@ namespace NKAI int getPathfinderBucketSize() const { return pathfinderBucketSize; } bool isObjectGraphAllowed() const { return allowObjectGraph; } bool isGarrisonTroopsUsageAllowed() const { return useTroopsFromGarrisons; } + bool isUpdateHitmapOnTileReveal() const { return updateHitmapOnTileReveal; } bool isOpenMap() const { return openMap; } bool isUseFuzzy() const { return useFuzzy; } }; diff --git a/config/ai/nkai/nkai-settings.json b/config/ai/nkai/nkai-settings.json index 7c29e2f27..b62a62910 100644 --- a/config/ai/nkai/nkai-settings.json +++ b/config/ai/nkai/nkai-settings.json @@ -5,6 +5,7 @@ "mainHeroTurnDistanceLimit" : 10, "scoutHeroTurnDistanceLimit" : 5, "maxGoldPressure" : 0.3, + "updateHitmapOnTileReveal" : false, "useTroopsFromGarrisons" : true, "openMap": false, "allowObjectGraph": false, @@ -22,6 +23,7 @@ "mainHeroTurnDistanceLimit" : 10, "scoutHeroTurnDistanceLimit" : 5, "maxGoldPressure" : 0.3, + "updateHitmapOnTileReveal" : false, "useTroopsFromGarrisons" : true, "openMap": false, "allowObjectGraph": false, @@ -39,6 +41,7 @@ "mainHeroTurnDistanceLimit" : 10, "scoutHeroTurnDistanceLimit" : 5, "maxGoldPressure" : 0.3, + "updateHitmapOnTileReveal" : false, "useTroopsFromGarrisons" : true, "openMap": false, "allowObjectGraph": false, @@ -56,6 +59,7 @@ "mainHeroTurnDistanceLimit" : 10, "scoutHeroTurnDistanceLimit" : 5, "maxGoldPressure" : 0.3, + "updateHitmapOnTileReveal" : false, "useTroopsFromGarrisons" : true, "openMap": true, "allowObjectGraph": false, @@ -73,6 +77,7 @@ "mainHeroTurnDistanceLimit" : 10, "scoutHeroTurnDistanceLimit" : 5, "maxGoldPressure" : 0.3, + "updateHitmapOnTileReveal" : false, "useTroopsFromGarrisons" : true, "openMap": true, "allowObjectGraph": false,