Who Defends?

Leha

ooseepoosee
Joined
Jun 24, 2003
Messages
2,456
Location
Israel,Bat-Yam.
I've got a question .

Suppose there are AI's pike and knight on the same tile .
If my units attack them , they will attack pike first , till it's "injured" and only then they will attack knight . But if AI units attack my pike and knight in the same situation , they can attack knight first sometimes . Why ???

Moderator Action: This discussion was getting too extensive for the Quick Answers thread so I have split it out. :) --Padma
Please read the forum rules: http://forums.civfanatics.com/showthread.php?t=422889
 
Maybe your knight is veteran and the pike is regular?

They both got 3 defense, but if the knight is veteran, it has more hitpoints and therefore it's a better defender.
 
It's supposed to be the strongest defensive unit there. The program considers a Elite Knight at two defense better than an regular (or injured) Pikeman at three defese. I'm sure there's a formula for it, I just don't keep those elite units on my defesive stack where the AI can get them.
 
Originally posted by Frollo
Maybe your knight is veteran and the pike is regular?

They both got 3 defense...

I think you're getting mixed up between Cavalry (3 defence) and Knight (2 defence).

EDIT: I was wrong, see later admission :o
 
OK . I see now , Turner :(

I was sure offensive unit doesn't count as deffender , no matter what it's deffense is .
 
I know all these numbers are so easy to mix up! :)

Anyway, what do we think will happen when the following units are attacked:

- injured veteran pikeman (3 def, 3 HP)
- uninjured regular knight (3 def, 3 HP)

I hope the AI is smart enough to considerate that we may want to immediately counterattack with the knight.

Perhaps if def and HP are equal, the one with the lowest movement points will defend?
 
Originally posted by Frollo
I hope the AI is smart enough to considerate that we may want to immediately counterattack with the knight.

Perhaps if def and HP are equal, the one with the lowest movement points will defend?
Then again, maybe it would consider the Knight's ability to retreat?
 
Originally posted by leha
I was sure offensive unit doesn't count as deffender , no matter what it's deffense is .
Oh no, I'm sure that if a spearman (defender, def 2) and a knight (offensive but def 3) got attacked, the knight will definately take the blows.
 
Originally posted by Dianthus

Then again, maybe it would consider the Knight's ability to retreat?
Good point. I think it does.

This calls for a little experiment! :) Or has it been done before?
 
Do it Frollo - it would be good to know for sure.

I always thought that if a unit is injured it would count after a same unit with full health witht he same HP. For example, with a Regular Pike at 3HP and Vet Pike at 3HP I thought the Regular would get attacked first.

Certainly in the case that Turner gave (Elite Knight at 2HP and a regular Pike at 3HP) I thought the pike would always get attacked first since it has 3HP.

Regarding the offensive/defensive units thing: isn't this in the editor? Don't they have flags for offensive and defensive units? IIRC Knights are marked as offensive and defensive, but I could well be wrong, all of this is just how I remember it....
 
I'm thinking it has to do with the fact that an elite knight with 3 defense (could have sworn it was two. But then, I usually jump from horsey's to calvary) has x chance of winning against whatever unit comes up. Besides, as I recall, a fortified unit does not retreat. I always fortify my non-blitz multi move units before exiting the turn, get that 25% bonus.
 
Originally posted by anarres
Do it Frollo - it would be good to know for sure.
I just might! I'll see if I can find some spare time.

Regarding the offensive/defensive units thing: isn't this in the editor? Don't they have flags for offensive and defensive units?
Can't say (still at work), but I do know you can tell your city governors to build mostly offensive of mostly defenders.
So either there must be a flag of some sort, or the game just considers units defensive if their defense value is higher than the offense value.
 
Originally posted by anarres


I always thought that if a unit is injured it would count after a same unit with full health witht he same HP. For example, with a Regular Pike at 3HP and Vet Pike at 3HP I thought the Regular would get attacked first.

I thought that, too.

Would be interesting how the actual defending unit of a mixed stack is figured out by the game engine, I'd guess a (HP dependent) combat calculator would cover this problem (with some additional special rules, like anarres point in case of same unit type with -currently- same number of HP).

[sigh] SMAC had that cute "assign favourite defender" feature :love: [/sigh]

Frollo, I'd also be glad to read any results if you run any test on this thingie :goodjob: :)
 
To those it might concern

