As a French person I feel like it's my duty to explain strikes to you. - AdrienIer

Create an account  

 
AI

AI advantage multipliers per difficulty :
Still subject to change so I'm not going to type it out.

^^^The above is what is listed in the CasterOfMagic doc that comes with the file as of 5.05.
Reply

Oh...it's in the changelog, in the EXP10 section.
(the AI SoM research line is now obsolete though - everyone has the same SoM research cost in the new research system. Also starting gold was increased to compensate for the starting settler change.)
Reply

So in Hadriex's last video, I noticed an AI problem. The AI correctly prioritizes targeting combat summons lower for each spell - but if has two spells that have different effects, it might go for the combat summon anyway.

In particular, if it knows Doom Bolt and could nuke the Demon Lord, it will still prefer to Disintegrate or Annihilate the summoned Zombie or Demon instead. Which is bad because these are cheap to summon (well, not the demons but those are free from the Demon Lord itself) so repeatedly doing this can cause the AI to run out of skill so the Demon Lord will survive when it could have been killed.
Problem is, if I simply say "priority to use disintegrate/annihilate on combat summons = low" then it will fail to do it even in cases where there is no demon lord that needs killing - for example it might decide that instead of Doom Bolting that Air Elemental, it's better to cast invulnerability and lionheart on their halberdiers, which just gives more chances for the enemy to cause damage.
Now adding a condition of "only if there are more than 1 enemy units" can at least ensure it won't interfere if there is no choice between 2 units...but if there are 3 combat summons left, or one combat summon and a few unimportant normal units, then the AI might opt to do silly things like buffing instead of nuking them.

Since direct damage all follow the same priority formula, this sort of problem can only happen at a choice between direct damage and an instant kill spell that has a high chance of working. (or equivalent)

Which means I unfortunately can't avoid going into detail on this and differentiate between the various summons, but can at least assume we only need to decrease priority on instant KO spells - direct damage won't pick the lower value target even if they are two different spells, and the direct damage outprioritizing the instant KO spell that could wipe out the expensive unit at a reasonable chance, I don't think can happen (albeit the AI might doom bolt that catapult instead of trying a 20% chance to kill the demon lord, but that isn't such a bad choice?).

So we have...
Zombies. Obviously, spending a high end instant KO spell on this is always a waste. It moves 1 so any sort of unit the AI has will be able to dispose of it. So low priority for this one. (maybe make exorcise and petrify exceptions? 100% success but only costs 20...nah, better to kill the demonlord first? But what is there is no demonlord and the human is using the zombie to detect invisible units? Arggh. Okay zombies aren't trivial. If not even zombies are trivial, might as well drop the entire idea...)

(Yes, I actually had a game where the AI nuking my zombie instantly when I needed to reveal their invisible unit to target it was a deciding factor that turned several battles to the AI's favor - not the entire game but enough to not want to lose this functionality...)
Reply

A couple issues where it seems the AI can be baited easily. One major and one smaller:

The AI recklessly spends MP in combat. This can be (ab)used particularly across the planes where the multiplier is maximum. The AI will happily spend 1000 MP in combat involving two minor units. All you have to do is find units that can keep away from the enemy and can survive the direct damage the AI might throw. It doesn't even matter if you lose in the end after the AI has spent out. This might be rather difficult one to fix, but perhaps the AI could cap his spending based on the value of units present?

When attacking a city, it seems the AI sallies out rather too easily. Perhaps he only (or at least mostly) considers ranged superiority on sallying out. Which means if you leave at least one unit of ammo unspent, and can well enough survive what ranged attacks come your way, you can fight the melee without the walls helping the enemy. Often he could even survive my ranged attacks well inside the walls, but will get killed as he steps out of the protection of his walls. I get that sallying is meant to counter chipping away with a few ranged units. But more often than not it seems much counterproductive to the AI now. Perhaps the AI should take a look at melee superiority and even speed superiority and more readily choose to sit it out? I mean just buying time, making the player chip away a few turns, would often seem to be a better AI strategy than sallying. Buys time to buy (ranged) units and bring in reinforcements.
Reply

The AI already isn't able to spend mana in combat if their mana reserve is getting dangerously low and that's the best I can do. It's not ideal but it's still better than the AI auto-losing battles because it refuses to spend mana. It isn't human so it can't tell the difference between a battle where a single trireme is attacked, or one where same trireme is fully loaded with transports, or between losing a random zombie or losing a valueable magician heading towards the stack assembly point.

For ranged superiority, amount of ammo should be included in the calculations. This doesn't matter though - on turn one they will leave the walls and once they did, they can't go back even if the attackers use up their ammo. Deciding to abandon the walls is a one time non-reversible action. There is a limit of how much ranged superiority is needed though, 1-2 inexperienced bowmen won't do it. If you feel there is a particular battle where your ranged force was too low but the AI abandoned the walls anyway, do let me know and I'll see if there is a need to raise the limit.
Reply

My gut feeling would be that only the transport scenario is where the AI really needs to spend the mana. And at least I'm very rarely seeing that matter - I can practically always kill the transport anyway if the AI spells don't kill me in 2 turns. And ~2 turns worth of mana the AI could spend either way(?), it's 15 turns that's abusable. Losing minor battles that might have been winnable with spending massive mana seems either way. And the AI has the resource bonus in both (in units and in mana).

But you have far more experience with this than I, and I have a feeling the AI mana use has been discussed (and probably even tested) to death earlier. So fair enough, and thanks for you time.
Reply

AI teleporters. They often teleport, attack, teleport - which uses up their last movement and they can't attack again. Can they be taught to prioritize targets next to them, at least a little bit? Enough that if the target next to them, and another target are the same, but the farther one has taken a small (less than half? Really though even if was only when both have taken the same damage that would be a huge improvement) amount of damage, the teleporter will prefer the adjacent target?

(Unicorns and great wyrms are the main offenders here - attack with 9 magicians and each teleporter should kill 2 but almost always it's only 1 each.)
Reply

So basically, change teleporters to count as infinite range if they have 1.5 or more moves, but otherwise use their normal range of "1"? I can try to see if there is a way to add that detail but can't guarantee it.
Reply

Yes.

Or simply add 1 priority (or some other low number) to adjacent units. 

Not sure of details though so that might not work.

Actually normal units do it too - go around the front row magician to attack the back row magician. But they don't lose attacks as noticeably.


I know one culprit is damaged targets - the AI wants to kill them first. But if they can one shot the unit at full health that shouldn't matter.
Reply

Well, there is a priority modifier for units that can be reached that turn.

...looked at the code. What you ask for is already there : Teleporters only count as having infinite "reach" for the distance check if they have 1.5 movement or higher.

Which means if they do not attack the closer target, the priority difference must be larger between the units than the priority bonus for picking the immediately reachable one. The bonus is fairly large, +6 btw, and there is an additional +12 if the unit has a thrown/gaze/breath attack and a further +5 if the target is also wounded.

In the case you describe those don't apply so only the difference of 6 needs to be overcome by other modifiers. - for example if the expected damage to the other target is enough to kill it, that's a +5 on top of the damage difference so likely enough. If all targets are "borderline" cases that have a 50-50 chance of dying to the attack, the AI might randomly assume one dies and the other does not and pick whichever rolled the better simulated attack damage. It's not 100% this is where the problem is from, but the most likely.
Reply



Forum Jump: