PDA

View Full Version : "Modifying Formation AI"



DARTH_VADER
09-05-2005, 12:47
“MODIFYING FORMATION AI”

by

DARTH VADER


I offer this comprehensive tutorial to all TW community in order to help other modders to understand what is my learning of this small but extremely vital for the game, txt file .Also, unfortunately (as in real life) when someone succeeds too much in a sector, various people are popping to steal at least something from his “glory”.
Well I am living this right now but certainly with ignorance because all this feedback, brainstorming, work hours spended for the modding of this game had a single purpose….to first enjoy this game better for myself, then share this with all the community and last but not least to receive the common acceptance of my ideas.
I do not do this for a living as all other modders I guess and so I get furious when I get reports of personal attacks or even “stealing” of my ideas. My personal opinion about internet users is that this tool, internet, could be used so much better if there was a mutual cooperation with each other and not a quest for personal glory. But I think this is the nature of Man, so I must accept it in some extend. I get so much compensation from the satisfaction received from the community from my efforts that is worth continuing.

I will begin with a theoretical approach to the actual usage of “formation ai.txt” file. I would call it the “tool” of AI. For example humans have hands to grab things, feet to walk etc. so the hard coded AI has this file to exploit its potential to the game. That means that if this file is badly modded, the AI gets even more awful. So it is unfair to say that the AI is actually unmoddable because with this file we can translate its thought. And so I will start to tell you of my perception of the AI army battle procedures.

A Formation is consisted of maximum 16 blocks. Each block represents 1 unit complex which can be of any kind (infantry, cavalry, general, elephant etc). The block is not only a typical place to put each unit relative to each other but acts as a “base” for each unit. That means, a unit (or units) stationed in a certain block will have a sphere of control around it and will interact with anything in proximity to it. Interaction is calculation of relative unit attributes and decision if the unit must attack, defend, stand or run away.
The whole formation blocks are used by the AI to give commands to them according to the area that surrounds them. So it is vital to make the formation actually effective for the AI to use. If you make units to be too far from each other you will notice early isolated attacks by single units that are without reason. That happens because these units are isolated with each other and once the sphere of control includes hostile units they interact and attack while the other just wonder marching. That is a dumb AI, I know, but shouldn’t there be something to do about?
What is done by me is to make units more cohered relative to each other. So the sphere of control of each unit includes radius from other friendly units and interacting together we see visually a cooperation of the army and decisive common movements that make the AI a truly worthy opponent comparing to previous occasion.
The block-base is used for the unit to return back if the first AI order is no longer valid. So you will see several times, especially for cavalry which moves quickly, hit and run tactics with base of return the actual block that refers to it. If the unit receives multiple threats or calculates easy targets it gets isolated from main army chasing its goal until it is no more. This is an advantage and disadvantage to AI simultaneously because if multiple units become uncontrolled and “raging”, the human opponent is able to repel them and trick them as they get isolated. So the main modding effort of me here was to make the center of the army as cohered as possible so to be able to move most of each troops to the same target with coordinated attacks. The cavalry will be predating and flanking when possible because of its strategic placement in the wings with cohesion between cavalry units. So every cavalry charge will include more than 2 cavalry units if available with much more devastating power. When they get isolated they still work as a group and destroy every unprepared rear defenses. All these will be explained technically later.
Also because of the kind of AI thinking (sphere control) it is better to put skirmishers behind melee troops because if hostile troops enter their radius and they are still on the move they attack instead of skirmish and so they are massacred. This is corrected by my swapping system which has 3 phases for each formation. First there is the defensive formation in which the missile stand in frond of army to pepper advancing hostile troops, then if they have to march, they are placed behind to be protected by heavier troops and support them from the rear, lastly in the midst of battle (new technique incorporated in upcoming DarthMod_6.0) a proportion of missile will head to the wings and launch devastating flank projectile attacks to human army.
In addition due to the sphere control issue it is unwise to put general units too much in frond relative to the army, because it assumes it can attack as an ordinary unit and once close to the enemy, it engages. I will explain technically how I fixed this.
It must be said that the whole formation of 16 max blocks is moved all together by the AI in a similar fashion of human maneuvering (like ctrl-A, pick all your troops and alt-click to be put somewhere with the same facing etc.) but the difference is that there is also a certain area that surrounds it that is fixed and if units happen to be moved and their destination spots are out of this area they get almost AI-uncontrolled. This is observed when AI defends and moves its army to a certain position in the map and some units, instead of moving there, they are put too much in frond of the army as if they are rejected by AI. This is also fixed by me by using a certain command which gives more space to the formation to breathe.
So I will begin with the basics by giving you an actual formation created by me (the roman maniple) and explaining as simply as possible its core attributes.


