AI got much worse

I remember in classic warcraft AI was pretty decent fielding huge late game armies.
Current AI despite huge amount of gold stops building buildings, is stuck on tier 1, does not buy items, basicly does nothing. 40 minutes into match and still uses footmen or grunts trained from 1 barracks.

This is unacceptable.

Edit: This doesn’t happen always. I feel like mostly it happens with Human AI and 1v1 match and still has like ~~50% chance? But when it happens it is awful.

1 Like

It is likely caused by incompatibility between melee balance changes and the AI script files. Unless the AI script files are updated to reflect balance changes then the AI can become stuck or perform sub optimally.

This is still happening, and is affecting both Normal and Insane Human AI. Computer (Normal) doesn't upgrade when playing as Human I have never seen this happening with Undead or a Night Elf. Not sure about the Orc AI, but personally I have found this to be affecting only a Human AI, and it still happens fairly often.

https ://imgur.com/a/DwPDKbX

Also there is another issue with a Night Elf AI: sometimes, newly trained heroes and land units that get out of the production buildings, get stuck in the trees. Now, I know that can happen with any faction, but all the other factions are cutting the trees down with workers, and so the units that are stuck in trees, will be set free eventually. In the case of Night Elf, however, the units will sit in their base for ages, possibly forever, and the AI is scripted in such a way, that it will either not move out of their main base with a whole massive army of theirs if it doesn’t include those stuck units, or if it does move, its combat power will be severely hindered, given that half of their army is stuck at their main base. Most of the time this happens when AI builds an Ancient of Lore in place of their collapsed gold mine at their starting base, but this can also happen with any building that is producing land units, such as Altar of Elders, that is built too close to the trees.

https ://imgur.com/a/RgitEZZ

Having waited for a year, and still not having received a resolution for this, I have went ahead and scripted my own. It all started with an innocent adding 3rd hero to an orc AI, and turned out to be a humongous effort, working every spare minute of my free time over the past month with an aim to fix the issues I disclosed above, and many many others. The original AI scripts were heavily convoluted, grossly inconsistent between different AIs and just generally needed an overwhelmingly overdue love since their original composure in 2003. A ridiculous amount of development and testing was spent to optimise, standardise and improve all AI scripts. I have used 1.29 as a baseline, as it was the latest version I could find the AI script files for, because reforged doesn’t have them in the open access, but they should still be current enough to use in the latest game version with minor to no adjustments. I have pastebined my results if anyone wants to test them out and compare with the original AI, and will update the links here if I run into any issue during my further testing, or if anyone recommends any adjustments, but I wouldn’t expect any major ones.

I would be very happy if Blizzard incorporated my work into an upcoming patch, because right now AI just really doesn’t cut it anymore as it may have 20 years ago. Anyway, with all that said, here are the results:

undead.ai - https://pastebin.com/eM4KQmS3
human.ai - https://pastebin.com/0Tj2hfjA
orc.ai - https://pastebin.com/btgUs6Uw
elf.ai - https://pastebin.com/FumJH1a2

