Hero AI contest 2013

Accname

2D-Graphics enthusiast
Welcome to the
Hero AI Contest
2013
This contest is about coding a custom AI for a standard melee hero from WC3 TFT.
You can use GUI triggers or jass code, it doesnt matter, as long as, in the end, you present us a good AI which is capable of fighting a 1 vs 1 arena battle against the competition.

Last update: 10.04.
Check the changelog below for more information!

The rules:
  1. Maximum of 3 submissions per forum member! No member may send in 2 AI's which use the same hero though.
  2. Only the heroes from the WC3 TFT standard melee game may be used.
  3. No object editor data may be changed by any participant.
  4. The code of a participant may not use any forbidden trigger functions. Which kind of functions are forbidden and which are not will be explained in more detail later in this thread.
  5. The template map provided in this thread has to be used for the fights.
  6. The best AI will be choosen by a big AI tournament. This tournament will be explained in more detail later in this thread.
  7. Each member has to use the given naming convention for variables and triggers. The naming convention is explained later in more detail. [updated as of V2]
  8. A member may not change his/her hero/AI once the tournament has started.
  9. The triggers for each AI must be made public prior to the start of the tournament. Each contestant is allowed to have a look at the code of all other contestants to see if they violated the rules.
  10. If a contestant notices the violation of a rule by the AI code of another contestant then he must immediately tell me and the other contestants. The submission which violates the rules will be removed from the tournament at once.
  11. The deadline is October 20th at 0.00. That is, you can work on your AI for all of September.
  12. The code for the AI must not come from an older project; it must have been made entirely for this tournament. [updated as of V2]
  13. Participants are not allowed to use the default hero AI from wc3. [updated as of V3]
The judging:
We will not have any judges for this contest. Instead, there will be a tournament between the AI's in which they fight against each other and cumulate points. The AI which got the most points in the end will be the winner. If two AI's have the same number of points then a final battle between these two will be held; the winner of this battle will be the winner of the tournament.
  • A tournament win will give 2 points for the winning AI.
  • If both AI's manage to kill each other, either immediately or with the use of previously summoned units, then both AI's will get 1 point.
  • The losing AI will get 0 points.
Two AI's submitted by the same member will not have to fight each other. Each AI will only have to fight the AI's of other players.
If a referee decides that the game is lagging too much because of memory leaks or an otherwise badly coded AI then he may end the battle prematurely. In this case a jury will decide which AI is at fault for the lag by inspecting the code.
If the jury decides, that one of the AI's is responsible for the lag then the other AI will be declared the winner of the match. If both AI's are coded equally horrible then both AI's will get 0 points.

If both AI's do not attack each other or deal damage to each other in any other way for 5 consecutive minutes then the referee might call a draw and both AI's get 0 points.

After each battle a replay of the fight must be published by the referee and is only declared valid if it can be played back by the other contestants. (That means the map has not been altered or changed.)

It is allowed and highly prefered, that the battles will be fought online so that other spectators can watch the fight.

Illegal Trigger Functions:
Include but are not limited to:
  • Obviously everything which directly changes the hitpoints / manapoints or other stats of a unit.
  • Chaning the gold of a player or disabling abilities.
  • Spamming chat messages to annoy the observers
  • Checking what kind of abilities your opponent has learned and which level they are.
  • Checking whether a unit is an illusion (mirror image) or not.
  • Changing the values of variables other then your own. (Includes the pre-set map variables)
  • Following or targeting heroes which are invisible. (Wind walk, ambush, etc)
  • Targeting or checking units which are outside of your heroes vision range.
Example for illegal trigger:
Code:
Events:
  Unit - A unit summons a unit
Conditions
  (Summoning Unit) Equal to Acc_EnemyHero
Actions
  Do something awesome here...
How to fix it:
Code:
Events:
  Unit - A unit summons a unit
Conditions
  (Summoning Unit) Equal to Acc_EnemyHero
  (Summining Unit) is visible to (Owner of (Acc_OwnHero))
Actions
  Do something awesome here...
If my hero can see that the enemy has summoned a unit then my AI can react to this. But if the summoning unit is not visible to me it would not be legal to react to it directly.

