AMAI 2.20 Developer Edition
News in 2.41 from 2.40:
StrategyManager now has one additional compile button for making an optimized compilation of the files for a final release. This will make the files much smaller but forget about using the optimised ones for debugging since the code will be hard to understand.
This optimization will reduce size of the PE and SE releases from now on and will also make AMAI consume less CPU power.
Bug making lock strategy not working fixed.
News in 2.41 from 2.40:
All jobs are now in external files containing functions and globals, they are all declared in the list file 'jobs.txt'.
Undead can now use DefendTownsDone without causing any bugs. there is also a new version of DefendTownsDone function yet untested with some conditions for making different defence depending on the stuation, will be used in next official AMAI.
Some new settings for the new feature making undead sell defence buildings that isn't defending anything.
Compiler now works more than 5(!) times faster.
News in 2.40 from 2.30:
Some new settings added for the new features also the ApplyTableChanges.pl is improved to automaticaly apply any missing setting it finds in common.eai to the version, racial and misc settings files.
Hero fleeing action rules moved out of common.eai to a external file named "HeroFleeRules.ai".
A simple edition .exe file will be generated every time you compile with the strategy manager now, it will appear in the version folder.
The new chat system that makes use of variables and conditions and support any foreign languages with whatever special characters there might be got a own new section last in this manual as section 2.4.
News in 2.30 from 2.20:
This time the editor got a few updates as well as a few new settings for strategies. Everyone now has complete easy acces to all global and racial settings as well as the strategy independant global build_sequence for every race, just look for the 3 new buttons to the left in the StrategyManager.
There is a new "copy" button to the right as well that let's you copy a strategy so you can easily make a new strategy based on a old one.
The 2 new settings for strategies(1on1 and FFA priority bonus) is now described along with the other strategy settings in the order they appear in the strategy guide of this manual.
If you are using or making a custom AMAI strategy just keep it installed and run the file 'ApplyTableChanges.pl' to get it automatically updated for this version of AMAI.
"All" setting now have explaining comments that are showed by the setting when you change them with strategy manager.
For all you mod/campaign makers that are using AMAI as a base AI in your creations, there is some updates to be made to some of the tables if you want to update to this version of AMAI.(that is recommended)
These changes will make AMAI support more than 4 races and it will be easier to configure.
1. A new column has been added to 'StandardUnits.txt', it got the lable "buy type" and is located between "type" and "needed1"
This column should contain data that defines in what way a computer can get the unit/structure/upgrade on that line.
The following types is used:
UNIT
BUILDING
HERO
UPGRADE
ML_UPGRADE
RACIAL_ITEM
NEUTRAL_HERO
MERC
GOBLIN_MERC
DRAGON
MERCHANT_ITEM
2. Mark all units you want AMAI to use vs towers with "siege" on the type column in 'StandardUnits.txt'.
3. Note that there is no specific order required any more in the 'StndardUnits.txt' table, so all "dummy" lines may now be removed.
4. Put all neutral heroes above the racial ones in the table file 'Heroes.txt'.
5. Check all tables for column names with race names in them and make sure all these race names are entered in capitals like in 'Races.txt'.
6. Check all tables for column names with strengths in them and compare them with the strength names in 'Strengths.txt'
7. Check all strategies and 'StandardUnits.txt' for "racial_hall", "racial_hall2" or "racial_hall3" and replace these with "racial_hall[1]", "racial_hall[2]" and "racial_hall[3]", replace "hall" with "hall1" in the type column in 'StandardUnits.txt' as well.
8. Run ApplyTableChanges.pl after you done all the previous steps to get the 2 new settings for strategies(1on1 and FFA priority bonus) added in the tables.
It's also now possible to add as many new races you like to AMAI by changing or adding races in the races.txt file in the version folder then changeing or adding race folders accordingly. New races should be a copy of a existing race folder so it already contains the right files.
After changes have been made run the ApplyTableChanges.pl to get all variable names and values fixed in the new/changed race folders.
For use of a different amount of races than 4 a gamecache have to be used in the map when the player choose race, since the normal war3 gui only supports 4 races.
This is for more advanced users only:
Firstly the boolean value is needed in gamecache to make AMAI override 'GetPlayerRace'.
Store bolean "Races", "Special" : true in gamecache "AMAI_Com.w3v"
Secondly the trigger needs to store data about what race every player in the game is using.
The different races got integer numbers in the order they are written in Races.txt, number 0 is Random, so the first race in the file is 1, second race 2 and so on.
This information shall be stored with 2 different integers for every player in gamecache, what race the player is("race") and what race the plyer chosed("RacePref").
Example: player 4 picked random and became human(2nd row in standard Races.txt)
Store these in "AMAI_Com.w3v":
"Race", "3" : 2 <-- "3" is Player 4 since Player 1 starts to count as 0 here, "2" is the 2nd line in Races.txt(human).
"RacePref", "3" : 0 <-- "3" still same player 4, "0" is becuse this player picked random as race.
News in 2.20 from 2.10:
Several new settings to make adjustments to the 2 new features in AMAI 2.20.
This manual is updated with instructions on them and some other instructions on different harass targets and strength types.
New settings are found at the end of section 2.2. Harass targets are located in section 1.4 by the harass code instructions and the strengths by the SetBuildReact() instructions near the end of 1.4.
Introduction:
This is the development version of the new Advanced Melee Artificial Intelligence for Warcraft 3 - Reign of Chaos and The Frozen Throne. This document contains detailed information on how to make your own personalized version of AMAI in whatever way you need.
AMAI can be customized for your own personal needs in term of AI strategies and a lot of other gameplay settings like personal profiles. AMAI can also be customized to fit a Total Conversion for Warcraft 3 supporting custom units and abilities very easy with help of these instructions.
First you need to know what exactly the purpose of AMAI is and how it works.
The purpose of AMAI is to be a automated dynamic AI for Warcraft 3 that works better and is much easier to edit than the original AI. Therefor when working with AMAI keep in mind that it's mostly automated and self adapting to most enviroments you can put it in. For example, don't try to make AMAI use a build order that you invented or read on a war3 strategy site or something like that, the result will be horrible. Since AMAI finds it's own order, the only thing you need to care about is to set up clear goals of what you would like AMAI to accomplish and it will find it's own way there.
If you got War3 AI experience:
Previous experience with Warcraft 3 melee AI won't help you much when working with AMAI but it will make you understand very quickly how evolved AMAI really is.
Originally War3 Melee AI was 3 parts of code for each race. the parts were build_sequence, upgrade_sequence and attack_sequence. The only one of these 3 parts that still exists in AMAI is the build_sequence but it's not working like the original build sequence that contained a build order, instead it contains 3 small lists of all goals you want the AI to acomplish for each tier.
Requirements:
First you will of course need a copy of Blizzard's Warcraft 3 with or without The Frozen Throne expansion pack.
You will need a computer that meets Blizzards recommended system requirements for Warcraft 3 since AMAI will consume a bit extra CPU power the minimum system requirements might not suffice for use with AMAI.
To make own strategies it's also very helpful if you have some previous experience with programming of any kind.
You will need a program able to edit tables in form of tab separated text files if you are a campaign creator or for some other reason want to make AMAI work with custom units.
Microsoft Excel is a good example of such a program.
You also need to have Perl installed on your computer in order to compile your AMAI and make use of the AMAI Editor to edit profiles and strategies. It's free and you can find it here.
Download and install it and then after rebooting your system you will be able to execute perl files (.pl) that are used for compiling AMAI and managing the strategies.
Overview:
This is the overview that tells you where to look to find out the info you need for what you want to do.
The manual will have two main parts. the first part is for hobby players who want to make their own favorite opponent using own design strategies that you can extract separatly from AMAI and exchange with other players on internet that also make own AMAI strategies. The second part is for those making own campaigns or total conversions for warcraft 3 and want to know how to make AMAI work as simple as possible with custom made units and abilities.
Part 1 - For the advanced gamer.
1.1 Get to know AMAI.
1.2 Making a profile.
1.3 Compiling your own AMAI.
1.4 The making of strategies.
1.5 Strategy exchanging.
Part 2 - For campaign creators.
2.1 Defining custom units and abilities for AMAI.
2.2 Global settings.
2.3 Making an AMAI translation.
1.1 - Get to know AMAI.
If you downloaded this software and read this far you already know that AMAI is a sophisticated version of the ordinary AI found in warcraft 3, so let us get on to the instructions on how to work with AMAI to make it operate with it's full potential.
Everything you need to do to make AMAI do your bidding is to setup some goals and settings. There are several different setting levels, like strategy specific setting, race specific settings and global settings that are applied no matter what race and strategy AMAI uses.
The goals are what AMAI does. The build sequence that every strategy consists of is simply a list of the goals, where you tell AMAI what to do, how many to make and how important it is that it is done. There isn't much more to be said here, since you don't need to know much about AMAIs functions to make it work. Just follow the instruction steps for the different activities in the following sections and you will understand how easy this really is.
1.2 - Making a profile.
If you used AMAI before you probably noticed that when the game is ongoing and at the end screens all computers get names instead of 'Computer(Normal)'. The meaning of this is to personalize the computers better and giving them an individual feel.
Some might think the names are only names but that is not the case. Behind every name is some unique settings, the 'profile settings'. These are different for every profile and give them a personality. For example the computer named '[AMAI]Aggressario' is a aggressive computer that dares to attack stronger foes and he also got some other properties like switching strategy more often and expand early.
Currently AMAI got 26 different profiles but got room for some more if you want to add a personal one to the list so it got a chance of getting randomly picked by one of the computers in the game. Or maybe you want to remove or edit the current profiles to get an own list of profiles that you can keep to use with all future versions of AMAI.
You will also be able to upload your own profiles and download other profiles from a database on internet, read more about this in the strategy exchange section.
Before playing around with AMAI profiles there is one limit you need to keep in mind:
There have to be at least 11 different profiles since AMAI pick a unique profile for every computer in the game, there will be trouble if a game is started and there are more computers than names on the profile list.
Lets get started. I will be making a new profile named 'Willy' and in detail describe every step I take to do so.
Make sure you installed Perl as instructed in the requirements section and after this you can run the strategy manager in AMAI directory 'AMAIStrategyManager.pl'.
Now press the "profiles" tab to get to the list of profiles that is currently installed in AMAI. Make a new profile by pressing the button 'New' to the right and select the profile "New_Profile" that should have appeared at the bottom of the list.
After this we want to customize this profile and give it a name. To do so we need to open it in the profile editor. Hit the button 'Edit' to the right to bring forth this editor with "New_Profile" selected.
The editor should now appear. We start by giving our new computer player the name of "Willy".
After this there is plenty of other settings you can fill out as you want, just read on and I will explain them all in the right order.
Aggression recommended: -10 to 10
This is usually a value between -10 and 10. A higher number means more aggressive while a lower means less aggressive. By many tests I have found out that computers work best if they are less agressive but that might have changed due to recent changes in the features. It's hard to know. However to be on the safe side I fill in -6 for Willy meaning he will only dare to attack a opponent if the opponents force is 6 strengthpoints smaller than his own force.
Uncertainty recommended: 5 to 15
This is one of the things we have to decrease the amount of cheating in the AI. This is how false the information about the enemies strength can be. For example 6 means this computer will get the strength of the enemy force +-6 points or less of the actual strength value.
First you might think you do the computer a big favor by setting this to 0 but thats actually wrong. In many cases it's good that the uncertainty makes the computer attack a stronger opponent that might not be home to defend his own base at the moment and just because this computer was lucky he then wins instead of sitting at home knowing that the enemy force is stronger and therefor not dare to attack.
I set this to 5 for Willy so he still knows the enemy pretty accurate.
Minimum Attack Strength recommended: 6 to 9
This is a number for how strong this computers army must be before it dares to leave the base to attack the enemy or do some creeping, for example a hero and a footman is 5+2 strength points(almost the food value for the units) this mean if this computer got a 6 here it will not attack until it got both the hero and at least 1 military unit completed.
I give Willy a 8 here so he doesn't try to leave base and get his units killed becuse he used a too small force.
Build Farm at left food recommended: 6 to 12
This setting tells how much free food there can be left before it is ordered to build another farm or whatever building it has that produces more food.
Willy gets 8 here meaning that when his food use is 8 less than his total food capacity he builds another farm.
First expansion time recommended: -10 to 10
A small influence on this computers expansion time, it's counted in units of 5 seconds meaning that a 5 will allow Willy expand 25 seconds later than usual or -5 will allow Willy to expand 25 seconds earlier than normal.(5*5=25)
Willy gets a 6 here.(allowing him to expand 30 seconds later than usual)
The base expansion time is depending on what strategy is used since it differs from different strategies. Look it up in the strategy making part of this manual.
Second expansion time recommended: -20 to 20
Same as the first but it's the influence for when this computer is allowed to make a second expansion. Remember that for both of these cases it doesn't mean that a computer 'will' make a expansion exactly when this time has passed, it will only be allowed to make a expansion. The computer can find out on it's own if it's in need of an expansion.
Willy gets -10 here. (allowing Willy to make second expansion 50 seconds earlier than normal)
Strategy Persistence recommended: 500 to 1500
this is how much the computer wants to keep using the current strategy. This mean that a lower value here will make the computer change strategy more often and therefor react faster on what the enemy does and counter it. But changing strategy more often isn't only good for the computer since it will ruin all it's current plans. For example a Orc computer might be using a strategy that builds grunts so it starts by building a barrack and just before the barrack is completed it discovers that the enemy got lots of ground attack units and decides to use a mass wyvern strategy instead. Now the barrack was built in vain. Such things are avoided by using a higher strategy persistance.
I give Willy a good average number of 900 here so he won't change strategy too often.
Influences number of factories built recommended: 0.9 to 1.0
This value is a part used in the computer's formula for calculating if they got enough income to be able to make use of extra buildings for faster unit production. The higher this value, the more unit production buildings of a type are built. As an example a human computer uses a strategy that builds lots of riflemen from one barrack. After this computer completes an expansion and starts to gain gold faster it might consider building another barrack to spend the higher income on producing riflemen much faster. Depending on this value it might do that or not.
Willy gets the good average number 0.9 here.
Taunt rate recommended: 0 to 2
This is how often this computer will display a taunt message. For now all profile got the value 1 becuse it has prooven to be a good avrage value. Every 5th second of game time the function that decides if a computer is going to taunt is executed, when that hapens it's the chanse of this value in % if the computer shall display a taunt chat message. '1' says that the computer will display a chat messege every 5th second 1% of the time. For Willy I enter 0.5 here since I don't want him to talk very often.
Expansion target bonus recommended: 0 to 20
This is an added aggression bonus if an enemy expansion is targeted for attack. Meaning that the higher this value is the more often will the computer dare to attack an enemy expansion.
Willy gets 8 here.
Hard coded AI target bonus recommended: 0 to 20
Same as the expansion target bonus but this is aggression added for targets selected by the hard coded AI made by Blizzard. These targets will most of the time be enemy expansions or backstabbing enemy forces that currently engage larger creeps nearby.
Willy gets 6 here.
Hard coded AI target rate recommended: 0.3 to 0.8
This is how often AMAI lets the hardcoded AI choose target instead of AMAI itself. A higher number closer to 1 means that the computer will attack expansions and backstab enemy forces more often while closer to 0 will make the computer creep more and attack enemy bases if enemy force is weak. Willy gets 0.5 making it a 50% chance that AMAI or hard coded AI choose a target.
Favorite hero
This effects in a small way what hero Willy will use the most for every race. For example if 'ARCHMAGE' is Willys favorite hero for Human he will more likely be using that hero. There is even a small chance that he will pick the Archmage hero even if the strategy used has no priority at all for that hero.
Just go ahead and give Willy a favorite hero of your choice for every race.
Favorite unit
Like the favorite hero this effects how Willy plays in a small way but probably in a larger way than the favorite hero since it has influence on what strategies Willy is going to use when playing. For example if Willy's favorite Night Elf unit is 'HUNTRESS' he will most likely use strategies that orders him to build lots of huntresses. Of course he will still switch to a strategy that better counters what the enemy got if huntress don't work but he rather sticks to huntress most of time since it's his favorite unit.
Willy should now look something like this.
After filling in all the settings for Willy I can now save this profile by hitting the ok button. Willy is created,but before you can play with or against Willy you will have to compile AMAI then install it to the maps you want to play. There is always a chance that Willy will be one of the computers in the game and that computer will have the peronality you just created.
As I said you must compile AMAI and since you probably not know how to do that yet that will be what you will learn in the next section of this manual.
1.3 - Compiling your AMAI.
This is very simple if you still got the strategy manager open. You just need to hit the 'Compile' button to the left and there will be a progress report in the perl window that you probably already got minimized so after you hit the button bring it up.
Now the compiler will make the 5 .ai files for the TFT version of AMAI. After the 5 files has been compiled the DOS window will ask you to press a button to continue so just press a button. after this we can now just run the installer AMAI.exe to install the newely compiled AMAI to a map of your choice and start playing with the changes you just have made.
1.4 - Making a strategy.
AMAI already got about 8 different strategies for every race but theoritically it should support an unlimited amount of different strategies. We start this section by starting the perl program 'AMAIStrategyManager.pl' that will bring you this menu.
What you currently see here as the left buttons indicate is all strategies for NightElf in the TFT version of AMAI.
With this strategy manager you will be able to exchange strategies with other users of AMAI by using the Insert and Extract buttons. From here you also find the editor. We start to learn how to make strategies by looking at an existing strategy. Start with selecting the human race instead by pressing the left button that now indicates 'ELF', after this the list has changed to display the human strategies. Now press the strategy named 'Rifle'.
Now press the right button 'Edit' that will open the editor with this strategy.
Now Im first going to describe all the settings you can see to the right just like in the profile making section.
Strategy Function Name
This is the working name of the strategy that will be used by the program files.
Default Name
This is the name the strategy is known by in game unless there is another language version of this name in the translation tables.
Default Report
This is what a computer says when it's starting to use this strategy unless there is another translation for this matching the used language when playing.
key_building1
This is the main building used by this strategy for unit prodution and most other needs. It is used for identifying this strategy as a better choice for a computer that needs to build something that counters the enemy forces that might got alternative solutions. For example a computer that has one workshop and one barrack might consider both mass flying machines and mass riflemen as good choices to counter an enemy air force, but if the computer instead has 2 barracks and no workshop the choice will more clearly point to this strategy since it already got one of the buildings mainly needed to create riflemen.
key_building2
This is used to define a second key building that will enforce the priority for this strategy in the same way as key_building1. Should be the second most used building for this strategy.
key_upgrade1
In same way as for key buildings this is the upgrade mostly used for this strategy. The higher level this upgrade is the more the computer already got of what is to be built in this strategy. This makes the strategy look like a 'best choice' if a computer is in need of the other properties for this strategy.
key_upgrade2
Same as for key upgrade 1 but this is the second most used upgrade.
key_unit
This is the unit most used by this strategy and is used in a similiar way as key building and upgrade. The more units of this kind the computer got the more good looking is the strategies having this unit as key unit next time the computer is about to change strategy.
beginning_strat
Set this to true if this strategy is allowed to be used as a starting strategy at the beginning of a game. Set this to false if your strategy is more meant to be enhancing an already established strategy and has no good goals for tier 1.
strat_minimum_time recommended: 20 to 50
This is how long time this strategy will be used as a minimum before a new strategy change is allowed. This usually is set to an estimated time it takes for this strategy to establish itself, therefor this time is only true for tier 1. If this strategy is selected in tier 2 this time will only be 2/3 of whats entered here, if it's in tier 3 it will be only 1/3 of this time.
strategy_type
The major function of the strategy. Here are four options: ranged, melee, air and casters. The use is that allied computers will try to choose strategies of different aspects instead of going both melee for example.
Main strategy tier recommended: 1 to 3
This is in what tier this strategy operates best. For example a mass footmen strategy works best early(tier 1) in the game while a mass knight strategy works best later in the game(tier 3).
base rp recommended: 20 to 30
This is the starting priority for this strategy. The higher this value is the more likely it is that the computers are going to use this strategy no matter what.
ally bonus recommended: -18 to 18
If your strategy is good for team play you can enter a priority boost this strategy shall get if the computer selecting strategy has allied players. (it is a team game)
1on1 bonus recommended: -18 to 18
If your strategy is good for 1on1 games you can enter a positive value here.
FFA bonus recommended: -18 to 18
If the strategy fits well for FFA it really need some extra priority here, like 9 or 18.
Race bonus recommended: -18 to 18
The following 9 settings is to give this strategy positive or negative priority boosts depending on what race enemy and allied players are.
Random enemy bonus is the bonus priority this strategy gets if an enemy is random race. The following settings explain themselves good enough. Human enemy bonus is priority added if an enemy is human and so on. The last 4 settings are depending on what race any allied player might be, for example orc ally bonus is priority added if a player is orc and is allied with the computer.
Strength bonus recommended: -10 to 10
The next 11 settings are priorities on different things this strategy is good or bad to go against. For example anti air strength should be a pretty high positive value for this riflemen strategy since it's one of the best human strategies to counter enemy air units. It's also a strategy using piercing attack meaning that it's pretty good at countering any units with light or unarmored armor so it should also have positives on anti unarmored strength and anti light armor strength.
However this strategy also has down sides such as riflemen having medium armor making them very bad vs melee attackers using normal attack. This makes the riflemen strategy get a negative value on anti normal strength.
Anti air strength - How good this strategy is against enemy air units.
Anti caster strength - How good this strategy is against enemy support units.
Anti tower strength - How good this strategy is against enemy defensive buildings.
Anti piercing strength - How good this strategy is against enemy piercing attack units.
Anti normal streangth - How good this strategy is against enemy normal attack units.
Anti siege strength - How good this strategy is against enemy siege attack units.
Anti magic strength - How good this strategy is against enemy magic attack units.
Anti unarmored strength - How good this strategy is against unarmored enemy units.
Anti light armor strength - How good this strategy is against enemy light armor units.
Anti medium armor strength - How good this strategy is against enemy medium armor units.
Anti heavy armor strength - How good this strategy is against enemy heavy armor units.
Expansion time recommended: 30 to 90
The time a computer using this has to wait before it is allowed to build the first expansion. The value is in units of 5 seconds meaning that 80 tells the computer to not expand until a gametime of 80*5 seconds has passed.
The computer will not build an expansion exactly after this time has passed. It will only be allowed to build one, it will know by itself if it needs an expansion yet.
Second expansion time recommended: 100 to 200
The time a computer using this has to wait before it's allowed to build the second expansion. The value is in units of 5 seconds meaning that 80 tells the computer to not expand until a gametime of 80*5 seconds has passed.
Both these values are influenced in a small way by what profile is being used as well.
First hero bonus
If you want a certain hero to be used more often as first hero with this strategy it should be selected here. Note though that that will only have an influence if this strategy is chosen as starting strategy.
First hero bonus amount recommended: 10 to 30
How high priority boost you want to give this hero as first hero. If you want to enforce a certain hero, use a very high value.
Second hero bonus
This is the same as the previous 2 settings but for second hero.
Second hero bonus amount recommended: 10 to 30
Priority boost for the selected hero to be used as second hero.
Aggression bonus recommended: -10 to 10
The following 12 settings sets how aggressive the computer using this strategy should be in different cases.
enemy_elf add agg - Changed aggression vs enemy night elf players in tier 1, 2 and 3.
enemy_human add agg - Changed aggression vs enemy human players in tier 1, 2 and 3.
enemy_orc add agg - Changed aggression vs enemy orc players in tier 1, 2 and 3.
enemy_undead add agg - Changed aggression vs enemy undead players in tier 1, 2 and 3.
You probably wonder why most of these settings are unused for the current strategies and thats becuse we don't know what values should be here to give best result. If you feel the same for any settings you should leave them blank or ask a good player for assistance on how the strategy should be played in different cases. If you just fill in random settings the results can be worse than just blank values. Blank here does not mean leaving the fields empty but putting a 0 in the fields.
That were all settings for strategies, now lets try to learn the most advanced part of this editor, the coding of build goals.
This is about the 4 textfields to the left in the editor. The top area is for strategy initalisation code and the other three are for different tiers.
Initalisation code
This part is seldomly used but it can be used for some strategies if you want to make a really optimized build order at the start of the game like in this case for riflemen or if you want to define some harass groups for the computer using this strategy.
Harassing is a new features in AMAI 2.0 and might not be as good as real harassing but it's good enough for annoying opponents.
But first lets take a look at what we currently see in this text field and take up what it is.
call AddBlock(1, BLACKSMITH, false, 1, HOUSE, 60)
call AddBlock(1, BLACKSMITH, false, 9, PEASANT, 60)
Both lines have the same function "AddBlock" this can be used to prevent the computer from doing something before it has done something else or before a certain time has passed. In this case the first line tells this computer that it should not build more than 1 human farm (1, HOUSE,) unless it has already started to build at least 1 blacksmith(1, BLACKSMITH, false,) or if 60*5 seconds have passed since game start.(60)
The second AddBlock call tells this computer that it should not build more than 9 workers(9, PEASANT,) unless it has started to build a blacksmith(1, BLACKSMITH, false,) or 60*5 seconds have passed.(60)
If you are not very familiar with coding this might look confusing but this is how the parameters work:
call AddBlock([How many must it build or start to build], [What must it have built or started to build], [Should the first value count started to build(false) or completed build(true)], [How many is it allowed to build before it has to obey the condition stated in the 3 first parameters],[What is it it is allowed to build this many of at a maximum], [How many game seconds *5 shall pass before this block is turned off])
For example I can show this completely different block:
call AddBlock(1, HUMAN_ALTAR, true, 0, ARCANE_VAULT, 36)
This block prevents the human computer from starting to build any shop( 0, ARCANE_VAULT,) unless at least 1 altar has been completed(1, HUMAN_ALTAR, true,) or 180 game seconds have passed(36).
This block is in global strategy initalisation unreachable from this editor but it's there to prevent any computer from building the shop too early.
This is as hard as it gets when making strategies. The remaining code is much more simple and besides, blocks are no requirements for making strategies that work good.
In this case the 2 blocks are there to make the human computer only get 9 workers, a farm and a altar before it starts to save to afford both the blacksmith and the barack and build them at the same time and by that get riflemen as fast as possible.
Aside from blocks harass groups may also be defined in the strategy init code. They can look like this:
call AddHarass(1, 2, FOOTMAN)
As you can see much more simple than a block. This adds 2 footmen(2, FOOTMAN) to harass group 1(1).
This allows you to make this computer send 2 footmen to any the enemy to attack unprotected workers or an unprotected expansion site.
But to do that you have to add another row of code to the other 3 text fields, thats what we are moving on to now.
To enable this harass group to work this code is needed as an example:
call Harass(1, HARASS_TARGET_PEONS, true, 5, 0.25, 0, true, 50, 80)
This will make the human computer using this strategy to send harass group 1(1) to attack enemy workers(HARASS_TARGET_PEONS) but it will avoid towers(true). It will flee back if it encounters enemy units of a strength that is at least 5(5) and will abort the harass and move home again if they have less than 25% HP left(0.25) or there is only 0 units left alive in the harass group(0). It will repeat this harass every 50*5 seconds(50) but not make the first harass attempt until 80*5 seconds have passed(80).
Other harass targets:
HARASS_TARGET_PEONS - Enemy workers
HARASS_TARGET_EXPANSION - Enemy expansion
HARASS_TARGET_MAIN_HALL - Enemy main hall
Code for Tier 1
Now we are finaly getting somewhere. Here is the actual build sequence of AMAI and in this box every line represents a goal AMAI will try to accomplish as long as it is in tier1. This code is usually much more simple than the blocks and harass code.
We start by looking at one of the present lines here:
call SetBuildUnit(8, RIFLEMAN, 50)
The "SetBuildUnit" function is used to make the computer build units or buildings while the "SetBuildUpgr" function is for making upgrades. This specific line in "Code for Tier 1" tells this computer to build 8 riflemen(8, RIFLEMAN,) with a priority of 50(50) you might think at first. But this is not entirely true.
Because everytime you order a AMAI to build multiple units they will get a priority(50) boost of the unit amount(8 - 1) *2. This means that the first rifleman will be ordered with a priority of 50 + (7 * 2), wich is 64. But since for every rifleman built there is one less rifleman ordered the priority will be 2 lower for every rifleman. This mean that the final 8th rifleman will be built with the priority of 50 that is the actual priority given in the function call.
Now you might wonder what's the reason for this. So thats what Im going to explain here.
In the old standard ways of making build orders for warcraft3 AI the same order would have been given without the priority like this:
call SetBuildUnit(8, RIFLEMAN)
But usualy you want the computer to build more than just riflmen. So we add some footmen as well like this:
call SetBuildUnit(8, RIFLEMAN)
call SetBuildUnit(8, FOOTMAN)
Now what do you think this computer does?, well if you got some experience with normal war3 AI you know that it will first build 8 riflemen then it will build 8 footmen. But if you want it to build both riflemen and footmen parallelly then in the old ways of war3 AI you will have to do like this:
call SetBuildUnit(1, RIFLEMAN)
call SetBuildUnit(1, FOOTMAN)
call SetBuildUnit(2, RIFLEMAN)
call SetBuildUnit(2, FOOTMAN)
call SetBuildUnit(3, RIFLEMAN)
call SetBuildUnit(3, FOOTMAN)
call SetBuildUnit(4, RIFLEMAN)
call SetBuildUnit(4, FOOTMAN)
call SetBuildUnit(5, RIFLEMAN)
call SetBuildUnit(5, FOOTMAN)
call SetBuildUnit(6, RIFLEMAN)
call SetBuildUnit(6, FOOTMAN)
call SetBuildUnit(7, RIFLEMAN)
call SetBuildUnit(7, FOOTMAN)
call SetBuildUnit(8, RIFLEMAN)
call SetBuildUnit(8, FOOTMAN)
As you can see it's a whole bunch of code.
Now behold the new and improved AMAI way to do this:
call SetBuildUnit(8, RIFLEMAN, 50)
call SetBuildUnit(8, FOOTMAN, 50)
Yes these 2 lines give exactly the same result as the 16 rows above thanks to that amount of additional units * 2 priority add. it simply works like this since the first rifleman got a priority of 64(50 + (8-1)*2) as I previosuly explained. as well got the first footman a priority of 64 since there is also 8 footman ordered. but since the riflemen are first the first unit built is the rifleman, then after the rifleman is built the next rifleman gets same priority -2 while the first footman still hasn't been built so it still got its priority of 64 and will be built after the rifleman. after this the computer got 1 rifleman and 1 footman and it has 7 rifleman and 7 footman more to build both now at a priority of 62.
So it's all over again, first it builds another rifleman since it's above the footman in the code and got exactly the same priority. then another footman again. So the result now looks like this in the old code style:
call SetBuildUnit(1, RIFLEMAN)
call SetBuildUnit(1, FOOTMAN)
call SetBuildUnit(2, RIFLEMAN)
call SetBuildUnit(2, FOOTMAN)
It will still continue to produce the full result of thoes 16 lines, ending with 8 riflemen and 8 footmen.
Now lets take a look at a larger part of this tier 1 code for the Riflemen strategy:
call SetBuildUnit(8, RIFLEMAN, 50)
call SetBuildUnit(4, FOOTMAN, 50)
call SetBuildUnit(1, hero_id[1], 80)
Here we got an order of 8 riflemen, 4 footmen and the first hero.
So what of this is going to be built first you think? Lets check.
First we got 8 riflemen with a priority of 50, that gives the first rifleman the priority of 64(50+(8-1)+2).
Second there is 4 footmen with a priority of 50, that gives the first footmen the priority of 56(50+(4-1)*2).
And lastly we got the hero with a priority of 80.
This means that the hero gets built first. secondly it will continue with building riflemen until the rifleman priority is lower than the priority of the first footman so let's count.
1. Hero1 80prio
2. Rifleman 64prio
3. Rifleman 62prio
4. Rifleman 60prio
5. Rifleman 58prio
6. Rifleman 56prio
and now...
7. Footman 56prio
and so it continues...
8. Rifleman 54prio
9. Footman 54prio
10.Rifleman 52prio
11.Footman 52prio
12.Rifleman 50prio
13.Footman 50prio
DONE!
Now this computer got an army already and is fully operational. Don't mind about the needed buildings, it knows what it needs and will build it.
We also see another function here. SetBuildUpgr works just like the SetBuildUnit function but is used for upgrades.
This for example:
call SetBuildUpgr(2, UPG_RANGED, 34)
Taken from the tier 2 code this upgrade order tells the computer to upgrade the ranged unit attack to level 2(2, UPG_RANGED,) with a priority of 34(34) and since the level 2 never was ordered it will upgrade that first of course with the 2*[additional amount] rule, that means the level 1 ranged upgrade is first done with the priority of 36. Works as I said just like the build function but is only used for upgrades.
By now you might have noticed that unit ordered first in the tier 1 code "merc_rush". This is a mercenary that will be bought if there is any mercenary camp on the map with a mercenary under the category merc_rush available.
There are several different kinds of mercs that can be ordered just by making a build order on the category name.
merc_rush - a weak but very early available mercenary of some kind.
merc_stopper - a mercenary with some kind of entangle or ensnare abillity.
merc_caster - a caster mercenary with no healing capabilities.
merc_healer - a healer merc with some kind of healing spell.
merc_melee - a stronger melee attacking mercenary.
merc_ranged - a range attacking mercenary.
In some cases the same mercenary can exist under multiple categorys but there is only 1 mercenary for each category or none.
The tier 2 and tier 3 code windows have the same kind of code as the tier 1 window but usually more since it's possible to build more units and do more upgrades in the higher tiers.
There are some other special build orders as well. In other human strategies orders calling "basic_melee". This is footmen or knights depending on what the computer can build for the amount number of food.
call basic_melee(50, 36)
This for example will build footmen or knights for the food value of 50 at the priority of 36.
My suggestion is that you take a look at different strategies for different races to see how they are made and then try to make your own strategy when you feel up to it.
Making a new strategy
Start by getting to the strategy manager and select the version and race your strategy shall be made for, then hit the button 'New' to the right.
Now a strategy by the name of New shall appear at the bottom of the list.
Now hit the edit button to start making this strategy.
Now we are going to make a simple AMAI strategy step by step and test it in game.
Start by giving it a name and report.
Next we have to make it build something. To prove how easy it is to make AMAI play with very little code i'm starting with only 2 lines in the tier 1 code.
A hero and 10 footmen should be sufficient for some creeping and early attacks on the enemy, so let's test it.
Hit the 'OK' button to save this strategy as it is. You will find yourself back at the strategy editor where this strategy still has the name "New", to fix this just restart the program or switch to another race and switch back and the name "Test" should appear instead if that was the name you gave it.
Now to lock the computer to only use this strategy so we can test it you have to select it in the list and hit the 'Lock' button to the right.
After this we need to compile it, so hit the compile button to the left.
After it has compiled just start the installer 'AMAI.exe' and install this version to a map of your choice so we can test it.
After this start Warcraft3 The Froxen Throne. (Unless it was a Reign of Chaos version you just did)
Go to Local Area Network and set up a game on the map you just installed this version of AMAI to with yourself as observer and bring up 2 human computers.
Start the game and check if everything is alright. If it works as it should both computers will tell you that they are using the test strategy you just made.
Now the game should go on with 2 human computers creeping and attacking each other while both try to keep an army of 1 hero and 10 footmen.
As you can see all the buildings and workers are built automatically. The computers buy support units as zeppelins and maybe some mercenaries automatically as well and try to do some harass attacks.
Since this strategy now is very simple the game will probably never end, both computers will just kill all creeps and then maybe don't even dare to attack each other since they got armies of equal size. This depends on what 2 profiles were picked for the 2 computers but is very likely to happen with this few units.
So get back to the editor and try to evolve your strategy a bit by adding an order to upgrade to tier 2. This is done by ordering the building name of the tier 2 hall, for human this is KEEP.
And we don't want it to get to tier 2 for nothing so let's add some code in this tier as well so the computer continues to build when it gets there.
Making the footmen level of attack and armor be upgraded to level2 as well as building a second hero and 5 riflemen should be good.
And remember to keep the footman order here if you still want the computer to keep a maximum of 10 footmen after it reaches tier 2 so it rebuilds any lost footmen.
Now just repeat the previous steps to test this updated strategy. Hit 'OK', lock it again just in case, compile it and install it.
Run a test game again and notice how the computers upgrade the hall by the time they got the first hero and 2-3 footmen. After the hall is upgraded they should make a blacksmith to make the melee unit upgrades ordered in tier2 and to be able to build the 5 riflemen also ordered.
You might notice sooner or later that the computers will also build a shop no matter if you ordered it or not, this is becuse they want some items like potions and scroll of town portal automatically and the best way to get them is to build a shop and buy them there so thats what they do.
There are some additional build functions that might come in handy when you are trying to bring your strategy to perfection.
The first is 'SetBuildItem' that works just like 'SetBuildUnit' or 'SetBuildUpgr' but instead it takes an item and orders the computer to get the given amount of this item for any of the heroes.
call SetBuildItem(2, HEALING_POTION, 40)
This orders a computer to buy 2(2) healing potions(HEALING_POTION) using any hero to buy them at the priority of 40.(40)
The second function is an advanced build function used to make your strategy a little more allround.
The name is 'SetBuildReact' and it's used to balance between 2 different unit types depending on how strong the enemy is in a certain area like this.
call SetBuildReact(20, 3, HUNTRESS, 5, ARCHER, enemy_unarmored, 4, 12, 50)
This command tells the computer to build 3(3) huntresses(HUNTRESS) and 5(5) archers(ARCHER) at all times but then spread a number of huntress and archers out on a food amount of 20(20) depending on how strong the enemy army is in the area of units with unarmored armor(enemy_unarmored).
if enemy unarmored strength is lower than 4(4) all this food becomes huntresses, if it's above 12 in strength(12) that food instead becomes archers only.
If the enemy unarmored strength is something between the 2 borders(4 and 12) the food amount is shared betweem both unit kinds.
For example if enemy unarmored strength is 8, 10 food will be huntress and 10 food will be archers.
Different strengths to be used with SetBuildReact():
enemy_heavyarmor - Enemy heavy armor strength
enemy_lightarmor - Enemy light armor strength
enemy_mediumarmor - Enemy medium armor strength
enemy_casters - Enemy casters strength
enemy_towers - Enemy tower strength
enemy_unarmored - Enemy unarmored strength
enemy_magic - Enemy magic attackers strength
enemy_normal - Enemy normal attackers strength
enemy_piercing - Enemy piercing attackers strength
enemy_siege - Enemy siege attackers strength
enemy_air - Enemy air units strength
If you made it this far I don't think you should have any trouble to complete a whole strategy on your own but there are some things to have in mind when making an AMAI strategy.
1. Only make goals and keep it simple to make AMAI work optimal as it's made to play on it's own.
2. When making an AMAI strategy keep in mind that your strategy should have a special purpose and not be an all round strategy since AMAI will use many different strategies. An all round strategy is not good for AMAI since there is always another strategy that counters what the enemy got better than any allround strategy. Make a strategy that is good against for example air units and give it a high positive on anti air strength setting like 8 but at the same time the strategy is bad vs ground units and very bad vs ranged units with piercing attack so remember to give it negatives to anti normal strength like -3 and anti piercing strength like -5 so AMAI will know that this strategy is no good choise unless enemy really got lot of air units mostly.
When you created your own strategy you might want to share it on internet and download other strategies made by other players to bring your AMAI closer to perfection. Read on to the next section to find out how to do this.
1.5 Strategy exchanging.
You can use the strategy maneger to insert and extract strategies and profiles very simple and by that you can also upload and download strategies and profiles from the internet.
We can easily try this by extracting the test strategy we already made in the strategy section or extract any other strategy that's already in AMAI.
Start the strategy maneger and select the strategy you want to extract, then hit the extract button to the right.
Now you just have to give it a name and select where you want to save this strategy that will appear on the harddrive as a '.ais' file.
When done we can test the insert button by just click it and find the '.ais' file you just extracted and insert it in AMAI.
Since the strategy name is already there it will have a number added after it to prevent conflicts.
But now you probably don't want 2 identical strategies in your AMAI so just remove the new strategy again by selecting it and hit the remove button.
The same extract and insert methods can be used on profiles, only exception is that they will use the file format '.aip'.
You can find an online AMAI strategy database via AMAI's home page as soon as it is done where you can upload and download strategies and profiles for AMAI.
Part 2 - For campaign creators.
This section is for users who already got experience with Warcraft 3 modding and only want the specific information needed to make AMAI work with custom units and abilities.
2.1 Defining custom units and abilities for AMAI.
For this you need a table editor like Microsoft Excel or any other program capable of opening and saving tables file in form of tab separated text files.
To add simple new custom units just edit the table file "StandardUnits.txt". There is one of these files for each version of AMAI. You find it in TFT or RoC folder together with some other table files used for adding special units that got some kind of morph abillity like Gargoyle - > Statue -> Gargoyle or can be upgraded to another unit like Head hunter -> Berserker. The StandardUnits.txt is at least the main table for all buildings, units, abilities, upgrades and items in the game that AMAI knows of, once you open it you will understand.
To add a new unit here just insert an empty line in the category where it belongs and add all the info in the columns. All columns got labels explaining what to put in them at the first line of this file and you will also understand what to enter by looking at the existing units.
You might also want to replace a standard unit, do that by just entering new info in its line.
All units that appear by using an ability from another unit or morph or cannot be built directly should have the word "mutated" in the 'type' column so they don't appear as buildable in the editor. Such units also need to be added to some of the other tables depending on what kind of transformation they come from.
Upgraded units go in here too and are added to tc_add on the original units line.
If a unit has more needs or upgraded forms(tc_add) than fit here they need to be added to the table 'NeededExtra.txt' for extra needs or 'UnitEquivalence.txt' for extra upgraded forms.
Unit conversions like 'Archer + Hippo -> Hippo rider' go in the 'UnitConversions.txt' table.
All hero abilities are to be declared in the 'HeroAbilities.txt' table.
All heroes are also declared with a build priority for the specific race that can use them in the file 'Heroes.txt' in every race folder. All hero skills use orders also have to be declared there in the file 'HeroSkills.txt'.
Of course new units and upgrades will need new strategies that order them to be built.
2.2 Global settings. There are plenty of global settings and other global code in AMAI that can be found in all these files.
Firstly you can open up the file 'GlobalSettings.txt' to get a list of all settings that are not strategy, racial or profile specific.
All race specific settings can be found in every race folder in the file 'Settings.txt'.
Other global code or race specific code can be found in the different '.eai' files.
'Common.eai' in the root directory has all the global code for AMAI, it is the main program of AMAI basically.
The global race code can be found in the file 'races.eai' also found in the root.
New global settings in 2.20: all found in GlobalSettings.txt in the version folders.(ROC or TFT)
harass_radius_attack_ranged (800) How far from inferior enemy ranged attackers harassing units will react and attack back.
harass_radius_attack_melee (400) How far from inferior enemy melee attackers harassing units will react and attack back.
harass_radius_flee_ranged (1200) How far from superior enemy ranged units harassing units will turn and flee back.
harass_radius_flee_melee (800) How far from superior enemy melee units harassing units will turn and flee back.
chatting (true) Turning all chat for computers on/off.
full_threat_distance (600) Full threat level if the threat is closer to the threatened town than this.
no_threat_distance (3000) No threat if the threat is more far away than this from the thretened town.
distance_threat_exponent (0.8) How fast the threat level will increse as the enemy aproaches a thretened position.
distance_threat_mult (540) Basic value that neutralizes the threat value.
atl_time_start (300) The minimum level of threat computers react on starts to increse after this many seconds of game time.
atl_time_end (900) And reaches it's maximum after this many seconds of game time.
atl_time_start_val (10) It starts with this threat value.
atl_time_end_val (20) And ends with this value.
atl_enemy_start (1) Accepted threat level multiplier increases at thit amount of enemies.
atl_enemy_end (4) Until this amount of enemies.
atl_enemy_start_mult (1) Multiplier for accepted threat level starts with this.
atl_enemy_end_mult (1.5) And ends with this.
teleport_low_threat (70) If the threatened town is more than teleport_low_threat_distance away the computer is allowed to use TP to the threatened town if the threat is this low.
teleport_high_threat (120) If the threatened town is closer than teleport_high_threat_distance the computer is allowed to use TP to the threatened town if the threat is this high.
teleport_low_threat_distance (5000)
teleport_high_threat_distance (3000)
teleport_army_min_strength (20) Minimum strength of the army to teleport to the threatened town.
teleport_min_threat (70) Minimum threat level for allowed townportal use to get to the threatened town.
shredder_peon_count (9) Amount of lumber collecting workers a goblin shredder shall count as.
minimum_peon_wood (2000) Amount of lumber needed at least for computers to don't build lumber collecting workers.
maximum_peon_wood (200) Amount of lumber needed at most for computers to build maximum number of lumber collecting workers.
2.3 Making an AMAI translation.
As you probably noticed AMAI support several different languages already, if you know a language that is not yet supported you can easily make your own translation and make AMAI use it by following these instructions carefully.
With this you work in the language folder, there you see some folders for all currently supported languages.
Now when you are going to add a new language just create a new folder here and copy all files from the language folder you want to translate from to your folder.
After this you just open all the '.txt' files and translate all text in it with a few exceptions.
Commander.txt and Strategy.txt are table files and need to be opened in a table editor like Microsoft Excel (although a simple text editor will probably do the job too).
When translating these don't touch the first column since that is the link name that makes AMAI know what strategy/command it is that you are currently translating.
If you are adding a report for a new strategy you created just add the function name of your strategy in a new line at the buttom of this file and fill in the other columns for it with your translation.
The chat files only contain different kind of taunts or messages for different situations as you might notice. Don't translate them straight over, remove them instead and come up with own taunts that fit your language better.
The file CommanderStart.txt contains the text displayed at the start of games when played using the commander. here you can also add some credits to yourself for making this translation.
When you are done with all files all that remains is to add your language in the language table located in the file 'Languages.txt' in the root, then you are done, your language should be selectable the next time you try out this AMAI after compiling and reinstalling it to a map.
2.4 Making an advanced AMAI translation.
The new chat system allows you to improve your chat using conditions and variables in the chat strings. This is how it works.
Instructions for use of variables, conditions and translations in 'Translations.txt'.
Variables: Entered anywhere in chat text with [ ].
Example: "My [Color] [Race] army will beat you puny [PlayerColor] [PlayerRace] army easily."
Result for a pink orc talking to a green human as seen if you are the green human:
"My pink orc army will beat your puny green human army easily."
Race - The computers own race.
Color - The computer own color.
Name - The computers own name.
PlayerColor - The other players color. (If displayed to enemies all enemies will see theire own color where this variable is)
PlayerRace - The other players race. (If displayed to enemies all enemies will see theire own race where this variable is)
TargetColor - If a computer saying something while it's targeting another player(attack or megatarget) this is the targets color
TargetRace - If a computer saying something while it's targeting another player(attack or megatarget) this is the targets race
OwnGold - Computer displays it's own current gold.
OwnLumber - Computer displays it's own current lumber.
RandomRace - Will display name of a randomly picked race.
More examples:
"I heard that [RandomRace] is really bad in this patch."
"We better attack that [TargetColor] [TargetRace], he's almost dead now."
"Can you please give me some gold, I only have [OwnGold]."
"Hi, my name is [Name], GL & HF!"
Conditions: Entered before the chat string starts with { }.
One condition: "{condition}I will only show this text under this condition."
Many conditions: "{condition1,condition2,condition3}Only when all these 3 conditions are meet you will see this."
Examples:
"{Random<=50}This chat line only has half the chance of other lines to be displayed"
"{OwnGold>=500,OwnLumber>=500}This chat line is only displayed when the computer has over 500 gold and lumber"
"{FFA}This chat line is only displayed if the game is FFA"
1on1 - Is the game a 1on1?
FFA - Is the game a FFA?
Random - usage: {Random>='number between 0 and 100'} {Random>=30} = has 70% chanse to not be displayed if used.
OwnGold - usage: {OwnGold>='amount of gold the computer must have'} {OwnGold>=200} = must have 200 gold to be displayed.
other usage: {OwnGold<400} = must have less than 400 gold to be displayed.
OwnLumber - usage: {OwnLumber>='amount of lumber the computer must have'} {OwnLumber>=300} = must have 300 lumber to be displayed.
Race - usage: {Race=} the message is only used by a computer if it's that race.
other usage: {Race!=} the message is only used by a computer if it's not that race.
RaceChoiceRandom - usage: {!RaceChoiceRandom} This message will only display if the computer is not random race.
Other usage: {RaceChoiceRandom} This message will only be displayed if the computer is random race.
More examples:
"{Race!=UNDEAD}[Race:C] is much better than undead will ever be."
"{FFA,Race=HUMAN}Human is so damn good at FFA, I will beat you all with ease."
"{Race!=ORC,1on1}Orcs are really bad now a days, especialy at 1on1."
Different word forms:
Now there is a new table file in every language, 'Translations.txt' is a file where every variable word is tranlated to the
current langauge but not only that, it also contain every word in the different forms that might be needed in the chat.
Example:
"Im a orc, is there any other orcs in the game?"
If this is done only using the variable [Race] the line will be:
"Im a orc, is there any other orc in the game?"
The same error would occure for any race but the solution is in this table.
the table contain translations like this:
ORC orc
ORC:S orcs
HUMAN human
HUMAN:S humans
and so on...
Now the correct line to make it use "orcs" instead of "orc" at the second place in the chat string is formated like this:
"Im a [Race], is there any other [Race:S] in the game"
As you probably understand now the variable [Race:S] will look up the current race name in the list with ":S" after and
use that word instead of the word at the race name alone. It don't need to be ":S" you can enter any identification you want
in the table as long as you refere to the same in the chat string.
like having this in the table:
HUMAN human
HUMAN:S humans
HUMAN:ANYTHING the mighty humans
"[Race] is a good race, don't you all [Race:S] agree that all [Race:S] should be called [Race:ANYTHING]?"
Of course if you enter for example ORC:A and a translation in the table you have to enter
every race with :A and a translation since you never know what race the computer is playing when using your chat line.