INVESTIGATING THE FORMATION

;************************************************* ***************
;NEW Special Attacking maniple formation for romans, and others with precursor weapons
;Checkerboard classic roman strategy ***DARTHMOD special***
;************************************************* ***************

begin_formation ai_roman_line

;;; purpose flags
defend
ai_priority 1.0

begin_dummy_block 0 ;; centre slot left empty for assault column to pass through
spacer 150.0 150.0 150 150
end_dummy_block

; Screen of missile inf
begin_block 1
max_units 3
unit_type missile infantry 0.9
unit_type elephants 1.0
unit_type heavy_chariots 1.0
unit_density close
block_formation line
block_relative_pos 0 0.0 -20.0
inter_unit_spacing 0.2
priority 1.0
end_block

;; First line of infantry
begin_block 2
min_units 3
unit_type light_pilum_infantry 0.9
unit_type heavy_pilum_infantry 0.7
unit_type heavy infantry 0.0
unit_type infantry 0.0
unit_density close
max_unit_width 20
block_formation line
block_relative_pos 1 0.0 -6.0
inter_unit_spacing 10.0
priority 1.0
end_block

;; second line of infantry
begin_block 3
min_units 3
unit_type heavy_pilum_infantry 1.0
unit_type light_pilum_infantry 0.1
unit_type heavy infantry 0.0
unit_type infantry 0.0
unit_density close
max_unit_width 20
block_formation line
block_relative_pos 2 0.0 -6.0
inter_unit_spacing 10.0
priority 1.0
end_block

;; 3rd line of infantry
begin_block 4
max_units 4
unit_type light infantry 0.6
unit_type heavy infantry 0.6
unit_type spearmen 0.5
block_formation line
block_relative_pos 3 0.0 -6.0
inter_unit_spacing 0.2
priority 1.0
end_block

;; Archers behind
begin_block 5
unit_type ranged_missile_infantry 1.0
unit_type light infantry 0.4
unit_type heavy infantry 0.4
unit_type spearmen 0.8
unit_type any 0.001
block_formation line
block_relative_pos 4 0.0 -6.0
inter_unit_spacing 0.2
priority 1.0
end_block


begin_dummy_block 6
spans 0 1 2 3 4 5
end_dummy_block

;; artillery and handlers at the back
begin_block 7
unit_type handler 1.0
unit_type siege 1.0
unit_type any 0.01
block_formation line
block_relative_pos 6 0.0 -20.0
inter_unit_spacing 10.0
priority 0.5
end_block


;; cavalry on the flanks and back a bit

;; left flank cav
begin_block 8
unit_type cavalry 1.0
block_formation line
block_relative_pos 6 -1.0 -1.0
inter_unit_spacing 0.2
priority 0.5
end_block

;; left flank cav(more)
begin_block 9
unit_type cavalry 1.0
block_formation line
block_relative_pos 8 1 -3.0
inter_unit_spacing 0.2
priority 0.5
end_block

;; right_flank cav
begin_block 10
unit_type cavalry 1.0
block_formation line
block_relative_pos 6 1.0 -1.0
inter_unit_spacing 0.2
priority 0.5
end_block