Just keep in mind to be fair here; we want an interesting and healthy competition.
If you are not sure about a trigger you can always ask in this thread.

The naming convention for variables and triggers:
All global variables and triggers a contestant may use need to follow the following naming convention:
  1. The name of the variable or trigger starts with 3 letters which uniquely identify the contestants account here at TheHelper.net. For example it would be "Acc" for me or "DrE" for DrEvil.
  2. If a contestant submits more then 1 AI then a number must follow these 3 letters. The number indicates the number of the submission. For example my first AI must use variables starting with "Acc1"; my second AI must have "Acc2", and so forth.
  3. If a user submits only 1 AI then the number may be omitted.
  4. Then, an underscore must follow the variable name. After the underscore the variable name may contain any letters or numbers however you like.
  5. Trigger names are followed by a blank instead of an underscore.
Example for variables by me:
Acc1_SomePointVariable
Acc2_aaabbbbb
Acc_TmpGrp
...etc

Examples for variables by DrEvil:
DrE1_SomeUnit
DrE_blablabla
DrE3_xyz

The Template Map:
A template map will be provided. The template map features some pre-set variables and triggers which must NOT be changed by the contestants.
The variables from the template map may be used in your triggers but their values must never be changed!

The map features two fountains of healing which will regenerate hitpoints and mana of all units close by.
The map features two fountains of mana.
The map also features two neutral shops which sell various items which can be bought by the AI and used in battle.

Besides that the map will give gold and experience to both AI's periodically to speed up the fighting process.
There are also creeps which will spawn periodically to get more experience and gold. These creeps, however, will never drop any items.

The map features four spawn locations for the AI heroes. Two locations will be picked at random for the opposing heroes and it is not allowed to check the map variables to see where your enemy spawned.

The map also features spawns of dead neutral ghouls so that undead heroes can revive units (deathknight, cryptlord, warden vengeance spirit) and player controlled spawns of footman corpses for paladins with the resurrection ability.

The map has also various trees which respawn after some time. These can be used by the keeper of the grove.

The experience curves for this map have been changed in order to speed up the game. Each level up requires now exactly 100 experience points. Each creep kill will give 25 x (level of creep) experience regardless of your heroes level.
Tomes of experience give 100 experience points which is equal to 1 level up exactly.

Screenshot of the map:

Prizes and Awards:
None. I am sorry but there are no prices for this contest. We do it for fun.
However, everbody is allowed to donate a price if they would like to.

Other then that you will earn respect and reputation for being such an awesome wc3 map maker.

Tips for the Contest:
  • Pick a good 1 vs 1 hero; some of the best heroes are: Deathknight, Demonhunter, Warden, Tauren Chieftain, Mountain King, Arch Mage, Farseer, Blademaster, Crypt Lord, Keeper of the Grove
  • Use the condition "(SomeUnit is visible to SomePlayer) Equal True" to check if an enemy can actually be seen and attacked by your AI. The AI should not cheat!
  • Code clean and without leaks. If the AI lags too much during a fight it might get punished for it.
  • Be fair and dont try to cheat; this contest is for fun, there is nothing to win and nothing to lose.
Submissions so far:
<Will be updated as they come in>


Changelog:
As of 10.04:
  • Deadline extended by 2 weeks!
As of version 4 (09.29):
  • Minor bugfix.
As of version 3 (09.23):
  • Deactivated KI guard positions for both Heroes and all summoned units. (Thanks to thorhunter for noticing this mistake)
As of version 2 (09.01):
  • Max neutral creep number decreased to 15.
  • Experience system completely remade. Every level now requires exactly 100 experience points.
  • Every creep will give 25 experience per creep level regardless of hero level.
  • A Multiboard has been added for the observers to show better game stats.
  • Creep respawn system has been changed. Creeps now respawn every 60 seconds but only if no hero is nearby.
Good luck to all participants, lets face each other in the tournament!
 

Attachments

Aniconic

I am the very model of a modern major general!
Coolness. I'll probably only do 1 AI since I won't have a ton of time. The Warden. With approval of course.
 

Aniconic

