HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

AMAI 2.2

08-14-2004, 06:17 PM#316
Spumpk1
No, I doubt they would use the heroes at all. You have to program into the strategies which heroes to choose and these aren't in there anywhere.
08-14-2004, 06:23 PM#317
Strategy Master
Zalamander said he was going to release a 2.31 version, which will possibly now be set up to use the 2 new heroes.
08-14-2004, 11:31 PM#318
Zalamander
Quote:
Originally Posted by Strategy Master
Zalamander said he was going to release a 2.31 version, which will possibly now be set up to use the 2 new heroes.

I can try making a special AMAI version for the 1.17 beta incuding use of the 2 new heroes and some optimization for whatever other changes that need changes in AMAI.
08-15-2004, 10:55 AM#319
Zalamander
Ok I made a version for 1.17 beta now using the 2 new neutral heroes.

And another good news is that I found the hero skill bug.
The bas news is that Im not completely sure about whats the best way to fix it, if I do it wrong other bugs might occur.

I can explain the bug here so anyone else can give it a thought.

The problem:
I found out that the problem is a misscalculation, it adds +1 when it get's the skill number in the list when it's not supposed to, meaning that it skips the first skill in the list and pick the skill that was supposed to be used as second skill as first skill instead. This also result in that they fail to pick a skill at level 10 most of times since that skill will be the first skill on the next skill list as long as this bug is here.

Here I explain it with all the functions for the skill use with the first hero and skills in the list as example.

This is how every race pick the skills, it acces the different skill lists depending on if it's hero 1, 2 or 3, there is 3 lists of skills for every hero as most of you know.
Code:
function set_skills takes nothing returns nothing
    if hero_id[1]== SEA_WITCH then
        call LoadSkills(1,1,1)
    elseif hero_id[2]== SEA_WITCH then
        call LoadSkills(2,1,2)
    elseif hero_id[3]== SEA_WITCH then
        call LoadSkills(3,1,3)
    endif

And here is the functions used when creating the skill list out of this function call.
Code:
function SkillArrays takes nothing returns integer
    local integer level = GetHeroLevelAI()
    local integer hn = GetHeroNumber(GetHeroId())

    if level > max_hero_level then
        set max_hero_level = level
    endif

    return skills[(hn - 1) * HERO_LEVEL_NUMBER + level]
endfunction

function StoreSkills takes integer ta returns nothing
  local integer i = 1
  loop
    exitwhen i > HERO_LEVEL_NUMBER
    set skills[(ta - 1) * HERO_LEVEL_NUMBER + i] = tempskills[i]
    set i = i + 1
  endloop
endfunction

function LoadSkillsExt takes integer sa returns nothing
  local integer i = 1
  loop
    exitwhen i > HERO_LEVEL_NUMBER
    set tempskills[i] = allskills[sa + i]
    set i = i + 1
  endloop
endfunction

function LoadSkills takes integer sa, integer hn, integer ta returns nothing
  call LoadSkillsExt((sa-1)*HERO_LEVEL_NUMBER + (hn-1)*3*HERO_LEVEL_NUMBER)
  call StoreSkills(ta)
endfunction

HERO_LEVEL_NUMBER is the maximum level a hero can become(how many times it is to pick a skill) so it's normaly 10.

we take the sea witch as first hero example.(call LoadSkills(1,1,1))

it will enter these 1,1,1 in the formula in LoadSkills() like this:

call LoadSkillsExt(1-1) * 10 + (1-1) * 3 * 10) this results in "0"

now it comes to LoadSkillsExt() with this "0"

notice local integer i = 1

and then
in the loop creating the list of skills:
set tempskills[i] = allskills[sa + i] <-- as you can see it sets it's first skill to be allskills[1] (0 + 1) since i is 1 from the start.

