AI - The Editor

Discussion in 'Tutorial Repository' started by Ghan, Mar 25, 2007.

  1. Ghan

    Ghan Administrator - Servers are fun Staff Member

    Ratings:
    +773 / 0 / -0
    Ok, I added a more in-depth explanation on how to create conditions.
     
  2. LGM

    LGM Guest

    Ratings:
    +0 / 0 / -0


    I'm a little confused. Select the unit and then it magicaly appears in the import manager? Could that be explaned a little better.

    please?​
     
  3. Ghan

    Ghan Administrator - Servers are fun Staff Member

    Ratings:
    +773 / 0 / -0
    Certainly. What you need to do is:

    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, if that helps.

    I think I'm going to revise that explanation....
     
  4. LGM

    LGM Guest

    Ratings:
    +0 / 0 / -0
    Thanks +rep

    EDIT: I would give you +rep, but it says I need to spread some around first...


    EDIT2: READ THIS
    I have a mac and it changes some things in the editor. If I go to file, Export All ... is not an option. I then went to configure controls. I turned it on, but it still isn't there. I tryed to give the hotkey command A. That just selects all units. Even though I turned that one off too.
     
  5. Ghan

    Ghan Administrator - Servers are fun Staff Member

    Ratings:
    +773 / 0 / -0
    Unfortunately, I know next to nothing about Macs. I have no idea what would make it work.
     
  6. Ghan

    Ghan Administrator - Servers are fun Staff Member

    Ratings:
    +773 / 0 / -0
    So? I've added some updates. Anything else to be said? My tutorial feels so lost and alone.... :p
     
  7. Sim

    Sim Forum Administrator Staff Member

    Ratings:
    +531 / 0 / -0
    Approved.
     
  8. Xwarhawk87X

    Xwarhawk87X Guest

    Ratings:
    +0 / 0 / -0
    what is an AI anyway?
     
  9. Ghan

    Ghan Administrator - Servers are fun Staff Member

    Ratings:
    +773 / 0 / -0
    AI - Artificial Intelligence

    Typically, a computer program designed to perform a task in a similar way that a human would, though with the obvious technical difficulties of trying to teach a computer to "think."
     
    • Like Like x 1
  10. Builder Bob

    Builder Bob Live free or don't

    Ratings:
    +249 / 0 / -0
    First let me thank you for writing such an easy to read explanation on how the basics on the AI editor works.

    However, I can't get it to work properly. In my map, lumber is more important than gold, so I want peasants to start gathering lumber first.

    In the AI editor I have set harvest priorities to
    8 workers on lumber, then 3 workers on gold.

    I have then imported the AI script to my map, and initialized it with a trigger like you wrote.

    Unfortunately the starting peasants go for gold first no matter what I do. I have tried to turn off all triggers that initializes any AI scripts and they still go for gold.

    Under the Building tab in the AI editor there are some drop down menus that are grayed out for me. Base building, Mine building, Gold worker and Lumber worker. I am thinking that maybe they are refering to default units, and as I am using custom units it will maybe not work as I intend. Do you know how to edit those?

    Hope you can help me out.

    Edit:

    I have a custom building classified as a town hall, and I have a custom peasant classified as a worker, but neither show up in the list. What can be the reason for it?
     
  11. AceHart

    AceHart Your Friendly Neighborhood Admin

    Ratings:
    +1,489 / 0 / -0
    The AI editor needs to know about it.

    The simplest way to get that is to use "file / add to map" from the AI editor.
    After that, it will know about your custom units.

    The alternative is to export your object date, and import it into the AI editor.
    Though you need to redo that for every change... not really recommended.
     
  12. Builder Bob

    Builder Bob Live free or don't

    Ratings:
    +249 / 0 / -0
    I had already imported all the object data to the AI editor and could set them in the priority list of what to build when. However, it seems that since I kept the race as human in the general tab, I couldn't change the Base building and workers in the building tab.

    When I changed the race to custom, I could define Base building and workers. Now I'm going to set up the building AI again and hope it works.

    Edit: By changing the race to custom and setting the base building and workers to custom units, nothing changed. They still went for the gold mine first. However, by deleting the gold mine from their base, I could make them start gathering lumber and play the AI exactly as I had written in the AI editor.

    I guess I should make my own thread about my problem, but if you have any ideas of how to make the workers go for lumber before gold, I'd appreciate it.

    Edit2: I have figured out the source of my problem. It's one of my triggers that causes peasants to gather around the gold mine.

    The easiest way to explain it is that I'm trying to make a similar system of that in starcraft, where every race build their own structure on top of the mine before they start gathering. Therefor I made a trigger that changed any order except build orders targeting the mine into move orders. For some reason the peasants are being ordered to use the mine (maybe it's something the computer does at map initialization to see if they have a mine nearby?) before they head for the lumber and consequently gets stuck in a move order targeting the mine. When I deactivate the trigger they always get lumber first as the AI script says.

    I must try to solve the problem some other way now.
     
  13. aChiLLeS

    aChiLLeS Guest

    Ratings:
    +0 / 0 / -0
    Once I modify the objects... (Let's say i want to create IA that would control Blood Elves) - human buildings, the way that they would produce blood elf units and use different upgrades... I just export the object settings in general, right? So that I can use them in AI editor later on?

    One more thing, is it possible to modify the race icon, that appears at the score screen after the game? There are four standard icons available, but in the campaign there were special icons for Naga or Blood Elf... Is it somehow connected with AI editor? I didn't notice such an option in any of the triggers.

    Finally, can I make the AI sort of "ignore" certain units? Normally it will probably gather all the units round the town hall... but let's say I would like to place several of his units in different places on the map - is it possible for the AI to ignore them? And is it possible to specify regions in which AI will constantly rebuild destroyed towers for instance?

    Hope to get some answers.
    Regards ;p
     
  14. Ghan

    Ghan Administrator - Servers are fun Staff Member

    Ratings:
    +773 / 0 / -0
    > I just export the object settings in general, right?

    You probably want to import the settings into the AI Editor.

    > is it possible to modify the race icon

    You could probably replace the icon for a certain race, but I don't think you could add one.
    The replacement would probably be done in Advanced -> Game Interface.

    > Finally, can I make the AI sort of "ignore" certain units?

    I don't think so, though you could use a "dummy" player that's allied to the computer.
     
  15. aChiLLeS

    aChiLLeS Guest

    Ratings:
    +0 / 0 / -0
    Ok, with the icons it really works. For ignoring units, there are some commands among the triggers.

    But I have another concern. What if I want to put custom buildings, let's say give the AI-controlled-player a semi-developed base at the very beginning? How am I supposed to modify the priorities of building units by AI? I made one attempt... putting a "condition" to every structure / unit which was about to be trained/built, but was already at the map (it was like "build barracks" condition: "if the number of BARRACKS units is equal 0"). But it turned out that AI didn't build anything. It just trained several Grunts (it was about to control Fel Orcs), peons... made a level one melee weapon upgrade and that's it. While it was about to create a well developed base and an expantion, plus - it should train quite a lot of units. My question is: if I put a building order with no condition, and such a building already exists on the map... will it be ignored and built again? Or will it be ignored in a way, that AI will simply skip the action of building it?
    I don't know if I made myself clear :) That's why I would be grateful if you just simply explain to me, how should I edit the priorities of building units for the AI when it starts with custom units/buildings on the map.

    Oh... and there's one more thing. How does the process of rebuilding the lost buildings and re-training the lost units of the AI-controlled-player look like? Will it simply try to reach the aim of the final point in the priority of building units, from building tab? Let's say a Watch Tower is destroyed... And the AI had a command at some point to build two watch towers - so will it autmatically rebuild it? And about the units... Will it train the units so that it would have all of those which where mentioned in the building tab? I suppose yes, but it would be nice if you could also say something more about it.

    Cheers ;]
     
  16. AceHart

    AceHart Your Friendly Neighborhood Admin

    Ratings:
    +1,489 / 0 / -0
    > AI will simply skip the action of building it?

    It should yes.

    AI scripts run repeatedly over and over... and, well, if some unit or structure already exists, it simply passes on to the next (if possible).
     
  17. aChiLLeS

    aChiLLeS Guest

    Ratings:
    +0 / 0 / -0
    Ok I'll try to simply add priorities with no conditions... If it won't skip I'll write again :].

    But today I came up with a nother problem :)

    What should I do if I want to put an AI player on an island... so that he would have to buy transport ships in a shipyard to reach an enemy base? Or let's say similarily that AI player would have to buy air transport from goblin's to reach the enemy? Do I put a transport ship or sth to the priorities of his build-up and the AI will simply guide his hero to the nearest shipyard to get it? The same question goes, what if I want the AI to purchase battle ships? Note, that I didn't yet try to use transport/ships... maybe it's as easy as it seems, just to put them into building tab ;p but i'd rather ask.

    And what about rebuilding the structures? What about the pre-placed custom buildings? Once they're damaged, will the AI rebuild them in the same location that they were earlier? Or will it choose it at random?
     
  18. AceHart

    AceHart Your Friendly Neighborhood Admin

    Ratings:
    +1,489 / 0 / -0
    The rebuilding part should work.
    Placement though... that's more like "Oh, here's a nice spot" :p

    Battleships work like normal units.

    Transport ships don't work.
    You can instruct your AI to build them, and it will do so, but it won't use them.

    Zeppelins work.
    There's a target priority for buying them, but you can also train them (recommended).
     
  19. aChiLLeS

    aChiLLeS Guest

    Ratings:
    +0 / 0 / -0
    Train them, you mean add to the building tab? It will trigger the player to go to the nearest goblin laboratory and recruit a zeppelin, if I understand correctly?

    Anyway thanks a lot, I'm going to check all of this soon : ]
     
  20. AceHart

    AceHart Your Friendly Neighborhood Admin

    Ratings:
    +1,489 / 0 / -0
    There's two ways(*) to get Zeppelins.

    The ususal "melee" way: there's some shop on the map, you walk up to it, clean up the usual Creeps and buy one.
    That's done with the target priority "go and buy a Zeppelin" (actual wording may differ).

    The unusual "costum" way: you add the Zeppelin as unit to some Barracks, and build it... same as Footmen or so.


    (*) actually, there's three:

    The "Underestimated Smart AI" way: if the comp looks like it needs one, some trigger with "Unit - Create"... :p
     

Share This Page