I am the very model of a modern major general!
Hey guys, sorry for the double post but I found a bug in the template map. Because all of the spectators are allied to the AI's with shared vision, all of the players lift the fog of war for each AI hero. I changed this in my downloaded copy of the map by changing the following code in the map initialization trigger from this:

Trigger:
  • For each (Integer A) from 3 to 12, do (Actions)
    • Loop - Actions
      • Player - Make (Player((Integer A))) treat Player 1 (Red) as an Ally with shared vision
      • Player - Make (Player((Integer A))) treat Player 2 (Blue) as an Ally with shared vision
      • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across (Playable map area)
      • Trigger - Add to Obs CamDistance &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -distance as A substring)
      • Trigger - Add to Obs LockCam &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -lock as An exact match)
      • Trigger - Add to Obs GetItems &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -items as An exact match)
      • Trigger - Add to Obs GetGold &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -gold as An exact match)
      • Trigger - Add to Obs GetExperience &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -exp as An exact match)
      • Trigger - Add to Obs GetAbilities &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -abilities as An exact match)


To the following:
Trigger:
  • For each (Integer A) from 3 to 12, do (Actions)
    • Loop - Actions
      • Player - Make (Player((Integer A))) treat Player 1 (Red) as an Ally
      • Player - Make (Player((Integer A))) treat Player 2 (Blue) as an Ally
      • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across (Playable map area)
      • Trigger - Add to Obs CamDistance &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -distance as A substring)
      • Trigger - Add to Obs LockCam &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -lock as An exact match)
      • Trigger - Add to Obs GetItems &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -items as An exact match)
      • Trigger - Add to Obs GetGold &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -gold as An exact match)
      • Trigger - Add to Obs GetExperience &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -exp as An exact match)
      • Trigger - Add to Obs GetAbilities &lt;gen&gt; the event (Player - (Player((Integer A))) types a chat message containing -abilities as An exact match)


This ensures that despite the specators having uninhibited vision of the map, the AI are still limited to the fog of war and can only interact with what they can see, as per the rules.

Also, I like the creep spawn trigger work, but the creep don't seem to move? Are they not suppose to?

Thanks!
 

Accname

2D-Graphics enthusiast
Hi, yes, thanks for the update on the vision thing, I didnt consider this problem.
The shared vision was initially used to see the heroes Items but I already wrote a trigger for this so it shouldnt be a big problem.

I will update the map shortly.

And no, the creeps are not supposed to move. They are just there to kill them and level up.
 

DrEvil

FCRI Associate!
If my hero is going for "late game" and kites the enemy around the map (whilst attacking them every say... 299 seconds) will I lose?
Also why 3 submissions?
How is it selected which AI from a contestant will face another?
Will more than one AI from a contestant actually battle?
(If so, how will points be kept?)

Also your item trigger to display items doesn't work for the neutral tavern heroes. (Yes they are melee heroes!)

PS: I love how you referenced to me in the original post :D

EDIT: Prizes... Prices had me really confused while reading it.
 

Accname

2D-Graphics enthusiast
Why would the item trigger not work for tavern heroes?
I think you mean the ability trigger.
That is because of 3 reasons:
1). I am very lazy
2). I didnt really think somebody would pick them
3). I am very lazy

But yeah, I will update the version with a few changes and reupload it.
-----------------------------------------------------------------------------------------
Each AI has to fight every other AI once in the tournament. The only exception is if two AI's were submitted by the same person.
If you submit several AI's then each of your AI's has to fight every other AI submitted by somebody else.

And no, as long as you do damage every now and then you will not be disqualified. As I said in the main post, after 5 minutes the referee could call it a draw but is not forced to!
-----------------------------------------------------------------------------------------
I have also updated the main post with a section about illegal trigger functions.
-----------------------------------------------------------------------------------------
By the way, my submission will not come before the end of september since I have an exam on september the 23th. Until then I will probably be studying.
I will pick one or two of the following heroes depending on whether somebody else already made an AI for one of them or not:
Demon Hunter, Warden, Blademaster, Tauren Chieftain, Keeper of the Grove
-----------------------------------------------------------------------------------------
EDIT: Prizes... Prices had me really confused while reading it.
Edit: Sorry mr drevil. English is not my first language you cowardly brit who is scared of fighting syria.
 

