AI for boss creeps?

LearningCode

New Member
Reaction score
24
Yea..
I've grown out of the Wintermaul-Terrain for my map -___-

I made my own terrain that suits this Hero Survival game I am making, lol.
I am making every round a boss round.

As in, The creeps come in groups with units supporting each other.
Like, a bunch of shackle-casters surrounded by healers and brutes is Level 1.

The problem is, I have no idea where to begin when it comes to creep AI.

I want to make it like this:
1) When creeps are spawned, order Shackle-casters to cast AerialShackles on nearest enemy unit.
2) When an enemy unit has the buff "Shackled", order all nearby brutes to attack Shackled unit.
3) When a unit is damaged, order the healers to heal damaged unit (This one is easy, auto-cast heal, lol)
4) If AerialShackles is not on cooldown for a unit and an enemy unit is attacking a healer, order the unit to cast AerialShackles on the attacking unit

It seems simple enough, but I have no idea how to do it.
Looking for guidance, lol.

(Hopefully, this will be the first and last time I ask for AI help)
 

avalya

New Member
Reaction score
37
Well,

1: Every 1 seconds of game time, pick every unit in playable map area that is that type of unit (the shackle-caster), then pick a random enemy (your friend that'd be) unit around it and order it to cast shackle.
2: A unit starts channeling an ability, if that ability is shackle then pick every nearby unit of type brute, order them to attack the targeted unit.
3: Yeah, auto-cast works just fine, remember to have it enabled (I think it is the first field in the object editor, where you can choose a spell to be auto-cast).
4: A unit is attacked, unit type of attacked unit is healer, pick every nearby friendly unit of type shackle-caster and if the target does not have the shackle buff, order it to shackle the attacker (thus multiple units won't cast shackle).
 

LearningCode

New Member
Reaction score
24
Oh..
I was thinking I'd have to use the AI-editor xD

I should have used this instead -___-
tyvm =)
 

avalya

New Member
Reaction score
37
AI pretty much only works for melee maps as far as I can recall, triggering creeps to cast spells is the best way, I've had creeps cast spells using spellbooks in the past though, but I haven't tried it in recent days, it worked fine, but triggering for specific occasions is probably the best way.
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
As far as i know, the only ability AI can have problems with is channel, but if it's ai then you can be a bit :rolleyes: since they actually don't have to own any abilities, like for example:

Trigger:
  • Fire Blast
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Demon Lord
    • Actions
      • Set FireblastInt = (FireblastInt + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (FireblastInt Greater than or equal to 7) and ((Mana of (Attacking unit)) Greater than or equal to 180.00)
        • Then - Actions
          • Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 180.00)
          • Animation - Play Demon Lord 0011 <gen>'s Spell animation
          • Set TempPoint = (Position of (Attacking unit))
          • Set TempGroup = (Units within 600.00 of (Position of (Attacking unit)) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True)))
          • For each (Integer A) from 1 to 3, do (Actions)
            • Loop - Actions
              • Set TempUnit = (Random unit from TempGroup)
              • Set TempPoint2 = (Position of TempUnit)
              • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at TempPoint facing Default building facing degrees
              • Unit - Add Flame Strike to (Last created unit)
              • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
              • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike TempPoint2
              • Unit Group - Remove TempUnit from TempGroup
              • Custom script: call RemoveLocation(udg_TempPoint2)
          • Set FireblastInt = 0
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call DestroyGroup(udg_TempGroup)
        • Else - Actions


It's a little spell i made, that seems to be cast at random to normal players, even reduces the mana, and the unit makes no effort at all ^^
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
The ability doesn't even exist, it's once every 7 attacks to make it seem random ^^ the only thing that exists is the dummy and the dummy abilities xD
 

avalya

New Member
Reaction score
37
Yeah I know, didn't see it was an attack count ability, well, you can abuse that, which is not too good. :p
 

tooltiperror

Super Moderator
Reaction score
231
Trigger:
  • Unit - A unit Is attacked


Not a reliable event.
 

avalya

New Member
Reaction score
37
Yeah, damage detection is much better, but it works for LearningCode's request there, since he only needs to see if a unit is attacked and not damaged to issue the order.
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Yeah, damage detection is much better, but it works for LearningCode's request there, since he only needs to see if a unit is attacked and not damaged to issue the order.

Not necesseraly, damage detection will fire off even off spells, when he fires of his spells, hence this will fire off more times than needed, goes for everything.
Why is it unreliable? I want a detailed explanation if you please, not just It's better. ^^
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
What's a BJ? xD And it's no problem, it activates as it should: Randomly ^^
 

tooltiperror

Super Moderator
Reaction score
231
BJ = Blizzard JASS.

JASS:
function TriggerRegisterAnyUnitEventBJ takes trigger trig, playerunitevent whichEvent returns nothing
    local integer index

    set index = 0
    loop
        call TriggerRegisterPlayerUnitEvent(trig, Player(index), whichEvent, null)

        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
endfunction


If you look at this, it does a ton of things, just to add an event to a trigger. You could just use one line from there to optimize the trigger.

Actually, I stand corrected, I`m fairly certain that the event is not a BJ, that was a mistake on my part, however I`m fairly certain it calls a native, which bugs.
 

avalya

New Member
Reaction score
37
It's actually not random at all, every time you start an attack, you get an additional charge, thus it can be abused by the stop-attack bug. Damage detection system do fire off of spells, true, but if you trigger all your spell damage, and set a Boolean to false before you deal the damage and then set it back to true after, and the damage detection triggers are set to not trigger when the boolean is true, then it will only activate on attacks.
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
thus it can be abused by the stop-attack bug

I want to see the AI do this ^^

Anyway, i know what i made, and it was made just for the AI x)
 

avalya

New Member
Reaction score
37
Ah yeah that's true, got me there. But yeah, I thought it would be used by players as well, so meh. :)
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Yep ^^

If it was a player controlled unit, using the attack function would be horrible, so you are right ^^
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top