;; right_flank cav(more)
begin_block 11
unit_type cavalry 1.0
block_formation line
block_relative_pos 10 -1 -3.0
inter_unit_spacing 0.2
priority 0.5
end_block

begin_dummy_block 12
spans 0 1 2 3 4 5 6 7 8 9 10 11
end_dummy_block

;; general at the back
begin_block 13
min_units 1
max_units 1
unit_type general_unit 1.0
unit_density close
block_formation line
block_relative_pos 12 0.0 -1.0
inter_unit_spacing 0.2
priority 1.0
end_block


end_formation

begin_formation ai_roman_line

;;; purpose flags
attack

ai_priority 0.9



;; First line of infantry
begin_block 0
min_units 3
unit_type light_pilum_infantry 0.9
unit_type heavy_pilum_infantry 0.7
unit_type heavy infantry 0.0
unit_type infantry 0.0
unit_density close
max_unit_width -20
block_formation line
block_relative_pos 0 0.0 -20.0
inter_unit_spacing 10.0
priority 1.0
end_block

;; second line of infantry
begin_block 1
min_units 3
unit_type heavy_pilum_infantry 1.0
unit_type light_pilum_infantry 0.1
unit_type heavy infantry 0.0
unit_type infantry 0.0
unit_density close
max_unit_width 20
block_formation line
block_relative_pos 0 0.0 -6.0
inter_unit_spacing 10.0
priority 1.0
end_block

;; 3rd line of infantry
begin_block 2
max_units 4
unit_type light infantry 0.6
unit_type heavy infantry 0.6
unit_type spearmen 0.5
block_formation line
block_relative_pos 1 0.0 -6.0
inter_unit_spacing 0.2
priority 1.0
end_block

;; Archers behind
begin_block 3
unit_type ranged_missile_infantry 1.0
unit_type light infantry 0.4
unit_type heavy infantry 0.4
unit_type spearmen 0.8
unit_type non_phalanx_spear 1.0
unit_type any 0.0001
block_formation line
block_relative_pos 2 0.0 -6.0
inter_unit_spacing 0.2
priority 1.0
end_block


begin_dummy_block 4
spans 0 1 2 3
end_dummy_block

; Screen of missile inf
begin_block 5
max_units 3
unit_type missile infantry 0.5
unit_type elephants 1.0
unit_type heavy_chariots 1.0
unit_density close
block_formation line
block_relative_pos 4 0.0 -6.0
inter_unit_spacing 0.2
priority 1.0
end_block

;; artillery and handlers at the back
begin_block 6
unit_type handler 1.0
unit_type siege 1.0
;unit_type any 0.01
block_formation line
block_relative_pos 4 0.0 -20.0
inter_unit_spacing 10.0
priority 0.5
end_block


;; cavalry on the flanks and back a bit

;; left flank cav
begin_block 7
unit_type cavalry 1.0
block_formation line
block_relative_pos 4 -1.0 -20.0
inter_unit_spacing 0.2
priority 0.5
end_block

;; left flank cav(more)
begin_block 8
unit_type cavalry 1.0
block_formation line
block_relative_pos 7 1 -3.0
inter_unit_spacing 0.2
priority 0.5
end_block

;; right_flank cav
begin_block 9
unit_type cavalry 1.0
block_formation line
block_relative_pos 4 1.0 -20.0
inter_unit_spacing 0.2
priority 0.5
end_block

;; right_flank cav(more)
begin_block 10
unit_type cavalry 1.0
block_formation line
block_relative_pos 9 -1 -3.0
inter_unit_spacing 0.2
priority 0.5
end_block

begin_dummy_block 11
spans 0 1 2 3 4 5 6 7 8 9 10
end_dummy_block

