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.
 

Lightstalker

New Member
Reaction score
55
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.
 

Vitriolic

New Member
Reaction score
0
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.​
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top