Giter Site home page Giter Site logo

smunlimited / amai Goto Github PK

View Code? Open in Web Editor NEW
194.0 14.0 31.0 10.71 MB

Advanced Melee Artificial Intelligence Mod For Warcraft 3

License: Other

Perl 2.54% Objective-J 87.43% Batchfile 0.47% CSS 0.02% HTML 7.73% JavaScript 0.30% TypeScript 1.31% SCSS 0.22%
warcraft3 amai ai-scripts

amai's Introduction

AMAI

Advanced Melee Artificial Intelligence Mod For Warcraft III.

Created by AIAndy, Zalamander and the Strategy Master.

Official Release Links available from https://www.hiveworkshop.com/threads/advanced-melee-ai.62879/.

AMAI was originally hosted on http://www.wc3campaigns.net/forumdisplay.php?f=601.

How to Play

AMAI release has the standard AMAI 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\, where <Username> should be replaced with your own username, 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 if you struggle to install, use an OS that is not supported.

For Warcraft III 1.30 onwards, you need to use http://www.zezula.net/en/casc/main.html to extract a copy of the official blizzard maps to install AMAI onto.

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 III Requirements and Versions

There are multiple editions of AMAI available to install based on your Warcraft III 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 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 III tech tree this edition is based on. The further a version is from the optimal, the more likely it will affect the AMAIs' ability to build, usually just unoptimal build order, but at the worst case it can no longer build at all.

Classic AMAI 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 III and either upgrade or downgrade as it breaks various things including but not limited to:

  • Preventing AMAI from chatting.
  • Heroes not learning skills although we have a fix that can get applied, this may not work if the map itself is too old.

AMAI UI Installer

The installer only works on 64-bit Windows 7/8/10.

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-electron-manager.exe to open the installer.

You can install to a single map or a whole directory.

installer

Command-line Install

This guide assumes that your working directory is AMAI.

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 1 or 0 if you want to install the Commander or not, respectively.

Press enter to install AMAI to the selected map.

Note that disabling the Commander makes -zoom xxxx non-functional on pre-REFORGED game versions.

example

Alternatively, for complex installs, if you have perl installed, you can run this:

perl .\InstallToDir.pl <Version> "C:\Documents\Warcraft III\Maps\AMAI\"

This will install AMAI to all maps recursively.

You can disable the commander for this install by running this:

perl .\InstallToDir.pl <Version> "C:\Documents\Warcraft III\Maps\AMAI\" "false"

After installing AMAI on your map, just start Warcraft III 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/macOS systems too.

Copy contents of AMAI\Scripts\<Version> and AMAI\Scripts\Blizzard.j into the Scripts folder in a map.

Manual Mod Install

You can install scripts locally to your game folder to enable AMAI for any map you play, freeing you from extracting the official maps, as well as being able to update AMAI easily.

For Warcraft III Windows version, change the registry key:

HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III" - Allow Local Files"=dword:00000001

Or alternatively, run this:

reg add "HKCU\Software\Blizzard Entertainment\Warcraft III" /v "Allow Local Files" /t REG_DWORD /d 1

For Warcraft III macOS version, from Terminal.app, run this:

defaults write com.blizzard.<Game> "Allow Local Files" -int 1

Where <Game> should be replaced with Warcraft\ III if you have the release version, or Warcraft\ III\ Public\ Test if you have the PTR version.

Create a Scripts folder in the game directory, and include the *.ai and Blizzard.j from AMAI Scripts folder with the <Version> you want.

  • 1.32.6 and below: Create a Scripts folder at the root of the game directory.
  • 1.32.7 and above: Create a Scripts folder in <Flavour> folder at the root of the game directory, where <Flavour> should be replaced with _retail_ if you have the release version, or _ptr_ if you have the PTR version.

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 completely custom maps (e.g Tower Defence). 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 do not appear to work. 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 that maps older than 1.24 will need resaving in the world editor if you want full 24 player support.

Build Requirements

To build scripts from source code or to make custom changes you must install perl (via strawberry or activestate).

Additionally you need to install the Tk module if you want to run the Strategy Manager UI Client as described in the manual.

