- Joined
- Mar 1, 2013
- Messages
- 555
Hey everyone
I made major changes to my AI by rebuilding the ITE order to improve speed and preformance. It is still far from finish though. I've found that after the AI killed a unit, it moves to the dying unit's location and stands there until it totally disappears. I assumed that it keeps 'attacking' the dead unit.
pCenter = Center of playable map area
gNatural[0] = weak animals
gNatural[1] = strong animals
AI_Count = number of Computer players
AI_Circle = base
Help will be appreciated
I made major changes to my AI by rebuilding the ITE order to improve speed and preformance. It is still far from finish though. I've found that after the AI killed a unit, it moves to the dying unit's location and stands there until it totally disappears. I assumed that it keeps 'attacking' the dead unit.
pCenter = Center of playable map area
gNatural[0] = weak animals
gNatural[1] = strong animals
AI_Count = number of Computer players
AI_Circle = base
-
Combat Copy Copy
-
Events
- Time - Every 0.50 seconds of game time
- Conditions
-
Actions
-
For each (Integer Temp_Int) from 1 to AI_Count, do (Actions)
-
Loop - Actions
- -------- <<RETREAT>> --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Integer((Life of AI_Hero[Temp_Int]))) Less than or equal to ((Integer((Max life of AI_Hero[Temp_Int]))) / 3)
-
Then - Actions
- Unit - Order AI_Hero[Temp_Int] to Move To ((Owner of AI_Hero[Temp_Int]) start location)
- Unit Group - Add AI_Hero[Temp_Int] to gRetreat
- Unit - Order AI_Circle[Temp_Int] to Human Paladin - Holy Light AI_Hero[Temp_Int]
- Skip remaining actions
- Else - Actions
-
If - Conditions
- -------- <<COMBAT>> --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Current order of AI_Hero[Temp_Int]) Equal to (Order(stop))
- ((Current order of AI_Hero[Temp_Int]) Equal to (Order(move))) and ((AI_Hero[Temp_Int] is in gRetreat) Equal to False)
- (Current order of AI_Hero[Temp_Int]) Not equal to (Order(attack))
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- -------- <<HEROS>> --------
- Set Temp_Point = (Position of AI_Hero[Temp_Int])
- Set Temp_Enemies = (Units within 750.00 of Temp_Point matching (((Owner of (Matching unit)) is an enemy of (Owner of AI_Hero[Temp_Int])) Equal to True))
-
Unit Group - Pick every unit in Temp_Enemies and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- ((Picked unit) is invisible to (Owner of AI_Hero[Temp_Int])) Equal to True
- ((AI_Hero[Temp_Int] is Able to attack flying units) Equal to False) and (((Picked unit) is A flying unit) Equal to True)
- ((Picked unit) is dead) Equal to True
- (Level of Locust for (Picked unit)) Equal to 1
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Unit Group - Remove (Picked unit) from Temp_Group
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Temp_Enemies is empty) Equal to False
-
Then - Actions
- Unit - Order AI_Hero[Temp_Int] to Attack (Random unit from Temp_Enemies)
- Custom script: call DestroyGroup(udg_Temp_Enemies)
- Skip remaining actions
-
Else - Actions
- Custom script: call DestroyGroup(udg_Temp_Enemies)
- -------- <<ANIMALS>> --------
- Set Temp_Enemies = (Units within 750.00 of Temp_Point matching ((((Matching unit) is in gNatural[0]) Equal to True) or (((Matching unit) is in gNatural[1]) Equal to True)))
-
Unit Group - Pick every unit in Temp_Enemies and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- ((Picked unit) is invisible to (Owner of AI_Hero[Temp_Int])) Equal to True
- ((AI_Hero[Temp_Int] is Able to attack flying units) Equal to False) and (((Picked unit) is A flying unit) Equal to True)
- ((Picked unit) is dead) Equal to True
- (Level of Locust for (Picked unit)) Equal to 1
- (Level of (Picked unit)) Greater than ((Hero level of AI_Hero[Temp_Int]) + 1)
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Unit Group - Remove (Picked unit) from Temp_Enemies
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Temp_Enemies is empty) Equal to False
-
Then - Actions
- Unit - Order AI_Hero[Temp_Int] to Attack (Random unit from Temp_Enemies)
- Custom script: call RemoveLocation(udg_Temp_Point)
- Custom script: call DestroyGroup(udg_Temp_Enemies)
- Skip remaining actions
-
Else - Actions
- Custom script: call RemoveLocation(udg_Temp_Point)
- Custom script: call DestroyGroup(udg_Temp_Enemies)
- Unit - Order AI_Hero[Temp_Int] to Move To (pCenter offset by (Random real number between 0.00 and 6000.00) towards (Random real number between 0.00 and 360.00) degrees)
-
If - Conditions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
For each (Integer Temp_Int) from 1 to AI_Count, do (Actions)
-
Events