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

[General] Changing Melee AI difficulty within the map (with Triggers)

Status
Not open for further replies.
Level 11
Joined
Aug 24, 2012
Messages
429
I am looking for a way to change the MELEE AI's difficulty during the map itself (not in the lobby). I only want to switch between the standard difficulties: Normal, Hard, Insane etc (or Easy, Normal, Hard whatever it is).

Is there a way I can do this through GUI?

The trigger Run Melee AI scrips gives no option to customize difficulty, it only uses whatever difficulty was chosen in the lobby.
 
Last edited by a moderator:
Level 10
Joined
Apr 4, 2010
Messages
509
The only way you can choose the difficulty of the AI in game is to trigger the AI yourself. Which is pretty hard. Instead of making the brain of the AI smart as a "hard difficulty" setting, you can just give the AI a resource boost and that would make it "hard" to play against. So you can try a resource handicap to adjust the difficulty setting.
 
Level 13
Joined
Jul 15, 2007
Messages
763
I'm pretty sure the easy, normal and insane difficulties all share the same AI; the only difference is that easy gets less resources and insane gets twice the amount normal does (you can check this for yourself by looking at their resources has they harvest).

That gives the illusion of changes in the difficulty of AI, because easy AI has underdeveloped/small armies whereas insane can essentially tech, build and train non-stop. If, by triggers, you made an "easy" AI have resource gains the same as the insane AI, they would be pretty much identical.
 
Level 11
Joined
Aug 24, 2012
Messages
429
Oh I didn't knew that, thanks, I will try giving them more resources:)

Edit: Giving more resources did very little to help the AI. Even though it had gold in the thousands, it barely trained new units and only researched 1/1 upgrades for melee units only. It trained no new casters and didn't even bother to tech up to gryphons.

Besides that, it behaves like a simple default (Normal) AI. It expands, builds Heroes and kills creeps properly.
 
Last edited:
AI Scripts is Jass made, hence works differently in all difficulties. This can be noticed when you play against Hard, they pop 3 heroes and deadly assault forces while easy use 1 hero and small attack force. They use the same AI But with different setting per difficulty.

Adding resources will not work, Melee AI is easier to change in the lobby OR you disable the initial trigger and run the appropriate AI once you choose the difficulty of the AI.
 
Level 10
Joined
Jun 6, 2007
Messages
392
What you could do is to find the original ai files, and create 3 versions of each, one for each difficulty. It should be easy to determine which parts of each file should be deleted, but takes some time. Also, run a syntax checker afterwards, as it's easy to make small mistakes in the process.
 
Level 13
Joined
Jul 15, 2007
Messages
763
I tested the AIs out on a standard Blizzard melee map and it seems the only tactical difference between the AI difficulties i observed were:

easy makes 1 hero, normal makes 2, insane makes 3
easy only does first tier of weapon/melee upgrades, normal first + second, insane does all

Besides that, all diffculties behave essentially the same and it seems a bit random: some Insanes will sit inside their base doing nothing whilst Normals/Easies will go out and roam. Insane also likes to wall its troops in with ziggurats/moonwells etc.

Army compositions are the same; easy, normal and insane will eventually grow an army the same size and composition (e.g. easy will build abominations and frost wyrms)

All AIs have the same gimmicks; the Human AI can bug out on any difficulty, and they're still not smart enough to realize you're attacking their army if they're retreating.

I do not know differences in how they do other techs.
 
Level 3
Joined
Mar 3, 2011
Messages
58
I've been trying to see how the melee AI works for quite some time.
Boosting it or whatever. Working with it is extremely frustrating. My suggestion is either create your own AI 3 times, one for each difficulty, or somehow get hold of melee AI and split it.
When a specific event occurs, delete the previous script and start the next
 
Level 11
Joined
Aug 24, 2012
Messages
429
AI Scripts is Jass made, hence works differently in all difficulties. This can be noticed when you play against Hard, they pop 3 heroes and deadly assault forces while easy use 1 hero and small attack force. They use the same AI But with different setting per difficulty.

Adding resources will not work, Melee AI is easier to change in the lobby OR you disable the initial trigger and run the appropriate AI once you choose the difficulty of the AI.

I need to change the AI once the map has started (so it cannot be done in the lobby).

How can I choose this 'appropriate AI' using triggers? Where is it stored? How can I access it?

Could you post an example trigger?

PS: I know there is one trigger that runs at the beginning of each melee map that runs whatever AI was chosen in the lobby. What I want is a version of this trigger that allows me to choose which standard AI it runs once the map has started.
 
Level 10
Joined
Jun 6, 2007
Messages
392
I'm using this kind of trigger on my custom race map:
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked player) is in (All players controlled by a User player)) Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Race of (Picked player)) Equal to Human
            • Then - Actions
              • AI - Start melee AI script for (Picked player): war3mapImported\ElfTestAi.ai
            • Else - Actions
        • Else - Actions
You must have imported the ai through import manager.
 
Level 3
Joined
Mar 3, 2011
Messages
58
^You could just place two conditions
check for computer
check for race
------
If you want to change the difficulty in game, you must have your own AI script. Normal melee AI? Nope, not even a chance.
 
Level 11
Joined
Aug 24, 2012
Messages
429
I'm using this kind of trigger on my custom race map:
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked player) is in (All players controlled by a User player)) Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Race of (Picked player)) Equal to Human
            • Then - Actions
              • AI - Start melee AI script for (Picked player): war3mapImported\ElfTestAi.ai
            • Else - Actions
        • Else - Actions
You must have imported the ai through import manager.

I know the trigger that Starts a melee AI script. What I need instead of the war3mapImported\ElfTestAi.ai is the standard AI used by the computer in melee maps. I cannot import it since I have no clue where this AI (.ai file) is located.

If I would know where the files ( there should be one for each difficulty I suppose) are then I could import them and run the trigger.

What I am lacking is the AI script itself.

The Files must be somewhere since the computer uses them...they are not in the sample .ai files provided by Blizzard.
 
Status
Not open for further replies.
Top