Advanced Melee AI

This tool originates from: http://www.wc3campaigns.net/forumdisplay.php?f=601
- Wayback Archive of Wc3c

Source code now available at: SMUnlimited/AMAI

Latest Release Notes

AMAI is a mod/tool for Warcraft III: Reign of Chaos and The Frozen Throne made to improve the computer AI of the game in many possible ways.

AMAI will make it easier to edit the War3 AI, harder to beat and more fun.

The goal is to make a human like opponent or ally that both react on events and tries to insult you by chat taunts while playing in a more human like way.

  • Personality Profiles: Each AI opponent has a set profile which modifies how it reacts or plays the game. Some can be real chickens and never dare to attack you while others will rush you down.
  • Dynamic Strategies: Constantly monitors the current situation of the game and always try to pick the best suited strategy to counter the enemy forces.
    • The computers will pick from all strategies depending on what kind of units the enemy has, how long the game has been going and what favorite units the current profile has.
  • Enhanced Micromanagement Control
    • To help keep as many units as possible alive by fleeing by town portal, zeppelin or foot.
    • This includes better use of items and healing items.
    • Makes the enemy force suffer as much as possible by focusing fire on the most vulnerable enemy units first if they are in range.
    • Will buy neutral heroes and units.
    • Can occasionally attempt tower rushes and militia/ancient expansions.
  • Enhanced Team Play
    • Coordinates with allies what it will be attacking or will join allies in attacking a target.
    • Human players have access to the Commander, letting you give commands.
    • Asks for aid if running out resources.
  • Surrenders : Based on profiles some AI's will give up when it detects its losing, while others will fight to the death.
  • Chat Support
    • AMAI will taunt enemy players, and share its build strategy with team players.
    • Includes Support for 10 different languages.
  • Easy to use Strategy and Profile editor.
    • Supports an unlimited amount of your own profiles.
    • Supports an unlimited amount of your own strategies.
    • Auto Building feature for example: a AMAI computer only needs to know that it shall build a hero and 15 footmen. It will automatically build all needed buildings, workers and farms in order to get this as fast as possible.

How to play
AMAI release has the standard AI scripts pre-built for you. You just need to install the scripts to maps or your game.

Map Extraction​

Most install options require installing onto maps, so these may need extraction first.

It is suggested to create a subfolder in your "maps" folder like C:\Users\<username>\Documents\Warcraft III\Maps\AMAI and copy the maps you intend to use AMAI with there.

You can opt to download a map pack containing a selection with AMAI preinstalled on or you can install onto your own maps.

For Warcraft 1.30 onwards you need to use Casc Storages - Main page to extract a copy of the official maps.

On windows make sure the maps to install onto are not in a protected UAC location.
  • This may mean you have to install to maps in a different directory then copy into your Maps folder afterwards
  • Or run installer as an administrator

Warcraft Requirements and Versions

There are multiple editions of AMAI available to install based on your warcraft 3 version you run with. Some install methods you must use the correct abrievation in the table to install the correct scripts.Improvements and fixes to the core AI engine will improve the older scripts as well.

AMAI ScriptsOptimal VersionSupported Version
REFORGED1.36.2 - 2.0.01.33+
TFT1.24-1.281.24+
ROC1.24-1.281.24 - 1.31

Optimal version is based on the warcraft tech tree this edition is based on. Use a version further away from the optimal the more likely it will affect the AIs ability to build, usually just unoptimal build order but worst case it can no longer build at all.Classic AI scripts do have some forward compatibility built in to fix some major issues in later versions including 24 player support.

Avoid v1.29.x of Warcraft 3 and either upgrade or downgrade as it breaks various things including but not limited to:
  • Preventing AMAI from chatting.
  • Heros not learning skills although we have a fix that can get applied, this may not work if the map itself is too old.

AMAI Installer
  • The installer has to be downloaded separately as its much larger compared to the AI package.
  • Unzip the contents of the installer to a folder of your choice.
  • Double-click amai-installer.exe to open the installer.
  • Select whether to install to a map or whole directory.
  • Select if Commander is enabled, or if you want to have AMAI play against the vanilla AI. Even teams are Vanilla AI, odd teams are AMAI.
  • Use Optimised Scripts: Optimises the scripts to use less CPU and memory. On by default.
  • Override Default AI Language: Sets the default chat language of AMAI to current language of the installer and disables initial game prompt of language in the Commander.

installer.jpg




