AI ethic: use a 1HP unit to do suicidal attack

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
salade
Posts: 50
Joined: January 3rd, 2011, 5:48 am

AI ethic: use a 1HP unit to do suicidal attack

Post by salade »

one of the AI rules as I observed is that when they can kill a unit, they are very likely to attack it, even if there is a chance they will get killed in the attack. I have no complain about this as it creates more surprise that make the game not so easy, such as when I expose a unit to 2 attacker tiles, the enemy may actually use more than 2 units to attack me as they could first do a suicidal attack (attack and get his unit destroyed) and then attack normally.

There is a case just happened that, my L2 ranger on a 60% mountain terrain get attacked by a L2 AI Dragoon with 1 hp from 40% plain ground. The Dragoon could kill me in a single hit and it did and killed my unit. What the AI won't concern is, after its attack, even if it win, I'll kill it in the next turn. (it's a 1hp unit with 16xp) In that game, it is a minor loss to me, and I t hink:
  • the attack is not reasonable. its first strike has 40% hit chance that means you can't reasonably expect it to hit me, and my first counter strike has 60% that means it should assume i could hit. So it is an unfavorable attack IMHO. it is mainly try his luck in the attack.
  • both the two units are L2, my unit has more xp. Say if it is L1, and I'm L2, it may worth to take the risk.
  • I somehow think his attack is quite "unethical" because my context is a World Conquest nightmare game that the AI has a lot of gold and units. In fact, it is just following a "dumb" AI rule to attack. but if we rationalize the attack, we could view it as, it has a lot of gold so it just wouldn't mind to lose a L2 1HP unit to do a suicidal attack. In other context you could say it is just very aggressive or just stupid.
User avatar
Crab
Inactive Developer
Posts: 200
Joined: March 18th, 2009, 9:42 pm

Re: AI ethic: use a 1HP unit to do suicidal attack

Post by Crab »

the point 'even if it win, I'll kill it in the next turn. ' is valid.
but the reasonable/unreasonable part depends on the agression parameter of the AI, which is, by default, 0.4, but is often changed by scenario designers. with default value, AI is happy to lose 166 gold of units to kill 100 gold of units. ( 1/ (1-0.4) = 1.667 )
f
Posts: 11
Joined: January 5th, 2008, 10:29 pm
Location: Germany

Re: AI ethic: use a 1HP unit to do suicidal attack

Post by f »

[quote="salade"]
the attack is not reasonable. its first strike has 40% hit chance that means you can't reasonably expect it to hit me, and my first counter strike has 60% that means it should assume i could hit. So it is an unfavorable attack IMHO. it is mainly try his luck in the attack.
[/quote]

Let us calculate...
In each strike - counter strike round:
chance that the ranger is dead after strike by dragoon: 40%
chance that the dragoon is dead after the retaliation: 60%*60%=36%

So the probability of the death of the ranger is larger in each round...
(not even counting the larger number of strikes of the dragoon or the higher price of the ranger)
salade
Posts: 50
Joined: January 3rd, 2011, 5:48 am

Re: AI ethic: use a 1HP unit to do suicidal attack

Post by salade »

Crab wrote:the point 'even if it win, I'll kill it in the next turn. ' is valid.
no doubt it is too demanding to expect AI to consider more than one step.

f wrote:Let us calculate...
In each strike - counter strike round:
chance that the ranger is dead after strike by dragoon: 40%
chance that the dragoon is dead after the retaliation: 60%*60%=36%
thx i think this is a great answer. my ranger has to survive the dragoon's attack before it can use the 60% hit chance so the kill chance is 36% but not 60%.
Post Reply