HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

is making spell AI worth it?

11-28-2004, 10:37 PM#1
-={tWiStÄr}=-
Lets start with this, i know pretty much nothing about AI. im making this with plain jass triggers. It is for when players leave the map the ai will take over. the problem is, there are about 50 custom spells, 5 per hero. I know exactly how i would do most of the AI if i could make a couple master lists of all the spells, but i dont want to. unless i could find a way to organize it into type of spell, priority to be learnt and keep it organized by hero in one list..
so yeah, my map is an AoS and it is pretty based on spells so i dont know if i should do this or not. I am going to leave an option for the player to take over the coputer also.
also, if i should do this i would need a little bit of help on how the heroes know when they can cast a spell. I know for stuff like warstomp i would probably count the unit and if it is high enough he would use the spell. but i dont know about cooldown or anything.
11-29-2004, 12:19 PM#2
a thing
1. I suggest realsing your map first without AI then the second version with AI.

2. For cooldown I guess you have a function that waits the cooldown then sets a boolean global to true (and you always check if a boolean global is true when ordering a unit to cast something).
11-29-2004, 01:12 PM#3
-={tWiStÄr}=-
why should i release a version with AI and one without AI? They will have control over which path (of the 3) the hero takes, and if they wish they can take complete control. the cooldown is what i was thinking to do. i may use gamecache instead so i dont have to loop through 3-4 huge arrays everytime a hero comes within range of another.
11-29-2004, 09:51 PM#4
Vexorian
Be chessy! just order them to cast the spells, the returned boolean would be true if it was succesful, you can have a trigger that casts a defensive spell in defensive situations

Code:
loop
        exitwhen IssueImmediateOrder(u,"manashield")
        exitwhen IssueImmediateOrder(u"immolation")
        exitwhen IssueImmediateOrder(u"warstomp")
        exitwhen true
endloop
´


then when learning, I in my arena have something like this
Â?
Code:
function LearnSummonSkill takes unit c returns boolean
    loop
            exitwhen SelectHeroSkill(c,'AHwe")
            exitwhen SelectHeroSkill(c,'AOfs")
            ----
            exitwhen SelectHeroSkill(c,'ANmg")
            return false
   endloop 
    return true
endfunction


function LearnAOESkill takes unit c returns boolean
---
endfunction


function LearnPassiveSkill takes unit c returns boolean
---
endfunction

etc--

function LearnSkill takes unit c returns nothing
     loop
            exitwhen LearnSummonSkill(c) // Comps are much better using summons than other skills
            exitwhen LearnPassiveSkill(c) // Comps don't need anything to use a passive skill
            exitwhen LearnAOESkill(c) // Comps don't need anything to use a passive skill
            ----

     endloop
endfunction
11-29-2004, 11:23 PM#5
-={tWiStÄr}=-
i sort of understand, but what if they have 2 defensive skills? in your example they would hardly ever use immolation if they had mana shield. same goes for learning. and with the exitwhens, will that work as soon as the function runs? that looks like it would work great except for where they would only use certain skills.
2 more general ai questions
1. how often should i check for what kind of situation is a unit in?
2. should i have another spell type other than summon passive and AOE? like special. cause some of my direct damage spells dont do damage, they do other stuff.
11-30-2004, 02:59 AM#6
Guest
what is AI?
11-30-2004, 03:00 AM#7
Guest
can you bye stuff with gold?
11-30-2004, 03:00 AM#8
Guest
cause i saw there was a shop called DOH!! i forgot
11-30-2004, 03:01 AM#9
Guest
and how do you get reputation markings and does anyone no if www.securegamers.com is going to be up anytime soon? o_O o_O o_O o_O o_O
11-30-2004, 03:22 AM#10
fugly
lol dude stay on topic and there IS an edit button....
11-30-2004, 08:23 AM#11
AIAndy
I deleted the posts fugly refers to because they were pointless spam. I don't think he really wanted those questions answered.
12-01-2004, 11:43 PM#12
-={tWiStÄr}=-
huh.. i didnt check this post yesterday, so im assuming i missed something..