Command Line Install
  • From Windows CMD/PowerShell or Wine wineconsole, run this: .\Install<Version>ToMap.bat "C:\Documents\Warcraft III\Maps\AMAI\<Map>.w3m" <N>
  • Where <Version> should be replaced with ROC, TFT, or REFORGED, <Map> with your preferred map, <N> with 0 or 1 or 2 if you want to not install the Commander or install the Commander or install the VS Vanilla AI mode respectively.
  • Alternatively for complex installs if you have perl installed from a commandline you can type perl InstallToDir.pl REFORGED "C:\Documents\Warcraft III\Maps\AMAI" and press enter to install AMAI to all maps in a directory and subdirectories.
  • You can disable the commander for this install via the perl InstallToDir.pl REFORGED "C:\Documents\Warcraft III\Maps\AMAI" "0"
  • After installing AMAI on your map just start Warcraft 3 and play the map against and/or with computers to make use of AMAI.

Manual install

  • You can manually use the included MPQEditor.exe to install to a single map.
  • You can use this with WINE to install on linux/Mac systems too.
  • Copy contents of AMAI\Scripts\<Version> into the Scripts folder in a map.
  • If wanting to use VS Vanilla AI mode copy the above scripts, but then also copy contents of AMAI\Scripts\<Version>\vsai into the Scripts folder in a map. You must copy the blizzard.j here instead of the original.

Manual Mod Install

You can install the scripts locally to your game folder to enable the AI for any map you play and to avoid extracting the official maps.
  • Change registry key: HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III" - Allow Local Files"=dword:00000001
  • Create a Scripts folder locally and include the *.ai files and Blizzard.j for the VERSION you want.
    • Pre 1.30 you can try and use the WC3 Mod Manager to enable.
    • 1.30.0~1.31.x : Create Scripts folder in the game root directory
    • 1.32.0 + : Create Scripts folder in the game retail directory
  • Run game and play a custom game on a standard melee map.
Notes
  • Advanced Melee AI is made to be used on 'melee' maps only so please don't try to use it on completly custom maps (e.g towerdefence), it will make no difference on such maps.
  • Custom melee maps need to be set to latest patch data. Open the map in the Warcraft editor, go to Scenario->Map Options-> and change "Game Data Set" to "Melee (Latest Patch)".
  • Lua maps are supported, but the Commander can only be used to set language and game mode at game start. You cannot use the commander during the game.If you want the full Commander support, Open the map in the Warcraft editor, go to Scenario > Map Options, and change Script Language to Jass, then install AMAI to it. If Script Language is disabled, please reset the Trigger Editor to its initial state.
  • You may need to run as an administrator if you have issues with maps not displaying any teams.
  • Note maps older than 1.24 will need resaving in the world editor if you want full 24 player support.
  • AMAI is more resource intensive than the normal AI scripts. At 24 players there is a higher risk of lag and crashes as the game cannot handle too many script operations happening in the same game frame. Reduce the number of players if you have issues. We continue to optimize and fix issues to help avoid this occuring.

V2.54
The original 10 year old version that supports 1.24 - 1.29 warcraft.
The download for 2.54 is the developer edition intended for developers to use.

For everyday use the player edition is alternatively available to download here


NOTE: The old 2.5.4 zip is now password protected because Google Chrome is flagging it as malicious software. The password is amai. Note some of the dlls are flagged as virus generic false positives in 2020 due to there age, but they are false positives


Keywords:
Artificial Intelligence, AI
Previews
Contents

AMAI 3.4.1 (Binary)

AMAI 3.4.2b (Binary)

AMAI 3.4.2b Installer (Binary)

AMAI 3.4.1 Installer (Binary)

AMAI 3.4.0 (Binary)

AMAI 3.4.0 Installer (Binary)

AMAI 3.3.5a Installer (Binary)

AMAI 3.3.5a (Binary)

AMAI 3.3.5 (Binary)

AMAI 3.3.4 (Binary)

AMAI 3.3.4 Installer (Binary)

AMAI 3.3.3a (Binary)

AMAI 3.3.3a Installer (Binary)

AMAI 3.3.2 (Binary)

AMAI Map Pack 3.3.2 (Binary)

AMAI 3.3.1a (Binary)

AMAI 2.6.2 (Binary)

AMAI 3.1.1 (Binary)

AMAI 3.2.2 (Binary)

Advanced Melee AI 2.54 (Binary)

Reviews
AMAI is very, very good. Much better than any Blizzard AI. I love it. ==Update - 25/08/12== It has recently come to our attention that some antivirus softwares like Norton detect a virus in this, however, we can assure you that it is a false...
3.3.5a released with emergency fixes

Changed​

  • If AI is not strong enough to creep an expansion it won't save resources and instead use them to buy more units.
