- Joined
- Jul 27, 2008
- Messages
- 14,361
AI Editor
Introduction:
AI Editor is simple way to create AI for existing or custom race other then use of JASS. AI editor is used for making "Melee Maps or Campaigns", for other type of maps (AoS, TD...) you should use triggers. This tutorial will teach you the basics and hopefully you will be able to make our very own AIs. It is recommended you have at least basic knowledge with triggers.
General Tab
This is where we begin. First thing you will probably do is set AI name and AI race. If you are making AI for custom race, allays remember to set race to be custom.
-Options-
This is quite simple. You will check certain options for AI that will effect it in game. It is already explained in AI Editor but just in case:
*Set Player Name - This option enables use AI name as the AI players name.
*Melee - To use Melee AI for standard games. Melee AI tend to attack and defend more closely to with allied player.
*Defend Users - AI will try to defend attacked user-controlled players.
*Random Paths - AI will tend to use paths more randomly.
*Attack Heroes - AI will place higher priority on attacking enemy heroes.
*Repair Structures - Workers will automatically repair structures.
*Heroes Flee - Heroes will leave the battle if they are seriously damaged or incapable of attacking.
*Units Flee - Units will leave the battle if they are seriously damaged or incapable of attacking.
*Group Flee - AI will try to avoid battles where he is at disadvantage and will run from the battles where he is loosing.
*Have No Mercy - AI will attack when his enemy is at disadvantage or if it is injured. The target corresponds to Enemy-Major Assault (more about this down)
*Ignore Injured - When preparing attack force AI will not use units with health bellow of 50%
*Remove Injured - AI will send injured units back to base or Fountain of Healing.
*Pick Up Items - Heroes will pick up items they find.
*Buy Items - Will buy useful items from any shop they encounter.
*Slow Harvesting - AI will gather only 1 gold and wood. instead of workers capability. This gives AI serious disadvantage.
*Allow Home Changes - AI will be able to chose new locations as Main Base where he will gather attack force and send injured units.
*Smart Artillery - Artillery units will tend to come in front of the attack force and will siege the enemy base if possible.
*Melee - To use Melee AI for standard games. Melee AI tend to attack and defend more closely to with allied player.
*Defend Users - AI will try to defend attacked user-controlled players.
*Random Paths - AI will tend to use paths more randomly.
*Attack Heroes - AI will place higher priority on attacking enemy heroes.
*Repair Structures - Workers will automatically repair structures.
*Heroes Flee - Heroes will leave the battle if they are seriously damaged or incapable of attacking.
*Units Flee - Units will leave the battle if they are seriously damaged or incapable of attacking.
*Group Flee - AI will try to avoid battles where he is at disadvantage and will run from the battles where he is loosing.
*Have No Mercy - AI will attack when his enemy is at disadvantage or if it is injured. The target corresponds to Enemy-Major Assault (more about this down)
*Ignore Injured - When preparing attack force AI will not use units with health bellow of 50%
*Remove Injured - AI will send injured units back to base or Fountain of Healing.
*Pick Up Items - Heroes will pick up items they find.
*Buy Items - Will buy useful items from any shop they encounter.
*Slow Harvesting - AI will gather only 1 gold and wood. instead of workers capability. This gives AI serious disadvantage.
*Allow Home Changes - AI will be able to chose new locations as Main Base where he will gather attack force and send injured units.
*Smart Artillery - Artillery units will tend to come in front of the attack force and will siege the enemy base if possible.
-Conditions-
But what is more important is window for conditions, they are almost same as the regular editor triggers. Condition you make here will be used latter for unit creation and attacks. Here you'll be able for example to make simple condition like "If number of footmen equal to 5" which you will then use in latter tabs. Conditions are extremely important for your AI.
-Custom Data-
Another important thing here is Custom Data import. Because AI editor is not connected to the map in World Editor you'll first have to extract data of your race from object editor. Go to object editor-file-extract all custom data..." and then simply import them. Its important if you are making a custom race.
Hero Tab
In a Hero Tab you will be telling AI what to do with Heroes.
-Heroes Used-
Here you'll set which heroes will be used. You can use any of the already existing heroes and custom heroes but you can chose only 3.
-Training Order-
Here you will set in which order heroes will be used. You can make 6 variation of order which AI will use depending of chance % you set.
-Skill Selection-
Here you will make order by which abilities will be learned for each hero. For each hero there are 3 lists depending when he was made ("as first Hero, as second Hero and as third Hero). You can make all 3 list same which means no mater when hero was made he will use same list.
NOTE:
-If you are using custom hero remember to add them in Advanced-Gameplay Content).
-Be sure AI can make Heroes.
-Go to link below to see which spells are usable by AI.
Building Tab
This probably most important tab. Here you'll say to AI each unit that he is going to train and and arrange his economy priorities.
-Building priority-
On this window you'll arrange the "what to do list" for AI. You can also specify in which base to build it. Also you'll here specify Town Hall that is going to be used for race (If it is custom remember to go to Advanced-Gameplay Content) and which mine building will use (like Undead or Night Elves do). AI will build from top to bottom so it is most important to make sure:
1)That units won't go over the food limit. If you go over the current food supply the order will be changed to red color. If this happens simply add food producing building above the red order.
2)That AI is capable of making the unit. You must make sure that the building that produces the unit is made, if upgraded is first needed it must be researched. All requirements must come "before" the unit or it will confuse AI and cause lag. Also be make sure that unit can be made in the building.
When making the list it is wise to use conditions in General Tab or if it is for only one unit you can modify custom condition by right clicking on unit and choosing "custom" condition. It is best to use conditions as much as possible because it will avoid bugs and units with conditions will be "skipped" so you can for example when AI reaches Third Tier order him to stop making footmen and switch to knights. The Conditions are important thing if you want to give your AI more intelligent behavior. Without conditions you are basically giving AI a predictable list which can be exploited.
-Harvest Priorities-
Here you say to AI how many workers will be used on gold or wood. You'll also be have to specified which worker will be used. You can have up to two workers, one for Gold and one for Lumber.
NOTE:
-Be sure AI can make units.
Attack Tab
Here you'll make attacks that AI will use. In Attack Group window you'll speechify which units will be used in attack. On the right side just add desired units and number of them that will be used for attack.
In Attack Waves you'll make list of which attack groups will be used and how often.
And last in Target Priorities you'll say which targets (Main Base, creep Camps...) will AI attack and when. Once again here is advices to use conditions from General Tab because you don't want AI to attack with 1 hero and 2 units medium creep camp. You can order for example AI to wait until he reaches 50 food before he attacks. Just don't forget that bad conditions may result for AI to never attack.
Test Configuration
Here you'll be testing your race against opponents but this only works for melee races.
In Action
When building a base, you have to make sure the AI has enough room to place it's buildings. In the WE, this is a radius of about 4 squares (the large golden ones). It'll freeze if it can't place them all.
--------------------------------------------------------------------------
Tutoraials also to see:
http://www.hiveworkshop.com/forums/...-cast-melee-game-ai-units-193280/#post1890195
by Boris_Spider.
Hope this explains the basics and if you have any advice or complaint please tell me. Here is a example of AI View attachment AI(Sea L).w3x. To play with AI set computer player-random-60%.
Last edited: