
Originally Posted by
The_Mark
It says it is, doesn't it?
Hehe well "very_hardy" should have really meant "very_hardy" and not "very_lazy", "secondary" should not have been "primary", "very hard battles" not "very fast battles" etc... so who knows what ai_priority really does
Did you find out if the AI picks only the formation with highest priority (other filters passed), disregarding all the ones with lower priority, or does it apply a small random factor to its checks?
No randomness
.
I have just done some quick tests with 1.2 to confirm, crossed my fingers but had the same results :
I wrote 2 very simple test formations A and B. They are perfectly identical, except a difference in spacing so we can see which formation the AI pick : A is a tight phalanx-style line, B has gaps between units.
Then the idea is to tweak A and B ai_priority to see what happens.
I created various custom battles with more than 1 units, run them a various number of time, and see what formation the AI picks for me and for itself.
Results:
With both ai_priority at 0.5 the AI always choose A, because it appears first.
With B's ai_priority set to a higher value (say B=0.6 A=0.4) it will always choose B, because it has a higher priority.
Here's the code for descr_formations_ai:
Code:
;
; TEST 1
; purpose: AI priority
; context: RTW vanilla 1.2, custom battles.
;
; A: a single compact line.
begin_formation A_compact_line
attack
defend
ai_priority 0.5
begin_block 0
unit_type any 1.0
block_formation line
block_relative_pos 0 0.0 0.0
inter_unit_spacing 0.0
priority 1.0
end_block
end_formation
; B: a wide line.
begin_formation B_wide_line
attack
defend
ai_priority 0.5
begin_block 0
unit_type any 1.0
block_formation line
block_relative_pos 0 0.0 0.0
inter_unit_spacing 10.0
priority 1.0
end_block
end_formation
I did more tests than that with 1.1 but I don't feel like doing them all over again for 1.2, I think nothing changed there.
Maybe there are some magic combination of ai_priority and block's priority to enable/disable randomness, or as you said some ai tag, but I doubt it. We can only experiment and guess until we get an official hint.
Bookmarks