• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] No idea what's leaking here, any help?

Status
Not open for further replies.
Level 2
Joined
Sep 8, 2016
Messages
8
Spell causing massive lag after 8+ casts, dummy hero ability based off of channel.

  • Time Out Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Time Out! (Melee)
    • Actions
      • Set TimeOut_Point = (Target point of ability being cast)
      • Set TimeOut_Group = (Units within 300.00 of TimeOut_Point matching (((Matching unit) Not equal to (Triggering unit)) and (((Matching unit) is Mechanical) Equal to False)))
      • Unit - Create 1 Time Out Post Dummy for (Owner of (Triggering unit)) at TimeOut_Point facing (Random angle) degrees
      • Unit - Add a (2.20 + (0.60 x (Real((Level of Time Out! (Melee) for (Triggering unit)))))) second Generic expiration timer to (Last created unit)
      • Unit Group - Pick every unit in TimeOut_Group and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Time Out Dummy for (Owner of (Triggering unit)) at TimeOut_Point facing Default building facing degrees
          • Unit - Add a (2.20 + (0.60 x (Real((Level of Time Out! (Melee) for (Triggering unit)))))) second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Human Dragonhawk Rider - Aerial Shackles (Picked unit)
      • Custom script: call DestroyGroup(udg_TimeOut_Group)
      • Custom script: call RemoveLocation(udg_TimeOut_Point)
I have a clean up trigger here, no idea if it might be the reason, dummy unit is based off of Chain Post doodad

  • Time Out Clean
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Time Out Post Dummy
    • Actions
      • Unit - Remove (Triggering unit) from the game
Issue was missing condition (Matching Unit is Alive)
 
Last edited:
Level 2
Joined
Sep 8, 2016
Messages
8
My dummy units are considered mechanical so they shouldn't be picked I believe, which means they won't be making a dummy unit for it I guess. So I'm still confused, when everything else was fine on my map before I added this spell, no lag over a 20 minute playtime that I did to test out a lot of different things in the map.
 
My dummy units are considered mechanical so they shouldn't be picked I believe, which means they won't be making a dummy unit for it I believe.
That has nothing to do with what I said.

everything else was fine on my map before I added this spell
Huhh I guess we can just move to making it more efficient then.
  • Filter out your unit groups like this. The tutorial explains why (Matching unit) is worse in every way
  • Store "(2.20 + (0.60 x (Real((Level of Time Out! (Melee) for (Triggering unit))" into a variable before you create the dummy units. You senselessly do the same arithmetic operation once + even MORE times in the unit group loop depending on how many dummy units you need to make
  • Store the (Owner of (Triggering unit) into a variable. Same reasoning as above ^
  • Store (Last created unit) inside the unit group loop into a variable
  • If you give a dummy unit the "Can't raise, does not decay" value in object editor, you don't need to remove them on death
Some other things:
  • You should add an "Is an ally" filter. You create dummy units for an ally even though they wouldn't be able to cast it on them. If you add this filter, you can also get rid of the "(Matching unit) not Equal to (Triggering unit)" filter. You should add an "Is alive" filter as well for the same reason
  • You shouldn't create dummy units for the player. This can mess up the score board at the end of each game
 
Last edited:
Level 2
Joined
Sep 8, 2016
Messages
8
I found the problem. I just added Unit is Alive == True, then it stopped lagging altogether.

That has nothing to do with what I said.


Huhh I guess we can just move to making it more efficient then.
  • Filter out your unit groups like this. The tutorial explains why (Matching unit) is worse in every way
  • Store "(2.20 + (0.60 x (Real((Level of Time Out! (Melee) for (Triggering unit))" into a variable before you create the dummy units. You senselessly do the same arithmetic operation once + even MORE times in the unit group loop depending on how many dummy units you need to make. You should also add an "Is alive" filter for the same reason
  • Store the (Owner of (Triggering unit) into a variable. Same reasoning as above ^
  • Store (Last created unit) inside the unit group loop into a variable

Thanks for helping me with the efficiency of this trigger, I'll start doing all you said above. +Repped you.

  • If you give a dummy unit the "Can't raise, does not decay" value in object editor, you don't need to remove them on death
I didn't know this was how to fix doodads staying on the map for way longer than they should be, I guess it makes sense.

Some other things:
  • You should add an "Is an ally" filter. You create dummy units for an ally even though they wouldn't be able to cast it on them. If you add this filter, you can also get rid of the "(Matching unit) not Equal to (Triggering unit)" filter
Spell is supposed to be hard to cast cause of low cooldown, big aoe, so it is supposed to have friendly fire, just not towards the caster.

  • You shouldn't create dummy units for the player. This can mess up the score board at the end of each game

Oh I'm fine with that, it's a habit since my dummy units are more often than not doing damage so I want to make sure kill bounty goes to the right person.
 
I found the problem. I just added Unit is Alive == True, then it stopped lagging altogether.
;D
You should add an "Is alive" filter as well...
Hmm so maybe it was just the function creating too many dummy units and or the dummy units being ordered to use an ability on a dead target.
 
Last edited:
Level 2
Joined
Sep 8, 2016
Messages
8
I reckon it's the dummy units actually being able to use the ability on a dead target since I didn't specify on Targets Allowed on the dummy ability to be Alive.

Thanks for the help! Your tutorial was really useful.
 
Status
Not open for further replies.
Top