here is the start of the skill list:
Code:
function InitNeutralSkills takes nothing returns nothing
  set allskills[0] = FROSTARROWS
  set allskills[1] = MANASHIELD
  set allskills[2] = FROSTARROWS
  set allskills[3] = MANASHIELD
  set allskills[4] = FROSTARROWS

It sets the second skill in the list as it's first skill.

However Im not sure if the bug is that the list is supposed to start at 1 instead of 0 or if the +1 should be removed from the functions.
08-15-2004, 12:25 PM#320
Strategy Master
Looking at that I would guess starting list at allskills[1] instead of 0.
Removing +1 looks like it will cause problems when i is compared with hero level number in the loops. EXITWHEN i > HERO_LEVEL_NUMBER

As i could get 2 less than hero number causing too many skills chosen and maybe mess up. But i am no AMAI jass code master, i could be completly incorrect.
08-15-2004, 12:36 PM#321
Zalamander
Quote:
Originally Posted by Strategy Master
Looking at that I would guess starting list at allskills[1] instead of 0.
Removing +1 looks like it will cause problems when i is compared with hero level number in the loops. EXITWHEN i > HERO_LEVEL_NUMBER

As i could get 2 less than hero number causing too many skills chosen and maybe mess up. But i am no AMAI jass code master, i could be completly incorrect.

Yeah I think you are right so I already considered that as the safest solution, started the list with 1 instead now and it worked nice so far, only saw some odd bug, a orc upgraded both its halls to tier2 at the same time both at home and at expansion, but it just can't be connected to this, must be something with the changed blizzard.j in 1.17, hope it don't occure too often.

Well here is a 2.31 Beta for the 1.17 beta that makes good use of the 2 new neutral heroes.
And of course got the skill select bug fixed.
http://amai.wc3campaigns.com/downloa...31PE_Beta1.ZIP

should work pretty well for 1.16 TFT as well as long as it's played on maps that don't have neutral heroes.

I wonder if that Firelord hero isn't a bit way overpowered currently.
Saw AMAI use it with 7-8 level 3 lava spawns summoned, every lava spawn has 900 HP and do 32 - 56 damage, thats more HP and damage than the Firelord it self if it's level 8 or below. It actualy did handle the whole enemy army pretty well on its own.
08-15-2004, 01:31 PM#322
Strategy Master
Great thanx. Gonna try it now.

EDIT- Oh and something i have wondered for quite a while.

Why don't you just put the ai player edition in an executable file using mpqdraft.
Then amai is set to work on any melee map. I do that every time with amai. I can't be bothered to use the installer on every single map.

And its smaller as well. At 434kb unzipped instead of 2.35 mb unzipped. (of course i know you can only use that for 1 TFT or ROC respectivly) But 434kb for both the executables is still less than 1mb so it saves alot of space.
08-15-2004, 03:21 PM#323
Zalamander
Quote:
Originally Posted by Strategy Master
Great thanx. Gonna try it now.

EDIT- Oh and something i have wondered for quite a while.

Why don't you just put the ai player edition in an executable file using mpqdraft.
Then amai is set to work on any melee map. I do that every time with amai. I can't be bothered to use the installer on every single map.

And its smaller as well. At 434kb unzipped instead of 2.35 mb unzipped. (of course i know you can only use that for 1 TFT or ROC respectivly) But 434kb for both the executables is still less than 1mb so it saves alot of space.

I guess it's a good idea, I have never used mpqdraft so I don't know how it works but I'll try sooner or later.

I updated the webpage now, released bugfixed PE and DE for 1.16(2.31)
and PE and DE for 1.17 beta.(2.32 DL links at news page)
08-15-2004, 03:33 PM#324
Elf.Lysander
Hi all AMAI crew, you sure did a good work, i enjoyed AMAI very much, it is ideal to deal with in no-internet ambiance, it funny to add some AMAI players in a LAN game too.

I found a new bug in the 2.30 version:

- AMAI player sometimes teches in expansion rather than in main base.

That happened with Human AMAI that made a fast expansion

