• 🏆 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!

Base abilities for custom spells cast by melee-game AI units

Level 9
Joined
Dec 12, 2007
Messages
489
I would like to add some information regarding this topic,
about custom Immolation, the AI-controlled unit will only activate it if :
1. custom Immolation deals damage
2. there are enemies around the AI-controlled unit
3. the custom Immolation can damage those enemies (OE - Target Allowed)
4. the AI-controlled unit has lost about 30-50% hitpoints.

found this after messing with AI in my own map, these conditions are found with trial and errors, perhaps someone else can confirm it.
 
Level 16
Joined
Aug 20, 2009
Messages
1,552
I would like to add some information regarding this topic,
about custom Immolation, the AI-controlled unit will only activate it if :
1. custom Immolation deals damage
2. there are enemies around the AI-controlled unit
3. the custom Immolation can damage those enemies (OE - Target Allowed)
4. the AI-controlled unit has lost about 30-50% hitpoints.

found this after messing with AI in my own map, these conditions are found with trial and errors, perhaps someone else can confirm it.

Thanks for contributing! +REP

I do hope there are more reliable source of datas though,

Such as in the MPQ anyone?

Is there such files that define these behaviours?
 
I think the AI part of the spells is raw-coded at the same place there is the effect part (the base effect, I mean, not what you can change in the editor).
If that's the case, it's in the game.dll or the storm.dll (don't remember which one) and would be hard to decode.

1. custom Immolation deals damage
Im quite sure this applies to all abilities that have a damage component.

As this one :
3. the custom Immolation can damage those enemies (OE - Target Allowed)
 

Yrk

Yrk

Level 6
Joined
Apr 1, 2014
Messages
239
Hi Boris_Spider ,

Here are some you can add to the list ( If this is Update )
-Phase Shift
-Mana Flare
-Anti-magic Shell
-Unholy Frenzy
-Cripple
-Purge
-Bloodlust
-Statis Trap
-Big Bad Voodoo
-Dispel
-Locust Swarm / Voodoo Spirits
-Death Pact

Hope it helps :)
-----
Ohhh , By the way , +Rep :)
 
Level 8
Joined
Jul 14, 2010
Messages
235
The AI only cast these spells if the unit with the ability already know it from before right? You can't give an Acolyte the spell "Divine Shield" and it will automatically cast it when attacked? So you have to base the unit you want to cast Divine Shield automatically on Bandit Lord or some other unit that have Divine Shield as default?

Because I tried giving "Priest" Divine Shield, but it didn't cast it automatically. But its base spells like Heal, Inner Fire and Dispel Magic it casts when the conditions are met.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
The AI only cast these spells if the unit with the ability already know it from before right? You can't give an Acolyte the spell "Divine Shield" and it will automatically cast it when attacked? So you have to base the unit you want to cast Divine Shield automatically on Bandit Lord or some other unit that have Divine Shield as default?

Because I tried giving "Priest" Divine Shield, but it didn't cast it automatically. But its base spells like Heal, Inner Fire and Dispel Magic it casts when the conditions are met.

I have made several tests at various times and this doesn't seem to be true. However, some abilities do have strange rules for being cast.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Well, it's a design limitation. It's either impossible to create an AI that would beat humans in a complex real-time game or it is prohibitively expensive. Thus, they are given some advantage to make up for them being stupid. Not having to scout is one of them in WC3.
 
Level 6
Joined
Feb 22, 2009
Messages
212
If you play melee games for a time, you will realize that sight abilities such as Sentinel (Night elf huntress), Sentry Ward (Orc Witch Doctor), Farsight (Orc Farseer), Flare (Human Mortal team) aren't used by AI. To some extent, Undead Shades are never produced by your AI opponent.

About Divine Shield question, i think the priest didn't use it because they are busy using Heal on themselves already. You may want to try on some other units and see the differences.
 
Level 9
Joined
May 21, 2014
Messages
580
If you play melee games for a time, you will realize that sight abilities such as Sentinel (Night elf huntress), Sentry Ward (Orc Witch Doctor), Farsight (Orc Farseer), Flare (Human Mortal team) aren't used by AI. To some extent, Undead Shades are never produced by your AI opponent.

