AI help

dannyboydude

Ultra Cool Member
Reaction score
33
well i wanted to make a custom AI for my new melee map

but i dont know how to start to learn about programing it .

whats the basic of functions that the AI should do for a melee map , and i cant find any tuts on AI or how to start programing it .

if anyone knows anything about it , please could you help me to understand how to program it.
 
Well not many people know how to use the AI editor. I suggest using triggers instead anyway. With triggers, your AI will never ''freeze'' because of some unknown reasons.
 
1. What is the AI Editor?

Simply put, the AI Editor is a tool that allows the mapper to create a custom AI script that can be implemented with any combination of structures and units. You can import any number of structures and units for use in the AI Editor.


2. Why Would I Want to Use the AI Editor?

The primary use of the AI Editor is to create a custom race that a computer player will be able to control. The AI Editor eliminates the need for a huge collection of triggers that would be needed to drive a custom race that the computer knows nothing about.

3. How Does the AI Editor Work?

Or, in other words, how do I create a custom AI? Well, first, we'll take a look at the different tabs in the AI Editor and their different functions, then you should be able to create your own AI.

A. The General Tab

The General Tab contains things that are, well, general. This is where you will declare what race your AI will be, Human, Orc, Undead, Night Elf, or Custom. There are also several options for general operations of the AI that come with their own tooltip and are fairly self-explanatory, so I won't go into detail there. There is also a large window for conditions to be used with construction and attack. These conditions can be used with many different operations of the AI Editor, including building and attacking. To create a new condition, click the Add Condtion button at the bottom. You can then give your condition a name. Click on the Configure Condition button to specify what the condition will do. You can then set up a number of comparisons that the AI will check wherever you wish to use that condition. I will give an example of how to do that later on. Lastly, there is an option for importing custom units. Because the AI Editor is not tied in any way with the current map open in the editor, it is necessary to import any custom units you will need to create your AI. When you create a custom unit that you want to use in the AI, export its data. Do this by selecting the unit in the Object Editor, then going to File -> Export All Object Data. Save that in a folder somewhere. When you go to import it into the AI, click on the Import button, find the file that you just saved, and import it. It should be a .w3o file when you export it. It will now be stored in the AI so that you can use it in the coming menus.



B. The Heroes Tab

This tab is probably the easiest as far as the actual AI Editor goes. It simply tells the three heroes the computer can train and sets up the probability of the order of the heroes as well as the order of abilities that the heroes will learn. Once again, this section needs little explanation, so I will move on.



C. The Building Tab

This is where it gets confusing. The Building Tab is where you control all of the units that will be built by the computer. First, you should tell it what building will be the main hall-type building the computer will use. If you import a building with the classification of town hall, it will appear in this list. You also specify which worker unit will be used for gold and lumber. Then in the big panel on the left, you see five peasants and a hall building. In this panel, you will need to enter EVERY unit that the AI will train and construct. You don't have to worry about replacing units as the AI will do this automatically. Make sure to pay attention to the order in which you train units and construct buildings. You wouldn't want to tell the computer to build a priest before an Arcane Sanctum has been constructed, right? Here you also indicated when the computer should build another expansion town, as well as when the first, second, and third heroes will be built. Food will be kept track of as you add units to the panel, and if it turns red, you need to add another farm-type building somewhere before that last food-draining unit. It is easy to move these "priorities" up and down on the list, as well. An important part of this list is that you can attach a condition to every priority. So, if you want the computer to build its first expansion town only if more than 50 food is being used, you can add this using the General Tab. Click add condition on the General tab, configure it, then right-click on the priority on the Building Tab, and select Modify Condition, then add your condition from the list. The Harvest panel on the right is where you specify how many peasant units you want to work on gold and lumber at each town. Here, you can tell the computer to have 5 on gold at the starting town, 5 at the first expansion, 4 on lumber at the starting town, and 2 on lumber at the first expansion, or however you want to configure it. Just make sure that these units have been added in the panel on the left, otherwise the computer won't know where to get the workers! You can add conditions to these in the same manner as the other panel.



D. The Attacking Tab

The Attacking Tab allows you to configure when the computer AI will attack certain objectives, as well as how many and what types of creatures should be included. By default, there is only one group: the All Units group. This group should be used in large attacks, because it takes all the units. In the upper-right panel, add the units that will be included in the currently selected group from the upper-left panel, as well as how many of each type will be included. You can add more "waves" as you wish, to give the computer more dynamic attacks. The biggest portion of this tab, however, is the bottom-right panel. This indicates which objectives the computer will attack and the conditions that need to be met before each attack is launched. But be careful: if you tell the computer to wait for a Enemy - Major Assault until the food used is over 80, but in the Building tab, the food only goes to 75, the attack will never be launched, because the computer will never build above 75 food. Now, remember how I said that you configure the conditions in the General Tab? Well, here's a practical explanation. Say you want your army to launch a Major Assault, but only if you have at least 5 footman. Then, you would create your condition in the General Tab by going to Integer Comparison, then to Total Units of Type - Completed Only. Then, make it greater than or equal to 5. Click OK, and it should show up in the window. To apply the condition, right-click on the Major Assault in the Attacking Tab, and select Modify Condition. Your condition that you just created should appear in the drop-down menu where it says None. Select it, and your condition is ready to go. The other different targets in the Attacking Tab are pretty self-explanatory.



E. The Test Configuration Tab

There really isn't a whole lot to be said here. In this tab, you can set the different properties for doing a simple test of the AI. I believe, however; that this will only work with the four main races.


F. Importing

This is the last thing you need to do. When you finish your AI, save it, then go to the map where you want to implement it. Use the import manager to import the AI that you just saved. Then use a trigger to tell the computer where to run the AI.​
 
well I followed that tutorial and still my AI isn't working so I guess its of no help....
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top