PDA

View Full Version : AI code maker



kazejudger
07-07-2011, 03:37 PM
Hi guys, i just sniffing around and i'm see that some ppl are making AI, well i helped to make the DotA AI from 6.68 to 6.60 i got to get out of AI team because of some personal problems. Well i wanna learn all i can about how to make a nearly perfect AI, i help some mates to make a forest of caldavar AI (i picked the original code and made a lot upgrades and made a few new heroes (about 10 heroes) AIs) and i can say the AI is little buggy, but the myrmidon AI is a real cheatter XD. I can't share the AI because he's not perfect for a release he's in the alpha test. Well if u guys need a AI codder i can help make the AI.

I have a little problem with the AI gain item over time (because the AI just don'y buy items at all, so i needed to make them gain some buffs instead the items, but in the middle-late game the players have goods items and the AI have almost nothing), i've tryied to use some variables and parameters that the UI mods uses, but i just can't make them work for the AI, with some have some experience with using a timer parameter please send me a PM with a little code and i need to know how i can use the "if" parameter.

The problem for me is i'm in the woods now (visiting my parents), so i can't acces the internet every day, but i will be the more active that i can.

Thanks for your time and sorry for my bad english,
KazeJudger.

Oloko
07-07-2011, 04:16 PM
That's an interesting project for sure, I hope you can share the scripts soon.

I don't really understand what exactly you are asking.
Do you want to know how to use "<condition>" or are you talking about UI scripts?
Are you also talking about the timer event you use inside entities scripts or something else? If you want to know how to use a timer, you can look at some hero scripts like Zephyr's tornadoes.

If you only want a constant increase on your buff, you can use a state with an impactinterval that will add charges to itself.

kazejudger
07-07-2011, 04:28 PM
i just wanna to know how i can make the AI gain the items using a time condition. Ex: when the match time reaches 5 min the AI gains the item fortified bracer and when the time reaches 10min the AI gain the item Strider.

the other one is i've been seen some UI codes and in one of them i see a rune spawn clock and there was a ontrigger="if(param, SetText(...));". This if code i didn't understand so well.

I will se the zephyr code to see if i can use the code there.

I need to go to my parents home so i think i can only see the post tomorrow.

Thanks for your time and sorry for my bad english,
KazeJudger.

Oloko
07-07-2011, 05:16 PM
In that case you probably don't need to use UI mods.
If you want to have some sort of "buying" template for the bots, you could use a state for this, but if you want to have a specific script for each hero, you could simply put the "timer" on each of them.

So for example, on the <onspawn> event of your hero entity, you give the basic items and then you use the <starttimer a="120000" /> action to trigger the timer after the number of MS you want (here its 120sec).
So now in your <ontimer> event of your hero, you can give items and use another <starttimer a="180000" /> action to give more items later.
You could use a modifier or something like that to keep track of what item you need to give.


<ontimer>
<hasmodifier name="ItemSet_1">
// Give item set #1, start timer and set the new modifier
</hasmodifier>
<else>
<hasmodifier name="ItemSet_2">
// Give item set #2, start timer and set the new modifier
</hasmodifier>
<else>
...
</else>
</else>
</ontimer>
There might be a better way to do this, but I think this should at least help you out a bit.

kazejudger
07-07-2011, 07:33 PM
I will ask for the original AI maker to post a piece of the code here (because i've picked the original AI on the half way the AI only attack when he was attacked, so i've been improve to make him attacking by his own using the target health conditions).

The AIs made until now are:
Andromeda
Arachna
Corrupted Disciple
Flint Bestwood
Deadwood
Defiler
Blacksmith
Myrmidon
Jereziah
Magmus
Pandamonium
Pyromancer
Pebles
Witch Slayer
Torturer
Scout

but they just attack mid XD, that's another problem we are trying to solve.

I'm awake during 3 days on sequence making this AI, i'm working hard together with my AI team developer.

I need help with a unit indentifier, most exactly a hero identifier to make the AI attack or retreat counting the number of the enemies.

Thanks for posting the timer i will try this code today and try to make the AI change lanes during the game.

Thanks for your time and help, sorry for my bad english,
KazeJudger.

Edit: The ppl who will try to add me in the game please don't do that because my acc is shared with a friend of mine so it was not me, i gived up from HoN (because i don't play HoN so well as i play DotA).