any chance to make AI go creep camps they can take down? most of the time they think they are on "whosyourdaddy" and the first camp they go creep is the red one, obviously with 1 hero and 2 or 3 units they get raped hard, and they often send more units to try to finish it but with a dead hero and units simply rallying into the red camp as they come out of barrack is just a massive waste of time/resources lol.
sometimes they just go through the middle camp as is in the way to the enemy base and other times they deliberately go attack them even during night when they are sleeping.
 
Level 3
Joined
May 15, 2024
Messages
8
Any chance to "fix" team mode? unfortunately 2v2 and 4v4 is very unfun, most games end up me being completely alone against the whole CPU team, while my CPU teammates run back and forth as in "need to help my ally, hold on I forgot something even though I don't know what is that I forgot" so its stuck on a loop back and forth most of the time. The times where it doesn't do that they run all the way to my base (which is too late as im already dead by the time they reach here) instead of using their TP. :(
 
Level 3
Joined
May 15, 2024
Messages
8
Another one that might be looked at is maybe, the decision making of teching up, 10th minute mark I was almost level 5, same supply as Human AMAI & same gold & both expos, and I was getting tier 3 while CPU was still at T1 with 1k gold, decided to Tier 2 at the 11th minute mark.
 
Level 1
Joined
Aug 27, 2024
Messages
2
Windows 10
Reforged 1.36.2
AMAI 3.3.5a (latest from github)

Sorry for the probably stupid question, but how do I get AMAI to work in Reforged? I tried to install it on different official maps (extracted by Casc), for example EchoIsles v2, in different ways (via UI, CMD), but the bot just stands on its base and does nothing.
 
Last edited:
Level 1
Joined
Aug 27, 2024
Messages
2
Windows 10
Reforged 1.36.2
AMAI 3.3.5a (latest from github)

Sorry for the probably stupid question, but how do I get AMAI to work in Reforged? I tried to install it on different official maps (extracted by Casc), for example EchoIsles v2, in different ways (via UI, CMD), but the bot just stands on its base and does nothing.

I found out that AMAI only works on old maps (from ...\Warcraft III\Maps\Download\ without "S2" in the name). It seems that all maps with "S2" have a different format, so AMAI does not work correctly. For example, it works for (2)EchoIsles.w3x, but does not work for (2)EchoIsles_S2_v2.2.w3x.

UPD:
I figured out why AMAI doesn't work on "S2" maps. It happens because all these maps use Lua scripting language. And AMAI doesn't work on such maps, which is written in the notes section. However, changing Lua to JASS in the World Editor for maps extracted from Reforged sources does not allow to make AMAI work on these maps. But on maps downloaded from W3Champions it works fine.
 
Last edited:
Level 6
Joined
Jan 5, 2022
Messages
73
I found out that AMAI only works on old maps (from ...\Warcraft III\Maps\Download\ without "S2" in the name). It seems that all maps with "S2" have a different format, so AMAI does not work correctly. For example, it works for (2)EchoIsles.w3x, but does not work for (2)EchoIsles_S2_v2.2.w3x.

UPD:
I figured out why AMAI doesn't work on "S2" maps. It happens because all these maps use Lua scripting language. And AMAI doesn't work on such maps, which is written in the notes section. However, changing Lua to JASS in the World Editor for maps extracted from Reforged sources does not allow to make AMAI work on these maps. But on maps downloaded from W3Champions it works fine.
Pretty much what you said. Make sure you downloaded the AMAI files and the installer and placed them correctly. If a map does not work, change language (from Lua -> JASS) in the world editor and try again. It disables stuff such as the w3c commands but it's needed to make AMAI work.
 
Level 1
Joined
Sep 15, 2024
Messages
2
Greeting to all,

I've tried installing AMAI into my map to test their aggressiveness and their behavior, those worked very well.
However, i've encountered a slight bug whereby my special effect does not apply to "neutral hostile" player. For own player and AMAI computer players, those special effect work as intended.

Furthermore, i've tried playing without the AMAI installed, and granted myself neutral hostile full controls to test and the special effects were present. Below are my 2 types of special effect triggers and leaks are handled.

[1]
1726401493518.png

[2]
1726401563501.png

-----------
Additional infor:
I am running on Warcraft 3 TFT version 1.31.1.12.
My bad for the grammar, as english is not my main language.

Any advises will be greatly appreciated!
 
Level 3
Joined
May 15, 2024
Messages
8
I only did a quick run up and seemed ok in my quick test. Annoying if that is the case.
As far as I can see, it's only (Normal) Humans, seem fine with other races, (Insane) Human seems fine too, just Human on normal acting weird, most of the times when they gather the peasants there wont be anything mining the mine.
 