DrEvil

FCRI Associate!
I had an idea to make the ability display, saving you loads of clicking... Because I love you accnoob :D

Also. I am not afraid of fighting Syria! My country is! Besides... these retarded countries are now unleashing chemical weapons.
You call that being scared? Running away from chemical weapons?

EDIT: It leaks a group... But I'm sure observers can't be disqualified for lagging out the competition. (I'm sure you can lag out a map with one leak... J4L would find a way...)
 

Attachments

Accname

2D-Graphics enthusiast
I know about the leaks in the observer triggers but they are not called very often. I guess they wont be called at all.
 

thorhunter

You can change this now in User CP.
It's not fully clear to me how the judging will be handled but I suggest recording and uploading a videos on youtube.
 

DrEvil

FCRI Associate!
It's not fully clear to me how the judging will be handled but I suggest recording and uploading a videos on youtube.

Each AI will play every AI that isn't made by the same contestant.
If an AI wins, he gets 2 points, if they draw, each gets a point, a losing AI gets 0 points.
At the end highest points wins?

There's no judging process, just a fight to the death.

Edit: I still don't fully understand the point system if you have multiple AI's though... Does each separate AI get it's own points?
 

DrEvil

FCRI Associate!
Do we have to find the locations of the fountains/shops or can we hardcode them?
(This question was asked a bit in the contest thread but never really addressed)
 

Accname

2D-Graphics enthusiast
Are the AIs allowed to co-operate, then, if multiple entries are submitted?
Its 1 vs 1 battles. But if you like you can try a 2 vs 2 battle but it will not be part of the tournament.

Do we have to find the locations of the fountains/shops or can we hardcode them?
(This question was asked a bit in the contest thread but never really addressed)
The fountains and shops are already saved in a unit variable. You can get the points from them without having to "scout" for the fountains and shops.
A human player would know where these shops and fountains are and so can the AI.
 

thorhunter

You can change this now in User CP.
My remarks:

2 Fountains of healing is way too many for 1v1 match. I suggest splitting them into one fountain of healing and one fountain of mana.

Constant experience growth renders some of the items in shops obsolate (like tome of exp). I suggest that players should start at level 3 and remove constant exp growth. We could use 2 shops with better variety of items (boots, claws etc.)

Creeps that respawn could use some level scaling instead of flat low level to allow leveling.

I'm not sure whether there will be just single battle between ai's or few rounds. Nevertheless, I suggest:
- Remove the 5 minute rule
- Add an 'x' minute timer that will end the match. Each match will then last same amount of time.
- If hero dies, it should respawn after short while.
- Outcome should be judged by hero kills/deaths in the first prior, their level/stats in the second.

If these suggestion are approved by majority I can take the burden of applying the changes to the map.

Also, I think it would be fun to have sort of FFA battle in the end.
 

Solu9

You can change this now in User CP.
I'm not sure whether there will be just single battle between ai's or few rounds. Nevertheless, I suggest:
- Remove the 5 minute rule
- Add an 'x' minute timer that will end the match. Each match will then last same amount of time.
- If hero dies, it should respawn after short while.
- Outcome should be judged by hero kills/deaths in the first prior, their level/stats in the second.
I like.
Although if the respawn idea is not approved I suggest, if both heroes are alive when the timer hits 0, that a simple HP count determines who wins.
 

Accname

2D-Graphics enthusiast
This is not supposed to be an AoS AI you code but a hero arena deathmatch.
1). There are 2 fountains to keep the map balance. Otherwise spawn locations might change the outcome of the battle slightly

2). Constant experience is needed to get to level 10 eventually.
The tomes of experience are still worthwhile because they allow you to level up quicker then your opponent.
Creep scaling might be a good idea but the battles will probably not even last long enough for that. After all, you simply can not kill stronger creeps with a single hero that fast.

3). A bigger variety of items might imbalance certain heroes as they allow for more useful combos. A hero with faster attack speed benefits more from claws of attack as a hero with slower attack speed.
Also, some heroes deal the majority of their damage through melee attacks and others by using skills / summoned units. The summoners will not benefit much from these items and this will imbalance the game in favor of fighting heroes.