Yesterday, we discussed in this thread on wich unit will defend if a stack of units is attacked. (see this and further posts)
For instance, when a regular pikeman and an injured veteran knight (both defense 3, HP3) are sharing the same tile, wich unit will the combat engine choose to defend? This and other questions we tried to solve.

I tried to experiment with this last night, but I found my knowledge of the editor severely lacking (first time I used it).
Am I overlooking something or is it just not possible to place injured units on the map?
All I can do is slap some units on the map and wait wich ones are getting injured by accident. This makes the experiment highly uncontrollable, non-repeatable and irreliable.

I may go on with this, but don't expect results very soon. I'm sorry.
 
Kudos for giving it a go, Frollo.

Yeah, I think you're going to have to wait until you get a knight that's attacked and looses the right amount of hit points. You could put it on rail roads and stretch out the empire with a lot of units, this might help bring the results closer to what you're looking for. . .
 
Originally posted by Frollo
To those it might concern

Yesterday, we discussed in this thread on wich unit will defend if a stack of units is attacked. (see this and further posts)
For instance, when a regular pikeman and an injured veteran knight (both defense 3, HP3) are sharing the same tile, wich unit will the combat engine choose to defend? This and other questions we tried to solve.

I tried to experiment with this last night, but I found my knowledge of the editor severely lacking (first time I used it).
Am I overlooking something or is it just not possible to place injured units on the map?
All I can do is slap some units on the map and wait wich ones are getting injured by accident. This makes the experiment highly uncontrollable, non-repeatable and irreliable.

I may go on with this, but don't expect results very soon. I'm sorry.

Thanks for giving it a try . I never tried editor too :(
Edit : Bamspeedy is " editor famous experimentator" , but he's too buisy with Conquests Beta-testing apparently , haven't heard of him a long time .
 
In response to the discussion above/yesterday....

Examples of Defender prioritisation

The following examples were noted during GOTM23, and are based on notes taken during play. While not strictly tests in an academic sense they illustrate the decision-making process behind the choice of defender by the AI.

Case One: Ansar Warriors attacking a city (size 7-12) on grassland

Defenders:
2 regular muskets
1 veteran pikeman
1 veteran impi

First defender is regular musket.
chooses highest defence factor over higher hit points
Attacker dies, musket is at 1/3 at end of combat.

Second defender is (undamaged) regular musket.
again, chooses highest defence factor over higher hit points
Attacker dies, leaves defender as a (promoted) 2/4 musket.

Third defender is veteran pikeman.
chooses higher hit points (4) rather than higher defence factor
Attacker kills defender.

Fourth defender is veteran impi
chooses higher hit points (4) rather than higher defence factor
Attacker dies, leaves defender as 2/4 impi

Defender swaps back to 2/4 musket
1/3 musket and 2/4 impi are other defenders. Chooses highest defence and hit points
Attacker dies, leaves 1/4 musket

Defender is now 1/3 musket
chooses 1/3 in preference to 1/4 unit i.e. unit with fewest lost hitpoints
Attacker kills defender

Defender is now 1/4 musket
In preference to 2/4 impi
Attacker kills defender.

Last defender is 2/4 impi. Is killed by attacker.

Case Two: Ansar Warriors attacking a city (size 7-12) on grassland

Defenders:
1 regular musket
1 veteran pike
1 veteran impi
1 regular impi

First defender is veteran pikeman
Ai selects highest hit points over defence strength
Defende is eliminated

Next defender is regular musket
AI selects higher defence strength in preference to higher hit points
Defender is reduced to 1/3; attacker dies

Next defender is veteran impi
AI prefer hit points to strength
Defender is eliminated

Next defender is regular impi
AI prefer hit points to strength
Defender is eliminated

Final defender is 1/3 musket; defender is eliminated.

Conclusions

From the above, admittedly limited, data, it appears that there is no over-riding preference for either hit points or defence value as the selection criteria for a defender. Indeed in two cases - the initial attacks against the two cities - the AI selected opposite units.
In case one, the AI preferred a regular musket to a veteran pikeman; in case two the pikeman was preferred.
While it may be that the defensive terrain has an effect, IIRC there were no rivers, both cities were on grassland, both were of like size, and both were attacked by veteran Ansar Warriors.

One might therefore conclude that a random element also exists when selecting defenders from a stack.
 
Back
Top Bottom