;; left flank missile(decides to support the flank even more)
begin_block 12
min_units 1
max_units 2
unit_type missile infantry 0.5
unit_type missile cavalry 0.5
block_formation line
block_relative_pos 11 -5.0 15
inter_unit_spacing 0.2
priority 0.6
end_block

;; right flank missile(decides to support the flank even more)
begin_block 13
min_units 1
max_units 2
unit_type missile infantry 0.5
unit_type missile cavalry 0.5
block_formation line
block_relative_pos 11 5.0 15
inter_unit_spacing 0.2
priority 0.6
end_block

;; general at the back
begin_block 14
min_units 1
max_units 1
unit_type general_unit 1.0
unit_density close
block_formation line
block_relative_pos 11 0 -5.0
inter_unit_spacing 0.2
priority 1.0
end_block


end_formation

begin_formation ai_roman_line

;;; purpose flags
attack
defend
ai_priority 0.01


; Screen of missile inf
begin_block 0
max_units 3
unit_type missile infantry 0.0
unit_type elephants 1.0
unit_type heavy_chariots 1.0
unit_density close
block_formation line
block_relative_pos 0 0.0 -20.0
inter_unit_spacing 0.2
priority 1.0
end_block

;; First line of infantry
begin_block 1
min_units 3
unit_type light_pilum_infantry 0.9
unit_type heavy_pilum_infantry 0.7
unit_type heavy infantry 0.0
unit_type infantry 0.0
unit_density close
max_unit_width 20
block_formation line
block_relative_pos 0 0.0 -6.0
inter_unit_spacing 10.0
priority 1.0
end_block

;; second line of infantry
begin_block 2
min_units 3
unit_type heavy_pilum_infantry 1.0
unit_type light_pilum_infantry 0.1
unit_type heavy infantry 0.0
unit_type infantry 0.0
unit_density close
max_unit_width 20
block_formation line
block_relative_pos 1 0.0 -6.0
inter_unit_spacing 10.0
priority 1.0
end_block

;; 3rd line of infantry
begin_block 3
max_units 4
unit_type light infantry 0.6
unit_type heavy infantry 0.6
unit_type spearmen 0.5
block_formation line
block_relative_pos 2 0.0 -6.0
inter_unit_spacing 0.2
priority 1.0
end_block

;; Archers behind
begin_block 4
unit_type ranged_missile_infantry 1.0
unit_type light infantry 0.4
unit_type heavy infantry 0.4
unit_type spearmen 0.8
unit_type any 0.0001
block_formation line
block_relative_pos 3 0.0 -6.0
inter_unit_spacing 0.2
priority 1.0
end_block


begin_dummy_block 5
spans 0 1 2 3 4
end_dummy_block

;; artillery and handlers at the back
begin_block 6
unit_type handler 1.0
unit_type siege 1.0
;unit_type any 0.01
block_formation line
block_relative_pos 5 0.0 -20.0
inter_unit_spacing 10.0
priority 0.5
end_block


;; cavalry on the flanks and back a bit

;; left flank cav
begin_block 7
unit_type cavalry 1.0
block_formation line
block_relative_pos 5 -1.0 -1.0
inter_unit_spacing 0.2
priority 0.5
end_block

;; left flank cav(more)
begin_block 8
unit_type cavalry 1.0
block_formation line
block_relative_pos 7 1 -3.0
inter_unit_spacing 0.2
priority 0.5
end_block

;; right_flank cav
begin_block 9
unit_type cavalry 1.0
block_formation line
block_relative_pos 5 1.0 -1.0
inter_unit_spacing 0.2
priority 0.5
end_block

;; right_flank cav(more)
begin_block 10
unit_type cavalry 1.0
block_formation line
block_relative_pos 9 -1 -3.0
inter_unit_spacing 0.2
priority 0.5
end_block

begin_dummy_block 11
spans 0 1 2 3 4 5 6 7 8 9 10
end_dummy_block

