Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
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 Scripts
Optimal Version
Supported Version
REFORGED
1.36.2 - 2.0.0
1.33+
TFT
1.24-1.28
1.24+
ROC
1.24-1.28
1.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.
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.
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
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...
Good afternoon. I was writing AI for my map with non-standard races. I did it in a standard AI editor, getting a .wai file. I don't always like the way AI works, I would like a faster and more flexible solution, similar to how it is with you. I understand correctly, this can be achieved by editing the ai file, and it is completely written in the jass language. Thank you in advance for your answer!
Good afternoon. I was writing AI for my map with non-standard races. I did it in a standard AI editor, getting a .wai file. I don't always like the way AI works, I would like a faster and more flexible solution, similar to how it is with you. I understand correctly, this can be achieved by editing the ai file, and it is completely written in the jass language. Thank you in advance for your answer!
I believe that AMAI is not yet ready for custom races or any other standard race (not orc, human, elf, or undead) in the game. But I'm not the best person to talk about it, because I'm just starting the project and only with the installation process. I'm looking to do something in the Deep Learning sense, but it's still going to be a long time coming out. Maybe this kind of solution fits what you want.
Good afternoon. I was writing AI for my map with non-standard races. I did it in a standard AI editor, getting a .wai file. I don't always like the way AI works, I would like a faster and more flexible solution, similar to how it is with you. I understand correctly, this can be achieved by editing the ai file, and it is completely written in the jass language. Thank you in advance for your answer!
You can by heavily editing AMAI and creating a new version pack with different races in it (how ROC and TFT are separate folders). Its been done in the past with various old long forgotten projects. And yes AMAI makes things easier in terms of writing the actual AI scripts with the strategy editor. But you have to setup all the AMAI csv and txt files with the new units and dependencies so that initial setup takes longer (assuming no bugs to fix with moving away from standard races)
Good afternoon. Not really into the subject, but I think you, as a jass-ai pro, can help me. I made an AI for my upgraded alliance. At first I did it in the AI editor, then I decided to try writing through jass and ran into two problems.
1) the function for creating a new thread, namely "call StartThread(function UpdateForgeAssignment)" does not work, more precisely, it does not do anything from it, or does it much later than it can.
2) for some reason, the UpdateConditions function does not work, and to be precise, it does not update the gCond_Pehotinec variable, according to the logic of which, it should return false if there is a CASTLE, but it still returns true. The AI is in the attachment, and please tell me what I'm doing wrong?
3) And please tell me how I can debug my script? BJDebugMsg does not work. Well, that is, how can I send messages to players from a bot?
So installing 3.2.2 ON TOP of the 3.1.1 AI doesn't decrease size. In a few days I will provide my map pool with 3.2.2 AMAI. BTW can you tell me if there's a way to install AMAI vs Blizz via the installer? Didn't look for that one.
Also installer didn't do the job for me? For some weird reason? Maybe I'm doing something wrong, will check
Thank you for the update and huge thanks to Electron for the installer/
now I have been experimenting for a long time and came to a sad conclusion for myself. For some reason, the AI can't run multiple infinite threads. When running in the main function ,
call StartThread( function UpdateForgeAssignment )
call StartThread( function WorkerBuildPriorities )
call StartThread( function WorkerAssignment )
call StartThread( function StartHarvestPriorities )
call StartThread( function AttackAssignment )
In which there are infinite loops, it runs only the first 3-4. The rest are just ignored. This is very sad, I will think about another solution.
@gartoll Yes installing it over older versions won't give the savings as the map mpq file is already messed up at that point. But on top of 3.2.2+ should be fine.
You need to compile the AI vs AMAI version like normal than copy the scripts over to the installer (or run installer if you extracted AMAI to the installer resources folder anyway)
@komarovba Correct only so many threads allowed in AI scripts, what I've noticed when you start adding more is it appears to start to kill threads even if one is running it will halt half way. AMAI is able to use 5 threads and we have built a scheduling system into one of the threads so we can queue actions into it.
@komarovba Correct only so many threads allowed in AI scripts, what I've noticed when you start adding more is it appears to start to kill threads even if one is running it will halt half way. AMAI is able to use 5 threads and we have built a scheduling system into one of the threads so we can queue actions into it.
I'm not doing it on an AMAI bot.
I've been experimenting with different options all day and damn, I can't get anything good.
I always get that only two threads work.
call StartThread( function WorkerAssignment )
call StartThread( function AttackAssignment )
And I assume that call CampaignAI (HOUSE, null) this is also the launch of a separate yet.
This thing is very annoying. I'm not going anywhere from the big conditions, it saddens me.
I'm not doing it on an AMAI bot.
I've been experimenting with different options all day and damn, I can't get anything good.
I always get that only two threads work.
call StartThread( function WorkerAssignment )
call StartThread( function AttackAssignment )
And I assume that call CampaignAI (HOUSE, null) this is also the launch of a separate yet.
This thing is very annoying. I'm not going anywhere from the big conditions, it saddens me.
So downloading became really easy now. It's impossible to have trouble, just put your 3.2.2 AMAI folder into your resources folder that comes with the AMAIInstaller.
However, if you still face problems, here are my 300 maps updated. The map pool barely changed and this time I added all of them as Blizz vs Blizz. Yet again, it has every single blizz map along with most of the maps that liquipedia considers competitve (click a map and expand the "other competitive maps" thing), the FML map pool and some others map in order to reach that number
Are you using the older versions of AMAI? I highly recommend getting the latest one (installer + latest version of AMAI binaries).
That way, you can use the "amai-electron-manager.exe" to install this mod instead of the commandline provided in AMAI binaries. Remember to place the binaries inside the "resources/AMAI" folder.
Ok, I got the installer to work. There mustn't be a second subfolder called AMAI, which is created by just unzipping.
The command line still doesn't work for me anymore though (it did in the past). It issues ECHO Cannot be found error for the map. But w/e, Installer should be good enough I guess.
I'd like to use the profile manager, but it needs perl with tk and I can't manage to install tk. Tried to install it through activeperl, but there's an error, and I can't find the 5.8 version which apparently has tk already included on it. I'm not familiarized with coding platforms so I don't know if there's an easier way to do it or if I'm messing things up. I use windows 11.
Another question: AMAI stops working as soon as I modify a map even though I keep it melee. I added taverns to a blizzard map and now I only get the default AI. I also can't manage to install it on hive melee maps, it says that it was installed correctly but I'm always getting the default AI.
I have one question though. To me it seems like the ai retreat their units when their healthbar reaches the red stat, wich would mean this is percentage based. I wonder if there is something i can change to make it a set hp, like 200 hp or something.
The problem right now is that grunts are maneuvered very well because their hp pool is large, but archers are only 2 hits away from death when they try to retreat.
The AI Humans constantly sends workers to the enemy base in an attempt to build a tower and all the workers just dying
Also, the AI continues to build new workers and send them to the enemy base until it loses.
Amai 2.6.2
Is it supposed to be like this ? The AI is building a tower very far from his base.
There is not a single tower at the base for protection
On the additional base the defensive towers are present
AI often does not pick up artifacts
Will there be further improvements to AMAI for the old version of Warcraft 3 (1.28) ?
Is there a way to install this on w3c maps? Maybe somehow remove something from the w3c files?
I tried renaming the blizzard.j file in the scripts folder of AMAI but it didn't work.
Is there a way to install this on w3c maps? Maybe somehow remove something from the w3c files?
I tried renaming the blizzard.j file in the scripts folder of AMAI but it didn't work.
Well, thx for the effort but I cannot download something from there without an account and it is apparently only for chinese. Can you upload it somewhere else without the need to use your phone number?
Hello, will there be an update for the 1.35 balance patch? The meta has definetly changed a little bit
Also is it feasible to change the way AMAI leaves team games? So instead of every unit being killed & building destroyed the other AMAI bots and humans of the team gain ADVANCED shared unit control? The only problem is how other AMAI bots from the same team would control it (because if you play singleplayer chances are one team isn't with AMAI bots)? I'm afraid this would take a lot of time (and memory) to implement and could slow the game down after some minutes.
I also have two more question. How do I open the Strategy Manager? It's supposed to be the AMAIStrategyManager.pl file apparently, but when I click it it closes almost instantly (I have Perl installed, but it's the latest version. I cannot find the v5.8 Perl version or anything older + the Perl Package Manager is no longer supported). I can only open it as a Notepad which doesnt really help. The only guide I can find is in AMAI/Manual/Pages, in the Tutorial document. This page also mentions a database to exchange strategies later within the document, which is missing entirely. Where can I find it?
One more problem I have is that the site is not available if you are outside the campus of the University of Southampton, while the site you mention in Manual/Pages in the document Import is now outdated and not archived in web.archive.org either :/
I'd like to use the profile manager, but it needs perl with tk and I can't manage to install tk. Tried to install it through activeperl, but there's an error, and I can't find the 5.8 version which apparently has tk already included on it. I'm not familiarized with coding platforms so I don't know if there's an easier way to do it or if I'm messing things up. I use windows 11.
Another question: AMAI stops working as soon as I modify a map even though I keep it melee. I added taverns to a blizzard map and now I only get the default AI. I also can't manage to install it on hive melee maps, it says that it was installed correctly but I'm always getting the default AI.
how did you add new profiles excactly? Can you help me? I try to open the file but cmd opens and closes instantly. I cannot get the 5.8 perl version and PPM is no longer supported
@gartool There is more up to date perl instructions on github but not the exact command line instructions. I recommend installing latest strawberry perl then installing tk via command line which was something like "cpan tk"
@gartool There is more up to date perl instructions on github but not the exact command line instructions. I recommend installing latest strawberry perl then installing tk via command line which was something like "cpan tk"
Holy shit thanks for the answer! I tried to e-mail you (I found your e-mail on some HTML documents) and [email protected] didn't work apparently although thats how it's listed ROFL
Also I think you can click reply instead of tagging. You typed my name wrong but it's ok
Thanks for answering my most important question, I'd like to hear about the rest but honestly I don't mind as much
How to make it work:
-Download Strawberry 5.10 (at least that was what I used)
-Download TK 804.034.gz (yet again that's what I used). MAKE SURE THAT TK IS INSTALLED WITHIN THE AMAI FOLDER, ALONG WITH THE AMAI STRATEGY MANAGER.
-go on cmd and type cpan -i tk
-wait 5-10 mins with half the terminal feeling up
-you can now open the Strategy Manager. It also opens a blank terminal which you don't need to use afaik. Tutorial on making a new bot is included somewhere in the manual file
As always, gartoll#6316 on Discord for help
@gartool There is more up to date perl instructions on github but not the exact command line instructions. I recommend installing latest strawberry perl then installing tk via command line which was something like "cpan tk"
Shame to say, armytarck and Towntarck Causing lag,Still unable to repair well,I tried sleep(0.02),But it will cause delays in saveunits job,Reducing the frequency too much can cause a crash
Also, due to poor English,Don't want to write up log, 3.2.2cn common and race not the Latest version,Maybe can try 2.6.2cn first,The code for both branches has been synchronized
yeah thats a pain in the ass, it imitates too well the people on battle.net that ragequits as soon as someone kills his 4 grunts lol.
I was 2vs2 computers and I had to tp out when I got cornered by 2 enemy while creeping, healed my units in base and went to help my allied AI, he still had all his buildings, his blademaster was injured but still alive staying invisible, and had like 6 grunts damaged, I got to his base and started focusing enemy heroes forcing them to tp out, when both computers left, the orc allied said "fuck this" and ragequited, I was like what the fuck?. I'm on version 3.2.2
It would be ok if at least you could take control like it happens in real pvp. but this AI just suicides and everything explodes lol.
Ye I recommended this as well. The best you can do is edit some code from an .eai file. Problem is I have 0 experience and knowledge on what to do so dont expect me to help here. However, that would create another problem, that being the enemy AMAI quitting giving you their control as well. I asked them about it a few months ago and said that they are working on a better system to control the bots.
yeah thats a pain in the ass, it imitates too well the people on battle.net that ragequits as soon as someone kills his 4 grunts lol.
I was 2vs2 computers and I had to tp out when I got cornered by 2 enemy while creeping, healed my units in base and went to help my allied AI, he still had all his buildings, his blademaster was injured but still alive staying invisible, and had like 6 grunts damaged, I got to his base and started focusing enemy heroes forcing them to tp out, when both computers left, the orc allied said "fuck this" and ragequited, I was like what the fuck?. I'm on version 3.2.2
It would be ok if at least you could take control like it happens in real pvp. but this AI just suicides and everything explodes lol.
They mimic human players so well that sometimes they forgot to pick up items after creeping (and not just worthless items but high-level ones like the +9 claws or the +4 agi & str)
I have this problem with the bots lol, the first worker takes the correct route, builds the expo and mines gold.
but then the other 4 morons coming from the main base try to be smart and take the "shortest" route to the gold mine, simply getting stuck behind the tavern, straffing left and right trying to phase through the fence lol. even if I kill them, the computer sends more worker to the same place.
only happens with amai, blizzard ai has no problem.
2nd picture, also this happens in the english translation, checked the text and it says "enemy color etc" but does not appear on the game.
Hi, by some reason AMAI 3.2.2 is not compatible with last refuge 1.5 Workers only gather gold and nothing more. With last refuge version 1 seems to work fine though.
Hi, by some reason AMAI 3.2.2 is not compatible with last refuge 1.5 Workers only gather gold and nothing more. With last refuge version 1 seems to work fine though.
Hi, by some reason AMAI 3.2.2 is not compatible with last refuge 1.5 Workers only gather gold and nothing more. With last refuge version 1 seems to work fine though.
seems to happen randomly on all maps, I often noticed that when I won too easy (4vs4)(2vs2) is because one of the AI did not start properly or got delayed.
cheking replays I noticed some AI simply idle for 5 or 6 minutes and then start like usual, others spend the starting money on buildings and then sit idly the rest of the game not mining gold/lumber or anything, and other times they simply won't do shit, just sit near the mine and do nothing at all.
maps are on Jass language/melee latest patch working perfectly.
forgot to add, why on maps where players start together (friends/sinergy/etc) AI tends to do stupid shit like send 2 workers to his mine and 3 to the mine of the ally?
Apparently you want the strategy manager to work? I do not understand completily.
If you do tho, you need to download the TK 804.034.gz library, then put it somewhere (I put it on the AMAI file), go on CMD with cd (path location) then type cpan -i tk (if that's wrong try some variation like -cpan i tk. If you cannot find the solution, you can always google. I think that the command is the same on Windows & Linux, at least to some extent.
Now as for where to download the library, simply google the name and add strawberry perl or something and click the first link. That's how it worked for me. I used web archive to download an older version but I think that new ones do the trick as well.
Apparently you want the strategy manager to work? I do not understand completily.
If you do tho, you need to download the TK 804.034.gz library, then put it somewhere (I put it on the AMAI file), go on CMD with cd (path location) then type cpan -i tk (if that's wrong try some variation like -cpan i tk. If you cannot find the solution, you can always google. I think that the command is the same on Windows & Linux, at least to some extent.
Now as for where to download the library, simply google the name and add strawberry perl or something and click the first link. That's how it worked for me. I used web archive to download an older version but I think that new ones do the trick as well.
Following the instructions exactly as told for the installer. IT does not work. Reading through past answers seem to do nothing to explain for it. Moved the AMAI to the resource folder for 3.2.2, did the same process for 3.1.1, same results
1) Looks like success...?
2) MPQ shows only scrips input for .ai
3) When the map is selected
Yes, musical chairs was played with folder paths and positions, no effect.
Running as administrator, same result.
I tried a number of other possibilities, nothing better, just "Installing..."
Comrades!
good afternoon, please tell me how I can import your common.ai to your map (which way should I go?) to use your functions in your jass ai?Thank you in advance for your answer!)
Comrades!
good afternoon, please tell me how I can import your common.ai to your map (which way should I go?) to use your functions in your jass ai?Thank you in advance for your answer!)
Hello! Despite not being the creator of the AMAI Bot, I can try to help
If you are looking to use AMAI bots the way they are in your map, you need to:
a) Make sure it's a melee map so the bots work properly (Altered Melee bug the bots around a bit since they are not supposed to work with that kind of maps, let alone non-melee maps)
b) Download the proper AMAI version you want, as well as Electron Manager. Ye, the manager is optional but it makes everything x100 times easier.
c) put the AMAI folder within the Resources folder of Electron Manager (make sure everything is within the AMAI folder and untouched overall)
d) Open the Electron Manager. Then everything is pretty easy, go on the top left and select the installation option you want, then the map (or folder) you want
If you are asking for something else (which I think you do), a great place to ask is the wc3 mmc (map making community) discord, the wc3 united discord, or the hive workshop discord itself.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.