A question - It is possible to make the AMAI creep over and over without returning at his base anytimes? *sniff* *sniff* i smell hardcoded things in the air

Keep up the good work!



P.S.: Found another bug, this time in 2.1 version, though i think is not corrected:

- While creeping, if a CPU controlled Crypt Lord uses Impale on creeps hitting ALL the creeps in that camp, while the units goes in the air CPU thinks that there are no more units to attack and return to base.
I have a replay of that.
08-15-2004, 03:37 PM#325
Elf.Lysander
Double post - i dont know how to delete it. Sorry.
08-15-2004, 05:05 PM#326
MurphGuitar
I'm so grateful for the 1.17 beta patch AMAI version already. I am loving the two new heroes. I just play the spells that I think are fun, which is why I can't win on battle.net. I don't like using the lava brats, but soul burn is useful to damage heroes and disable their spells at the same time. When I first heard about the Goblin Alchemist I was so excited because of the healing spell, but I think it's useless right now. Also the area of effect is so small I'm tired of moving hurt units into it. But I LOVE transmute!! Oh my God, transmuting a tauren or a chimaera is incredible!!

And that makes me wonder...will you have to specifically tell the AMAI things like, if you have a level 6+ Alchemist and you're going to use transmute, make sure you use it on the most expensive enemy unit? Will you direct the AMAI to not use the Alchemist's other spells so much when it gets to level 6 so it has mana for transmute? (That happens to be what I do.)

Also, if a Night Elf AMAI player is facing a level 6+ Alchemist and is using Mountain Giants, will you specifically tell the AMAI that it's crucial to get the resistant skin upgrade to prevent the enemy from transmuting the 425G Mountain Giant? Just wondering how that's going to work. Thanks again for a great program.
08-15-2004, 07:32 PM#327
Strategy Master
Question