;; left flank missile(decides to support the flank even more)
begin_block 12
min_units 1
max_units 2
unit_type missile infantry 1.0
unit_type missile cavalry 1.0
block_formation line
block_relative_pos 11 -5.0 15
inter_unit_spacing 0.2
priority 0.8
end_block

;; right flank missile(decides to support the flank even more)
begin_block 13
min_units 1
max_units 2
unit_type missile infantry 1.0
unit_type missile cavalry 1.0
block_formation line
block_relative_pos 11 5.0 15
inter_unit_spacing 0.2
priority 0.8
end_block

;; general at the back
begin_block 14
min_units 1
max_units 1
unit_type general_unit 1.0
unit_density close
block_formation line
block_relative_pos 11 0.0 -10.0
inter_unit_spacing 0.2
priority 1.0
end_block


end_formation





Ok this is a long one I begin linearly from top to down:

- “begin_formation ai_roman_line” =this is the name of the formation. AI will search through available named formations with preferred those with high-priority and according with unit type proportion.

-“;;; purpose flags
defend
ai_priority 1.0” = this is purpose flags that for those the AI will use the formation. For this the AI will use it while defending. AI priority = 1.0 is a number that AI will grant as an integer relative to other formation ai priorities available and after calculating the unit type that mostly serves this formation, it prefers it or not. So it is vital that each formation has a character and not be of generic type because then only priorities will be granted and so other formations may be never used. This example formation is mainly used by armies that consist mainly heavy precursor weapons as Romans have. So it will be used mainly by them but maybe also from Carthaginians, Iberians etc who can also have this kind of troops.
Also note that ;=a txt line not used by compiler but it starts a comment for the reader.

- “begin_dummy_block 0 ;; centre slot left empty for assault column to pass through
spacer 150.0 150.0 150 150
end_dummy_block”= This is a special technique I use for eradicating a CA bug that resulted AI units to get out of formation AI control and act independently and suicidally . It affects cavalry and general units and makes them to have a different extra spacing relative to center of the army but also makes the formation receive more effective space to use and so the formation blocks do not lose the area of control. To be more specific without it you could have anticipated (especially when AI defends) some units to be in the move without reason, over spaced by main army as if they do not belong there. The rest of the army watched the human player massacre them and did not do anything about it. That was because the formation AI is surrounded by a certain unseen box and if the formation width or generic abuse of space exceeds it then it is rejected by the system.
The values I have chosen (150 150 etc) are carefully tested to bring the desired outcome. If you give very high values you will see cavalry units to be 2 km away from army. Too small numbers and then you will anticipate the CA bug with less but existent probability.

-“; Screen of missile inf
begin_block 1
max_units 3
unit_type missile infantry 0.9
unit_type elephants 1.0
unit_type heavy_chariots 1.0
unit_density close
block_formation line
block_relative_pos 0 0.0 -20.0
inter_unit_spacing 0.2
priority 1.0
end_block” =This refers to the first actual block of the formation

begin_block 1=the command to create it
max_units 3=max (or maybe min) units that will be placed here.
unit_type whatever nbr:0.0 – 1.0= the creation of unit types that may be used for this block together with the priorities. The available unit types are quite many and you have to check all formations to see what names are available so as to use them and only them. Or else you will crash. The priorities give a ratio to AI which uses to fill all the blocks with troops. Max ratio means that AI will first fill this block with this unit type and then all other. If smaller than max then it will calculate and may leave some identical unit types to fill other blocks as well to fill gaps.
unit_density close=(close or loose) as you manually do midst of battle for units. But be warned. I have reverted all densities back to close in my new version because there is a bug that sometimes makes AI to move berserk if the default formation is loose and next command is close. This made skirmishers to attack idiotically sometimes because they ran with no purpose.

block_formation line= can be line,column,square and it does the positioning between troops if more than one is inserted.
Line places units from left to right. Column places units from top to down. Square places them quite bizarre (like double column) so I do not use it.