4). The 5 minute rule is VERY important. You dont wanna see 2 really bad AI's just stand in their corners doing nothing. It is there to provide the referee with the opportunity to cancel the battle if both AI's are not doing anything.
The timer is reset even if a creep is hit. So as long as your AI does ANYTHING other then running around in circles this time limit will NOT be a problem.

5). No respawn. This will alter the entire nature of the contest.
There is one battle to the death.



The discussion thread was posted more then a weak ago, all kinds of suggestion could have been made back then. Since nobody else took the opportunity to create the contest I did it myself and these are the rules I have selected for the contest.
For anybody who is curious, they are more or less the same as the older hero AI contest had.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    @Vyper85 I think he had some undiagnosed mental health problems and I guess in the last few weeks they just became really prominent, and they were fighting about shit. I think he was drinking quite a bit that night as well, but I'm not positive what exactly happened. I believe that the assumption at this point was he didn't know the gun was loaded and was intending to scare her.
  • Varine Varine:
    As far as work, idk. I doubt I'll actually get fired, nor do I know why they would be trying to force me out. I'm just going to keep doing my thing until I find a new one or something else happens. I think my other boss is pretty upset with the goings on there as well, I've heard him talking about buying a different bar a couple times
  • Varine Varine:
    Although today my direct deposit didn't go through and no one is answering their phone, so maybe that is their plan
  • Varine Varine:
    I don't see why they wouldn't just fire me though
  • Varine Varine:
    I don't think it would be that hard to actually find a different job, but I kinda liked this one. Up until recently it was pretty chill
  • Varine Varine:
    On the bright side of all this I can get my vaccine next week I think
  • Varine Varine:
    There's a French restaurant up the street from me that's about to re-open that wanted me to work there before lockdowns, so I'll probably go talk to him next week when I know what's going on, and I took some extra time off for the funeral so I'll have a couple free days
  • jonas jonas:
    there may be some legal/benefits aspects to firing you vs you quitting on your own
  • Varine Varine:
    I mean maybe, but it's not like we're a big corporation. The entire business might have 10 employees
  • Varine Varine:
    I don't feel like that would be on the top of their mind, like I'm not eligible for severance or anything and we don't have benefits they would have to give me
  • Varine Varine:
    Plus I'm confident it's only one of my bosses, the other owner is pretty cool. But I don't think he's the one that has as much control over executive decisions
  • Varine Varine:
    They aren't cutting my responsibilities or interjecting in my management abilities or anything, it's just stupid shit that comes up. And they don't exactly have people lining up for my job, there's not that many people applying for the positions I hire
  • Varine Varine:
    Eh, whatever. Thanks for listening guys
  • jonas jonas:
    Sure :) Let us know how it ends
  • Varine Varine:
    All of these things will end happily, they're just stressful. And I still lack many good friends that I can go to, and the ones I can are preoccupied with similar things. Thus general chit chat, cuz for some reason TH and Ghan and Tom all actively keep it up.
  • Varine Varine:
    Just gotta keep Miss Mazie up through the week until her shock wears off and she realizes that she still has family all around her, and bossman will do whatever he's going to do and I'll respond appropriately when it happens. Thank you all for the support, I do very much appreciate everyone being here for me through the years
    +3
  • vypur85 vypur85:
    Best of luck Varine!
  • vypur85 vypur85:
    I just gotten myself an offer to work in China. The pay quadruples my current one. Damn.... Not really ready to start a new life there in China.
  • The Helper The Helper:
    I have heard that they pay pretty good to English teachers in China - you would be an expat
  • jonas jonas:
    Cool, what kind of job?
  • Accname Accname:
    I would be careful with jobs in China. They can be hit and miss depending on where in China you go. Places like hong kong / Shengzen / Beijing can be neat. Other places not so much.
  • Accname Accname:
    I would recommend searching for some first person experiences for the city you got the offer in. Especially now when the political situation in China is deteriorating.
  • jonas jonas:
    Accname, long time no see
  • jonas jonas:
    What have you been up to
  • tom_mai78101 tom_mai78101:
    Hey Accname, welcome back.

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome
    Top