Something I couldn’t fix via the script updates:

  • Sometimes certain heroes controlled by AI get so deadset on using certain target abilities on enemy heroes, that they charge across the entire map, just to use it. MUST THROW THAT STORM BOLT says mountain king as he runs across the entire map for a solid minute, completely oblivious to multiple warring factions in his path, just to throw that storm bolt into far seer on the opposite side of the map, who chain lightninged him a minute ago. Then mountain king must retreat the same way, ignoring everything in his path again. Needless to say, chance of him making it to farseer and back are rather low, as he can be intercepted and sent back into the altar to reconsider his behaviour. So this inclines me to believe there is something fundamentally wrong with nuking abilities, because the OCD AI exhibits trying to use those abilities on enemy heroes is just next level. There should be a code change to limit the distance for a target ability usage, so that if a hero failed to throw a storm bolt at the enemy hero in time while the fight was ongoing, and before the enemy retreated, then our hero should just relax, save mana, and wait for the next opportunity to throw that bolt, instead of traveling across the the entire map and surely get killed trying to use it.

  • AI should have a build distance of 2 squares away from any natural unwalkable obstacle, e.g. trees and cliffs. Because units get stuck as they spawn. This is especially pronounced with night elf, who can’t chop the trees down, but can happen with other factions as well. In the updated AI scripts, I have factored in a workaround of building structures at the second expansion, but this is just that, a workaround. The proper solution would be a code change to always have a 2 square distance from all the constructions, then AI may start building more structures at their main base once again.

  • AI always seems to be prioritising attacking the player in the first active slot, even if there are numerous opponent bases closer to them. If you host a 3x3x3x3 game with 12 AI on Divide and Conquer map and take an observer slot, you will notice that wherever team with an AI in slot 2 spawns, all opponent AI teams, even from the diametrically opposite side of the map, will make their way to attack team 1, while ignoring other enemy teams buildings and units in the way, just to attack AI in slot 2! This is definitely not working as expected, as AI should really be prioritising a closest target of an opponent player next to them instead of the opponent in slot 2 who is based in the opposite corner of the map, as the closest target is the immediate threat. But instead all AI are going for a kill of a player in slot 2. That means if slot 2 has spawned in map’s south west, then not only south east and north west AI will come to attack that player, but north east will come to attack them as well! An average player could probably fight off two teams via the conventional methods if they really tried, but there is no way they can fight off three teams, even if the attacks are consecutive and not simultaneous. Its just too much. A proper solution would be a code change, so that AI prioritises attacking opponent bases closest to them, instead of being hard coded to go after a slot 2.

  • AI doesn’t know how to use certain skills, that make enemy units invulnerable for a brief moment properly. For example, when undead is expanding, and killed all of the neutral guards at a gold mine, but dreadlord has put the last defender to sleep, it triggers “all clear” function of the AI, because there are no hostile vulnerable units there now, so AI just … leaves, abandoning a single creep there. Needless to say the acolytes will either not expand there, or even if they do, they will get killed, and so will their haunted gold mine. In the updated AI script, I have factored in a workaround, which makes AI to learn such skills last, as by the late game when heroes get high enough level to learn them, it probably won’t make much difference, but the proper solution would be a code change that forces the enemy to check for both vulnerable and invulnerable units at the expansion before deeming it cleared. Sleep is the only such culprit I am aware of at the moment, as crypt lord’s impale was recently fixed, no longer making units invulnerable for a brief moment. This issue is actually pretty serious for me to consider not allowing dreadlord AI to learn sleep at all, because unlike running across the map to carrion swarm someone and dying, which affects only that hero, when you make the last creep at the gold mine invulnerable and considering the camp cleared, while its really not, this affects the entire player, as getting the timely expansion can really make or break the game, such as not having the required gold not only to resurrect the lone cowboy, who charged across map to death coil enemy hero, but for bare necessities as well… like acolytes.

That sounds exceedingly unlikely but who knows. If you’re hoping for something like that, I would ask, were you able to investigate the AMAI project and whether newer versions of it were compatible with Reforged? How do they compare against your work?

Circa 2008 or something AMAI seemed very, very skillful at this game and far superior to the ingame AIs but the Activision updates really made it hard to use AMAI whenever I tried a few years ago. So, I don’t know the current status of its project.

1 Like

Yeah, the last time I played with AMAI was back in 1.21b. I haven’t come across a working version since then, and what I have come across, my scanner detected was full of malware, so I haven’t even installed it to give it a try.

The baseline I used in the scripts was a default Blizzard AI that came with the game. I made quite a few changes, and although most of them were just polishing up and making the content neater, if Blizzard decides to consider including some of my changes in an upcoming patch, it may still take them some time to compare differences via WinMerge of their original 2003 version with the 2023 one I updated, and then do their own testing before release.

I was a bit hesitant to base my scripts on AMAI, as it may have been more time consuming and complicated for Blizzard to look into afterwards, while Blizzard original AI scripts were very easy to understand and modify. It is still largely the same AI, and I play it for fun sometimes. The insane AI actually poses a challenge now. Try it out and see for yourself : )

I agree with you on all of those known issues with the melee ai. It has gotten even worse in 2024. I have two family members who are very casual WC3 players so we like to only play against AI together when we play, and boy are there issues.
One I don’t believe you mentioned, which could be because it’s new to 2024, is if the AI chooses to teleport to your base to help out from an attack, they will not leave your base. They constantly just hover around your town hall getting into each unit’s way. This is something I haven’t really noticed being an issue in previous years. It’s almost as if each unit is trying to attack-move to your town hall but can’t get there.
Anyway just thought I’d mention that. I love the idea of editing the melee AI and updating it, was considering doing myself as well since I have experience with doing it to the campaign AI files.
However, something I am not familiar with is where to place the updated melee ai and/or common ai if it has been updated.
MPQ Editors make it easy to extract the scripts from the programs files but how to import them back in?

One year later me and my friends returned to WC3 new patch. We noticed that insane enemies are much more weaker. They attacked one main base, killed all our units and for no reason they flee from the base without destroing the remaing buildings. After that they give up attacking our main bases and star attacking one or two farm bases. In the past we didn’t have a chance with this kind of enemies.