Edit2: For everyone who want an AI maker can send me a PM (MP, personal message, whatever) and i will answer as soon as i can.

Edit3: After the AI is perfectly done i will sent the AI map to the HoN developer to make them add the map to the game (that's my wish, but i don't know what HoN Developers have in mind). The AI are one of the points who make me play league of legends and dota, because i can play with the bots until i'm "pro" in the game or at last until i feel the gameplay.

Oloko
07-08-2011, 10:37 AM
If you want to count the number of "entities" around your entity, you can use the <testnearby /> action. You can find some usage of the action in some NPC's <onthink> event. It's mainly used to test if they should cast their spells or not.

You might want to actually do more test on the units around, rather than only counting the number. Cause the bot would run away if he spotted 3guys with 1hp, 1mana, stunned, perplexed, etc. So what you can do is use an <areaofeffect> action to be able to get some info on the units around.

kazejudger
07-11-2011, 05:35 PM
I made the AI gain items over time through a Gadget, i made the first item set spawn together with the AI, but the problem is i'm using aura to make the AI receive the buffs from the items.

I will send you the AI through a PM because i don't wanna this be a open project right now (when the AI is perfect we will open the code for everyone).

The AI is much terrible because i'm working first on the AI gain item over time (80 hours on sequence until i found the solution). The next step is to make the AI indentifies when he's in disvantage (on hero count) and when there's no allied creeps to make him retreat. I will work in this two toninght.

The problem is, the only two targetscheme from aura that work is: ally_hero and my_hero, but with my_hero the AI gain the aura stacks =/. We're trying to make a targetscheme that make the AI heroes individual.

I don't reply before because i'm in my parents house (my girlfriend wanna meet them, so as good boyfriend i made his "dream" become reality XD), so can't come every day to my friends house to use the internet (last week i come here 2 times and she:"why u make me come here with you're not with us?"), so i can come here just 1 time per week (and my friends house is about 2 hours from my parents home, they live in the woods).

Thanks for your time and help,
KazeJudger.

Oloko
07-12-2011, 10:53 AM
I wouldn't recommend using a lot of state on the same entity, since there is a maximum number of states an entity can have (I don't remember the number).
Rather than using auras and multiple states, I would probably spawn a gadget like you did but I would set my the hero as the proxy:

<spawnunit name="Gadget_AIAndromeda_ItemSet1" proxy="this_entity" />

So now the gadget knows which hero it should give item/buff to. Maybe it would also be better to give real items to the bots using the <giveitem ... /> action rather than giving them buffs. If you really want to use buffs, then I would suggest you to at least only use one per hero. You can probably use states levels to do this:


<onexpired>
<applystate name="State_Andro_Buff" continuous="true" statelevel="1" />
</onexpired>So by changing the "statelevel" attribute to the level you want, you can use the same state by changing a bit of the state:


<state
name="State_Andro_Buff"

deathpersist="true"

strength="18"
agility="9"
intelligence="9"

movespeed="0,70"
damage="0,24"
>

</state>This way the sate will give the right bonus at each level of the state. Make sure that states applied that way will persist through death using deathpersist="true".
I still think that giving out real items would be better and probably easier.

I would also recommend you to read the full list of commands to get to know HoN scripting a bit more. Some part of your script could have been done easier if you searched a bit.
For example, if you want your Hero to go back to its well. You can use the existing targetscheme for it: <targetscheme name="ally_well" allow="Well" restrict="!ally"/>. With that target scheme, you only need to use the <pushentitysearch ... /> action to get your entity on the entity stack, without the need of spawning a gadget specially for it, since you will still need a global affector to get it.

I have no intention of going through your whole script, but if you need help on some specific part of your script, I would recommend to keep posting here. The thing is that if people can't look at what you are talking about, they can't really help you. So I would suggest you to at least post some part of you script when asking for help, so that people can see what you are trying to do and how exactly you are doing it.

kazejudger
07-16-2011, 09:28 PM
i just say to not use the AI until there's near perfect. i will try the everything you said, but there's the net problem, so maybe it's a little bit hard to help people and get helped.
I need a help with the AI to indentify the "ally_creeps" because i tried this targetscheme to make the AI retreat when there's no allied creeps, but the AI don't identify them. I need a help with that targetscheme.