About Divine Shield question, i think the priest didn't use it because they are busy using Heal on themselves already. You may want to try on some other units and see the differences.

The AI DOES use Sentinel.
 
Just wanted to add this, as there's a lot of confusion about AoE spell AI and how they sometimes trigger if only 1 unit is caught by it:

This happens when the caster has full mana. In this case, it's actually smart to use your spell to kill the unit fast in order to not waste the mana regeneration.
 
Level 3
Joined
Jun 3, 2009
Messages
53
Question: does the AI behave this way only if you use the action:
  • Melee Game - Run melee AI scripts (for computer players)
or do computer players behave the same way even without it?
 
Level 16
Joined
May 2, 2011
Messages
1,345
inner fire is used whenever the ally unit is attacking (becuz it gives bonus dmg)

im not sure if its used when the unit cannot attack.

slow i think is used if the enemy is attacking (like curse) butim not sure.

basically, auto cast spells behave same as auto cast I think.

(need double check)!!!!
 
Level 20
Joined
Nov 20, 2005
Messages
1,178
Guys,

is polymorph never used by sorceress?

If abilities aren't mentioned it's because none of the contributors have submitted the casting trends of the AI. Please submit your experiences working with custom AI base abilities. The more information I have the more useful others may find this tutorial.
 
Level 16
Joined
May 2, 2011
Messages
1,345
Hello,

AI behaviour here seems wierd. I gave Beast master has his own abilitities (bear + quil beast) in addition to water elemental and Book of the dead (ability not item).

why does it seem to me that the AI summons only when the beast master health is low? also He almost never used book of the dead (he only did it once when i removed all other abilities)

could the reason be perhaps that campaign AI script is run?

Edit: alright, so when BEAST VS BLADE necro book wont be used. However, when I let beast reach my town and I call to arms, he does use it.

Perhaps the ai will only use necro book when he is outnumbered? Perhaps something else.
 

Attachments

  • TestAIMap04.w3x
    21.9 KB · Views: 128
Last edited:
Level 16
Joined
May 2, 2011
Messages
1,345
Hello,

it seems like Vengence, the warden ability, is only used when there are some corpses nearby. The AI wouldnt summon otherwise.

e:

Hello,

AI uses a lot of the summon abilitites. Even dark portal, item doom guard summon, and summon HeadHunters are used and not ignored.

When I have time I will check inferno (must be used cuz melee, duh),and rain of chaos inshallah


hmmm,

the ensnare ability makes me curious
 
Last edited:
Level 16
Joined
May 2, 2011
Messages
1,345
seems like cripple is only cast on powerful units.

it is always cast on knights. it is never cast on footmen.

AI cast it on grunts when they have level 2 weapon upgrade

If I change Foot men attack speed to be much higher, AI will cast cripple on them.
 
Last edited:
Level 16
Joined
May 2, 2011
Messages
1,345
Forked Lightning doesn't work for me. Units are around but it won't cast.
What about Death Coil? Do they use it normally during attacks? Or just to heal their undead?
maybe it will cast only if there are enough units. If you have played Curse of the Blood elves original campaign, you would see that it is used by the AI (check last 2 chapters)
 
Level 1
Joined
Feb 4, 2019
Messages
3
Forked Lightning doesn't work for me. Units are around but it won't cast.
What about Death Coil? Do they use it normally during attacks? Or just to heal their undead?
At the moment the normal melee AI from Blizzard is broken. I think the spell-reference has been changed. The names of hero-spells have been changed in the WorldEdit as well. Thus the AI does not skill spells anymore :O
Alternative AIs such as AMAI don't work either because of the changed spell reference
 
Level 20
Joined
Nov 20, 2005
Messages
1,178
At the moment the normal melee AI from Blizzard is broken. I think the spell-reference has been changed. The names of hero-spells have been changed in the WorldEdit as well. Thus the AI does not skill spells anymore :O
Alternative AIs such as AMAI don't work either because of the changed spell reference
It worked in the wc1 remake, and i'm still using that version for the wc2 remake! Not even blizzard string works and it was the same back then. :(
 
Top