• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Why is this mana refuel trigger leaking and destroying my map? Doesn't seem to make much sense

Level 16
Joined
Jun 9, 2008
Messages
346

Shortlegs

Long story short, I wanted a sort of "gas station mechanic" that restores mana to units with autocast. Wasn't quite okay with solutions like Spirit touch, though I might to have to dig that out again if this cannot be fixed.

Anyway, I was really happy with my solution based on Faerie Fire, unfortunately, it comes with the tiny drawback that the trigger leaks like hell and crashes my map after one hour or so, as it cannot handle more than a little above 1 GB.
(800 MB after 30min, 1GB+ after one hour -> Crash; Without this trigger, it's 700 MBs after 30min, then relatively stable at maximum 900 MB or so even after 2 hours).

Here is the trigger in question:

Original version which did exactly what I wanted
  • Refuel working
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Replenish Faeriefire (Neutral Hostile)
    • Actions
      • Animation - Change (Target unit of ability being cast)'s vertex coloring to (0.00%, 100.00%, 0.00%) with 0.00% transparency
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Life of (Target unit of ability being cast)) Less than (Max life of (Target unit of ability being cast))
              • (Mana of (Target unit of ability being cast)) Less than (Max mana of (Target unit of ability being cast))
        • Then - Actions
          • Set DifferenzLife = ((Max life of (Target unit of ability being cast)) - (Life of (Target unit of ability being cast)))
          • Set DifferenzMana = ((Max mana of (Target unit of ability being cast)) - (Mana of (Target unit of ability being cast)))
          • Set DifferenzSumTarget = (DifferenzLife + DifferenzMana)
          • Set DifferenzStock = (Mana of (Casting unit))
          • -------- Totality --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DifferenzStock Greater than DifferenzSumTarget
            • Then - Actions
              • Unit - Set mana of (Target unit of ability being cast) to 100.00%
              • Unit - Set life of (Target unit of ability being cast) to 100.00%
              • Unit - Set mana of (Casting unit) to ((DifferenzStock - DifferenzSumTarget) + 8.00)
            • Else - Actions
              • -------- Help with Mana --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Mana of (Target unit of ability being cast)) Less than (Max mana of (Target unit of ability being cast))
                • Then - Actions
                  • Unit - Set mana of (Target unit of ability being cast) to ((Mana of (Target unit of ability being cast)) + 8.00)
                • Else - Actions
              • -------- Help with Life --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Life of (Target unit of ability being cast)) Less than (Max life of (Target unit of ability being cast))
                • Then - Actions
                  • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 4.00)
                • Else - Actions
        • Else - Actions
          • Unit - Order (Casting unit) to Stop
          • Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + 8.00)
Slimmed down version which is still sortof okay and which I hoped would fix the issue, but didn't:

  • Refuel Now Hopefully no Leak
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Replenish Faeriefire (Neutral Hostile)
          • ((Target unit of ability being cast) has buff Refuel ) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Target unit of ability being cast)) Less than (Max mana of (Target unit of ability being cast))
        • Then - Actions
          • Unit - Set mana of (Target unit of ability being cast) to ((Mana of (Target unit of ability being cast)) + 10.00)
        • Else - Actions
          • Unit - Order (Casting unit) to Stop
          • Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + 10.00)
 
Last edited:
There are no leaks, but the triggers should be designed like this:
  • Refuel Begin
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Replenish Faeriefire (Neutral Hostile)
      • Or - Any (Conditions) are true
        • Conditions
          • (Life percentage of (Target unit of ability being cast)) Greater than or equal to 100.00%
          • (Mana percentage of (Target unit of ability being cast)) Greater than or equal to 100.00%
    • Actions
      • Unit - Order (Triggering unit) to Stop
  • Refuel Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Replenish Faeriefire (Neutral Hostile)
    • Actions
      • Set DifferenzLife = ((Max life of (Target unit of ability being cast)) - (Life of (Target unit of ability being cast)))
      • Set DifferenzMana = ((Max mana of (Target unit of ability being cast)) - (Mana of (Target unit of ability being cast)))
      • Set DifferenzSumTarget = (DifferenzLife + DifferenzMana)
      • Set DifferenzStock = (Mana of (Triggering unit))
      • -------- Totality --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DifferenzStock Greater than DifferenzSumTarget
        • Then - Actions
          • Unit - Set mana of (Target unit of ability being cast) to 100.00%
          • Unit - Set life of (Target unit of ability being cast) to 100.00%
          • Unit - Set mana of (Triggering unit) to ((DifferenzStock - DifferenzSumTarget) + 8.00)
        • Else - Actions
          • -------- Help with Life + Mana --------
          • Unit - Set mana of (Target unit of ability being cast) to ((Mana of (Target unit of ability being cast)) + 8.00)
          • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 4.00)
