Auto-translated
The formula for determining the value of a unit stack is incorrect or not quite right; here is the correct formula:
FV_unit = floor((sqrt(Fight_Value + (Fight_Value * (Hero_Attack + Attack_Bonus) / 20) * (Fight_Value + (Fight_Value * Hero_Defense + Defense_Bonus) / 20)))
And if the expression Fv_unit * Sum_of_Units > 2 * Fight_Value * N is true, then the AI will attack the main stacks; if it is not true, then it will avoid them and attack individual units.
floor - rounds the resulting number down.
Where bonuses are the sum of bonuses for native territory (+0 or +1) and the bonus to the unit from the hero's special ability for that unit, in units. For example, Galtran's +1 at level 1 will give to skeletons. Fight_Value is the unit's value.
This formula can be used when attacking Black Towers with a black or golden dragon.
Also, a more general formula for a mixed army to determine at what point the AI algorithm changes in battle:
Σ(Ni * floor(sqrt(V(vi,ha,b1) * V(ai,hd,b1)))) > 2 * vj * Nj,
where V(vi,ha,b1) = FV_unit.
If the formula is not true, then the AI will try to protect archers, attack those who deal less retaliatory damage, keep its distance from the main stack's attack, attack the unit from which the retaliatory attack has been removed, and which is wounded. And in general, many different coefficients are used; in general, the damage will be based on Unit_Value * Damage / Unit_HP
FV_unit = floor((sqrt(Fight_Value + (Fight_Value * (Hero_Attack + Attack_Bonus) / 20) * (Fight_Value + (Fight_Value * Hero_Defense + Defense_Bonus) / 20)))
And if the expression Fv_unit * Sum_of_Units > 2 * Fight_Value * N is true, then the AI will attack the main stacks; if it is not true, then it will avoid them and attack individual units.
floor - rounds the resulting number down.
Where bonuses are the sum of bonuses for native territory (+0 or +1) and the bonus to the unit from the hero's special ability for that unit, in units. For example, Galtran's +1 at level 1 will give to skeletons. Fight_Value is the unit's value.
This formula can be used when attacking Black Towers with a black or golden dragon.
Also, a more general formula for a mixed army to determine at what point the AI algorithm changes in battle:
Σ(Ni * floor(sqrt(V(vi,ha,b1) * V(ai,hd,b1)))) > 2 * vj * Nj,
where V(vi,ha,b1) = FV_unit.
If the formula is not true, then the AI will try to protect archers, attack those who deal less retaliatory damage, keep its distance from the main stack's attack, attack the unit from which the retaliatory attack has been removed, and which is wounded. And in general, many different coefficients are used; in general, the damage will be based on Unit_Value * Damage / Unit_HP
isq 742235848