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

Create an account  

 
Tactical combat

The AI Tactical combat was not very bright, so I was happy when Kyrub improved it.
Now the combat are much better, but something is not sound.

When I saw 4 Minotaurs going after my bowman, moving next to my cavalry headed to the enemy bowmen, without attacking my cavalry even if they could, I thought something needs to be fixed.

AI should check at the beginning of every turn, what (and IF) is the best spell to cast, then decide for every unit the best target to hit/pursue.

I.E. The minotaur next to my cavalry can decide to attack it, while another 2 squares away to my cavalry and 5 squares away from my bowman, can decide to pursue the bowman, knowing the cavalry cannot be reached, unless it moves voluntarily next to the M, while the bowman, if there are enough pursuers, can be reached and killed.

I think the parameters to be used to decide what unit attack are:
1. Invulnerability
2. Distance
3. Number of HP combined
4. Defense
5. Cost

1. Invulnerability
Heroes should skip this check. If the enemy is immune to one or all my attacks, do not use the attack(s) against it.

2. Distance
The closer the higher the chance it will be targeted. If I have to choose between an enemy I can hit vs another I have to move to hit, the first should be preferred most (all?) of the times.

3. Number of HP combined
If a unit is wounded it is easier to kill, if it has special skills that do not depends on its health (like fireball, increase allied resistance, etc.) could be better kill it immediately.

4. Defense
Less defense to the attack, means more damage inflicted. If the damage is presumed null, could be better to choose another target or do not attack at all.

5. Cost
Killing an expensive unit is more enemy wizard damaging, since it have to spend more if it want to build it again.


There are other factors (killing a low level hero, before it become too powerful; searching for an invisible enemy), but to start this could be enough. rolleye
Only the people crazy enough to think they can change the world of Arcanus and Myrror can do it. rolleye
Reply

(December 14th, 2015, 15:34)FrancoK Wrote: The AI Tactical combat was not very bright, so I was happy when Kyrub improved it.
Now the combat are much better, but something is not sound.

When I saw 4 Minotaurs going after my bowman, moving next to my cavalry headed to the enemy bowmen, without attacking my cavalry even if they could, I thought something needs to be fixed.

AI should check at the beginning of every turn, what (and IF) is the best spell to cast, then decide for every unit the best target to hit/pursue.

I.E. The minotaur next to my cavalry can decide to attack it, while another 2 squares away to my cavalry and 5 squares away from my bowman, can decide to pursue the bowman, knowing the cavalry cannot be reached, unless it moves voluntarily next to the M, while the bowman, if there are enough pursuers, can be reached and killed.

I think the parameters to be used to decide what unit attack are:
1. Invulnerability
2. Distance
3. Number of HP combined
4. Defense
5. Cost

1. Invulnerability
Heroes should skip this check. If the enemy is immune to one or all my attacks, do not use the attack(s) against it.

2. Distance
The closer the higher the chance it will be targeted. If I have to choose between an enemy I can hit vs another I have to move to hit, the first should be preferred most (all?) of the times.

3. Number of HP combined
If a unit is wounded it is easier to kill, if it has special skills that do not depends on its health (like fireball, increase allied resistance, etc.) could be better kill it immediately.

4. Defense
Less defense to the attack, means more damage inflicted. If the damage is presumed null, could be better to choose another target or do not attack at all.

5. Cost
Killing an expensive unit is more enemy wizard damaging, since it have to spend more if it want to build it again.


There are other factors (killing a low level hero, before it become too powerful; searching for an invisible enemy), but to start this could be enough. rolleye