What does call SetBuildUpgr(minimum do

for example
call SetBuildUpgr(minimum((TownCountDone(FOOTMAN)/6),1), UPG_DEFEND, 50)

Does it act as a sort of condition. Depending on what it does i could find a nice use for this.
08-15-2004, 08:37 PM#328
Zalamander
Quote:
Originally Posted by Elf.Lysander
Hi all AMAI crew, you sure did a good work, i enjoyed AMAI very much, it is ideal to deal with in no-internet ambiance, it funny to add some AMAI players in a LAN game too.

I found a new bug in the 2.30 version:

- AMAI player sometimes teches in expansion rather than in main base.

That happened with Human AMAI that made a fast expansion

A question - It is possible to make the AMAI creep over and over without returning at his base anytimes? *sniff* *sniff* i smell hardcoded things in the air

Keep up the good work!



P.S.: Found another bug, this time in 2.1 version, though i think is not corrected:

- While creeping, if a CPU controlled Crypt Lord uses Impale on creeps hitting ALL the creeps in that camp, while the units goes in the air CPU thinks that there are no more units to attack and return to base.
I have a replay of that.

Sorry, hardcoded all 3 of them :/
We are mostly trying to solve the return between creeps issue, maybe soon we have solve it.

Quote:
Originally Posted by MurphGuitar
I'm so grateful for the 1.17 beta patch AMAI version already. I am loving the two new heroes. I just play the spells that I think are fun, which is why I can't win on battle.net. I don't like using the lava brats, but soul burn is useful to damage heroes and disable their spells at the same time. When I first heard about the Goblin Alchemist I was so excited because of the healing spell, but I think it's useless right now. Also the area of effect is so small I'm tired of moving hurt units into it. But I LOVE transmute!! Oh my God, transmuting a tauren or a chimaera is incredible!!

And that makes me wonder...will you have to specifically tell the AMAI things like, if you have a level 6+ Alchemist and you're going to use transmute, make sure you use it on the most expensive enemy unit? Will you direct the AMAI to not use the Alchemist's other spells so much when it gets to level 6 so it has mana for transmute? (That happens to be what I do.)

Also, if a Night Elf AMAI player is facing a level 6+ Alchemist and is using Mountain Giants, will you specifically tell the AMAI that it's crucial to get the resistant skin upgrade to prevent the enemy from transmuting the 425G Mountain Giant? Just wondering how that's going to work. Thanks again for a great program.

Sorry all skill use is hardcoded, we only make them use some manualy when it comes to healing between battle, but having control over them in a fight would require a lot of CPU power. Hopefully the hard code use it smart enough, it have always targeted the most expensive so far when I have been looking.

Quote:
Originally Posted by Strategy Master
Question

What does call SetBuildUpgr(minimum do

for example
call SetBuildUpgr(minimum((TownCountDone(FOOTMAN)/6),1), UPG_DEFEND, 50)

Does it act as a sort of condition. Depending on what it does i could find a nice use for this.

Yeah it is a condition, the minimum() function takes 2 values adn return the smallest value, in this case the 2 values is "TownCountDone(FOOTMAN)/6" and "1" meaning that as long as the amount of footmen owned by this computer /6 isn't more than 1 this upgrade will not be done becuse it will be lower than 1 instead of 1 "call SetBuildUpgr(<here>, UPG_DEFEND, 50)" so it's a condition, that works better than making a if block around the upgrade call I think.
08-16-2004, 07:27 AM#329
Elf.Lysander
Hi, thanks for the answers, very responsive!
I want to contribute again giving my feedback.

Some month ago i made several (10+) AMAI-only game to test their strategy. These tests were done with 2.1. Anyway, I'm going to put the bug i found that i think they can eventually be present in this latest version.

- With Commander, issuing the command Restriction / No Attack to an AMAI ally, there is no way to negate later that command, in order to make AMAI attacks again. Tried "Cancel all order" but still doesnt work.

- When a creeping hero goes low HP, it shouldn't TP to base, instead he should simply run (i have replay though i think it's not necessary).

- Sometimes AMAI use more then 1 TP to TPing to his base. I mean the AMAI having 2 heroes, and uses BOTH teleport scroll from his heroes (i have replay).

- In 2.1, profiles Terra, Xerox, and Arraxy build their farm too soon, severely affecting their economy, specially in the beginning. I think an IDEAL farm build time DO exist, so there's no need to customize farm build time. Profile Trollus costruct his farm at the right moment (i have replay of all 4 profiles).
Suggestion: remove customizable farm build time and set all profiles their FBT as Trollus.

I also have many bug in 2.1 strategy, tell me if u think it's good to them or are outdated.

Hope this may help,
thanks in advance for the answers.

Bye bye and ENJOY THE SUMMER!!
08-16-2004, 11:17 AM#330
peon
@Elf.Lysander

I have tried 2.31 beta, maybe I can answer:

"- With Commander, issuing the command Restriction / No Attack to an AMAI ally, there is no way to negate later that command, in order to make AMAI attacks again. Tried "Cancel all order" but still doesnt work."

Probably not fixed yet, but instead of "cancelling restriction", I tried ordering it to attacking enemies directly, and it worked.

"- When a creeping hero goes low HP, it shouldn't TP to base, instead he should simply run (i have replay though i think it's not necessary)."

Fixed, and now the unit saving system is much better ^_^

"- Sometimes AMAI use more then 1 TP to TPing to his base. I mean the AMAI having 2 heroes, and uses BOTH teleport scroll from his heroes (i have replay)."

I saw once in 2.20, and never after (my first AMAI was 2.20)

- In 2.1, profiles Terra, Xerox, and Arraxy build their farm too soon, severely affecting their economy, specially in the beginning. I think an IDEAL farm build time DO exist, so there's no need to customize farm build time. Profile Trollus costruct his farm at the right moment (i have replay of all 4 profiles).

I didn't counted it, but it seemed "just in time".

enjoy!