Activestate uses the package manager to install modules, while strawberry you need to use the CPAN client to install a module.

Tested with strawbery perl 5.30 and Tk 804.034.

(You may need to run as an administrator if you have issues with maps not displaying any teams.)

Build Requirements for AMAI Installer (Via Electron)

  • node 14 or greater...
  • npm 6 or greater...
  • angular-cli 16 or greater...

Running Electron Locally

Go to the Electron folder inside the project and open the IDE of your choice.

Run this to install project dependencies:

npm i

Run this to open in development environment:

npm start

Deploying the Electron Installer

Run this inside the Electron folder:

npm run electron:build

You must have a built or downloaded copy of AMAI and unzip it in the folder <AMAI Installer>\resources\AMAI.

  • You only need to include the Scripts folder and MPQEditor.exe within the AMAI directory.

Zip the contents of the release/win-unpacked folder and deploy this zipped file.

Notes about the Electron Installer Build Process

I'm working on doing the zip mentioned above in an automated way.

The build process creates the executable for the current operating system only. To create other executables, the process must be run on the corresponding operating system.

I will be working on the possibility of building the linux executable on windows.

Building Scripts

You need to use the various Make<Version> bat files to create the AMAI scripts for various versions.

For example, if you have REFORGED game version, run/double-click MakeREFORGED.bat to create REFORGED scripts.

Then install like normal by running this:

.\InstallREFORGEDToMap.bat "C:\Documents\Warcraft III\Maps\AMAI\<Map>.w3m" <N>

To use the installer, you must copy the Scripts folder and MPQEditor.exe to the folder <AMAI Installer>\resources\AMAI.

Run up a custom game and select the map to play.

Optimise Build

This will optimise previously built AI scripts to make them a little bit faster and leaner. Only useful if you are having performance issues, as it's not shipped by default.

Run/double-click one of the MakeOpt<Version> bat files. (e.g MakeOptROC.bat to create optimized ROC scripts for the classic ROC game version.)

Then install like normal by running this:

.\InstallROCToMap.bat "C:\Documents\Warcraft III\Maps\AMAI\<Map>.w3m" <N>

VS AI Build

This special version will make odd teams run with AMAI and even teams run with the standard Blizzard AI.

Useful for testing how much better AMAI is against the original AI.

Not shipped by default as it creates a very different Blizzard.j file.

Run/double click one of the MakeVAI<Version> bat files. (e.g MakeVAITFT.bat to create the AMAI vs Blizzard AI scripts for the classic TFT version.)

Then install like normal by running this:

InstallTFTToMap.bat "C:\Documents\Warcraft III\Maps\AMAI\<Map>.w3m" <N>

Features

Personality Profiles:

  • Each AMAI has a set of profiles which modifies depending on 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 on what it will be attacking or will join allies in attacking a target.
  • Real players have access to the Commander, letting you give commands.
  • Asks for aid if running out resources.

Commander Game Modes:

  • Play matches where real players can only order their allies to victory with the Commander, or real players and AMAI both directly control the same units and buildings.

Surrenders:

  • Based on profiles some AMAI computers will give up when it detects it's losing, while others will fight to the death.

Chat Support:

  • AMAI computers will taunt opponents, and share its' build strategy with team players.
  • Includes Support for 10 different languages.

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: an 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.

Commander

The Commander allows you to give orders to your AMAI allies.

There will also be language selection dialogs to change the language of dialogs and AMAI chat messages.

To disable the Commander, pass the correct option to the install scripts in the first place, or run this:

.\DisableCommander.bat "C:Users\<Username>\Documents\Warcraft III\Maps\AMAI\<Map>.w3m"

Once installed another dialog will appear with game mode options:

  1. No Commander - Disables the Commander during this game.
  2. With Commander - Commander is availaable. Press ESC key to bring up the Commander menu.
  3. Computers Only - Same as With Commander, except real players do not play, real player forces are removed and real players can only issue orders via the Commander to try and make AMAI ally win.
  4. Joint Control - Same as Computers Only, but real players can also directly control their ally AMAI's forces.

Commander Advanced Settings

It's now possible to set a default language and gametype so that the dialog box will not appear again and again when the game starts.

