Nullkiller AI will now prefer giving its scout heroes faster units to
optimize their movement points on next turns.
Unit selection logic:
- AI prefers to give 'weak' units that won't affect army strength of main
hero. Unit is considered 'weak' if its level below 4 or if its AI value
is below 1% of total army strength. So AI can give high-tier unit to
scout, but only if main hero already has massive army.
- Within weak units, if hero is moving on terrain with penalty, AI will
always prefer units that are native to this terrain. So on snow AI will
always prefer unit from Tower even if its speed is lower than unit from
another faction.
- Within remaining candidates, AI will prefer unit that will give higher
movement points limit. This also means that in case of H3 rules, all
units with 11+ speed will be viewed as equally good
- If there are multiple units with same speed, AI will prefer unit with
lowest AI value
AI will no longer leave the defense of a threatened town in order to bring the army to another hero.
AI will no longer send heroes to die outside of towns that already have a garrisioning hero inside, if there's a stronger enemy hero lurking around the town.
AI no longer rushes towns that don't have a citadel or better when there is a scary enemy hero around.
AI will no longer try to maximize defenses by using the strongest possible defender. Instead it will try to use the most appropriate defender. The most appropriate is considered to have roughly 75% power of the threat and the score will be lower but still above zero the bigger the deviation is.
Dismissing StayAtTown-tasks for heroes with less than 100 movement-points in order to avoid these tasks to be creates for heroes that have no movement over and over.
Resource-silo is now evaluated by it's output rather than like a building the AI doesn't know what it is good for.
AI should now try to maximize the highest mage-guild instead of building them slowly one by one.
Drastically reducing the score of dwelling-upgrades for upgrades the AI already has.
Heroes that are currently threatened anyways will be more brave and not care about going for things that are also threatened if there is nothing safe in range.
AI will no longer waste their heroe's MPs defending cities that don't have at least a Citatdel.
Reverted prior change that caused AI to no longer push for grey towns.
AI no longer thinks it can recharge their mana at towns without a mage-guild.
AI no longer treats neutral monsters as if they were their enemies.
Upgrading armies no longer has it's own priority-tier. It is now handled at the same-priority as hunter-gather.
Fixed an issue causing the AI to use evaluationContext.powerRatio as maxWillingToLose instead of evaluationContext.powerRatio * ai->settings->getMaxArmyLossTarget().
Defense-tasks no longer ignore maxWillingToLose when the target isn't a hero.
Basic dwellings get a score-boost to take into consideration that units are immediately hirerable as opposed to just being added at the beginning of next weak. This means they should win out against early Citadels more.
Handling for conditional quicker mage-guild-upgrading incase of caster-mains.
AI-heroes are reduce their confidence for attacks based on how many of the units they currently have stacks from exist somewhere else in their empire. So for example if an AI has 2 black-drakes while 3 more are waiting in their castle, they act as if their army was only 2/5th as strong as it is. This should make them more likely to first reinforce their army before attacking.
Changed the formula of scoring dwelling-upgrades in a way that doesn't overvalue upgrading vs. producing new units so much.
AI will no longer be so overconfident when fighting enemy heroes near their own castle. This lead to a lot of horrible trades, especially between different AI which made FFAs way easier in the long run.
AI should be better at preventing their enemies finding their towns undefended due to considering enemies that are not immediately in their castle's range too.
If only gold is missing but no special-resources the AI will no longer devalue what building it wants to build next and build something cheaper instead. This should lead to AI quicker reaching their tier 7 units and skipping some unnecessary lower tiers on the way to it.
- human player will now use pathfinder settings from config (as before)
- nullkiller AI will now use its own, modified settings
- added option to configure NKAI usage of monolith to config
- fixed pathfinder costs not updating on receiving levelup
AI now has better (but not perfect) system for scoring artifacts.
All artifacts now have their base score, based on bonuses provided by
the artifact. For composite artifacts, AI will also consider bonuses
from its components.
When exploring, AI will now weight artifacts as min(base score, price /
5), meaning even artifacts that AI can't score will still have some
priority, if only to sell them or deny them to enemy
AI will now also consider what to equip when trading with heroes or on
the end of AI pass. When considering what to equip, hero will use base
score of an artifact, adjusted by how relevant particular bonus /
artifact for a hero. Some examples:
- Morale-bonusing artifacts have their score reduced based on percentage
of undeads in the army, all the way to 0 for undead-only troops
- Artifacts that give spells (books, hat) will have score reduced based
on how many of these spells are already known by hero
- Land movement artifacts have zero score while on water and vice versa
- Necromancy artifacts will have zero score if hero does not have
necromancy
- Archery artifacts are scaled by amount of ranged troops, and only used
if hero has archery skill
AI may still equip 'bad' artifact, however this should only happen if
hero has no other artifacts to equip into said slot.
TODO's for future PR's (although not sure if / when I will work on
these):
- avoid equipping duplicates of the same artifact. Most notably with
scrolls, but may happen with other misc artifacts or rings.
- consideration for various spell-immunity neclaces
- consideration for birectional artifacts, like Shackles of War, or some
Spheres - since these artifacts need consideration on what our expected
enemy is to correctly estimate whether
- equipping artifacts based on immediate need - for example, equipping
recovery artifacts before end of day, equipping legion pieces only in
town on day 7, preparing for strong / weak enemies (or even preparing
for specific enemy in advance)
- transferring resource-generating artifacts and such to scout heroes,
allowing main hero to focus on combat
- ensure that AI can equip combined artifacts even if non-primary slots
are in use - by considering whether score of combined artifact is higher
than score of all used slots