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

How to make the AI take certain units seriously?

Status
Not open for further replies.
Level 2
Joined
Nov 8, 2007
Messages
6
I've played with the Ai editor and what not. One issue I often have with custom units is that the AI doesn't take them seriously when facing them. What I mean is, they don't use all of their unit's abilities just because it's one enemy.

"Nah I dont need those water elementals, its just one rock golem thing" and then they get creamed and run away.

How can I change this?
 
The default abilities of WarCraft 3 are created the way we create spells via triggers.
They are just hardcoded so we can't change them.

So fx. when you see a Tauren Chieftain not using Warstomp when there are only one unit in sight, it's because it's not coded to do that.
It probably makes a "unit in range" check, When the number is lower than 3 then don't use Warstomp.

So you have to trigger the use yourself.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
You cannot as the ability AI has nothing to do with strategic AI.

Ability AI is hard coded and the AI will even cast abilities when they are not running any AI. The ability tactical AI uses certain hard-coded conditions to determine when to cast such as number of enemies in area for AoE moves (sounds like your problem), being attacked, facing casters etc. The emphasis is this is hard-coded.

You will need to trigger your own tactical AI to solve your problem. This is done by using a trigger with the necessary cast events that evaluates if an ability should be cast in response and then does so if it was determined appropriate. This can either run in parallel to the standard tactical AI (complimentary, allows it to deal with special cases like lone units not normally possible) or be the full AI for the ability in the case of abilities with no tactical AI present (channel, death pact etc).

There are a few considerations you need to factor in. The trigger should only be active if an AI has such units that require its tactical decisions so as to prevent constant overhead (especially important for generic events). Just because you think it is appropriate to cast an ability does not make it so (casting a huge AoE damage ultimate on a single target is pretty stupid strategically as casting it on that 30 unit army attacking your base would be far more effective and deal 30 times the damage). Also you may need to handle strategic orders interacting with the casting or the AI might not move after a cast or might move during a channel.

In SC2 you have full access to customize tactical decisions such as by writing tactical AI functions and linking them to units/abilities. This feature is an under-ratted improvement over WC3 that few people have looked into.
 
Status
Not open for further replies.
Top