To find the settings, edit and search for language and game_mode from Blizzard.j file located at AMAI\Scripts. You should directly end up viewing the two rows below:

string language = ""  // Possible values: "" (dialog), "English", "Deutsch", "Swedish", "French", "Spanish", "Romanian", "Russian", "Portuguese", "Norwegian", "Chinese"
string game_mode = "" // Possible values: "" (dialog), "commander", "no_human", "ai_only", "shared"

If you make the first row look like this:

string language = "English"  // Possible values: "" (dialog), "English", "Deutsch", "Swedish", "French", "Spanish", "Romanian", "Russian", "Portuguese", "Norwegian", "Chinese"

The language selection dialog box will not show up again when the game starts, instead the specified language "English" will always be used by the computers.

The game_mode setting works exactly the same way, but that setting will only apply if you play a game where different game modes are available, like if you got an allied computer in the game, else the normal melee game type will always be used.

Custom Maps

AMAI is designed to work with melee maps.

If you make a custom map, you need to make sure in the world editor it is also set to Latest Patch dataset and still using the melee AI.

If you don't do this the AMAI will get stuck upgrading past Tier 2 as it will use the vanilla patch.

Scripted maps may need to disable the Commander as it will otherwise conflict.

To change the patch data set, use the following menus from the world editor:

  • Scenario > Map Properties > Options > Game Data Set, Change from Default (based on map melee status) to Latest Patch.

If your custom map has custom units you will need to make custom changes to AMAI which can be followed in the Manual.

Custom AI

AMAI has built in support to be able to write new strategies and profiles using the Strategy Manager UI Client . The Manual folder contains more details.

Credits

Helpers

  • Hrothgaar
  • WargH
  • DK Slayer (For the Commander)

Translations

  • English - Chad Nicholas
  • Swedish - Zalamander
  • German - AIAndy, Sagan
  • French - JUJU, WILL THE ALMIGHTY
  • Spanish - Vexorian, Moyack, Slayer95
  • Romanian - Andas_007
  • Chinese - Dr Fan, Sheeryiro KeamSpring, Pixyy
  • Russian - RaZ and Darkloke, Lolasik011
  • Portuguese - imba curisco ghouleh
  • Norwegian - Aray

Quality Assurance

  • Hrothgaar,
  • WargH,
  • ster,
  • Tommi,
  • xWOLF,
  • Feannor,
  • Jum-Jum,
  • and anyone else missing a mention here.

Tooling

  • JASS Precompiler - Vidstige
  • MPQEditor - Ladislav Zezula

amai's People

Contributors

jzy-chitong56 avatar keamspring avatar pasteurellosis avatar paulo101977 avatar pixyy avatar slayer95 avatar smunlimited avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amai's Issues

AI traps itself at home more frequently

In the 2.54 version, the buildings distribution of AMAI sometimes can be stupid. For example, it might build towers and farms to surround the barrack in the corner. As a result, no unit can get out of this barrack to join the main force. This problem is still tolerable because it will not affect the movement of the main force. The only loss is some units cannot join the battle.
But in the 3.01 version, things get worse.
In the changelog of 3.0, there is a change:

Halved front location distance from town center but now calculates an arc of locations to use.

This change makes AMAI's buildings denser than before. The distance between buildings is significantly shorter, which makes units easily block each other or get blocked by the building. Especially when the hero uses TP to coming home. The way out is small and AMAI doesn't know how to let units move out one by one. They usually move together and stuck together.
In this case, the whole team of the AMAI, including the units outside the base and not be blocked, suddenly lost their mind. They will continually move left and right, which will not help the situation. So the whole game becomes meaningless because AMAI is incapable of fighting again.
WC3ScrnShot_080121_232700_001
WC3ScrnShot_080121_232705_001

This bug happens mostly to humans and Elf. Their buildings are denser than other races.
It happens once on Undead. It's a little bit different. The only unit that has been blocked is Lich, but the whole team is also stuck and starts moving left and right. Maybe when the hero has been blocked, this bug will be triggered.
I will upload the pictures of this situation tomorrow.

Maybe it's best to roll back to the original settings, or tweak some codes about building distance?

AI won't build any units even it has enough money and foods.