block_relative_pos nbr +/-nbr +/-nbr =
first nbr is the formation block that we want the current block to be relative with.
Second nbr is the horizontal relativity (- = left, + =right) in meters
Third nbr is the top/down relativity (- = back, + =frond) in meters

If we use for first block a top/down relativity different to 0.0 then we give an offset to all the formation. And this is the technique used by me to help the AI maneuver the formation and be effective. I gave him a different position to arrive (more behind) than it was programmed by hard coded AI so as to start attacking and not be on the move even when in dangerous proximity with human army. If you give too large numbers to this you may anticipate an AI never attacking or if you do the opposite (+offset than –offset) then you will see a truly idiot AI attacking en masse and losing en masse
priority 1.0=this is the main priority block that AI calculates for each block. The greater number deserves more troops to be placed in that block in accordinance with the other blocks. Just like a ration between blocks.

inter_unit_spacing nbr=This is the command that arranges the block’s unit spacing between each other. I gave 0.2 meters to all (except maniple formations) in order to produce cohesion for the reasons I have described above.

end_block=it ends this block and expects the next. All block should be created sequentially

-All blocks have similar attributes to a.m . Lets see the next one:
“;; second line of infantry
;; First line of infantry
begin_block 2
min_units 3
unit_type light_pilum_infantry 0.9
unit_type heavy_pilum_infantry 0.7
unit_type heavy infantry 0.0
unit_type infantry 0.0
unit_density close
max_unit_width 20
block_formation line
block_relative_pos 1 0.0 -6.0
inter_unit_spacing 10.0
priority 1.0
end_block”


This block will consist minimum 3 units if you have more than 3 of the kind allowed.
Note the command max_unit_width 20
This makes each block unit to have 20 troop deep box formation.
The formation will be put 6 meters behind the first line and will have an inter unit spacing of 10 meters to make it similar to roman strategy.
Lets see the third.

“;; second line of infantry
begin_block 3
min_units 3
unit_type heavy_pilum_infantry 1.0
unit_type light_pilum_infantry 0.1
unit_type heavy infantry 0.0
unit_type infantry 0.0
unit_density close
max_unit_width 20
block_formation line
block_relative_pos 2 0.0 -6.0
inter_unit_spacing 10.0
priority 1.0
end_block”

It is almost identical to the previous. It is 6 meters behind the previous one. Watch the unit types and priorities. They are different and so light pilum will be mostly place frond while the heavy will be placed behind. If not pilum we put other unit generic types with zero priorities to make the formation valid.

So we create even more blocks. Be warned that the formation must cover all unit types. To be certain after you finish you put the unit type “any” with a very small priority to help AI to place units not directly consisted in the formation you create. Or else you crash.

Here is a vital block. The dummy block.

“begin_dummy_block “BlockNbr”
spans 0 1 2 3 ……. BlockNbr -1 end_dummy_block”

This is a special block that consists of no units but is useful as it binds all referred blocks (with the command spans 3 4 5 for example binds blocks 3 4 5).
And so the next block that it will be created and we want to be relative with the dummy block, will be relative to all blocks that is referred to. Very usefull for creating symmetrical formations and no intersection between units.

And finally I mention the creation of the general unit:

“;; general at the back
begin_block 13
min_units 1
max_units 1
unit_type general_unit 1.0
unit_density close
block_formation line
block_relative_pos 12 0.0 -1.0
inter_unit_spacing 0.2
priority 1.0
end_block”



