LightRain
02-08-2010, 03:09 PM
Tower AI is not, as it may appear, and as many falsely claim, random, but is actually completely deterministic.
There are two layers of Tower AI: hero protection, and everything else.
Rule 1: The tower will attack any hero that attacks an enemy hero.*
*Spells don't count. This includes manually casting orbs (ie Vindicator's, Arachna's)!
"Attacking" means "starting your autoattack animation". Unlike with creeps, you can right click an enemy hero and not draw tower fire until your hero actually lifts his arm to attack. You can cancel your attack animation by moving, stopping, holding, etc. and still get shot by the tower.
Rule 2: The tower will attack nearby units, with priority given to units attacking it, and then to units closest to it.
Three things trigger a tower to check for new targets: Any unit attacks an ally hero in range; the current target dies or leaves the tower's range; a possible target enters the range of a tower which has no targets at the moment.
When the first trigger (attack on enemy hero) occurs, the tower checks what its current target is doing. If the current target is not actively attacking an enemy hero, it will switch to a new target.^ However, if the target has not stopped attacking a hero, the tower will continue to attack it.
The second trigger basically returns the tower to its neutral state. Then, if other heroes are still attacking heroes, the tower will pick a new, closest one. Otherwise, it will pick the closest unit that is attacking the tower and fire on it until it dies, leaves, or something attacks an ally hero; if nothing is attacking the tower at the moment, it will pick the closest unit and fire on it until it dies, leaves, or something attacks an ally hero.
If it runs out of targets, the tower waits for something to come in range, and fires on it.
^This means that if you and an ally are attacking an enemy hero under a tower and the tower is shooting at you, you can press Hold and wait until the tower fires on your ally. Then you can continue attacking, and the tower will continue to attack your ally unless your ally dies, leaves the range, is disabled, or presses Hold himself.
Now with video! Thanks to siknoz!
Here ya go, ran in practice mode literally about 15min ago, sorry I don't really do editing so you'll just have to take it as is.
1st vid - Vindicator at enemy tower
http://www.youtube.com/watch?v=xMbr8lTd-7E
1st set of attacks - Right-Clicked his Master's Incantation, notice that when this is set to auto-cast, that I draw aggro from the tower immediately
2nd set of attacks - Regular ranged attacks draw aggro immediately
3rd set of attacks - Individually casting\clicking Master's Incantation, in this I do not draw any aggro at all. I am also standing BEHIND my units so according to the AI it will not attack me because it will attack the closest or Lowest HP target, neither of which I am.
2nd vid since someone asked about it
http://www.youtube.com/watch?v=uV9S6jldJHA
Electrician's hold doesn't draw aggro, Pyromancer using all 3 spells within tower range, does not draw aggro. I lowered the fps on the vid a little bit so you can see the tower attacks a little better.
Hope this helps...
Made another quick vid to show some mechanics for the tower ai as well.
http://www.youtube.com/watch?v=dbzZpeAyHR8
Notes :
Segment 1 - Shows that you can attack the tower while the tower currently has a target, as long as you stop attacking before that creep dies, and as long as there is another unit that is closer to the tower than you, it will not attack you. This is good for when you want to put some damage on the tower but don't have insta-wave kill ability.
Segment 2 - If you continue to attack the tower, after the current target is dead, the tower will attack you.
Segment 3 - Tower will attack the CLOSEST ATTACKING target, which means that if you are attacking the tower with creep and YOU are the closest target, the tower will attack you.
Segment 4 - Even though you may be the closest target, if another unit is attacking the tower, the tower will target that unit first.
Hopefully the 3 vids I posted in the thread will answer most questions people had about the mechanics of towers in HoN.
practical experiments (reproducible):
Take for example this situation: Demented Shaman and some Hellbourne creeps approach a tower. The tower targets the first creep that gets in range and kills it, then picks another melee creep and targets it. Meanwhile Demented Shaman is attacking the tower.
Now, some Legion creeps come. The Hellbourne creeps switch to attacking the Legion creeps, while Demented Shaman continues to attack the tower. Because this isn't a Rule 1 trigger, Demented Shaman will not be shot at if the melee creep that is targeted is still alive. In fact, Shaman can keep that creep alive longer through healing and Arcane Hide in order to get even more attacks in on the Tower. However, when the creep is about to die, Demented Shaman should stop attacking the tower and let it acquire a new target before he continues to attack the tower - otherwise, the tower will attack him, and he will be forced to back away if he doesn't want to be shot at.
In another situation, Keeper of the Forest and two Forsaken Archers are attacking a Legion Succubus next to a Legion tower. (Training mode okay >.>) Tree moves in first and gets shot at by the tower for attacking Succubus. Then, the two Forsaken Archers (let's call 'em FA and FB) move in and begin attacking Succubus. Now, the tower will continue to attack Tree until I press the Kill! button and he dies. Then, because FA is closer to the tower, the tower attacks FA. Now if FA presses hold and waits for FB to continue attacking Succ, the tower will attack FB. FA can then continue attacking Succ without getting shot at, even though she is closer to the tower, until FB gets Mesmerized by Succ. At that point FA will be the only one attacking Succ, and she will be fired upon.
Credit goes to Meowshi's guide to Heroes of Newerth Basics (http://forums.heroesofnewerth.com/showthread.php?t=5465) for the basic info, and to those who questioned me and got me to investigate further. As always, any feedback and independent information is appreciated.
I maintain an open call for any replays, videos, or other such evidence that contradicts anything in here.
I am aware of the issue of it switching targets between creeps and... guess what! siknoz to the rescue!
Ok, I finished the video, I even added in a bonus for ya ^_-
In the first segment it basically does what you said it does. Exactly the way I explained, since the ranged creep was technically the FIRST unit to attack me, the tower switched from the melee to the ranged.
In the second segment it shows that I can manipulate it and make it attack a different melee creep too. Notice the melee creep attacks me before any other units do, so the tower switches from its current target, to the attacking target.
http://www.youtube.com/watch?v=kHYplTAGVwI
Enjoy..hopefully this answered Cordial's question.
Also if you want to avoid having the tower switch targets, simply move up enough to allow the melee creep to attack you(actually swing at you), after that the tower target will be LOCKED and won't change.
There are two layers of Tower AI: hero protection, and everything else.
Rule 1: The tower will attack any hero that attacks an enemy hero.*
*Spells don't count. This includes manually casting orbs (ie Vindicator's, Arachna's)!
"Attacking" means "starting your autoattack animation". Unlike with creeps, you can right click an enemy hero and not draw tower fire until your hero actually lifts his arm to attack. You can cancel your attack animation by moving, stopping, holding, etc. and still get shot by the tower.
Rule 2: The tower will attack nearby units, with priority given to units attacking it, and then to units closest to it.
Three things trigger a tower to check for new targets: Any unit attacks an ally hero in range; the current target dies or leaves the tower's range; a possible target enters the range of a tower which has no targets at the moment.
When the first trigger (attack on enemy hero) occurs, the tower checks what its current target is doing. If the current target is not actively attacking an enemy hero, it will switch to a new target.^ However, if the target has not stopped attacking a hero, the tower will continue to attack it.
The second trigger basically returns the tower to its neutral state. Then, if other heroes are still attacking heroes, the tower will pick a new, closest one. Otherwise, it will pick the closest unit that is attacking the tower and fire on it until it dies, leaves, or something attacks an ally hero; if nothing is attacking the tower at the moment, it will pick the closest unit and fire on it until it dies, leaves, or something attacks an ally hero.
If it runs out of targets, the tower waits for something to come in range, and fires on it.
^This means that if you and an ally are attacking an enemy hero under a tower and the tower is shooting at you, you can press Hold and wait until the tower fires on your ally. Then you can continue attacking, and the tower will continue to attack your ally unless your ally dies, leaves the range, is disabled, or presses Hold himself.
Now with video! Thanks to siknoz!
Here ya go, ran in practice mode literally about 15min ago, sorry I don't really do editing so you'll just have to take it as is.
1st vid - Vindicator at enemy tower
http://www.youtube.com/watch?v=xMbr8lTd-7E
1st set of attacks - Right-Clicked his Master's Incantation, notice that when this is set to auto-cast, that I draw aggro from the tower immediately
2nd set of attacks - Regular ranged attacks draw aggro immediately
3rd set of attacks - Individually casting\clicking Master's Incantation, in this I do not draw any aggro at all. I am also standing BEHIND my units so according to the AI it will not attack me because it will attack the closest or Lowest HP target, neither of which I am.
2nd vid since someone asked about it
http://www.youtube.com/watch?v=uV9S6jldJHA
Electrician's hold doesn't draw aggro, Pyromancer using all 3 spells within tower range, does not draw aggro. I lowered the fps on the vid a little bit so you can see the tower attacks a little better.
Hope this helps...
Made another quick vid to show some mechanics for the tower ai as well.
http://www.youtube.com/watch?v=dbzZpeAyHR8
Notes :
Segment 1 - Shows that you can attack the tower while the tower currently has a target, as long as you stop attacking before that creep dies, and as long as there is another unit that is closer to the tower than you, it will not attack you. This is good for when you want to put some damage on the tower but don't have insta-wave kill ability.
Segment 2 - If you continue to attack the tower, after the current target is dead, the tower will attack you.
Segment 3 - Tower will attack the CLOSEST ATTACKING target, which means that if you are attacking the tower with creep and YOU are the closest target, the tower will attack you.
Segment 4 - Even though you may be the closest target, if another unit is attacking the tower, the tower will target that unit first.
Hopefully the 3 vids I posted in the thread will answer most questions people had about the mechanics of towers in HoN.
practical experiments (reproducible):
Take for example this situation: Demented Shaman and some Hellbourne creeps approach a tower. The tower targets the first creep that gets in range and kills it, then picks another melee creep and targets it. Meanwhile Demented Shaman is attacking the tower.
Now, some Legion creeps come. The Hellbourne creeps switch to attacking the Legion creeps, while Demented Shaman continues to attack the tower. Because this isn't a Rule 1 trigger, Demented Shaman will not be shot at if the melee creep that is targeted is still alive. In fact, Shaman can keep that creep alive longer through healing and Arcane Hide in order to get even more attacks in on the Tower. However, when the creep is about to die, Demented Shaman should stop attacking the tower and let it acquire a new target before he continues to attack the tower - otherwise, the tower will attack him, and he will be forced to back away if he doesn't want to be shot at.
In another situation, Keeper of the Forest and two Forsaken Archers are attacking a Legion Succubus next to a Legion tower. (Training mode okay >.>) Tree moves in first and gets shot at by the tower for attacking Succubus. Then, the two Forsaken Archers (let's call 'em FA and FB) move in and begin attacking Succubus. Now, the tower will continue to attack Tree until I press the Kill! button and he dies. Then, because FA is closer to the tower, the tower attacks FA. Now if FA presses hold and waits for FB to continue attacking Succ, the tower will attack FB. FA can then continue attacking Succ without getting shot at, even though she is closer to the tower, until FB gets Mesmerized by Succ. At that point FA will be the only one attacking Succ, and she will be fired upon.
Credit goes to Meowshi's guide to Heroes of Newerth Basics (http://forums.heroesofnewerth.com/showthread.php?t=5465) for the basic info, and to those who questioned me and got me to investigate further. As always, any feedback and independent information is appreciated.
I maintain an open call for any replays, videos, or other such evidence that contradicts anything in here.
I am aware of the issue of it switching targets between creeps and... guess what! siknoz to the rescue!
Ok, I finished the video, I even added in a bonus for ya ^_-
In the first segment it basically does what you said it does. Exactly the way I explained, since the ranged creep was technically the FIRST unit to attack me, the tower switched from the melee to the ranged.
In the second segment it shows that I can manipulate it and make it attack a different melee creep too. Notice the melee creep attacks me before any other units do, so the tower switches from its current target, to the attacking target.
http://www.youtube.com/watch?v=kHYplTAGVwI
Enjoy..hopefully this answered Cordial's question.
Also if you want to avoid having the tower switch targets, simply move up enough to allow the melee creep to attack you(actually swing at you), after that the tower target will be LOCKED and won't change.