smunlimited / amai Goto Github PK
View Code? Open in Web Editor NEWAdvanced Melee Artificial Intelligence Mod For Warcraft 3
License: Other
Advanced Melee Artificial Intelligence Mod For Warcraft 3
License: Other
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)
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
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.
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.
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?
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.
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.
After they reached home, Farseer passed its healing potion to Tauren Chief, which is a rare situation.
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.
With a massive army of mechanical units, if only the hero is hurt it can trigger the urgent healing systems when its not serious "Army is badly damaged and needs healing"
This causes the AI to no longer do anything until until the hero is healed.
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.
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.
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.
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.
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. ^_^
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.
This bug happened twice on two similar AMAI HvU matches. Not quite clear whether it will happen on other occasions.
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.
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.
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.
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:
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...
Tweaks to tech trees and item prices required
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.
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.
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.
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?
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?
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.
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?
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.
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.
Zepplin hovers over the unit forever until it is shot down or the burrowed unit is healed and pops back up.
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.
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
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.
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
Micro system to be able to deny experience gains to enemies while in battle
After using it on a map, some Orc buildings changed:
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.
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.
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.
A number of issues with the current system which is still based largely on the vanilla systems
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)
Closed the issue by mistake; I can play now, but it seems more buggy now, the choose strategy menu is still too short, I can select only 1-9 strategies when orc race has 15
Originally posted by @purouwu in #24 (comment)
AI will upgrade research about dispersal skills but will never use this on summoned objects, which is a huge waste. So how to make AI units learn to use dispersal skills on summoned objects?
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.
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?
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.
Not sure on the cause but AMAI can end up getting stuck attacking its own building and just sits its army there.
Only once an enemy attacks them does it fix the issue.
Changes to merc camp units and item costs.
Various hero power changes, unused ultimates could be tweaked in ability selection.
i tried to connect you on hiveworkshop,when i choose chinese and then i get grabled code in the game。Can you help me?
AMAI 2.6.0 not work with Warcraft 3 v 1.28.5.7680
Built in blizzard maps occasionally fail to add all the AMAI scripts.
Temporary workaround: Either use the world editor to add the scripts, or use Ladiks MPQ Editor to change the max file limit then AMAI can install all files correctly to the map. http://www.zezula.net/en/mpq/download.html
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.
AMAI 3.10c: https://github.com/Pixyy/AMAI
Can this be played in LAN? What happens if the host or client presses esc to open commands?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.