Level 6
Joined
Jan 5, 2022
Messages
73
As far as I can see, it's only (Normal) Humans, seem fine with other races, (Insane) Human seems fine too, just Human on normal acting weird, most of the times when they gather the peasants there wont be anything mining the mine.
What map were you playing btw and what mode? :D

Maybe a replay could help.
 
Level 3
Joined
Nov 17, 2024
Messages
11
Thank you !!!!


This is my first time using this mod. Are the images in the middle of the screen, like Reforged, Frozen Throne, and Region of Chaos, not meant to be clickable?

Also, when I press the install button at the top and make a selection, nothing seems to work. Is this an issue unique to me, or are others experiencing the same problem?
 
Level 9
Joined
May 26, 2004
Messages
81
This is my first time using this mod. Are the images in the middle of the screen, like Reforged, Frozen Throne, and Region of Chaos, not meant to be clickable?

Also, when I press the install button at the top and make a selection, nothing seems to work. Is this an issue unique to me, or are others experiencing the same problem?
They are supposed to be clickable. But you are also missing the rest of the menu options
:eek:2

Question is your default OS language not english? Also what OS as in theory needs to be win7 or higher.
 
Last edited:
Level 3
Joined
Nov 17, 2024
Messages
11
They are supposed to be. But you are also missing the rest of the menu options
:eek:2

Question is your default OS language not english? Also what OS as in theory needs to be win7 or higher.
ahh i use win11. but my os language is not English cuz I'm non-English speaking country.

But fortunately, it works fine with the manual installation you mentioned
Now, AI is definitely playing the game better 👍👍
 
Level 9
Joined
May 26, 2004
Messages
81
ahh i use win11. but my os language is not English cuz I'm non-English speaking country.

But fortunately, it works fine with the manual installation you mentioned
Now, AI is definitely playing the game better 👍👍
Patched the installer, when it found a language it didn't understand it exploded. Should work correctly now.
 
Level 6
Joined
Jan 5, 2022
Messages
73
Hey @Strategy Master , it seems that there's a problem when trying to install vs Vanilla AI, as it says it's missing vsaiBlizzard.j and stops the process before it starts

From what I can understand, there were some changes in the launcher and you forgot a / which creates this problem. A temporary solution for anyone looking to install vs Vanilla AI is to go on win-unpacked\resources\AMAI\Scripts\OPTREFORGED\vsai, rename Blizzard to vsaiBlizzard and then move it to Scripts/OPTREFORGED

For those wondering, I have the map pack rdy but I don't wanna share it incomplete. I'll try my best tommorow if it's not fixed, it's getting late now.
 
Level 9
Joined
May 26, 2004
Messages
81
Hey @Strategy Master , it seems that there's a problem when trying to install vs Vanilla AI, as it says it's missing vsaiBlizzard.j and stops the process before it starts

From what I can understand, there were some changes in the launcher and you forgot a / which creates this problem. A temporary solution for anyone looking to install vs Vanilla AI is to go on win-unpacked\resources\AMAI\Scripts\OPTREFORGED\vsai, rename Blizzard to vsaiBlizzard and then move it to Scripts/OPTREFORGED

For those wondering, I have the map pack rdy but I don't wanna share it incomplete. I'll try my best tommorow if it's not fixed, it's getting late now.
Patched and fixed installer

Update: And a second issue which is now fixed:eekani:
 
Last edited:
Level 6
Joined
Jan 5, 2022
Messages
73
Great! With the issue fix I finally got my map pack ready for anyone wanting it. 420 maps, which includes all maps from the previous map pack (aka all blizz maps, all w3c ladder maps, all competitive maps and many many more) plus a few new ones, mostly from Zucht! Download link below, changes in the zip file. Size of the download is 615mb apparently, something changed :D


Juggernaut bug fixed



(tagging @alex11chr as he asked for the map pack already)
 
Last edited:
Level 2
Joined
Mar 14, 2024
Messages
6
Great! With the issue fix I finally got my map pack ready for anyone wanting it. 420 maps, which includes all maps from the previous map pack (aka all blizz maps, all w3c ladder maps, all competitive maps and many many more) plus a few new ones, mostly from Zucht! Download link below, changes in the zip file. Size of the download is 615 apparently, something changed :D