It is vital to notice that:
-The Special General Block consists of only the general.(Min,Max=1 and only the general unit is referred as possible usable unit.
-The relative block of the general is 12 which is a special dummy block that spans ALL the army. So the general will typically try to be on the back of every unit he controls.
-I have not made it to be too back from it (only 1 mtr) because the actual spacing that is produced with proximities and unit block spans is large already and would cause a general to be too far away.


The above mentioned technique produces an effect that makes AI general to be almost always at the back of his army, making only hit and run tactics and returning to his base of the last formation block which he should be only.

Now a normal formation should end here and go for the next. But here starts the “swapping” technique.

After putting “end formation” I start a new one with the SAME name.

“begin_formation ai_roman_line

;;; purpose flags
attack

ai_priority 0.9”

Yes. It is the same name as the previous only that:
-The purpose flag is set to “attack” than “defend”
-ai priority is smaller by 0.1 which means 0.9

The majority of the formation is almost identical but some blocks swap place or some units swap position and priorities.
The result is the production of an internal formation that AI will use next by 100% if the flag changes from “defend” to “attack”.

Then after finishing this formation as the previous I end it and insert again a multi role internal formation with the SAME name again but much less priority.

“begin_formation ai_roman_line

;;; purpose flags
attack
defend
ai_priority 0.01”

This is an essential multi role formation used always by the AI so that means that by all the formations created there should be one available of multi role “Attack/Defend”

Again this internal formation is mostly identical with the previous but some units change position (not too much difference than their previous so that AI does not struggle to reach to his destination/objective).
Also it is important to note that the ai priority is set to be small = 0.01 so that it is used only for the multi role flag. If not then it would sometimes be chosen to replace the pure attack or defend special formations.
Also the 0.01 is the same to all internal multi role formations produced for each formation set and that for helping AI to only choose the internal multi role and not the multi role of another formation set.
Or else the AI will start for example with maniple formation and then in midst of battle and because of wrong ai priorities will swap to a barbarian totally different formation and so start to run like a maniac to reach to it.
AI first looks proportion of units + priority, then issues the formation to start with. Then it searches first for formation with the same name and respective flag + priorities and if in this set finds not the appropriate searches for the next name etc.

All the above mentioned technique is identical to computer programming and subroutines .There is a main formation (the flag “defend”) with which the AI defends and also always starts each battle. Also human army always chooses from this collection of “defend” formation to start with.
Then when the AI chooses to attack swaps to either “attack” or “attack/defend”
Also when reinforcements arrive the “attack / defend” flag is chosen.
Also the attack/defend is used in various occasions in siege + bridge battles in cooperation with the standard formation specially built for these occasions.

Then I have used all available flag sets for the formation and I am done.
So one formation set is basically consisted by 3 co-operating formations that all together fulfill the purposes of the AI and there is no need to search for other non-identical formation. AI will stick to it till the end of battle, swapping between available variations to exploit his attack.

In the end I lastly mention that I have totally removed the “pursue” flag command so that AI will never use it. Hopefully it is set to search for next flag and not CTD. You cannot remove the other flags because they are essential.
The “pursue” command caused the AI to become overly aggressive and use every unit to attack fully and berserk. No army order could be maintained and the visual was an angry mob of stupid soldiers attacking everything near without plan.
By removing it you observe a much more thinking AI.
This was tested by giving this flag to all formations and then watched the battles produced. It was a total mess.

I have also in mind to talk about the siege+bridge special formations but will do this after I find time for it.
Also I do not mention the general strategy of swapping (What are the specific adjustments rules for each role formation).
Generally a persistent reader can compare formations with each other to see the difference and then by reading my general comments can understand better.
For the time being enjoy and study this tutorial which will be edited from time to time to enhance its contents.
Sorry if you do not find answers to all your queries but cannot do more at this time.
Will revert.
:book:

Epistolary Richard
09-05-2005, 21:36
Thanks for this excellent insight, Darth. It's greatly appreciated :bow:

Duke John
09-06-2005, 08:38
Setting melee states
To disable skirmish/guard mode and guard of units add the following line:

begin_block 3
min_units 1
unit_type missile infantry 1.0
default_melee_state engage_at_will
unit_density close
block_formation line
block_relative_pos 2 0.0 -1.0
inter_unit_spacing 20.0
priority 1.0
end_block

Edit: engage_at_will is probably wrong.