Thanks for all the help, the time you spent and sorry for my bad english,
KazeJudger.

Edit: I've tried to make the AI gain item through the giveitem, but they just don't gain the item and i don't know why. The comand list you said about is the map editor guide? I have them but there's some comands i don't get it how to use and when i try to use them , they just don't work and i don't know why (no internet connection to make the research is a ****).

Edit2: There's some way to AI identify the towers as target or targetschemes? like first tower from top is tower_top_1 and first mid tower is tower_mid_1 and so on.

Angstfisher
07-17-2011, 02:07 PM
If I may. I think that you could identify the towers by their entity, as I saw in pharaohs wall of mummies.


<ondamaged>
<changedamage b="1" op="min"/>
<entitytype type="Hero_Mumra">
<changedamage b="3" op="max"/>
</entitytype>
</ondamaged>
If you could use this <entitytype type=""/> to figure out if a tower of type 1,2,3 or 4 ( as you know the outer tower does least damage and gradually the towers gain more damage and armor, so its safe to assume they're probably different entitites. ). It might work.
Also you might be able to identify towers (atleast buildings.) by something I found in pyro's Fervor


<onattackimpact propagatetoillusions="false">
<cantarget targetscheme="enemy_units">
<applystate name="State_Pyromancer_Ability3_Burning" duration="3000" />
</cantarget>
<cantarget targetscheme="enemy_buildings">
<applystate name="State_Pyromancer_Ability3_Burning_Building" duration="3000" />
</cantarget>
</onattackimpact>
Here the targetscheme enemy_buildings , so its probably safe to assume there is also ally_buildings as a targetsheme no?

Also I don't think ally_creep will work (personally I havent seen such a targetscheme.), so you should stick to ally_units (or whatever it is) and perhaps use <entitytype type=""/> for warlocks/archer and imp/treant.

Could you like I just did use the forum's tags for code and post a part that you have problems with. That would make it easier for people to help you on the spot, rather than downloading all of your code and try finding the part you're having problems with. Oloko also pointed this out. but It would certainly make it easier to help you for alot of people.

Oloko
07-18-2011, 07:04 AM
The targetscheme "ally_creeps" should work. It's in the list of all targetschemes and it's used in Plague Rider's 3rd spell.
So what you can do is:

<testnearby radius="500" targetscheme="ally_creeps" origin="this_entity" />
<compare a="result" b="0" op="eq">
<!-- code to back -->
</compare>

The <giveitem ... /> action is used in the tutorial. You can use it that way:

<giveitem target="this_entity" name="Item_Lifetube" />

As for the tower, this depend on how flexible you want your bot to be. I think the best approach for now is to make your bot only work on Caldavar.
The reason I say this is that tower are given names because they are used in nodes. You can look it up in the entitylist file: "lane1_goodtower3", "lane2_goodtower3", "base_goodtower1", etc. This mean you can directly access any tower by doing:

<setent0 name="base_goodtower1" />
So you will be able to target it now:

<useability source="this_entity" slot="0" target="ent0" force="true" block="true" />

But like I said, this mean your bots won't work in other map, since they can have any name in other maps.
I also know that towers have different level, so you can also use this in your scripts, but this wouldn't help you much to find a particular tower.

If you want a targetscheme only for towers, you will need to create your own. There is already some targetscheme that will detect tower, but it will also detect other things too. You can also test if a specific target is a tower with the unit type, like if you receive damage and want to back your bot if the damage he received was from a tower (Armadon's 3rd skill use it):
<targettype type="Tower">
<!-- script against tower -->
</targettype>
<else>
<!-- it's not a tower -->
</else>

kazejudger
07-27-2011, 08:23 PM
I tried almost everything, but i don't know the bots just don't recongnize the hellbourne creeps as allied (maybe is because the AI is spawned through console). There's some way to make the AI as players? (like they are players in lobby and choose the color (but the AI color will be selected by default, like they're players that are forced to choose that color, not spawned in the game)).

Thanks for all the help i'm going to my house tomorrow so i will be much more active.

Thanks for all the help and comprehension,
KazeJudger.