Insecticide added a new bug (or feature? idk but it's bad) to this procedure.
When a target is close enough to attack in the current turn, that one is supposed to receive a bonus to priority.
However, insecticide changed the <= in this check to "<" so anything reachable exactly that turn with the last movement point, does not count. Guess how many movement points most units have? Yea, 1, and those units will never, ever think "hey, I can attack this guy this turn, let's go for it".
idk why Kyrub did this but Raid will undo it, among other changes to the targeting procedure. See W158.

The actual factors the AI looks at
-does the target have ranged attacks and how strong
-How much is their effective defense considering all immunities against the attack we use
-Is a wall blocking the way
-Is it a spirit in a node square
-Is the unit sleeping
-Is it damaged? (doesn't matter how much)
-Is it confused?
-Did we attack the same guy last turn?
-If we are a hero, do we have enough defense to risk attacking the target?
-Is there a Wall of Fire in the way?
-Can we reach the target and attack this turn

however, the numbers on many of these are poorly set up by default which does not help much, again W158 should help a lot.
Reply

(December 14th, 2015, 18:31)Seravy Wrote: Insecticide added a new bug (or feature? idk but it's bad) to this procedure.
When a target is close enough to attack in the current turn, that one is supposed to receive a bonus to priority.
However, insecticide changed the <= in this check to "<" so anything reachable exactly that turn with the last movement point, does not count. Guess how many movement points most units have? Yea, 1, and those units will never, ever think "hey, I can attack this guy this turn, let's go for it".
idk why Kyrub did this but Raid will undo it, among other changes to the targeting procedure. See W158.
I think it was intended as a feature: attacking ranged attacker first. I remember in my mind I pictured 4 Great Wyrms attacked by 4 Minotaurs and 4 LongBowmen with GW attacking the ranged units first, then the melee troops.
It is indeed good to attack enemy ranged troops first, if they can hurt our units, but not always, especially if the unit selected is slow.

Quote:The actual factors the AI looks at
-does the target have ranged attacks and how strong
if our units are immune to the ranged does it drop to 0?

Quote:-How much is their effective defense considering all immunities against the attack we use
Including our spells?


Quote:-Is a wall blocking the way
For path calculation (can I reach it or there is a wall in between?) or simply the wall defense bonus?

Quote:-Is it a spirit in a node square
I suppose it gets an higher priority. Is also valid for guardian spirit?

Quote:-Is the unit sleeping
To leave it last or to kill it first?

Quote:-Is it damaged? (doesn't matter how much)
I will prefer: "can I kill it in a round?"


Quote:-Is it confused?
To lower the chance of targeting by at least 25% I suppose.


Quote:-Did we attack the same guy last turn?
To spread or to concentrate the attacks?

Quote:-If we are a hero, do we have enough defense to risk attacking the target?
Very good! I never imagined this. Does this take in account the next round attack of all the enemies able to reach it?


Quote:-Is there a Wall of Fire in the way?
I never bothered WoF, did anyone?


Quote:-Can we reach the target and attack this turn
This one should be at least more important than WoF. wink


Quote:however, the numbers on many of these are poorly set up by default which does not help much, again W158 should help a lot.
So far you've made so many bugfixes I wasn't able to read them all (Hey! It's a compliment! bow ) I'm finishing the FIX first, then AI, DIPL and finally FEAT, but I'm going to take a look at this now. jive
Only the people crazy enough to think they can change the world of Arcanus and Myrror can do it. rolleye
Reply

The problem with kyrub's changes was that there was too much priority on attacking ranged troops. The CP's melee troops would ignore your melee troops and try to get to the archers. Of course, you can just move your archers farther away and murder them with your infantry. Many times, the CP's units would be better off just charging forward and attacking the first unit they see. It's what I do...try to get 3 of my units concentrating on 1 of his units, blammo crippled. One of the things that I think kyrub was susceptible to was creating his patch for the way MoM was played in 2010-2012. He spent a lot of effort trying to invalidate the invulnerable guardian spirit exploit, for example.
Reply

(December 15th, 2015, 10:42)Tiltowait Wrote: The problem with kyrub's changes was that there was too much priority on attacking ranged troops.
You mean before the patch or after?
In general attacking the ranged troops is fine, if you use ranged troops, spells or very fast units. In effects the melee troops should protect the ranged troops from enemy melee troops.


Quote: The CP's melee troops would ignore your melee troops and try to get to the archers. Of course, you can just move your archers farther away and murder them with your infantry. Many times, the CP's units would be better off just charging forward and attacking the first unit they see. It's what I do...try to get 3 of my units concentrating on 1 of his units, blammo crippled.
Yep! Should the CP's melee troops come close and "ambush" player's melee troops, like we do with its own, would be better, but it is difficult to code, I suppose.

Quote: One of the things that I think kyrub was susceptible to was creating his patch for the way MoM was played in 2010-2012. He spent a lot of effort trying to invalidate the invulnerable guardian spirit exploit, for example.
Did he succedeed? noidea
Only the people crazy enough to think they can change the world of Arcanus and Myrror can do it. rolleye
Reply

Quote: The CP's melee troops would ignore your melee troops and try to get to the archers.
This was because of this :
Quote:Insecticide added a new bug (or feature? idk but it's bad) to this procedure.
When a target is close enough to attack in the current turn, that one is supposed to receive a bonus to priority.
However, insecticide changed the <= in this check to "<" so anything reachable exactly that turn with the last movement point, does not count. Guess how many movement points most units have? Yea, 1, and those units will never, ever think "hey, I can attack this guy this turn, let's go for it".
In fact, attacking a unit immediately received so much priority that it was almost always done...but the above change prevented it from taking effect on anything that moved 1 per turn. (and even on cavalry they would only attack when standing directly next to your units already, otherwise they'll go for the bowmen)
I honestly have no idea why he changed that, and how he didn't notice it's seriously wrong, probably an accident.

Quote:I think it was intended as a feature: attacking ranged attacker first.
There is a separate modifier for that so no. You can verify this on cavalry. They'll first try to go around your units, but when standing next to your units, their movement of 2<distance of 1, so they'll attack whatever is next to them, ignoring the archers. It is caused by the above.

Quote:if our units are immune to the ranged does it drop to 0?
No, we only know the unit making the attack inside the procedure, not the rest of our army. It's extremely unlikely to have a whole army immune to ranged attacks anyway.

Quote:Including our spells?
We are talking about the "Unit_Attack_Target_Priority" procedure here for melee attacks. Targeting spells is different story that could fill 5 whole subforums :D

Quote:For path calculation (can I reach it or there is a wall in between?) or simply the wall defense bonus?
Path calculation, and to prevent leaving the defended area.

Quote:I suppose it gets an higher priority. Is also valid for guardian spirit?
Anything that has the Meld ability

Quote:To leave it last or to kill it first?
Kill first. Originally only ranged units did that, but I changed it to include melee as well and lowered the priority boost a little.
It's a waste of mana to make something sleep and leave it alive.

Quote:I will prefer: "can I kill it in a round?"
Impossible to calculate, damage is random. We did check our attack vs their defense to prefer targets that would take more damage.

Quote:To lower the chance of targeting by at least 25% I suppose.
Yes, lowers by 10.

Quote:To spread or to concentrate the attacks?
Neither. It's just to make the unit not change their target the next turn unless there is a good reason to. This was too high originally and I lowered it.
This was also partially responsible for the units sticking to a bad decision like going after the archers even when reaching the enemy units, but that insecticide was the root of the problem, this just escalated it.

Quote:Very good! I never imagined this. Does this take in account the next round attack of all the enemies able to reach it?
No, just the counterattack from the guy we try to hit, and only their melee.
Reply



Forum Jump: