1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00

Threat in DangerHitMap

Added new value threat to DangerHitMapAnalayzer. The purpose is to allow decisions to be less binary around enemy heros.
This commit is contained in:
Xilmi 2024-07-15 17:28:10 +02:00
parent 53c51b4278
commit 48ecbd4cbf
2 changed files with 3 additions and 0 deletions

View File

@ -96,6 +96,7 @@ void DangerHitMapAnalyzer::updateHitMap()
newThreat.hero = path.targetHero;
newThreat.turn = path.turn();
newThreat.threat = path.getHeroStrength() * (1 - path.movementCost() / 2.0);
newThreat.danger = path.getHeroStrength();
if(newThreat.value() > node.maximumDanger.value())

View File

@ -22,6 +22,7 @@ struct HitMapInfo
uint64_t danger;
uint8_t turn;
float threat;
HeroPtr hero;
HitMapInfo()
@ -33,6 +34,7 @@ struct HitMapInfo
{
danger = 0;
turn = 255;
threat = 0;
hero = HeroPtr();
}