Begins casting -> Happens when the unit is "winding up" to cast the ability. The ability is not actually used at this stage.

Starts the effect -> Happens when the unit successfully casts the ability. The ability has spent mana and is on cooldown, or is about to be. This is the Event you should be using most of the time.

A unit's Art - Cast Point has an affect on both of these and will delay their outcome.

Note that certain Actions can run other triggers. For example, there's a chance that your issued "Stop" order is causing another trigger to run, which could contain the leaks and maybe cause other issues.
 
Last edited:
Note that certain Actions can potentially run other triggers. For example, there's a chance that your issued "Stop" order is causing another trigger to run, which could contain the leaks and maybe cause other issues.
Love this, much better.

I also wondered if maybe the leak and crash comes not from this trigger but the way it interacts with other triggers, but I have been unable to find a connection. Got a lot of triggers, though...

Out of curiosity, I'll check if the crash still happens with your improved version

EDIT: Ha, it crashes almost INSTANTLY now (pretty much as soon as this trigger fires). Really weird.
EDIT-EDIT: Though not every time I test it. Maybe it crashes when it interacts with the wrong unit?
Or could it been related to combat - the way mana and life percentages switch so quickly during battle, especially with 12+ players having fights simultaneoulsy all over the map? Maybe that's what the map cannot handle
 
Last edited:
It's an extremely simple trigger that'll have zero impact on performance. The possible problems:

1. One of the functions is unsafe, which is very unlikely since that would affect everyone. Although, who knows what the latest patch has broken.

2. You're causing another trigger to run. Perhaps you have some kind of Heal Event system in your map? Or maybe a "unit's life/mana becomes X" Event? Both the "Stop" order and the change of Life/Mana can cause other triggers to run.

3. Like you said, some unit doesn't like getting targeted. The only logical conclusion there is that a trigger references it which causes the crash.

4. Some kind of Art related issue, a corrupted model for example. This would likely have to do with the Ability art.
 
It's an extremely simple trigger that'll have zero impact on performance. The possible problems:
I figured as much - switching this trigger on or off has an immediate effect, but it must be because it interacts with something else.
1. One of the functions is unsafe, which is very unlikely since that would affect everyone. Although, who knows what the latest patch has broken.

2. You're causing another trigger to run. Perhaps you have some kind of Heal Event system in your map? Or maybe a "unit's life/mana becomes X" Event? Both the "Stop" order and the change of Life/Mana can cause other triggers to run.
I can't think of any trigger that would use those events, and I don't have another heal system in play.
What I do have though is a trigger that checks whether or not a unit has mana, and if it doesn't, it substracts HP. That however is a If/Then/Else function deep within the trigger (the event is periodical).

3. Like you said, some unit doesn't like getting targeted. The only logical conclusion there is that a trigger references it which causes the crash.
It seems to happen whenever there is a big fight with multiple units, especially neutral hostile, though I cannot always check as it may happen anywhere on the map. Might look into the units involved.

Wouldn't explain the rapid and constant MB growth though?

4. Some kind of Art related issue, a corrupted model for example. This would likely have to do with the Ability art.
I kinda doubt it, because all assets involved (EDIT: in the spell) are standard blizzard assets, but most of all, they still go off without the trigger (unit keeps using faerie fire on autocast either way) with no ill effect.
 
Last edited:
Back
Top