This bug happened twice on two similar AMAI HvU matches. Not quite clear whether it will happen on other occasions.
WC3ScrnShot_080621_141935_001
WC3ScrnShot_080621_144016_001

The human was attacked by the undead in the early stage and they lost many footmen and workers. They need to build more units to fight back and they have enough barracks and money to do so.
But AMAI did nothing but keep building workers. So it lost shortly after its hero dead.

1.30+ Tech Tree updates

1.30 had tech tree changes, need to update AMAI to be fully aware of these changes.

https://wow.gamepedia.com/Warcraft_III/Patch_1.30.0

  • Also need to confirm that if AMAI tries to build something, doesn't have the right requirements (because we hadn't updated AMAI), does the system handle and ignore the build order.
  • Human Sun Blade Upgrade has 4 requirements, AMAI only has support for 3.

22 AMAI laggy game unplayable

Got a serious issue here,when my friend and i trying to play 2v22 amai,the game becomes super laggy after 10mins which is the time when units get more and more.Its unpalyable like 1 fps 1 sec.But the original Ai its ok to play.Please do something about it.

Multiple Focus Fire Points

Currently focus fire only takes account of units near the hero, then the fallback of the army.

It should take account of all armies (aka multiple focus fire points across the map at once rather than only ever handling a single unit in the entire map even if a second army was busy attacking other units)

Build Sequence Bug

There is a bug in the build system where a unit cannot be built because its been assigned the wrong build type

CANNOT_BUILD expand ELF_ALTAR 190

ELF_ALTAR should be a unit not an expansion. This sometimes causes the build system to get stuck yet it has the resources to build an altar just fine.

Computer not using tech?