Oloko
07-27-2011, 09:53 PM
You can add a fake player using the "addFakePlayer team slot" command in the console.
ex:
"addFakePlayer 2 1" will add a fake player for pink.

Make sure to never put two fake player on the same slot, otherwise it will create issues. One thing with this is that the fake player will not "pick" a hero.

Z3ROCOOL22
07-28-2011, 10:01 AM
Oh i wish you can finish the AI, i love to have the option for play VS AI in HON like do in DOTA/LOL/ROTT.
(http://honlan.freeforums.org/artificial-intelligence-t531.html)

kazejudger
08-01-2011, 12:17 PM
i'm working very very hard to make a decent AI, at the moment we're having problem in making the AI change line, the next step is to make the AI can be spawned as Legion too, so not only the Hellbourne have AI.

Thanks for your time and comprehension,
KazeJudger.

Edit: at the moment this two things are our priority, because the "aura items" are "good" at the moment, we're trying to make this AI much more better than DotA (better than LoL it's a little bit hard).

Tafelpoot
08-01-2011, 12:30 PM
why don't you use <giveitem/> ? makes more sense no?

kazejudger
08-01-2011, 05:23 PM
i wanna some moderator or administrator exclude this topic i don't want this anymore because my team gived up, so i'm ask to a moderator to exclude this topic because now HoN is free to play so you just can create an free account and train against real players.

Tafelpoot
08-02-2011, 05:09 AM
Actually a lot of people would like to play vs AI when they want to try a hero for the first time. I couldn't test your map because it bugged my UI, but it sounded like you were getting really close. So don't give up please !

Also, this map can be played on practice server so when HoN gets DDOSed or your internet is broken, you can play this map.

Z3ROCOOL22
08-02-2011, 07:54 AM
Give up? really? Come man a lot of ppl wanna have the option for play Vs AI, don't give up man!

I send you a PM that can interest you.

k0reaNo
08-05-2011, 09:42 AM
gL....

kazejudger
08-05-2011, 11:00 AM
I will not give up annymore. I think with myself "They don't want to help anymore, good for me because i will put only my name in this AI" XD

I'm working very hard to make this AI, but i don't know how some guys have the skill to "burn" a motherboard (yes one of my friends done that and yes i'm very very anger), so until i or he bought a new one i have only this **** notebook to work and yes this **** don't support HoN.

So i will be codding and after that i will be testing.

Thanks for all your help and support,
KazeJudger.

PS: I will post a reply every time the AI had a big change such: "change lanes" or "killing kongor". The reason i don't like DotA\LoL AIs is because the just don't kill Roshan or Dragon\Baron. I will make this AI with various levels of difficult, from the most easy to the "chosen koren robot one" (sorry i just can't resist to say that XD). This end of week i will work in change lanes and ganking in and from the forest and AI search for runes every 5 minutes. That's all for now =D.

BlayZin
08-10-2011, 04:52 AM
I would like to see some Action with AIs :)
Pls don't give up. The community looking up to you.

AI's Missin' in HoN thats one thing LoL's better with.

Z3ROCOOL22
08-19-2011, 01:26 AM
BUMP! Any news?

kazejudger
09-04-2011, 08:56 AM
Yes there's great news:

Now the AI can be of legion or hellbourne team, they now attack differents lanes and trying to make the AI kill kongor.

But there's a problem all AI hero model is now a teapot XD i know why this is caused but i need a little bit of tests to make sure that i can make the AI return to the original model without need to be copy-paste models to them folder.

That's all for now.

Thanks for your time and comprehension,
KazeJudger.

Z3ROCOOL22
09-04-2011, 08:38 PM
Yes there's great news:

Now the AI can be of legion or hellbourne team, they now attack differents lanes and trying to make the AI kill kongor.

But there's a problem all AI hero model is now a teapot XD i know why this is caused but i need a little bit of tests to make sure that i can make the AI return to the original model without need to be copy-paste models to them folder.

That's all for now.

Thanks for your time and comprehension,
KazeJudger.

Yeah i m happy to hear that! keep on the GJ.

HowHigh2
10-18-2011, 10:02 PM
epic. im following this threads :3

embrance
10-19-2011, 08:40 PM
we need to know morezzzz!I was thinking of modding some stuff,but I want to include some basic AI in the maps.