• 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.

Why does my FPS drops so much from this

Level 5
Joined
Mar 18, 2023
Messages
52
The intended effect is to trigger this when a hero holding a specific item reaches lethal damage (using damage engine) and it would run the trigger. During this time for 3s, the hero holding the item would be Soul Burned (prevent using spells), banish (prevent attacks + gives a good ghost-looking SFX) and become immune to all damage (was originally going to use Invulnerable but then I decided Berserk with -# so I can show the buff icon representing the item. Soul Burn & Banish will be universal for other stuff so their buff status/icon cannot be changed). But yeah I can't figure out why this lags so hard. I'm currently testing it through a throwaway trigger by having it triggered when I cast a spell. Thank you ahead of time if someone can help me.
  • Restless Dead Effects Copy Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Jaina's Blizzard (Jaina Q)
    • Actions
      • Set VariableSet TempUnit[0] = (Triggering unit)
      • Set VariableSet TempPoint[0] = (Position of TempUnit[0])
      • Unit - Create 1 AllUnitTypes[0] for (Owner of TempUnit[0]) at TempPoint[0] facing Default building facing degrees
      • Unit - Add (Apparitional) Debuffs to (Last created unit)
      • Ability - Set Ability: (Unit: (Last created unit)'s Ability with Ability Code: (Apparitional) Debuffs )'s Real Level Field: Damage Penalty ('Nso3') of Level: 0 to 1.00
      • Ability - Set Ability: (Unit: (Last created unit)'s Ability with Ability Code: (Apparitional) Debuffs )'s Real Level Field: Duration - Hero ('ahdu') of Level: 0 to 3.00
      • Ability - Set Ability: (Unit: (Last created unit)'s Ability with Ability Code: (Apparitional) Debuffs )'s Real Level Field: Duration - Normal ('adur') of Level: 0 to 3.00
      • Unit - Order (Last created unit) to Neutral Fire Lord - Soul Burn TempUnit[0]
      • Unit - Add a 0.40 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 AllUnitTypes[0] for (Owner of TempUnit[0]) at TempPoint[0] facing Default building facing degrees
      • Unit - Add ALL Banish to (Last created unit)
      • Ability - Set Ability: (Unit: (Last created unit)'s Ability with Ability Code: ALL Banish )'s Real Level Field: Duration - Hero ('ahdu') of Level: 0 to 3.00
      • Ability - Set Ability: (Unit: (Last created unit)'s Ability with Ability Code: ALL Banish )'s Real Level Field: Duration - Normal ('adur') of Level: 0 to 3.00
      • Unit - Order (Last created unit) to Human Blood Mage - Banish TempUnit[0]
      • Unit - Add a 0.40 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TempPoint[0])
      • Unit - Add (Apparitional) Restless Dead 100% Mitigate to TempUnit[0]
      • Unit - Order TempUnit[0] to Orc Troll Berserker - Berserk.
      • Unit - Remove (Apparitional) Restless Dead 100% Mitigate from TempUnit[0]
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
Also, you don't need two Dummy units. Here's an optimized trigger:
  • Restless Dead Effects Copy Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Jaina's Blizzard (Jaina Q)
    • Actions
      • Set VariableSet TempUnit[0] = (Triggering unit)
      • Set VariableSet TempPoint[0] = (Position of TempUnit[0])
      • -------- --------
      • Unit - Create 1 AllUnitTypes[0] for (Owner of TempUnit[0]) at TempPoint[0] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint[0])
      • Set VariableSet TempUnit[1] = (Last created unit)
      • Unit - Add a 0.40 second Generic expiration timer to TempUnit[1]
      • -------- --------
      • Unit - Add (Apparitional) Debuffs to TempUnit[1]
      • Ability - Set Ability: (Unit: TempUnit[1]'s Ability with Ability Code: (Apparitional) Debuffs )'s Real Level Field: Damage Penalty ('Nso3') of Level: 0 to 1.00
      • Ability - Set Ability: (Unit: TempUnit[1]'s Ability with Ability Code: (Apparitional) Debuffs )'s Real Level Field: Duration - Hero ('ahdu') of Level: 0 to 3.00
      • Ability - Set Ability: (Unit: TempUnit[1]'s Ability with Ability Code: (Apparitional) Debuffs )'s Real Level Field: Duration - Normal ('adur') of Level: 0 to 3.00
      • -------- --------
      • Unit - Add ALL Banish to TempUnit[1]
      • Ability - Set Ability: (Unit: TempUnit[1]'s Ability with Ability Code: ALL Banish )'s Real Level Field: Duration - Hero ('ahdu') of Level: 0 to 3.00
      • Ability - Set Ability: (Unit: TempUnit[1]'s Ability with Ability Code: ALL Banish )'s Real Level Field: Duration - Normal ('adur') of Level: 0 to 3.00
      • -------- --------
      • Unit - Order TempUnit[1] to Human Blood Mage - Banish TempUnit[0]
      • Unit - Order TempUnit[1] to Neutral Fire Lord - Soul Burn TempUnit[0]
      • Unit - Order TempUnit[0] to Orc Troll Berserker - Berserk.
Notes:
1) You may want to use unique variables for this trigger instead of Temp since you're ordering these Units to cast multiple abilities. I'm not 100% certain the trigger queue will play nice here.

2) There will be an initial FPS drop when loading these assets for the first time, perhaps that's what you're experiencing? You didn't say how long the FPS drop lasts so it's hard to tell.

3) If your Dummy unit cannot cast multiple spells at once then you haven't set it up properly.
Copy and paste the Locust, Set Model = None, Shadow = None, Attacks Enabled = None, Movement Type = None, Speed Base = 0.
 
Last edited:
Level 5
Joined
Mar 18, 2023
Messages
52
Also, you don't need two Dummy units. Here's an optimized trigger:
  • Restless Dead Effects Copy Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Jaina's Blizzard (Jaina Q)
    • Actions
      • Set VariableSet TempUnit[0] = (Triggering unit)
      • Set VariableSet TempPoint[0] = (Position of TempUnit[0])
      • -------- --------
      • Unit - Create 1 AllUnitTypes[0] for (Owner of TempUnit[0]) at TempPoint[0] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint[0])
      • Set VariableSet TempUnit[1] = (Last created unit)
      • Unit - Add a 0.40 second Generic expiration timer to TempUnit[1]
      • -------- --------
      • Unit - Add (Apparitional) Debuffs to TempUnit[1]
      • Ability - Set Ability: (Unit: TempUnit[1]'s Ability with Ability Code: (Apparitional) Debuffs )'s Real Level Field: Damage Penalty ('Nso3') of Level: 0 to 1.00
      • Ability - Set Ability: (Unit: TempUnit[1]'s Ability with Ability Code: (Apparitional) Debuffs )'s Real Level Field: Duration - Hero ('ahdu') of Level: 0 to 3.00
      • Ability - Set Ability: (Unit: TempUnit[1]'s Ability with Ability Code: (Apparitional) Debuffs )'s Real Level Field: Duration - Normal ('adur') of Level: 0 to 3.00
      • -------- --------
      • Unit - Add ALL Banish to TempUnit[1]
      • Ability - Set Ability: (Unit: TempUnit[1]'s Ability with Ability Code: ALL Banish )'s Real Level Field: Duration - Hero ('ahdu') of Level: 0 to 3.00
      • Ability - Set Ability: (Unit: TempUnit[1]'s Ability with Ability Code: ALL Banish )'s Real Level Field: Duration - Normal ('adur') of Level: 0 to 3.00
      • -------- --------
      • Unit - Order TempUnit[1] to Human Blood Mage - Banish TempUnit[0]
      • Unit - Order TempUnit[1] to Neutral Fire Lord - Soul Burn TempUnit[0]
      • Unit - Order TempUnit[0] to Orc Troll Berserker - Berserk.
Notes:
1) You may want to use unique variables for this trigger instead of Temp since you're ordering these Units to cast multiple abilities. I'm not 100% certain the trigger queue will play nice here.

2) There will be an initial FPS drop when loading these assets for the first time, perhaps that's what you're experiencing? You didn't say how long the FPS drop lasts so it's hard to tell.

3) If your Dummy unit cannot cast multiple spells at once then you haven't set it up properly.
Copy and paste the Locust, Set Model = None, Shadow = None, Attacks Enabled = None, Movement Type = None, Speed Base = 0.
For #1, like variables to reference the ability being used? In terms of #2, the lag lasts as long as the duration (3s). It shouldn't be the first time loading thing since I was both testing this and the Lethal event one at the same time. But the FPS drop is sooo massive. I'm talking like 10 fps for whatever reason. I'll try to get a video recording with a YT link soon if you wish to have visuals. For #3 Ahh I didn't know a single dummy can cast multiple spells instantly. That's good to know. I just assumed that when you order them to do something and then give them another order right after, it'll just cancel the first order.. Thank you Uncle!
 
Level 5
Joined
Mar 18, 2023
Messages
52
From code side I cannot see any issue, so I would assume the issue is with the abilities.

Soul Burn works with intervals, so check what is the interval of damage in that ability you are using (you are changing duration and damage penalty, what is the damage interval?
OH WAIT lmao. Ok now that makes sense. I set the interval to 0 :xxd:. I have a habit of glancing/rushing through the fields of custom spells and setting nearly everything to 0 or 0.001. Well problem solved. Big thanks!
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
For #1, like variables to reference the ability being used?
Let's say that you have another trigger that runs whenever a unit casts ALL Banish, and let's say that trigger Sets TempUnit[0]. The problem: You've now overwritten TempUnit[0] from the first trigger with a different unit in the second trigger. When it comes time to have TempUnit[0] cast Berserk it would likely reference the wrong unit. But this is a big assumption, the trigger queue may handle this and ensure that things are sequenced properly, I'm not 100% sure how it works here.

For #3 Ahh I didn't know a single dummy can cast multiple spells instantly. That's good to know. I just assumed that when you order them to do something and then give them another order right after, it'll just cancel the first order.
The Dummy unit is designed to cast abilities immediately which is why multiple Ability orders can be sequenced without issues. This works because it's Art - Cast Point and Art - Cast Backswing are set to 0.00 which would otherwise delay the casts. Additionally, it's Movement settings allow it to cast without needing to turn and face it's target which removes another potential delay.

To go into greater detail, Art - Cast Point controls how long it takes to cast an ability and Art - Cast Backswing controls how long a unit continues to play it's spell animation after casting. For example: Archmage is ordered to cast Summon Water Elemental. He lifts his staff and begins moving it in an arcing motion. Shortly after this (0.3 seconds if memory serves me right) he Summons a Water Elemental. He then continues to wave his staff for another ~3 seconds, for no reason other than to play out the full "spell" animation. This Backswing can be cancelled and is known as a mechanic called "animation canceling" - which applies to Attacks as well. You can also cancel an ability cast with a Stop order if you're quick enough. The Cast Point adds an initial delay which acts as a timing window for it to be interrupted.
 
Last edited:
Level 5
Joined
Mar 18, 2023
Messages
52
Let's say that you have another trigger that runs whenever a unit casts ALL Banish, and let's say that trigger Sets TempUnit[0]. The problem: You've now overwritten TempUnit[0] from the first trigger with a different unit in the second trigger. When it comes time to have TempUnit[0] cast Berserk it would likely reference the wrong unit. But this is a big assumption, the trigger queue may handle this and ensure that things are sequenced properly, I'm not 100% sure how it works here.


The Dummy unit is designed to cast abilities immediately which is why multiple Ability orders can be sequenced without issues. This works because it's Art - Cast Point and Art - Cast Backswing are set to 0.00 which would otherwise delay the casts. Additionally, it's Movement settings allow it to cast without needing to turn and face it's target which removes another potential delay.

To go into greater detail, Art - Cast Point controls how long it takes to cast an ability and Art - Cast Backswing controls how long a unit continues to play it's spell animation after casting. For example: Archmage is ordered to cast Summon Water Elemental. He lifts his staff and begins moving it in an arcing motion. Shortly after this (0.3 seconds if memory serves me right) he Summons a Water Elemental. He then continues to wave his staff for another ~3 seconds, for no reason other than to play out the full "spell" animation. This Backswing can be cancelled and is known as a mechanic called "animation canceling" - which applies to Attacks as well. You can also cancel an ability cast with a Stop order if you're quick enough. The Cast Point adds an initial delay which acts as a timing window for it to be interrupted.
I was originally going to run the actual effects within the Lethal Event (and will now do that). After running into the fps problem, I tried to fix it by having the effects be ran through a separate trigger. My 2nd method was swapping into a unit group and temp unit was for that before I found it that it still lags haha. That's why I was like ok yknow what lets just make a throwaway trigger and see if it still lags if I activate it through simple means like Blizzard. Which then led to the posted throwaway trigger. Can't believe such a simple fix and I prob wasted like 2 hours trying to understand what was wrong lmao. As for the dummy, my dummy had the default Backswing. But for some reason I still worked and the dummy casted both spells haha. Nevertheless I changed it 0 just now just incase
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
I was originally going to run the actual effects within the Lethal Event (and will now do that). After running into the fps problem, I tried to fix it by having the effects be ran through a separate trigger. My 2nd method was swapping into a unit group and temp unit was for that before I found it that it still lags haha. That's why I was like ok yknow what lets just make a throwaway trigger and see if it still lags if I activate it through simple means like Blizzard. Which then led to the posted throwaway trigger. Can't believe such a simple fix and I prob wasted like 2 hours trying to understand what was wrong lmao. As for the dummy, my dummy had the default Backswing. But for some reason I still worked and the dummy casted both spells haha. Nevertheless I changed it 0 just now just incase
I assume the newly issued Order in the trigger acts as an "animation cancel" and interrupts the Backswing. But Cast Point will definitely delay the initial casting of the ability, that I know for certain.
 
Top