The computer never upgrades its units (blacksmith. graveyard, hunter's hall, war mill). It uses only some specific upgrades, like upgrading the units who uses mana to adept and for orc the spiked barricades and brute strength, don't know for other races. I use the 3.0 version on reforged.

Help with map...

I made a map for myself some time ago, it turned out to be very fun, but I was only able to get AMAI2.54PE version of this software working. Trust me, I tried my best, but AMAI2.6.0 just didn't work on my computer, so I couldn't configure the AI to work better...

The map is inspired by WTII's tower island strategy (https://www.youtube.com/watch?v=9QsiyepDN8U)

If someone wants to, they can configure the AI to work better for the map to make it more challenging and release it on hiveworkshop as their own. I only have wc3 1.29v, so I can't make it work for reforged properly...

Things that are needed to finish the map properly:

  • Configure AMAI of enemies to prioritize effective strategy to combat tower island strategy
  • Configure AMAI of Player 1 (Red) to never quit game and to never leave the tower island
  • Configure map settings to use newer path (+1.32)
  • Balance tweaks if needed.

I would be very happy if someone could take care of this map as otherwise I don't this it will ever be released...

Download link - https://drive.google.com/file/d/1OVBJYQ6aMhX9qcW40L0Cr506QyZL3x-P/view?usp=sharing

Sorry for posting this on here, I just don't know where else it would be appropriate...

Recover dynamic strategies work (aka 3.0)

The real time dynamic strategy work is in a branch on the compiled scripts but was lost from the original core files.

Need to rescue the changes and add back to the core scripts.

Small problems about Interaction with items

There are some small problems with the interaction between AI and items.
Sometimes AI will forget to pick up items after kill creeps. And if there are two heroes are standing in front of the same store, One is healthy with full inventory, while the other is in low hp condition. Two heroes will stay stuck there if the store selects the former hero. The latter one will try to buy healing items such as healing potions. But because the store picks the wrong target, the hero can't buy them. He will stand still and slowly wait for the hp to recover. This will waste plenty of time.
These are just some tiny problems about Interaction with items, the problem about full inventory and useless items will be mentioned in another issue.

Unable to download

Heyo! Thank you for the work put in this.

I am unable to install the bat. file into the files. Whenever I click on it or use the command prompt, it opens and closes almost immediately. (Have 0 programming experience)

Function BuildAdvUpgr2 is incomplete, which might invalidate the dynamic strategy system.

The new dynamic strategy system uses the function BuildAdvUpgr2 to control upgrades. For example:
if tier == 1 then
endif
call BuildAdvUpgr2(1, UPG_ULTRAVISION, 1, TownCountDone(ARCHER) + TownCountDone(HUNTRESS), 5, 3, 20)

There is no description of the function BuildAdvUpgr2 in the manuals reference section, so I checked common.eai and found these:

function BuildAdvUpgr takes integer qty, integer unitid, integer starttier, integer unitcount, integer maxunits, integer tierprio, integer prio returns nothing
if tier >= starttier then
if unitcount > 0 then
if qty >= tier-starttier+1 then
call BuildUpgr(tier-starttier + 1, unitid, R2I(LinearInterpolation(0, maxunits, 1, prio + ((tier-starttier)* tierprio) , unitcount)))
else
// If tier greater than the start tier and qty is less than the difference between the two
call BuildUpgr(qty, unitid, R2I(LinearInterpolation(0, maxunits, 1, prio + ((tier-starttier)* tierprio), unitcount)))
endif
endif
endif
endfunction

// unitper - Number of units to give a 1% chance of building upgrade
function BuildAdvUpgr2 takes integer qty, integer upgid, integer starttier, integer unitcount, real unitper, integer max, integer prio returns nothing
//set num = (R2I((100 - FoodUsed())/GetFoodUsed(old_id[])) - 1) * prio_q_inc // build upgrade priority at priority of unit
if tier >= starttier then
if unitcount > 0 then
if GetRandomInt(1, 100) <= Min(R2I(unitcount/unitper), max) then
if qty >= tier-starttier+1 then
call BuildUpgr(tier-starttier + 1, upgid, prio)
else
// If tier greater than the start tier and qty is less than the difference between the two
call BuildUpgr(qty, upgid, prio)
endif
endif
endif
endif
endfunction

Both BuildAdvUpgr function call function BuildUpgr. The last parameter of function BuildUpgr is about priority. The function BuildAdvUpgr changes the priority by using the R2I code. But in function BuildAdvUpgr2 the priority hasn't been changed at all.

I guess the function BuildAdvUpgr2 is incomplete. This is a huge bug that could let the dynamic strategy system do more harm than good for AMAI. Need to fix soon.

Multiplayer?

Can this be played in LAN? What happens if the host or client presses esc to open commands?

Shadow Hunter won't use healing waves at the base even its mana is full

AMAI's Ocr has a serious problem with healing units. It always leaves many low hp units needed healing at the base. So the healing waves of Shadow Hunter are very important. But sometimes Shadow Hunter won't use healing waves at the base even its mana is enough. It might try to buy some healing items such as healing salve rather than use healing waves.

I guess it is because that the hero is set to need_to_recover pattern, so it will not do anything until its hp and mana become full. This situation happens to different heroes. They will stay at home doing nothing even their army is engaging nearby.

How to block conversations with in-game computers

First of all, thank you for the new update of amai, and thanks to the application of amai to the use map, we are having fun with our users.
Even if you choose insane mode, Blizzard ai is so stupid, so applying amai is almost essential.
But the only complaint is that I play melee games between people and computers, and the conversations between computers are very annoying.
Is there any way to block computer conversations?
I don't know if there is a way to edit and compile the source myself, but I'm not a developer, so I don't know how.
It would be nice if there was an option to hide the conversations of computers during the game.
I would really appreciate it if you consider it in the next update or release.

Units returned home can block other units

When units are healing at home they stand around and can block other units.

Specifically the hero can get blocked while its trying to move to buy a healing item

Need to disperse units somehow so unit can get there.

Make AI controlled heroes not pick up your items from creeps?

Is there a way to tell the AI to drop a specific item, like left click while on the hero's inventory or from a menu? When I fight creeps, at the end of the fight, my AI ally just comes and takes my items and tomes :(. Also, I noticed the AI sometimes doesn't pick up items and tomes, it just runs away, and maybe after some minutes it will come back for it.

2.54B computer Human/orc/elf cannot upgrade main hall

hello sir
im already tried from version 1.24B,124E untill 1.31 public realm test warcraft FT OLD

the main problem is
only undead know how to upgrade main hall

Human/orc/elf dont know how to upgrade main hall

i know maybe 2.54B is unsupported know
but i hope you fix this critical issue at least for community W3 OLD FT

you can also tried with greedisgood and warpten for quickly test result

Human race mass repair bug

Old hardcoded issue where if you kill a peasant constructing a building, the AI will suicide its workers to the building which will result in total destruction of the economy if the enemy is sitting waiting for them.

Chinese translation errors, missing and outdated

Thanks to @keamspring for fixing the Chinese language translation/encoding issues, the language for Chinese is available again.
But during the test, I found some other problems with the Chinese translation. Some translation is confusing while others are missing in some sentence. This is a problem I didn't meet in AMAI 2.54b version. So I checked the Language folder and found out where the problem is.
There are two versions of the Chinese translation in AMAI 2.54. Dr.Fan's version was correct but it used ANSI standard, which could make it unavailable in the game. Sheeryiro's version used UTF-8 with BOM. Therefore, the former is deprecated, while the latter has been retained until later versions.
But Sheeryiro's version has a lot of serious mistakes, such as confusing words Dryad and Druid as well as Banshee and Sorceress. So many translations are completely wrong which might mislead players who fight alongside AMAI or use commander.
And in its Strategy.txt there are lots of lines missing, so the translation of the strategy sentences is mixed in Chinese and English.
The sentences in ChatTaunt.txt and other Chat.txt were written in 2004. Many words and sentences are totally out-of-date. I bet the new generation can't even read these sentences fluently, let alone understand them.

And there are some new issues in AMAI 3.01's translation. In AMAI 2.54, AI's strategy chatting and the sentence in Strategy.txt are the same. But in AMAI 3.01, there are more words at the end of the sentence. Those words are about the enemy units AI wants to counter with, such as heavy armor, piercing.
translate error_1

I guess is related to the Dynamic strategies system. I can't find these words in the Languages folder so I can't translate them.

Could you tell me where can I find these words and which file should I put my translation in?

My goal is to check and rewrite the Chinese translation. Make it correct and keep up with the times.
This might takes few days, and when I finish, I will submit it after running the test locally.
Meantime I will upload some pictures show the change before and after so that you can be assured that it works.

Thanks again for your dedication to this project. There are far more Chinese players using AMAI than you think. People are thinking highly of it, and even some pro players sometimes use AMAI to practice. But lots of them are still using AMAI 2.54 because they don't know this project is still updating. I'm about to write an article that fully introduces the newest AMAI and post on Tieba(Chinese version of Reddit) after the release of a more complete version.

Looking forward to your reply.

Desperation Attacks

When AMAI is losing it should try anything to survive especially if its a profile that does not want to give up.

E.g add peons/ancients to the assault group to try and survive/take out as much of the incoming force as possible before death.

language for chinese can not be available

i try to repair this problem , but cannot repair it . I think the main problem are loading encoding in Language.txt and the encoding of **.eai .
please connect me if you wanna repair this problem

InstallTFTToMap.bat changes building requirements

After using it on a map, some Orc buildings changed:

  • Voodoo Lounge wont sell "Lesser Clarity Potion".
  • Wind Raiders require Fortress
  • Tauren Totem wont train Spirit Walker
  • Spirit Lodge trains Spirit Walker

Desperation_assault mode error

A new feature called Desperation_assault has been added in AMAI 3.0. During the test, I found something very odd.
When Elf is going to do their final attack, all the trees will stand up and move together. All the heroes and wisps will follow the trees. Maybe they are blocking each other, or perhaps they are in the same group, they will move dramatically slow.

Wisps and Trees stuck

After they defeat enemies attack, they will still stick together and move to the enemy's base together very slow. Even if it's impossible to repair the building as the gold is zero, the wisps will still follow the trees. Since the wisps cannot attack and never use the detonate, it's meaningless for them to move with the main force, which will only slow the whole team down.

Wisps and Trees stuck_2

Even if the enemy's attack has been defeated and they will not come again for a while, trees will continue to move to the enemy's base, try to attack something.

Ignore an empty goldmine

For example, this Tree of Life just passes by an empty goldmine and keeps going. As they don't have any gold, the only strategy that might lead to winning is to sit down beside the goldmine and start mining.

take a long way to attack

Instead, what they did is ignore it and continue their march to hell, try to attack the enemy base. So the last hope of victory vanished after this confusing decision.

This is just a typical case of many kinds of errors about Desperation_assault. I believe there are some logical problems with this new feature, such as how to define the last resort and how to clear the alarm and return to normal.

Since I didn't fully understand this new function, I cannot give a neat solution to fix it. Perhaps you know where the problem is.

Looking forward to your reply and fix.

BTW, I am doing a large-scale test about AMAI, from counting the win rate of all races and profiles to letting different versions of AMAI compete with each other. I will report the bugs found in time and share something interesting in the test.

Let's build back a better AMAI together. ^_^

How to use AMAI for custom maps?

Hi all I made a custom map which works like melee but have new custom units. I looked it up online and it says it's possible to modify AMAI to let it work on custom maps. However the old "developer manual" seems to be no longer accessible and I couldn't find anything that tells me how to do that. Is it possible to get a tutorial about this on github? Many thanks.

AMAI vs AI uses an outdated blizzard.j

The AMAI vs AI logic doesn't use the standard blizzard.j file.

Find a way to allow this to be upgraded easily when we update the blizzard.j files for the standard AMAI.

AMAI 2.6.0 not working with 1.29

When I try to play custom games, the menu where to choose the number of computers, race, teams and color is missing. When I try to start, it just gives a red error and returns to the previous menu. The AMAI 2 folder is AMAI 2.6.0, the one without number is 2.54, which works but it has some bugs, like when the computers says something in chat it's just blank and the number of strategies menu to choose from is from 0-9, when some races have up to 15 strategies. Can you please make a video tutorial on how to install AMAI 2.6.0 and later?

2021-01-10.00-02-07.mp4

Better captain control

A number of issues with the current system which is still based largely on the vanilla systems

  • Continously adding new troops to assault makes attacks slow as troops drip feed into an army that is far away.
  • When fleeing units flee through enemies armies.
  • Sometimes units ignore enemy troops around it (which is could beat) but do not attack the enemy troops because captains are technically fleeing.

The counter system is still called too frequently

Test with 3.11.
I watched a match between two AMAI from an observer's point of view so that I could see all the text they send about counter-strategy. In the mid-game, the text became so frequently that there were 3 texts in 26s, and the strategy that AI used didn't change at all. The only thing that has changed is the enemy units that need to be countered.

屏幕截图(1017)
屏幕截图(1019)

As you can see, there are 3 texts from 9:53 to 10:19.

I think the parameter counter_timer in races.eai has something with this issue.
In lines 718 and 749, This parameter is divided by 2.
local integer counter_timer = R2I(I2R(-strat_minimum_time[strategy] * (4 - Min(3, tier)))/(3*sleep_multiplier*Max(difficulty - 1, 1))/2)
Maybe we should remove this or replace it with multiply by 2?

The ranged troops blindly avoided melee troops

In the 3.0 version, there is a change:

Ranged ground attackers will now try to avoid slower melee attackers that get too close.

It's a good thought, but in practice, things are not going well as designed. In actual combat, the ranged ground units are significantly weakened by this change.
When two forces are engaging, the range ground units are clearly at a disadvantage even if they have an advantage in numbers.
The original intention of the design is to allow them to avoid melee attacks. Try to make some hit-and-run movement. But in fact, the firing was always interrupted by the movement of retreat. When a slower melee attacker, such as a grunt, is getting closer, the ranged attacker is too busy to avoid the enemy so that it can't do any damage to the enemy. Even the unit with high HP will run away like the low HP unit used to be in the early version.
The night elves are the most affected because their troops are mostly ranged units. There are plenty of times an Orc's grunt with low HP chased a large group of Elves archers to fight, and none of the archers were dared to return fire. The frontline troops were retreating, but the rear troops were advancing, bumping into a piece on both sides, jamming each other. The formation was completely disrupted and the entire army was wiped out. Elf's win rate in this version is significantly lower than the previous version. I think this problem is a critical reason.

Maybe it's better to let the low HP units retreat rather than every unit. It is also an option to let the troops retreat after completing the attack movement.

To be noted, fight with creeps will not trigger this problem. Archers won't disengage when the melee creeps getting close. Maybe creeps are not the sort of slower melee attacker mentioned in the file?

AI's low-hp hero sometimes can't use healing potions correctly.

I have seen multiple times that AI's dying hero didn't use the healing potion it had. It's hard to find where this bug comes from. But this time I find a special case that is worth writing a new issue.
WC3ScrnShot_011322_222125_001
WC3ScrnShot_011322_222130_001
As you can see, AI's orc hero was retreated by using a town portal. Tauren Chief was in bad shape but it didn't have a healing potion. The healing potion was in Farseer's bag.
WC3ScrnShot_011322_222149_001
WC3ScrnShot_011322_222154_001
After they reached home, Farseer passed its healing potion to Tauren Chief, which is a rare situation.
WC3ScrnShot_011322_222244_001
Soon Farseer was killed by the enemy's Death Knight. Tauren Chief didn't use the healing potion even if it was targeted by Death Knight. So it died unsurprisingly.

In this scenario, I think there are two possible reasons why this kind of bug might be triggered. First, AI's hero may not use healing potions correctly after using a portal. Second, maybe it's the swap of the healing potion between the two heroes that caused this bug.

Inconsistency with AMAI

After downloading AMAI up to the most recent one, 3.0 using AMAI.exe to install the scripts on maps, the game does not always load AMAI.

There is a huge inconsistency. Sometimes the game would just have the normal AI playing even when playing on the appropriate map. You would then have to restart the match several times and use cheats to reveal the map to see what AI you are fighting against. Only about 20% of the time, you would get an AMAI AI profile to load up in game.

This also applies in team games. 2/6 AIs would only be using AMAI scripts while the rest would be using the standard AI scripts.

Is there a way to just outright delete the standard AI skirmish scripts? I want to only fight against AMAI.

How to make AI disable 2nd hero or 3rd hero?

For example, if I want AMAI's NE to use Warden as its first hero, and I also want AI not to use any other heroes because they might slow down the upgrade speed of the Warden. What should I do to make it happen?
I checked the AMAIStrategyManager. There are options for the hero's bonus amount in the Strategy file. The document does not state whether this value can be set to a negative number. Can I set a very high value for Warden as the first hero and set a negative value for the 2nd and 3rd heroes?

Inventory filled with useless items and wrong assessment about items' value

Sometimes, the evaluation of items is obviously wrong. For example, a hero once threw his potion of invulnerability on the ground and ran to Goblin Merchants to buy a potion of lesser invulnerability.
But the bigger problem is that AMAI overestimates the value of low-level items and will always hold them. This will only take up space in the inventory for nothing.
For instance, AI's hero will never use the function of some items, like Cloak of shadows and Crystal Ball. These items are completely useless for AI's hero and cannot give any buff. It's better to sell them rather than hold them forever. But AI's hero seldom, if not never, sells these kinds of items to make room for inventory.

The next problem is about insisting on holding poor items. Some items are unimportant for certain heroes, for example, Gloves of Haste and agility+3 shoes for the non-agility hero. These low-level items are not totally useless, but it's clear that in the late game, these items should be replaced by more useful items.
In the late game, heroes will kill creeps much stronger than what they killed in the early game, which will bring more useful items than before too. But AI's hero might still carry those low-level items during the whole game and ignore more precious items. And the full inventory filled with low-level items will prevent heroes to buy more healing items from the shop.

I checked the files in the AMAI folder, only found some codes in StandardAiSettings.txt about buying and taking items. The default setting is:
SetHeroesBuyItems not isNewbie //Heroes attempt to buy useful items from shops (NOTE: this is the blizzard controlled item usage)
SetHeroesTakeItems true //Ai attempts to pick up items left on ground

It's not clear how AMAI control heroes selling items. Enlighten me if there are some files related to this.

I wonder if there is a way to let AMAI control heroes sell and re-evaluate items so that they can make full use of their inventory and economic advantage. Sell the useless item and buy/pick up the useful one.

Updates for 1.32.6

Changes to merc camp units and item costs.

Various hero power changes, unused ultimates could be tweaked in ability selection.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.