• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Do Computer Units Act like Neutral-Hostile?

Status
Not open for further replies.
Level 4
Joined
Dec 24, 2016
Messages
42
Hello Everyone,

I am making a map that involves boss-battles, so it is important that people can switch aggro and allow other players to deal damage. However, I ran to a specific problem where a boss with a ranged attack would just change targets towards a summoned Quilboar despite having a low hit-point melee hero right at its face. To experiment with this, I had made the Priority for the Quilboar to be 1 while the Hero was at 2. I also had a Summoned Golem with Priority 9 (which I deployed at the same time). I made the conclusion that Priority doesn't really mean much against a Computer opponent as even when I had the hero with a Golem, the AI would target whatever was in front of them (This is my goal; I want computers to aggro on the closest enemy unit).

I never had this issue when I was creeping in a melee game where I could have low hit-point archers while the Gnoll Poachers would focus my Demon Hunter. How do I change the AI behavior so that it would not focus specific units and instead on the closest.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Be aware that the computer player needs to be a computer controller (not an empty or unset slot) and must have an active AI running to achieve optimum intelligence.

Neutral Hostile have a purposely stupid AI that is always active. For example Neutral Hostile units will generally avoid attacking buildings even if they are surrounding the building in a hostile state with no other targets available.
 
Level 4
Joined
Dec 24, 2016
Messages
42
Be aware that the computer player needs to be a computer controller (not an empty or unset slot) and must have an active AI running to achieve optimum intelligence.

Neutral Hostile have a purposely stupid AI that is always active. For example Neutral Hostile units will generally avoid attacking buildings even if they are surrounding the building in a hostile state with no other targets available.

Is there a way for the Computer Player to behave like a Neutral Hostile so that things like Switching Aggro is much easier? I prefer not to have to change the player to Neutral Hostile as I am sure there are problems like not being able to ally with them, not being able to order them around (via trigger), and not being able to give them full vision of the map.

I tried once triggering the AI with a "current order is attack, keep attacking the current unit, then stop" but I think it might be a bit exploitable and defeats the purpose of trading aggro if the Boss will just chase you, and even then, the AI will still target specific units that are farther away once at the stop command. Do I have to tweak it with the AI-Editor? then implement that AI? I am having trouble finding the right parameters.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Is there a way for the Computer Player to behave like a Neutral Hostile so that things like Switching Aggro is much easier? I prefer not to have to change the player to Neutral Hostile as I am sure there are problems like not being able to ally with them, not being able to order them around (via trigger), and not being able to give them full vision of the map.
The behaviour of Neutral Hostile is hard coded. As far as I am aware you cannot make computer controlled player slots act like them.

Have you tried making sure an AI is running for the computer player? It does not need to do much, eg melee AI, but it just has to turn on their AI system.
 
Level 4
Joined
Dec 24, 2016
Messages
42
Have you tried making sure an AI is running for the computer player? It does not need to do much, eg melee AI, but it just has to turn on their AI system.

I have tried that. I have set it to both Melee AI and a custom AI. The Custom AI is set so that it will not focus heroes; I also unchecked "Have no Mercy." I also set their target priorities of attack groups to nothing. I should also mention that I have two dimensions of AI units. "Creep Camps" and "Bosses." If I run an AI script (either the Melee or the Custom), the AI will act in a way so laughable that I had to get rid of it. For example, these creeps would just walk over to the top of the map and group up which is the funniest thing I have ever seen. And even then, these units will still focus ranged units instead of units that are in front of them.

Worst case scenario, I just leave it so that the AI will continue to hit whatever it wants and make aggro-trading nigh impossible. Otherwise, I do wish I could set it so the Computer Player would not have a preference on what it's attacking and allow players to switch what it's attacking whenever its current target runs out of range.

No... I do not want to use a Taunt spell because that would also affect hostile player units (this map is a 3v3v3 vs AI) and would also cause the unit to chase from their guard positions.

I am confident one boss map managed to get it right but I forgot which one it was but there is also a possibility that the AI for that map was Neutral Hostile. However, I would like to think that there is a method that I could use for allowing Computer players to act the same way.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
And even then, these units will still focus ranged units instead of units that are in front of them.
They should focus the units with the lowest health or which pose the most threat. Range units generally are hence it makes the most sense. In Heroes of the Storm, for example, you would focus down Raynor or Sgt Hammer attacking from the back who are auto attack DPS heroes with low health rather than a Johanna or Stiches attacking in the front who are tough heroes with low DPS.

Many boss maps made a novelty agro system where by triggers ordered the boss to certain arbitrary targets based on what the agro system decided should be attacked.

To be honest agro systems go against the idea of AI as they are fundamentally unintelligent. There is no logic behind a unit attacking a low dps high health hero over other high dps low health heroes which pose the greatest risk to the boss losing.
 
Status
Not open for further replies.
Top