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

[Trigger] Why this is laag??

Status
Not open for further replies.
Level 7
Joined
May 23, 2011
Messages
179
This trigger causes laag.... Why????

  • Melee Initialization
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set BloodMageLoc = (Position of Blood Mage 0000 <gen>)
      • Set PickedGroup = (Units within 700.00 of BloodMageLoc matching (((((Matching unit) is alive) Equal to True) and ((Percentage life of (Matching unit)) Less than 100.00)) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an ally of (Owner
      • Set RandomUnitGroup = (Random 1 units from PickedGroup)
      • Set RandomUnit = (Random unit from RandomUnitGroup)
      • Unit - Create 1 Dummy for (Owner of Blood Mage 0000 <gen>) at BloodMageLoc facing Default building facing degrees
      • Unit - Add a 0.30 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave RandomUnit
      • Custom script: call RemoveLocation(udg_BloodMageLoc)
      • Custom script: call DestroyGroup(udg_RandomUnitGroup)
      • Custom script: call DestroyGroup(udg_PickedGroup)
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to 1.00%
Please help
!!! Is there an alternative way to triggers this out???
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Melee Initialization
Because you make 100 units a second which last for 0.3 seconds. This also means you leak 100 units a second due to a WC3 engine bug (units getting removed in anyway from the game cause a small leak).
JASS is also interpreted by a crappy interpreter which runs as slow a frozen snail.
Let us not forget you are doing group opperations 100s of times a second.
Let us not forget that the chain heal ability is being cast 100 times a second, and even with the smallest bouncing that is a lot of stuff happening.

I advise...
1. Decreasing the tick rate (to 0.1 seconds odd).
2. Recycling the dummy caster unit between itterations.
3. Using X/Y pairs instead of locations to save on handle allocation/deallocation time.
4. Recycling the same group each itteration (needs JASS as GUI obscures how enums truely work).

Untitled Trigger 001
You set the life of every unit on the whole map to 1%. If you have 1000 units that is 1000 units it must select and then do a life reduction calculation for each of those units. Try breaking it over a period of time (like 20 every 0.1 seconds) or reducing the problem scope (so fewer units are effected).
 
Status
Not open for further replies.
Top