NOTE: It has come to my attention shortly after uploading this file that (8) The Juggernaut can create buggy spawns when playing 2v2v2v2. So please, do not play 2v2v2v2 on this map unless you dont mind it. It's not guaranteed it'll happen, but it most likely will. I'll see how i can fix it but will replace the link when I do. If you downloaded the pack already and want the fix without installing everything again, dm me on discord and i will give you the fixed maps when rdy (name there is also gartoll, remember, the r before the t)



(tagging @alex11chr as he asked for the map pack already)
Thanks @gartoll! Appreciate it!
 
Level 6
Joined
Jan 5, 2022
Messages
73
select "install on folder" is not working from the top menu, only works clicking the large icons.
I'm used to click top menu XD
fuck me, can't get it to start in english no commander, it keeps asking me to select language.
first of all did you open amai-installer or amai-electron-manageR? I dont think it matters but just to make sure :D

secondly, what's the default language of your system & of wc3? Mine's both in english and didn't ask me anything :D
 
Level 9
Joined
May 26, 2004
Messages
81
select "install on folder" is not working from the top menu, only works clicking the large icons.
I'm used to click top menu XD
fuck me, can't get it to start in english no commander, it keeps asking me to select language.
If you have ever installed the commander, you probrably won't be able to uninstall it without using the DisableCommander.bat script. We probrably need an option for that in the installer.

first of all did you open amai-installer or amai-electron-manageR? I dont think it matters but just to make sure

secondly, what's the default language of your system & of wc3? Mine's both in english and didn't ask me anything

Should just be amai-installer. electron manager is the old installer which shouldn't work with new editions if you have that present.
 
Level 1
Joined
Dec 21, 2024
Messages
2
Great! With the issue fix I finally got my map pack ready for anyone wanting it. 420 maps, which includes all maps from the previous map pack (aka all blizz maps, all w3c ladder maps, all competitive maps and many many more) plus a few new ones, mostly from Zucht! Download link below, changes in the zip file. Size of the download is 615mb apparently, something changed :D


Juggernaut bug fixed



(tagging @alex11chr as he asked for the map pack already)
@gartoll

i know you just made a Map Pack but i see that the big 3.4.1 has come out would you please be able to create a pack for the latest release please and thank you!
 
Level 6
Joined
Jan 5, 2022
Messages
73
@gartoll

i know you just made a Map Pack but i see that the big 3.4.1 has come out would you please be able to create a pack for the latest release please and thank you!
I know but im moving some stuff around these days which is why i haven't made it yet. So ye just wait a few days should be ready around Christmas

Will be 450 maps, which should be around 700mb. In the future i might make a smaller pack with just w3c ladder maps
 
Griefer AI is too hardcore, undead AI went around haunting the gold mines of 2 orc allies.
AMAI 3.4.2
Reforged latest patch.
forgot to say, AI started doing it at 4 or 5 minute mark, hence the AI orc has no gold lol.
 

Attachments

  • WC3ScrnShot_010925_164013_000.png
    WC3ScrnShot_010925_164013_000.png
    3.6 MB · Views: 65
  • WC3ScrnShot_010925_164024_000.png
    WC3ScrnShot_010925_164024_000.png
    3.6 MB · Views: 64
Last edited:
Level 3
Joined
May 15, 2024
Messages
8
Feedback @Strategy Master Orc sometimes does tower rush, but it wont stop trying even after a failed attempt, it just does it 24/7 which becomes really boring to play against. The AI should have some sort of check where it goes back playing normally when the tower rush failed.
 
Level 1
Joined
Jan 22, 2025
Messages
2
-cmd:help and ESC dialog are not working on 1v1, would love to be able to do Commander VS AI 🙂.
Also, why is there still a -zoom command? Reforged fixed this in the options, so it's kinda obsolete.
Thank you for your work!
 
Level 6
Joined
Jan 5, 2022
Messages
73
-cmd:help and ESC dialog are not working on 1v1, would love to be able to do Commander VS AI 🙂.
Also, why is there still a -zoom command? Reforged fixed this in the options, so it's kinda obsolete.
Thank you for your work!
These commands are only for your ally AIs, thats why they dont work in 1v1, no ally to use commands on :D
 
Level 1
Joined
Mar 13, 2025
Messages
2
Hello guys! what happened to Dynamic AMAI? a long ago it was adjusting strategies midgame.
And what about Undead Ally griefing, will it be fixed?
thx!
 
Level 2
Joined
Mar 14, 2024
Messages
6
Griefer AI is too hardcore, undead AI went around haunting the gold mines of 2 orc allies.
AMAI 3.4.2
Reforged latest patch.
forgot to say, AI started doing it at 4 or 5 minute mark, hence the AI orc has no gold lol.
Been seeing this same behavior pretty consistently, unfortunately.
 
Top